code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
-- ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow 1993-2004 -- -- The native code generator's monad. -- -- ----------------------------------------------------------------------------- {-# OPTIONS -fno-warn-tabs #-} -- The above warning supression fla...
nomeata/ghc
compiler/nativeGen/NCGMonad.hs
bsd-3-clause
4,069
74
17
888
1,345
719
626
112
2
-- |This modules provides functions commonly used for working with matrices module Matrix ( -- * funtions size, zero, rowMajor, colMajor, min2D, size2D, valid2D, minCol, maxCol, det, removeColI, removeRowI, transpose, coli, rowi, mul, appOnly, scalar, add, ...
ankeshs/numerikell
tmp/Matrix.hs
bsd-3-clause
7,265
6
12
2,301
3,429
1,902
1,527
165
2
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Exception import Control.Concurrent import Control.Lens ( (^.) ) import qualified Data.ByteString as B import SecondTransfer.IOCallbacks.SocketServer import SecondTransfer.IOCallbacks.Types simpleEcho :: TLSServerIO...
shimmercat/second-transfer
examples/simple_tcp_server/Main.hs
bsd-3-clause
1,095
0
16
347
276
134
142
31
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveDataTypeable #-} module Blaze.React.Examples.RoutingTest ( app ) where import Blaze.React import qualified Data.Text as T import Data.Void import qualified Text.Blaze.Event ...
MoixaEnergy/blaze-react
src/Blaze/React/Examples/RoutingTest.hs
mit
1,746
0
12
473
327
185
142
37
2
module Main where import Distribution.Simple (defaultMainWithHooks) import Distribution.Simple.UUAGC (uuagcLibUserHook) import UU.UUAGC (uuagc) main = defaultMainWithHooks (uuagcLibUserHook uuagc)
kayuri/HNC
Setup.hs
lgpl-3.0
199
0
7
19
49
29
20
5
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} module T16255 where import Data.Kind import GHC.TypeLits data SBool :: Bool -> Type type family F1 :: forall k. k -> Type where F1 @Bool = SBool data family D1 :: forall...
sdiehl/ghc
testsuite/tests/typecheck/should_fail/T16255.hs
bsd-3-clause
587
5
7
111
132
80
52
-1
-1
{-# LANGUAGE ExtendedDefaultRules #-} module Models.SectionSpec where import BasicPrelude import Test.Hspec import Models.Section ( parseName ) spec :: SpecWith () spec = parallel $ describe "parseName" $ do it "runs tests in a sub-module" $ do let a = 1 :: Int...
dogweather/nevada-revised-statutes-parser
test/Models/SectionSpec.hs
bsd-3-clause
735
9
15
194
162
87
75
19
1
{-# LANGUAGE OverloadedStrings #-} module C.Prims where import Data.Binary import Data.Monoid(Monoid(..)) import Data.Typeable import qualified Data.Set as Set import Doc.DocLike import Doc.PPrint import PackedString import StringTable.Atom import qualified Cmm.Op as Op import GHC.Exts data CallConv = CCall | StdCa...
hvr/jhc
src/C/Prims.hs
mit
7,051
0
13
1,789
2,258
1,192
1,066
-1
-1
{-| SDL (Simple DirectMedia Layer) is a library for cross-platform development of interactive applications. SDL provides routines for managing windows, rendering graphics, processing sound, collecting input data, and much more. The Haskell @sdl2@ library provides both a high- and low-level API to interface with SDL. T...
dalaing/sdl2
src/SDL.hs
bsd-3-clause
4,349
0
6
854
165
113
52
25
0
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.ConsoleHandler -- Copyright : (c) The University of Glasgow -- License : see libraries/base/LICENSE -- -- Maintainer : cvs-ghc@haskell.org -- Stability ...
frantisekfarka/ghc-dsi
libraries/base/GHC/ConsoleHandler.hs
bsd-3-clause
5,166
0
3
1,301
26
24
2
3
0
module ListRange () where import Language.Haskell.Liquid.Prelude -------------------------------------------------------------------- -------------- Defining A List Type -------------------------------- -------------------------------------------------------------------- {-@ data List [llen] a <p :: x0:a -> x1:a -> ...
abakst/liquidhaskell
tests/pos/ListISort-LType.hs
bsd-3-clause
1,367
0
9
318
309
178
131
26
1
-- This module implements a basic Test Runner for testing QuickCheck properties. -- It's mostly identical to what xmonad does. [1][2] -- Given the (current) size of this codebase, that's the simplest thing that can -- possibly work [3], without taking on needless dependencies on other packages. -- It's named Discordia,...
ploeh/dependency-rejection-samples
Haskell/Discordia.hs
mit
1,842
0
15
393
282
158
124
22
2
{-# LANGUAGE OverloadedStrings #-} module Main where import Algebra.Graph.AdjacencyMap import Algebra.Graph.AdjacencyMap.Algorithm import Data.Bifunctor (second) import Data.Foldable (traverse_) import qualified Data.Set as S import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.IO as T ...
genos/online_problems
advent_of_code_2019/day06/src/Main.hs
mit
974
0
10
201
358
195
163
28
1
{-# LANGUAGE TemplateHaskell #-} module ElmodoroStatusType ( ElmodoroStatus(..) ) where import Database.Persist.TH data ElmodoroStatus = Idle | InProgress | Break | BreakPending | Completed | Aborted deriving(Eq, Read, Show) derivePersistField "ElmodoroStatus"
ryandv/elmodoro
backend/ElmodoroStatusType.hs
mit
271
0
6
41
63
38
25
6
0
-- | -- -- Copyright: -- This file is part of the package themoviedb. It is subject to -- the license terms in the LICENSE file found in the top-level -- directory of this distribution and at: -- -- https://github.com/pjones/themoviedb -- -- No part of this package, including this file, may be copied, -- ...
pjones/themoviedb
src/Network/API/TheMovieDB/Types/Season.hs
mit
2,088
0
23
439
320
197
123
30
1
-- example code 2 for socketserver import MissingH.Network.SocketServer import MissingH.IO import MissingH.Logging.Logger import Data.Char import System.IO import MissingH.Str lineInteraction :: [String] -> [String] lineInteraction inp = let realInteract :: [String] -> [String] realInteract [] = [] re...
haskellbr/missingh
missingh-all/examples/test2.hs
mit
974
0
11
223
265
138
127
22
4
-- <nickager> I’m struggling with understanding functional composition. -- <nickager> Why does: -- <nickager> (\x y -> negate $ x * y) 3 4 -- <nickager> work -- <nickager> but -- <nickager> (negate . (*)) 4 3 -- <nickager> gives an error: -- <nickager> No instance for (Num (a0 -> a0)) arising from a use of ‘it’...
NickAger/LearningHaskell
notes/confusing fmap.hs
mit
3,851
32
16
711
300
170
130
-1
-1
{-# LANGUAGE ViewPatterns #-} module TypeCheck where import Syntax import Environment import Unbound.Generics.LocallyNameless import Control.Monad.Except import Control.Monad.State import Control.Monad.Reader import Control.Monad.Identity import Data.List (intersect) isVar :: Term -> Bool isVar TmVar{} = True isVar...
kellino/TypeSystems
fullSub/TypeCheck.hs
mit
3,887
16
27
1,195
1,371
666
705
106
14
module Handler.TaskSpec (spec) where import TestImport import Data.Aeson (object, encode, (.=)) import Database.Persist.Sql (toSqlKey) import qualified Data.ByteString.Lazy.Internal as LBS (ByteString) import HappyScheduler (Deadline) sendTaskRequest :: Text -> Int -> Deadline -> Bool -> Bool -> YesodExample App () s...
frt/happyscheduler
test/Handler/TaskSpec.hs
mit
6,095
0
19
2,620
1,331
658
673
125
1
import Data.Array import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.IO as IO import Text.Parsec import Text.Parsec.Text data Light = Off | On deriving (Eq, Show) type Lights = Array Coordinates Light data Instruction = Instruction Command Coordinates Coordinates deriving (Eq, ...
SamirTalwar/advent-of-code
2015/AOC_06_1.hs
mit
1,819
66
9
393
694
377
317
48
1
{-# LANGUAGE LambdaCase, RecordWildCards, FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module Language.Hasquito.TypeCheck where import Control.Applicative import Control.Monad.Except import Control.Monad.Reader import Control.Monad.Writer import qualified Data.Map as M...
jozefg/hasquito
src/Language/Hasquito/TypeCheck.hs
mit
4,209
0
14
1,020
1,669
845
824
81
3
{-# LANGUAGE CPP, NoImplicitPrelude, PackageImports #-} module Foreign.ForeignPtr.Safe.Compat ( module Base ) where import "base-compat" Foreign.ForeignPtr.Safe.Compat as Base
haskell-compat/base-compat
base-compat-batteries/src/Foreign/ForeignPtr/Safe/Compat.hs
mit
179
0
4
21
25
19
6
4
0
{-# LANGUAGE RecordWildCards #-} module Board.Creator where import Data.Hashable import Data.List import Data.Map as M (insert, Map(..), empty) import Board.Utils import Board.Types createMinHashed :: [(Board, Rotation)] -> String createMinHashed bs = encodeBoard . snd $ minHash where hashed = map (\(x,_) -> (...
cirquit/genetic-tic-tac-toe
src/Board/Creator.hs
mit
618
0
12
109
215
120
95
16
1
-- | Eine Aufgabe, bei der gar keine Studenten-Lösung akzeptiert wird -- Tutor soll "von Hand" die Oks eintragen -- und damit (schriftliche \/ mündliche) Seminar-Aufgaben bewerten -- Vorteil ist, daß die dann mit in der Auswertung auftauchen {-# language TemplateHaskell #-} {-# language DeriveDataTypeable #-} {-# lan...
marcellussiegburg/autotool
collection/src/Blank.hs
gpl-2.0
1,354
6
10
245
226
138
88
31
1
module Export.Matlab ( writeMatlabFile ) where import System.IO import Text.Printf writeMatlabFile :: String -> [(Double, (Double, Double, Double))] -> IO () writeMatlabFile fileName dynamics = do fileHdl <- openFile fileName WriteMode hPutStrLn fileHdl "dynamics = [" mapM_ (hPutStrLn fileHdl . sirDynamicT...
thalerjonathan/phd
thesis/code/sir/src/Export/Matlab.hs
gpl-3.0
1,660
0
12
269
358
165
193
36
1
module Lib.Syntax.Symbol where import Data.Set (Set) import qualified Data.Set as S type Symbol = String builtin_syms :: Set Symbol builtin_syms = S.fromList [ "int-add", "int-mul", "int-div", "int-sub", "int-modulo" , "float-add", "float-mul", "float-div", "float-sub", "float-modulo" , "not" ...
gatlin/psilo
src/Lib/Syntax/Symbol.hs
gpl-3.0
915
0
10
250
198
120
78
30
2
-- ParseRegexStr.hs -- -- Author: Yoshikuni Jujo <PAF01143@nifty.ne.jp> -- -- This file is part of regexpr library -- -- regexpr is free software: you can redistribute it and/or modify -- it under the terms of the GNU Lesser General Public License as -- published by the Free Software Foundation, either version 3 of the...
YoshikuniJujo/regexpr
Hidden/ParseRegexStr.hs
gpl-3.0
6,960
42
26
1,927
2,100
1,134
966
144
5
{-# LANGUAGE ForeignFunctionInterface #-} module Scotch.Types.FFI where import Foreign import Foreign.C foreign import ccall "dynamic" mkPtrFun :: FunPtr (Ptr a -> IO (Ptr a)) -> Ptr a -> IO (Ptr a) callWithNull :: FunPtr (Ptr a -> IO (Ptr a)) -> IO (Ptr a) callWithNull f = mkPtrFun f nullPtr
bendmorris/scotch
Scotch/Types/FFI.hs
gpl-3.0
297
0
12
53
123
62
61
7
1
module System.Arte.Decode.Graphics where ------------------------------------------------------------------------------ import Control.Applicative import Control.Concurrent.STM import qualified Control.Concurrent.STM.TArray as T import Control.Lens import qualified Data.Array.MArray ...
imalsogreg/arte-ephys
arte-decoder/src/System/Arte/Decode/Graphics.hs
gpl-3.0
7,809
1
24
2,258
2,284
1,192
1,092
139
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Html.NewUser where import Prelude import Html.Common import Html.Url import Text.Blaze.Html5 import qualified Text.Blaze.Html5 as H import Text.Blaze.Html5.Attributes import qualified Text.Blaze.Html5.Attributes as A newUserHtml :: Html newUse...
schell/pusher
src/Html/NewUser.hs
gpl-3.0
2,170
0
19
728
598
273
325
45
1
module DNA_lib ( Base(A,C,G,T,X), -- Enumerated type representing bases adenine, cytosine, guanine, thymine and 'other'. DNA(DNA), -- Representation of a molecule of DNA as a sequence of its bases parseDNA, -- Parser for DNA molecule displayDNA, -- Diag...
ckaestne/CIDE
CIDE_Language_Haskell/test/fromviral/DNA_lib.hs
gpl-3.0
9,294
10
18
3,389
3,238
1,847
1,391
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-vault/gen/Network/Google/Resource/Vault/Matters/Create.hs
mpl-2.0
4,452
0
16
1,059
707
414
293
98
1
-- ----------------------------------------------------------------------------- -- This file is part of Skema-Common. -- Skema-Common is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as -- published by the Free Software Foundation, either version 3...
SkemaPlatform/skema-common
src/Skema/Util.hs
agpl-3.0
5,532
0
13
968
1,318
750
568
69
3
{-# LANGUAGE RecordWildCards #-} v = A { .. } where b = 2
lspitzner/brittany
data/Test313.hs
agpl-3.0
58
0
6
14
19
11
8
2
1
{-# LANGUAGE TemplateHaskell, TypeFamilies, OverloadedStrings #-} module Model.Category.Types ( Category(..) ) where import Data.Function (on) import Data.Int (Int16) import qualified Data.Text as T import Instances.TH.Lift () import Language.Haskell.TH.Lift (deriveLift) import Model.Kind import Model.Id.Types t...
databrary/databrary
src/Model/Category/Types.hs
agpl-3.0
670
0
12
109
200
119
81
28
0
module YesNo where boolToWord :: Bool -> String boolToWord True = "Yes" boolToWord _ = "No"
ice1000/OI-codes
codewars/101-200/convert-boolean-values-to-strings-yes-or-no.hs
agpl-3.0
93
0
5
17
29
16
13
4
1
import Control.Monad (guard) fp = ["Double", "Float", "Rational"] int = ["Int", "Int8", "Int16", "Int32", "Int64", "Word", "Word8", "Word16", "Word32", "Word64"] intToIntWork :: [(String, String)] intToIntWork = do i1 <- int i2 <- int guard $ i1 /= i2 return (i1, i2) showIntToInt :: (String, S...
snoyberg/convertible
utils/genNumInstances.hs
lgpl-2.1
3,005
0
16
710
642
337
305
58
1
{-# LANGUAGE ScopedTypeVariables, CPP #-} module Graphics.ImageMagick.MagickWand.WandImage ( getImageHeight , getImageWidth , getImagePixelColor , resizeImage , getImageCompressionQuality , setImageCompression , setImageCompressionQuality , getImageBackgroundColor , setImageBackgroundColor , extentI...
flowbox-public/imagemagick
Graphics/ImageMagick/MagickWand/WandImage.hs
apache-2.0
39,469
0
16
8,458
7,147
3,859
3,288
452
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QMessageBox.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:22 Warning : this file is machine generated - do n...
keera-studios/hsQt
Qtc/Gui/QMessageBox.hs
bsd-2-clause
88,040
0
20
14,369
28,712
14,784
13,928
-1
-1
-- http://www.codewars.com/kata/54cb771c9b30e8b5250011d4 module Faberge where heigth :: Integer -> Integer -> Integer heigth n m | n <= 0 = 0 | m <= 0 = 0 | n >= m = 2 ^ m - 1 | 2 * n > m = 2 ^ m - 2 - heigth (m-n-1) m | otherwise = sum $ scanl (\acc k -> acc * (m-k+1) `div` k) m [2..n]
Bodigrim/katas
src/haskell/B-Faberg-Easter-Eggs-crush-test.hs
bsd-2-clause
308
0
14
89
173
88
85
8
1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Test.Hspec.Megaparsec.AdHoc ( -- * Helpers to run parsers prs , prs' , prs_ , grs , grs' -- * Working with source position , updatePosString...
recursion-ninja/megaparsec
tests/Test/Hspec/Megaparsec/AdHoc.hs
bsd-2-clause
7,297
0
17
1,756
2,034
1,092
942
161
1
-- BisectionRoot_Test.hs module BisectionRoot_Test where import qualified Distribution.TestSuite as TS import qualified Test.HUnit as HU import qualified BisectionRoot as BR bisection_Test1 :: HU.Test bisection_Test1 = HU.TestCase $ HU.assertBool "bisection_Test1" $ (BR.bisectionRoot (\x -> 2*x+3) (-100,100)) == (...
mherzl/BisectionRoot
BisectionRoot/test/BisectionRoot_Test.hs
bsd-2-clause
1,412
0
12
232
485
264
221
37
3
-- Copyright (c) 2009, Diego Souza -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of condit...
dgvncsz0f/hoauth
src/main/haskell/Network/OAuth/Http/Response.hs
bsd-3-clause
2,557
0
9
598
114
87
27
9
0
-- | Removal of cycles from a grammar. {-# LANGUAGE FlexibleContexts #-} -- for Eq (gr n e) {-# LANGUAGE ScopedTypeVariables #-} module Data.Cfg.CycleRemoval( SCComp(..), removeCycles, removeCycles', removeCyclesM', ) where import Control.Monad.State import Data.Cfg.Cfg(Cfg, Production, ProductionM...
nedervold/context-free-grammar
src/Data/Cfg/CycleRemoval.hs
bsd-3-clause
6,906
0
18
2,124
1,683
882
801
105
3
{-# LANGUAGE MultiParamTypeClasses #-} {-# OPTIONS -fno-warn-orphans #-} ---------------------------------------------------------------------- -- | -- Module : Interface.TV.OFun -- Copyright : (c) Conal Elliott 2006-2013 -- License : BSD3 -- -- Maintainer : conal@conal.net -- Stability : experiment...
conal/TV
src/Interface/TV/OFun.hs
bsd-3-clause
5,147
0
10
1,169
1,742
931
811
83
1
module Folly.Unification(Unifier, applyUnifier, mostGeneralUnifier, unifier, uniqueVarSub) where import Control.Monad import Data.List as L import Data.Map as M import Data.Set as S import Folly.Formula type Unifier =...
dillonhuff/Folly
src/Folly/Unification.hs
bsd-3-clause
2,234
0
22
529
892
468
424
51
5
-- | -- Module : Core.Collection -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : portable -- -- Different collections (list, vector, string, ..) unified under 1 API. -- an API to rules them all, and in the darkness bind them. -- {-# LAN...
vincenthz/hs-xyz-test
Core/Collection.hs
bsd-3-clause
3,754
0
13
950
843
478
365
63
0
module Singletons.T78 where import Data.Singletons.TH import Prelude.Singletons type MaybeBool = Maybe Bool $(singletons [d| foo :: MaybeBool -> Bool foo (Just False) = False foo (Just True) = True foo Nothing = False |])
goldfirere/singletons
singletons-base/tests/compile-and-dump/Singletons/T78.hs
bsd-3-clause
241
0
7
53
40
24
16
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes, TemplateHaskell #-} module Data.Equivalence.Monad_Test where import Test.QuickCheck hiding ((===)) import Data.Equivalence.Monad import Control.Monad import Data.Set (Set) import qualified Data.Set as Set import System.Exit ------------------------------...
pa-ba/equivalence
testsuite/tests/Data/Equivalence/Monad_Test.hs
bsd-3-clause
3,997
0
14
1,124
1,580
750
830
126
2
-------------------------------------------------------------------------------- -- | Try to detect build-like expressions. As a reminder, -- -- > build :: (forall b. (a -> b -> b) -> b -> b) -> a -- > build g = g (:) [] -- -- The forall parameter is of huge importance, since otherwise we can just -- construct lists an...
jaspervdj/what-morphism
src/WhatMorphism/Build.hs
bsd-3-clause
13,553
0
21
3,993
3,050
1,553
1,497
204
7
{-# LANGUAGE CPP #-} module MateVMRuntime.NativeSizes where import Data.Word ptrSize, longSize :: Num a => a ptrSize = 4 longSize = 8 type NativeWord = Word32
LouisJenkinsCS/Minimal-JVM
MateVMRuntime/NativeSizes.hs
bsd-3-clause
162
0
6
29
42
26
16
7
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ExtendedDefaultRules #-} module Application where import Application.Types import Server import Templates import UrlPath import Web.Page.Lucid import Web.Scotty.Trans import Network.Wai.Middleware....
athanclark/deconfigured
src/Application.hs
bsd-3-clause
1,959
0
23
647
469
252
217
51
1
module Vandelay.DSL.Core ( module X ) where import Vandelay.DSL.Core.Counter as X import Vandelay.DSL.Core.IO as X import Vandelay.DSL.Core.Modules as X import Vandelay.DSL.Core.ParserT as X import Vandelay.DSL.Core.Text as X import Vandelay.DSL.C...
tumarkin/vandelay
src/Vandelay/DSL/Core.hs
bsd-3-clause
337
0
4
106
67
51
16
8
0
{-# LANGUAGE ScopedTypeVariables #-} import Data.Maybe import Data.List import Control.Arrow import Data.Map (Map) import qualified Data.Map as M import Data.Set (Set) import qualified Data.Set as S import Control.Monad.State import Debug.Trace type Nonterm = String data Atom a = NT Nonterm | T a ...
abbradar/comps
src/Lab5.hs
bsd-3-clause
3,121
0
20
1,173
1,457
737
720
78
10
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Data.Ini where import Control.Applicative import Data.ByteString (ByteString) import Data.Char (isAlpha) import Data.Map (Map) import qualified Data.Map as M import Data.Text (Text) import qualified Data.Text.IO as TIO import Test.Hspec import Text.RawString.QQ i...
chengzh2008/hpffp
src/ch24-Parser/parseConfig.hs
bsd-3-clause
4,304
0
18
1,065
1,235
624
611
123
1
------------------------------------------------------------------------------- -- | -- Module : System.Hardware.Arduino.Protocol -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Internal representation of the firmata protocol. -----...
LeventErkok/hArduino
System/Hardware/Arduino/Protocol.hs
bsd-3-clause
4,996
0
15
1,477
1,402
734
668
72
16
{-# LANGUAGE ExistentialQuantification, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, TypeSynonymInstances, CPP, DeriveDataTypeable #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Core -- Copyright : (c) Spencer Jan...
adinapoli/xmonad
XMonad/Core.hs
bsd-3-clause
22,230
0
22
5,441
4,335
2,373
1,962
-1
-1
{-# LANGUAGE FlexibleContexts, StandaloneDeriving, UndecidableInstances #-} {- | Module : Text.Paraphrase.Errors Description : Internal module for defining error types Copyright : (c) Ivan Lazar Miljenovic License : 3-Clause BSD-style Maintainer : Ivan.Miljenovic@gmail.com This module is ...
ivan-m/paraphrase
src/Text/Paraphrase/Errors.hs
bsd-3-clause
19,403
0
16
5,880
4,630
2,395
2,235
272
22
{-# LANGUAGE EmptyDataDecls, TypeSynonymInstances #-} {-# OPTIONS_GHC -fcontext-stack42 #-} module Games.Chaos2010.Database.Operator_source where import Games.Chaos2010.Database.Fields import Database.HaskellDB.DBLayout type Operator_source = Record (HCons (LVPair Operator_name (Expr (Maybe String))) ...
JakeWheat/Chaos-2010
Games/Chaos2010/Database/Operator_source.hs
bsd-3-clause
467
0
15
67
104
58
46
11
1
module TailorShop ( tailorShop ) where import Numeric import Data.Char import Data.List tailorShop :: IO () tailorShop = do n_temp <- getLine let n_t = words n_temp let n = read $ n_t!!0 :: Int let p = read $ n_t!!1 :: Int a_temp <- getLine let a = map read $ words a_temp :: [Int] ...
zuoqin/hackerrank
src/TailorShop.hs
bsd-3-clause
597
0
20
245
261
139
122
17
2
-- | Simple, high-level DNS lookup functions for clients. -- -- All of the lookup functions necessary run in IO since they -- interact with the network. The return types are similar, but -- differ in what can be returned from a successful lookup. -- -- We can think of the return type as either \"what I asked fo...
kazu-yamamoto/dns
Network/DNS/Lookup.hs
bsd-3-clause
16,737
0
15
3,409
2,100
1,192
908
118
3
{-# LANGUAGE FlexibleContexts #-} module Control.Concurrent.FairRWLock.Lifted ( acquireRead , acquireWrite , checkLock , new , peekLock , releaseRead , releaseWrite , withRead , withWrite ) where import Control.Concurrent.FairRWLock (RWLock,LockKind,RWLockException,FRW) import qualified Control.Con...
alphaHeavy/lifted-SafeSemaphore
src/Control/Concurrent/FairRWLock/Lifted.hs
bsd-3-clause
1,200
0
10
206
403
218
185
33
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANG...
haskell-distributed/distributed-process-execution
src/Control/Distributed/Process/Execution/Exchange/Internal.hs
bsd-3-clause
9,810
0
14
2,293
1,863
1,017
846
190
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | -- Module : Generics.Regular.Views -- Copyright : (c) 2010 Chris Eidhof -- License : ...
chriseidhof/regular-web
src/Generics/Regular/JSON.hs
bsd-3-clause
2,672
0
13
633
764
400
364
42
1
{-# LANGUAGE PackageImports #-} module Main (main) where import "haskell-lang" HL.Main (develMain) main :: IO () main = develMain
haskell-lang/haskell-lang
app/devel.hs
bsd-3-clause
132
0
6
21
36
22
14
5
1
{-# LANGUAGE OverloadedStrings #-} module S3sync.Git (cdToToplevel, -- cd to the root-dir of the current repo commit, -- Run a commit clean, -- reset the current repo to HEAD everything, -- All files tracked in HEAD changes, -- Pars...
matthewSorensen/s3-tools
S3sync/Git.hs
bsd-3-clause
3,932
0
13
1,024
1,109
611
498
67
8
{-# LANGUAGE TypeOperators , TypeFamilies , FlexibleContexts , FlexibleInstances , UndecidableInstances , DataKinds , ConstraintKinds #-} module Metric ( module GHC.TypeLits , Unit , Metre , Second ...
MaximilianAlgehed/Metric
src/Metric.hs
bsd-3-clause
3,973
37
17
1,500
2,037
1,086
951
127
1
module ValidatedSpec (spec) where import Test.Hspec import Data.Validated import Control.Applicative import Control.Monad spec :: Spec spec = do describe "fmap" $ do it "should answer valid for valid" $ do fmap (+1) (Valid 1) `shouldBe` (Valid 2) it "should an...
arquitecturas-concurrentes/iasc-functors-sample-scala
spec/ValidatedSpec.hs
mit
3,187
0
19
897
1,244
621
623
71
1
{- | Module : ./Isabelle/IsaPrint.hs Description : printing Isabelle entities Copyright : (c) University of Cambridge, Cambridge, England adaption (c) Till Mossakowski, Uni Bremen 2002-2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : p...
spechub/Hets
Isabelle/IsaPrint.hs
gpl-2.0
41,908
1,387
27
14,867
14,680
7,636
7,044
927
54
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE DeriveGeneric, OverloadedStrings #-} module Bot.Types where import Control.Auto.Blip import Control.Auto import qualified Data.Map as M import Data.Time import Prelude hiding ((.), id) -- we use (.) and id from `Control.Category` import Data.Aeson import Data.Aeson...
urbanslug/nairobi-bot
src/Bot/Types.hs
gpl-3.0
5,500
3
32
2,247
1,266
667
599
125
0
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} module Bot.Data.Network where import Network.Wreq import Data.Int (Int64) import Control.Lens import Control.Exception.Base (try) import Network.HTTP.Client (HttpException(..)) import Network.HTTP.Types.Header import qualified Data.ByteString.Lazy as LB import Da...
urbanslug/nairobi-bot
src/Bot/Data/Network.hs
gpl-3.0
2,784
0
14
551
855
446
409
63
2
{-# LANGUAGE CPP, RecordWildCards, NamedFieldPuns, DeriveDataTypeable #-} -- | Handling project configuration. -- module Distribution.Client.ProjectConfig ( -- * Types for project config ProjectConfig(..), ProjectConfigBuildOnly(..), ProjectConfigShared(..), PackageConfig(..), MapLast(..), ...
headprogrammingczar/cabal
cabal-install/Distribution/Client/ProjectConfig.hs
bsd-3-clause
29,106
0
23
7,572
4,631
2,453
2,178
478
13
module Distribution.Server.Features.Check ( CheckFeature, checkResource, CheckResource(..), initCheckFeature, postCandidate, postPackageCandidate, putPackageCandidate, doDeleteCandidate, uploadCandidate, publishCandidate, checkPublish, CandidateRender(..), doCan...
isomorphism/hackage2
Distribution/Server/Features/Check.hs
bsd-3-clause
14,988
25
35
3,439
3,177
1,770
1,407
-1
-1
{-# LANGUAGE CPP #-} #include "fusion-phases.h" -- | Closures. -- Used when closure converting the source program during vectorisation. module Data.Array.Parallel.Lifted.Closure ( -- * Closures. (:->)(..) , ($:) -- * Array Closures. , PData(..), PDatas(..) , ($:^),...
mainland/dph
dph-lifted-boxed/Data/Array/Parallel/Lifted/Closure.hs
bsd-3-clause
8,568
0
15
2,586
2,269
1,212
1,057
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-sdb/gen/Network/AWS/SDB/PutAttributes.hs
mpl-2.0
5,832
0
10
1,182
564
352
212
64
1
-------------------------------------------------------------------------------- -- -- Module : VectorAdd -- Copyright : (c) 2009 Trevor L. McDonell -- License : BSD -- -- Element-wise addition of two vectors -- -------------------------------------------------------------------------------- module Main where --...
mwu-tow/cuda
examples/src/vectorAddDrv/VectorAdd.hs
bsd-3-clause
3,396
0
28
629
957
486
471
-1
-1
----------------------------------------------------------------------------- -- | -- Module : System.Hardware.Haskino.SamplePrograms.Strong.LCDCounter -- Based on System.Hardware.Arduino -- Copyright : (c) University of Kansas -- License : BSD3 -- Stability : experimental -- -- Simple L...
ku-fpg/kansas-amber
legacy/Shallow/LCDCounterPrime.hs
bsd-3-clause
4,289
0
16
1,552
701
384
317
69
8
module Main where import Graphics.UI.WX main :: IO () main = start $ do f <- frame [text := "Checkbox Test"] c <- checkBox f [text := "See the space -->"] t <- staticText f [text := "<-- between the arrows?"] set f [layout := margin 10 $ row 0 [widget c, widget t]]
sherwoodwang/wxHaskell
samples/test/CheckBoxWidth.hs
lgpl-2.1
312
0
13
99
123
61
62
9
1
module ListBranches where import qualified Github.Repos as Github import Data.List main = do possibleBranches <- Github.branchesFor "thoughtbot" "paperclip" case possibleBranches of (Left error) -> putStrLn $ "Error: " ++ (show error) (Right branches) -> putStrLn $ intercalate "\n" $ map Gi...
mavenraven/github
samples/Repos/ListBranches.hs
bsd-3-clause
345
0
12
71
99
51
48
9
2
module Main where import Control.Applicative {- import Control.Monad import Data.Int {- x :: [Int] x = [minBound] -- main = print (liftM2 subtract x x) --main = print ([subtract] <*> x <*> x) -} x :: Int x = 2 -} main = print test0 {-# NOINLINE test0 #-} test0 = head ([flip (*)] <*> pure (2::Int) <*> pure 2)
beni55/ghcjs
test/integer/subtract.hs
mit
317
0
10
67
58
33
25
5
1
extern inline int foo(int a) { return a * 2 + 1; }
SanDisk-Open-Source/SSD_Dashboard
uefi/gcc/gcc-4.6.3/gcc/testsuite/gcc.dg/pch/inline-1.hs
gpl-2.0
53
2
7
15
41
17
24
-1
-1
{-# htermination logBase :: Float -> Float -> Float #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_logBase_1.hs
mit
56
0
2
10
3
2
1
1
0
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Pipes.Util where import Prelude hiding (readFile, writeFile, lines) import Control...
tonyday567/hdcharts
src/Pipes/Util.hs
mit
15,055
0
21
4,476
5,909
2,936
2,973
366
7
{- | module: $Header$ description: OpenTheory interpretations license: MIT maintainer: Joe Leslie-Hurd <joe@gilith.com> stability: provisional portability: portable -} module HOL.OpenTheory.Interpret where import Control.Monad (guard) import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Data.M...
gilith/hol
src/HOL/OpenTheory/Interpret.hs
mit
4,974
0
12
889
1,297
667
630
105
2
module Y2017.M09.D13.Solution where import Data.Time import Data.Time.Clock import Network.HTTP.Conduit -- below imports available via 1HaskellADay git repository import Y2017.M09.D08.Solution {-- There's something funny about the article titles of the Y2017.M09.D08.Exercise Check out the title names. Ring any be...
geophf/1HaskellADay
exercises/HAD/Y2017/M09/D13/Solution.hs
mit
3,104
0
13
560
260
150
110
22
1
module Types ( Rule(Rule), Ruleset(Ruleset) ) where data Rule = Rule String String deriving (Show) data Ruleset = Ruleset String [Rule] deriving (Show)
noahklein/css.hs
src/Types.hs
mit
188
0
7
59
59
36
23
11
0
module Main where import Data.STRef import Control.Monad.ST import Control.Monad() import Debug.Trace data Node s a = Node { value :: a , next :: STRef s (Node s a) } | Nil deriving (Eq) -- instance of show for Node s a instance (Show ...
amal029/haskell-tests
dlist.hs
mit
3,137
0
17
1,656
987
476
511
68
4
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} module NumbersAPI ( NumbersAPI , numbersServer) where import...
korayal/feedlyparser
src/NumbersAPI.hs
mit
1,484
0
15
390
367
202
165
33
1
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Melody.GameOfThrones where import DSL import Control.Monad gameOfThrones = Par treble (Mult 0.5 bass) stave = checkStave 12 ---------------------------------------------------------------------- -- Treble -----------------------------...
feuerbach/music
Melody/GameOfThrones.hs
mit
6,057
0
15
2,268
2,048
913
1,135
222
1
{- | Module : $Header$ Description : simplification of formulas and terms for output after analysis Copyright : (c) Heng Jiang, C. Maeder, Uni Bremen 2004-2005 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : portable Simplifica...
nevrenato/Hets_Fork
CASL/SimplifySen.hs
gpl-2.0
9,423
0
20
3,112
2,824
1,355
1,469
192
19
-- -- Copyright (c) 2012 Citrix Systems, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This progra...
OpenXT/network
nwd/Rpc.hs
gpl-2.0
1,254
0
8
211
157
98
59
12
1
doubleMe :: (Num a) => a -> a doubleMe x = x + x -- doubleUs x y = x*2 + y*2 doubleUs x y = doubleMe x + doubleMe y doubleSmallNumber x = if x > 100 then x else x*2 doubleSmallNumber' x = (if x > 100 then x else x*2) + 1 conanO'Brien = "It's a-me, Conan O'Brien!" boomBangs xs = [if x < 10 then
dalonng/hellos
haskell.hello/baby.hs
gpl-2.0
304
1
8
78
127
68
59
-1
-1
module LineTools where data Square = Black | White | Any deriving Eq data LineInfo = LineInfo { lineLen :: Int, hints :: [Int] } deriving Show type Line = [Square] type Grid = [Line] squareToChar Black = 'X' squareToChar White = '.' squareToChar Any = ' ' -- Shows square lists as strings instance Show Squar...
zouppen/siluetti
LineTools.hs
gpl-3.0
1,440
0
12
298
426
233
193
30
1
module DepProcessors where import qualified DepProcessors.Data.Result as R import qualified DepProcessors.Npm as Npm import qualified DepProcessors.Bower as Bower import qualified DepProcessors.Composer as Composer type Downloader = (FilePath, IO R.Result) processors :: [(String, [FilePath] -> IO [Downloader])] proc...
splondike/depcache
src/DepProcessors.hs
gpl-3.0
806
0
14
128
210
121
89
14
1
{-# LANGUAGE NoOverloadedStrings #-} module GUI.RSCoin.ErrorMessage ( reportSimpleError , reportSimpleErrorNoWindow ) where import Control.Monad (void) import Graphics.UI.Gtk (AttrOp ((:=))) import qualified Graphics.UI.Gtk as G reportSimpleError :: G.Window -> String -> I...
input-output-hk/rscoin-haskell
src/User/GUI/RSCoin/ErrorMessage.hs
gpl-3.0
800
0
10
187
212
112
100
22
1
module Parser ( ) where import Syntax import Text.ParserCombinators.Parsec parseValue :: Parser Term parseValue
juanbono/tapl-haskell
arith/.stack-work/intero/intero936AMM.hs
gpl-3.0
118
0
5
20
27
16
11
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Permissions/Get.hs
mpl-2.0
3,377
0
14
736
382
230
152
63
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/Members/Delete.hs
mpl-2.0
3,113
0
15
739
392
235
157
63
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/VerificationCodes/Generate.hs
mpl-2.0
4,918
0
20
1,175
718
417
301
106
1
module JSON where import Data.Char import Data.List import Data.List.Split import Data.Aeson.TH -- GHC staging restriction gah.. jsonOpts = defaultOptions { fieldLabelModifier = uncamel . drop 1, constructorTagModifier = uncamel, allNullaryToStringTag = True } uncam...
DanielG/kvm-in-a-box
src/JSON.hs
agpl-3.0
555
0
10
137
178
100
78
13
3