Search is not available for this dataset
repo_name
string
path
string
license
string
full_code
string
full_size
int64
uncommented_code
string
uncommented_size
int64
function_only_code
string
function_only_size
int64
is_commented
bool
is_signatured
bool
n_ast_errors
int64
ast_max_depth
int64
n_whitespaces
int64
n_ast_nodes
int64
n_ast_terminals
int64
n_ast_nonterminals
int64
loc
int64
cycloplexity
int64
iblumenfeld/cryptol
src/Cryptol/Transform/Specialize.hs
bsd-3-clause
-- Specializer ----------------------------------------------------------------- -- | Add a `where` clause to the given expression containing -- type-specialized versions of all functions called (transitively) by -- the body of the expression. specialize :: Expr -> M.ModuleCmd Expr specialize expr modEnv = run $ do ...
539
specialize :: Expr -> M.ModuleCmd Expr specialize expr modEnv = run $ do let extDgs = allDeclGroups modEnv let (tparams, expr') = destETAbs expr spec' <- specializeEWhere expr' extDgs return (foldr ETAbs spec' tparams) where run = M.runModuleT modEnv . fmap fst . runSpecT Map.empty
294
specialize expr modEnv = run $ do let extDgs = allDeclGroups modEnv let (tparams, expr') = destETAbs expr spec' <- specializeEWhere expr' extDgs return (foldr ETAbs spec' tparams) where run = M.runModuleT modEnv . fmap fst . runSpecT Map.empty
255
true
true
1
11
86
128
58
70
null
null
silky/csound-expression
src/Csound/Control/Sf.hs
bsd-3-clause
genSfMsg :: (SigSpace a, Sigs a) => SfFun a -> Sf -> D -> Msg -> SE a genSfMsg play sf sustain msg = return $ mul env $ play (veloc msg) (notnum msg) 1 1 sf where env = sfEnv sustain (veloc msg / 127)
204
genSfMsg :: (SigSpace a, Sigs a) => SfFun a -> Sf -> D -> Msg -> SE a genSfMsg play sf sustain msg = return $ mul env $ play (veloc msg) (notnum msg) 1 1 sf where env = sfEnv sustain (veloc msg / 127)
204
genSfMsg play sf sustain msg = return $ mul env $ play (veloc msg) (notnum msg) 1 1 sf where env = sfEnv sustain (veloc msg / 127)
134
false
true
1
10
49
124
56
68
null
null
beni55/hermit
src/HERMIT/Kernel.hs
bsd-2-clause
msg (Always s) = Just s
23
msg (Always s) = Just s
23
msg (Always s) = Just s
23
false
false
0
6
5
19
8
11
null
null
kadena-io/pact
src/Pact/Types/ExpParser.hs
bsd-3-clause
list' :: ListDelimiter -> ExpParse s (ListExp Info,Exp Info) list' d = list >>= \l@(ListExp{..},_) -> if _listDelimiter == d then commit >> return l else expected $ enlist d (\(s,e)->unpack(s<>"list"<>e))
208
list' :: ListDelimiter -> ExpParse s (ListExp Info,Exp Info) list' d = list >>= \l@(ListExp{..},_) -> if _listDelimiter == d then commit >> return l else expected $ enlist d (\(s,e)->unpack(s<>"list"<>e))
208
list' d = list >>= \l@(ListExp{..},_) -> if _listDelimiter == d then commit >> return l else expected $ enlist d (\(s,e)->unpack(s<>"list"<>e))
147
false
true
0
15
34
115
61
54
null
null
uuhan/Idris-dev
src/IRTS/JavaScript/AST.hs
bsd-3-clause
jsStmt2Text (JsFun name args body) = T.concat [ "function " , name , "(" , T.intercalate ", " args , "){\n" , indent $ jsStmt2Text body , "}\n" ]
179
jsStmt2Text (JsFun name args body) = T.concat [ "function " , name , "(" , T.intercalate ", " args , "){\n" , indent $ jsStmt2Text body , "}\n" ]
179
jsStmt2Text (JsFun name args body) = T.concat [ "function " , name , "(" , T.intercalate ", " args , "){\n" , indent $ jsStmt2Text body , "}\n" ]
179
false
false
0
7
62
59
31
28
null
null
wereHamster/github-influx-bridge
Main.hs
mit
influxConfig :: Manager -> IO (Maybe (Config, Text)) influxConfig httpManager = runMaybeT $ do uri <- MaybeT $ lookupEnv "INFLUXDB" URI{..} <- MaybeT $ return $ parseURI uri URIAuth{..} <- MaybeT $ return $ uriAuthority (username, password) <- MaybeT $ case T.splitOn ":" (T.pack $ init uriUserInfo) of ...
939
influxConfig :: Manager -> IO (Maybe (Config, Text)) influxConfig httpManager = runMaybeT $ do uri <- MaybeT $ lookupEnv "INFLUXDB" URI{..} <- MaybeT $ return $ parseURI uri URIAuth{..} <- MaybeT $ return $ uriAuthority (username, password) <- MaybeT $ case T.splitOn ":" (T.pack $ init uriUserInfo) of ...
939
influxConfig httpManager = runMaybeT $ do uri <- MaybeT $ lookupEnv "INFLUXDB" URI{..} <- MaybeT $ return $ parseURI uri URIAuth{..} <- MaybeT $ return $ uriAuthority (username, password) <- MaybeT $ case T.splitOn ":" (T.pack $ init uriUserInfo) of [a,b] -> return $ Just (a,b) _ -> ...
886
false
true
0
16
280
366
176
190
null
null
unisonweb/platform
parser-typechecker/src/Unison/Codebase/Editor/HandleInput.hs
mit
showTodoOutput :: Action' m v PPE.PrettyPrintEnvDecl -- ^ Action that fetches the pretty print env. It's expensive because it -- involves looking up historical names, so only call it if necessary. -> Patch -> Names0 -> Action' m v () showTodoOutput getPpe patch names0 = do todo <- checkTodo patch na...
596
showTodoOutput :: Action' m v PPE.PrettyPrintEnvDecl -- ^ Action that fetches the pretty print env. It's expensive because it -- involves looking up historical names, so only call it if necessary. -> Patch -> Names0 -> Action' m v () showTodoOutput getPpe patch names0 = do todo <- checkTodo patch na...
596
showTodoOutput getPpe patch names0 = do todo <- checkTodo patch names0 if TO.noConflicts todo && TO.noEdits todo then respond NoConflictsOrEdits else do numberedArgs .= (Text.unpack . Reference.toText . view _2 <$> fst (TO.todoFrontierDependents todo)) ppe <- getPpe respo...
344
false
true
0
17
147
154
71
83
null
null
trskop/hs-not-found
not-found/src/Control/Monad/Utils.hs
bsd-3-clause
-- | Flipped version of '>.>'. (<.<) :: Monad m => (a -> b -> m c) -> (a -> m b) -> a -> m c (<.<) = flip (>.>)
111
(<.<) :: Monad m => (a -> b -> m c) -> (a -> m b) -> a -> m c (<.<) = flip (>.>)
80
(<.<) = flip (>.>)
18
true
true
0
10
30
67
36
31
null
null
GaloisInc/ivory
ivory-opts/src/Ivory/Opts/SanityCheck.hs
bsd-3-clause
-- Not an imported type, but we don't need hte type here. structs m = [ (nm, Imported) | (I.Struct nm _) <- getVisible I.modStructs m ]
155
structs m = [ (nm, Imported) | (I.Struct nm _) <- getVisible I.modStructs m ]
97
structs m = [ (nm, Imported) | (I.Struct nm _) <- getVisible I.modStructs m ]
97
true
false
0
10
46
44
23
21
null
null
Rathcke/uni
ap/advanced programming/exam/src/subs/ParserTest.hs
gpl-3.0
testSucc1 :: Test testSucc1 = TestCase (do parsedFile <- parseFile "tests/scope.js" assertEqual "description" simpleScopeAST $ show parsedFile)
207
testSucc1 :: Test testSucc1 = TestCase (do parsedFile <- parseFile "tests/scope.js" assertEqual "description" simpleScopeAST $ show parsedFile)
207
testSucc1 = TestCase (do parsedFile <- parseFile "tests/scope.js" assertEqual "description" simpleScopeAST $ show parsedFile)
189
false
true
0
10
80
42
19
23
null
null
vdweegen/UvA-Software_Testing
Lab1/Final/Exercises.hs
gpl-3.0
isMaster = checkCardFormat [[51..55], [2221..2720]] [16]
57
isMaster = checkCardFormat [[51..55], [2221..2720]] [16]
57
isMaster = checkCardFormat [[51..55], [2221..2720]] [16]
57
false
false
0
7
6
30
17
13
null
null
TimRichter/Idris-dev
src/Idris/DSL.hs
bsd-3-clause
mkTTName :: FC -> Name -> PTerm mkTTName fc n = let mkList fc [] = PRef fc [] (sNS (sUN "Nil") ["List", "Prelude"]) mkList fc (x:xs) = PApp fc (PRef fc [] (sNS (sUN "::") ["List", "Prelude"])) [ pexp (stringC x) , pexp (mkList fc xs)]...
919
mkTTName :: FC -> Name -> PTerm mkTTName fc n = let mkList fc [] = PRef fc [] (sNS (sUN "Nil") ["List", "Prelude"]) mkList fc (x:xs) = PApp fc (PRef fc [] (sNS (sUN "::") ["List", "Prelude"])) [ pexp (stringC x) , pexp (mkList fc xs)]...
919
mkTTName fc n = let mkList fc [] = PRef fc [] (sNS (sUN "Nil") ["List", "Prelude"]) mkList fc (x:xs) = PApp fc (PRef fc [] (sNS (sUN "::") ["List", "Prelude"])) [ pexp (stringC x) , pexp (mkList fc xs)] stringC = PConstant fc ...
887
false
true
0
15
406
389
192
197
null
null
tidalcycles/tidal-midi
Sound/Tidal/MIDI/Tetra.hs
gpl-3.0
(breath, breath_p) = pF "breath" (Just 0.5)
43
(breath, breath_p) = pF "breath" (Just 0.5)
43
(breath, breath_p) = pF "breath" (Just 0.5)
43
false
false
0
7
6
24
12
12
null
null
rrnewton/hgdata_trash
src/Crypto/GnuPG.hs
mit
encryptLbs :: [Recipient] -- ^ The recipients for encryption. -> LBS.ByteString -- ^ The plain data. -> IO LBS.ByteString -- ^ The encrypted data. encryptLbs recipients input = do (hIn, hOut, _, _) <- runInteractiveProcess "gpg" ( [ "--encrypt" , "--quiet...
552
encryptLbs :: [Recipient] -- ^ The recipients for encryption. -> LBS.ByteString -- ^ The plain data. -> IO LBS.ByteString encryptLbs recipients input = do (hIn, hOut, _, _) <- runInteractiveProcess "gpg" ( [ "--encrypt" , "--quiet" , "--batch" ...
526
encryptLbs recipients input = do (hIn, hOut, _, _) <- runInteractiveProcess "gpg" ( [ "--encrypt" , "--quiet" , "--batch" ] ++ concatMap (\r -> ["--recipient", r]) recipients ) Nothing Nothing consumeInput LBS.hPutStr hIn ...
384
true
true
0
14
190
122
65
57
null
null
tuturto/space-privateers
GameDefinition/Content/TileKind.hs
bsd-3-clause
pillar = TileKind { tsymbol = 'O' , tname = "rock" , tfreq = [ ("cachable", 70) , ("legendLit", 100), ("legendDark", 100) , ("noiseSet", 100), ("skirmishSet", 5) , ("battleSet", 250) ] , tcolor = BrWhite , tcolor2 = defFG , tfeature = [] }
308
pillar = TileKind { tsymbol = 'O' , tname = "rock" , tfreq = [ ("cachable", 70) , ("legendLit", 100), ("legendDark", 100) , ("noiseSet", 100), ("skirmishSet", 5) , ("battleSet", 250) ] , tcolor = BrWhite , tcolor2 = defFG , tfeature = [] }
308
pillar = TileKind { tsymbol = 'O' , tname = "rock" , tfreq = [ ("cachable", 70) , ("legendLit", 100), ("legendDark", 100) , ("noiseSet", 100), ("skirmishSet", 5) , ("battleSet", 250) ] , tcolor = BrWhite , tcolor2 = defFG , tfeature = [] }
308
false
false
0
9
112
104
66
38
null
null
ndmitchell/nsis
src/Development/NSIS/Plugins/WinMessages.hs
bsd-3-clause
stm_ONLY_THIS_NAME = 0x00000008
40
stm_ONLY_THIS_NAME = 0x00000008
40
stm_ONLY_THIS_NAME = 0x00000008
40
false
false
0
4
11
6
3
3
null
null
nkoep/dotfiles
xmonad/.xmonad/xmonad.hs
apache-2.0
shrinkRect p (Rectangle x y w h) = Rectangle (x+fi p) (y+fi p) (w-2*fi p) (h-2*fi p)
88
shrinkRect p (Rectangle x y w h) = Rectangle (x+fi p) (y+fi p) (w-2*fi p) (h-2*fi p)
88
shrinkRect p (Rectangle x y w h) = Rectangle (x+fi p) (y+fi p) (w-2*fi p) (h-2*fi p)
88
false
false
0
8
20
80
39
41
null
null
brendanhay/gogol
gogol-adexchangebuyer2/gen/Network/Google/AdExchangeBuyer2/Types/Product.hs
mpl-2.0
-- | The negotiable terms of the deal. proTerms :: Lens' Product (Maybe DealTerms) proTerms = lens _proTerms (\ s a -> s{_proTerms = a})
136
proTerms :: Lens' Product (Maybe DealTerms) proTerms = lens _proTerms (\ s a -> s{_proTerms = a})
97
proTerms = lens _proTerms (\ s a -> s{_proTerms = a})
53
true
true
2
9
24
55
25
30
null
null
mb21/qua-kit
libs/hs/luci-connect/examples/AddingNumbersService.hs
mit
main :: IO () main = runReallySimpleLuciClient () $ do yield $ registerMessage 14 awaitForever calculate where calculate (MsgRun token "AddingNumbers" pams _) = case fromJSON (Object pams) of Success (RunCalculate x y) -> yield $ MsgResult token (resultJSON [ "sum" .= (x + y) ...
673
main :: IO () main = runReallySimpleLuciClient () $ do yield $ registerMessage 14 awaitForever calculate where calculate (MsgRun token "AddingNumbers" pams _) = case fromJSON (Object pams) of Success (RunCalculate x y) -> yield $ MsgResult token (resultJSON [ "sum" .= (x + y) ...
673
main = runReallySimpleLuciClient () $ do yield $ registerMessage 14 awaitForever calculate where calculate (MsgRun token "AddingNumbers" pams _) = case fromJSON (Object pams) of Success (RunCalculate x y) -> yield $ MsgResult token (resultJSON [ "sum" .= (x + y) ]) [] ...
659
false
true
4
15
189
257
116
141
null
null
harendra-kumar/asyncly
benchmark/BaseStreams.hs
bsd-3-clause
benchFold :: NFData b => String -> (t IO Int -> IO b) -> (Int -> t IO Int) -> Benchmark benchFold name f src = bench name $ nfIO $ randomRIO (1,1) >>= f . src
162
benchFold :: NFData b => String -> (t IO Int -> IO b) -> (Int -> t IO Int) -> Benchmark benchFold name f src = bench name $ nfIO $ randomRIO (1,1) >>= f . src
162
benchFold name f src = bench name $ nfIO $ randomRIO (1,1) >>= f . src
70
false
true
0
11
40
92
45
47
null
null
ikirill/ComputationalMathematics
Cube/Permutation.hs
gpl-3.0
power n p | n < 0 = power (-n) (inv p) | otherwise = loop n p where loop :: Int -> Perm -> Perm loop 1 p = p loop 15 p = loop 3 (loop 5 p) loop n p = let s = power (n `div` 2) (square p) in if even n then s else mul s p -- | Return which multiplications will be done by the po...
334
power n p | n < 0 = power (-n) (inv p) | otherwise = loop n p where loop :: Int -> Perm -> Perm loop 1 p = p loop 15 p = loop 3 (loop 5 p) loop n p = let s = power (n `div` 2) (square p) in if even n then s else mul s p -- | Return which multiplications will be done by the po...
334
power n p | n < 0 = power (-n) (inv p) | otherwise = loop n p where loop :: Int -> Perm -> Perm loop 1 p = p loop 15 p = loop 3 (loop 5 p) loop n p = let s = power (n `div` 2) (square p) in if even n then s else mul s p -- | Return which multiplications will be done by the po...
334
false
false
2
11
118
179
80
99
null
null
vincenthz/cryptonite
Crypto/PubKey/DH.hs
bsd-3-clause
-- | generate params from a specific generator (2 or 5 are common values) -- we generate a safe prime (a prime number of the form 2p+1 where p is also prime) generateParams :: MonadRandom m => Int -- ^ number of bits -> Integer -- ^ generator ...
429
generateParams :: MonadRandom m => Int -- ^ number of bits -> Integer -- ^ generator -> m Params generateParams bits generator = (\p -> Params p generator bits) <$> generateSafePrime bits
271
generateParams bits generator = (\p -> Params p generator bits) <$> generateSafePrime bits
94
true
true
0
8
147
60
31
29
null
null
brendanhay/gogol
gogol-serviceconsumermanagement/gen/Network/Google/ServiceConsumerManagement/Types/Product.hs
mpl-2.0
-- | The fully qualified message name. tName :: Lens' Type (Maybe Text) tName = lens _tName (\ s a -> s{_tName = a})
116
tName :: Lens' Type (Maybe Text) tName = lens _tName (\ s a -> s{_tName = a})
77
tName = lens _tName (\ s a -> s{_tName = a})
44
true
true
0
9
23
46
25
21
null
null
taktoa/hskpipe
src/Compile.hs
gpl-3.0
typeCheck (ESub a b) = typeCheck' [(a, TNumber), (b, TNumber)] TNumber
75
typeCheck (ESub a b) = typeCheck' [(a, TNumber), (b, TNumber)] TNumber
75
typeCheck (ESub a b) = typeCheck' [(a, TNumber), (b, TNumber)] TNumber
75
false
false
0
7
15
41
22
19
null
null
fmthoma/ghc
compiler/coreSyn/CoreUtils.hs
bsd-3-clause
exprStats (Coercion c) = coStats c
37
exprStats (Coercion c) = coStats c
37
exprStats (Coercion c) = coStats c
37
false
false
0
6
8
19
8
11
null
null
gbaz/cabal
Cabal/Distribution/Simple/Utils.hs
bsd-3-clause
-- | More detail on the operation of some action. -- -- We display these messages when the verbosity level is 'verbose' -- info :: Verbosity -> String -> IO () info verbosity msg = when (verbosity >= verbose) $ putStr (wrapText msg)
238
info :: Verbosity -> String -> IO () info verbosity msg = when (verbosity >= verbose) $ putStr (wrapText msg)
115
info verbosity msg = when (verbosity >= verbose) $ putStr (wrapText msg)
78
true
true
0
8
48
56
29
27
null
null
HIPERFIT/futhark
src/Language/Futhark/TypeChecker/Terms.hs
isc
fixOverloadedTypes :: Names -> TermTypeM () fixOverloadedTypes tyvars_at_toplevel = getConstraints >>= mapM_ fixOverloaded . M.toList . M.map snd where fixOverloaded (v, Overloaded ots usage) | Signed Int32 `elem` ots = do unify usage (Scalar (TypeVar () Nonunique (typeName v) [])) $ Sca...
2,172
fixOverloadedTypes :: Names -> TermTypeM () fixOverloadedTypes tyvars_at_toplevel = getConstraints >>= mapM_ fixOverloaded . M.toList . M.map snd where fixOverloaded (v, Overloaded ots usage) | Signed Int32 `elem` ots = do unify usage (Scalar (TypeVar () Nonunique (typeName v) [])) $ Sca...
2,172
fixOverloadedTypes tyvars_at_toplevel = getConstraints >>= mapM_ fixOverloaded . M.toList . M.map snd where fixOverloaded (v, Overloaded ots usage) | Signed Int32 `elem` ots = do unify usage (Scalar (TypeVar () Nonunique (typeName v) [])) $ Scalar $ Prim $ Signed Int32 when (v `S...
2,128
false
true
25
18
584
634
289
345
null
null
kojiromike/Idris-dev
src/Idris/Core/Elaborate.hs
bsd-3-clause
simplify :: Elab' aux () simplify = processTactic' Simplify
59
simplify :: Elab' aux () simplify = processTactic' Simplify
59
simplify = processTactic' Simplify
34
false
true
0
7
8
27
11
16
null
null
graninas/Andromeda
src/Andromeda/Simulator/Actions.hs
bsd-3-clause
setEnabled tvProduce = liftIO $ atomically $ writeTVar tvProduce True
69
setEnabled tvProduce = liftIO $ atomically $ writeTVar tvProduce True
69
setEnabled tvProduce = liftIO $ atomically $ writeTVar tvProduce True
69
false
false
1
6
9
25
10
15
null
null
ChristianBertram/tic-tac-toe
AI.hs
mit
maximumFst :: Ord a => [(a, b)] -> (a, b) maximumFst [] = error "empty list"
76
maximumFst :: Ord a => [(a, b)] -> (a, b) maximumFst [] = error "empty list"
76
maximumFst [] = error "empty list"
34
false
true
0
8
15
45
24
21
null
null
anniecherk/pyschocnf
app/SystemTester.hs
bsd-3-clause
-- this is either (==) or (<) doTestKandN :: (Int -> Int -> Bool) -> String -> IO String doTestKandN eqOrLessThan file = do result <- readFile file let nSetVars = read (splitOneOf "_./" file !! 1) ::Int --- lord have mercy lord have mercy lord have mercy let k = read (splitOneOf "_./" file !! 3) ::Int -- t...
460
doTestKandN :: (Int -> Int -> Bool) -> String -> IO String doTestKandN eqOrLessThan file = do result <- readFile file let nSetVars = read (splitOneOf "_./" file !! 1) ::Int --- lord have mercy lord have mercy lord have mercy let k = read (splitOneOf "_./" file !! 3) ::Int -- this makes assumptions about ho...
430
doTestKandN eqOrLessThan file = do result <- readFile file let nSetVars = read (splitOneOf "_./" file !! 1) ::Int --- lord have mercy lord have mercy lord have mercy let k = read (splitOneOf "_./" file !! 3) ::Int -- this makes assumptions about how the generateKofN formats file names... return $ validat...
371
true
true
0
14
93
130
62
68
null
null
jgm/pandoc-types
src/Text/Pandoc/Arbitrary.hs
bsd-3-clause
arbTableFoot :: Int -> Gen TableFoot arbTableFoot n = do rs <- choose (0, 5) TableFoot <$> arbAttr <*> vectorOf rs (arbRow n)
133
arbTableFoot :: Int -> Gen TableFoot arbTableFoot n = do rs <- choose (0, 5) TableFoot <$> arbAttr <*> vectorOf rs (arbRow n)
133
arbTableFoot n = do rs <- choose (0, 5) TableFoot <$> arbAttr <*> vectorOf rs (arbRow n)
96
false
true
0
11
30
63
29
34
null
null
sdiehl/ghc
libraries/base/GHC/Event/Manager.hs
bsd-3-clause
-- | Create a new event manager. new :: IO EventManager new = newWith =<< newDefaultBackend
91
new :: IO EventManager new = newWith =<< newDefaultBackend
58
new = newWith =<< newDefaultBackend
35
true
true
1
6
15
23
10
13
null
null
Paow/encore
src/types/Typechecker/TypeError.hs
bsd-3-clause
validUseOfBreak (_:bt) = validUseOfBreak bt
43
validUseOfBreak (_:bt) = validUseOfBreak bt
43
validUseOfBreak (_:bt) = validUseOfBreak bt
43
false
false
0
7
4
19
9
10
null
null
tismith/tlisp
write-yourself-a-scheme/listings/listing8.hs
mit
unpackBool :: LispVal -> ThrowsError Bool unpackBool (Bool b) = return b
72
unpackBool :: LispVal -> ThrowsError Bool unpackBool (Bool b) = return b
72
unpackBool (Bool b) = return b
30
false
true
0
6
11
34
15
19
null
null
pparkkin/eta
compiler/ETA/DeSugar/Coverage.hs
bsd-3-clause
isGoodBreakExpr (HsMultiIf {}) = True
37
isGoodBreakExpr (HsMultiIf {}) = True
37
isGoodBreakExpr (HsMultiIf {}) = True
37
false
false
0
6
4
17
8
9
null
null
flyingleafe/parser-gen
src/GrammarProcessing.hs
bsd-3-clause
checkLL1 ∷ ParserGrammar → GrammarTable → GrammarTable → Either String () checkLL1 gr first follow = do forM_ (M.toList gr) $ \(nt, ParserRule _ _ rules) → do let rulePairs = makePairs rules forM_ rulePairs $ \(a, b) → do let fstA = getFIRST first a fstB = getFIRST first b if (fstA ∩ fst...
560
checkLL1 ∷ ParserGrammar → GrammarTable → GrammarTable → Either String () checkLL1 gr first follow = do forM_ (M.toList gr) $ \(nt, ParserRule _ _ rules) → do let rulePairs = makePairs rules forM_ rulePairs $ \(a, b) → do let fstA = getFIRST first a fstB = getFIRST first b if (fstA ∩ fst...
560
checkLL1 gr first follow = do forM_ (M.toList gr) $ \(nt, ParserRule _ _ rules) → do let rulePairs = makePairs rules forM_ rulePairs $ \(a, b) → do let fstA = getFIRST first a fstB = getFIRST first b if (fstA ∩ fstB ≢ []) ∨ (("EPSILON" ∈ fstA) ∧ (getList follow nt ∩ fstB ≢ [])) the...
486
false
true
0
25
155
251
124
127
null
null
mrkkrp/stack
src/Stack/Config.hs
bsd-3-clause
loadMiniConfig :: Config -> MiniConfig loadMiniConfig config = let ghcVariant = fromMaybe GHCStandard (configGHCVariant0 config) in MiniConfig ghcVariant config
169
loadMiniConfig :: Config -> MiniConfig loadMiniConfig config = let ghcVariant = fromMaybe GHCStandard (configGHCVariant0 config) in MiniConfig ghcVariant config
169
loadMiniConfig config = let ghcVariant = fromMaybe GHCStandard (configGHCVariant0 config) in MiniConfig ghcVariant config
130
false
true
0
11
27
45
21
24
null
null
ganeti/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
hvUseGuestAgent :: String hvUseGuestAgent = "use_guest_agent"
61
hvUseGuestAgent :: String hvUseGuestAgent = "use_guest_agent"
61
hvUseGuestAgent = "use_guest_agent"
35
false
true
0
4
5
11
6
5
null
null
tolysz/dsp
DSP/Filter/FIR/FIR.hs
gpl-2.0
h3 :: Array Int Double h3 = listArray (0,4) [ 1, 2, 3, -2, -1 ]
63
h3 :: Array Int Double h3 = listArray (0,4) [ 1, 2, 3, -2, -1 ]
63
h3 = listArray (0,4) [ 1, 2, 3, -2, -1 ]
40
false
true
0
7
15
46
26
20
null
null
FranklinChen/write-you-a-haskell
chapter7/poly_constraints/src/Infer.hs
mit
-- Unification solver solver :: Unifier -> Solve Subst solver (su, cs) = case cs of [] -> return su ((t1, t2): cs0) -> do su1 <- unifies t1 t2 solver (su1 `compose` su, apply su1 cs0)
206
solver :: Unifier -> Solve Subst solver (su, cs) = case cs of [] -> return su ((t1, t2): cs0) -> do su1 <- unifies t1 t2 solver (su1 `compose` su, apply su1 cs0)
184
solver (su, cs) = case cs of [] -> return su ((t1, t2): cs0) -> do su1 <- unifies t1 t2 solver (su1 `compose` su, apply su1 cs0)
151
true
true
2
10
59
99
50
49
null
null
hspec/hspec
hspec-core/src/Test/Hspec/Core/Compat.hs
mit
sortOn :: Ord b => (a -> b) -> [a] -> [a] sortOn f = map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x))
131
sortOn :: Ord b => (a -> b) -> [a] -> [a] sortOn f = map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x))
131
sortOn f = map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x))
89
false
true
1
13
36
105
52
53
null
null
brendanhay/gogol
gogol-classroom/gen/Network/Google/Classroom/Types/Product.hs
mpl-2.0
-- | YouTube video material. mYouTubeVideo :: Lens' Material (Maybe YouTubeVideo) mYouTubeVideo = lens _mYouTubeVideo (\ s a -> s{_mYouTubeVideo = a})
158
mYouTubeVideo :: Lens' Material (Maybe YouTubeVideo) mYouTubeVideo = lens _mYouTubeVideo (\ s a -> s{_mYouTubeVideo = a})
129
mYouTubeVideo = lens _mYouTubeVideo (\ s a -> s{_mYouTubeVideo = a})
76
true
true
2
9
29
55
25
30
null
null
vaibhav276/haskell_cs194_assignments
polymorphism/Calc.hs
mit
eval (Add e1 e2) = (eval e1) + (eval e2)
40
eval (Add e1 e2) = (eval e1) + (eval e2)
40
eval (Add e1 e2) = (eval e1) + (eval e2)
40
false
false
0
7
9
34
16
18
null
null
uduki/hsQt
Qtc/Enums/Gui/QFileDialog.hs
bsd-2-clause
eAccept :: DialogLabel eAccept = ieDialogLabel $ 3
52
eAccept :: DialogLabel eAccept = ieDialogLabel $ 3
52
eAccept = ieDialogLabel $ 3
29
false
true
0
6
9
18
8
10
null
null
lingxiao/CIS700
depricated/CountMinSketch2.hs
bsd-3-clause
maxi = 30 :: Event
30
maxi = 30 :: Event
30
maxi = 30 :: Event
30
false
false
0
4
16
9
5
4
null
null
nomeata/list-fusion-lab
ListImpls/BaseFrom76.hs
bsd-3-clause
head :: [a] -> a head (x:_) = x
64
head :: [a] -> a head (x:_) = x
64
head (x:_) = x
28
false
true
0
6
41
29
15
14
null
null
considerate/progp
Haskell/merge.hs
mit
merge xs [] = xs
16
merge xs [] = xs
16
merge xs [] = xs
16
false
false
0
6
4
13
6
7
null
null
christiaanb/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
voidPrimTyConKey = mkPreludeTyConUnique 57
65
voidPrimTyConKey = mkPreludeTyConUnique 57
65
voidPrimTyConKey = mkPreludeTyConUnique 57
65
false
false
0
5
26
9
4
5
null
null
brendanhay/gogol
gogol-games-management/gen/Network/Google/GamesManagement/Types/Product.hs
mpl-2.0
-- | Uniquely identifies the type of this resource. Value is always the fixed -- string \`gamesManagement#playerScoreResetAllResponse\`. psrarKind :: Lens' PlayerScoreResetAllResponse (Maybe Text) psrarKind = lens _psrarKind (\ s a -> s{_psrarKind = a})
255
psrarKind :: Lens' PlayerScoreResetAllResponse (Maybe Text) psrarKind = lens _psrarKind (\ s a -> s{_psrarKind = a})
118
psrarKind = lens _psrarKind (\ s a -> s{_psrarKind = a})
58
true
true
1
9
35
53
26
27
null
null
joachifm/pwcrypt
src/pwcrypt.hs
mit
getPassword :: String -> Line.InputT IO SB.ByteString getPassword p = fromString . fromMaybe "" <$> Line.getPassword (Just '*') p
129
getPassword :: String -> Line.InputT IO SB.ByteString getPassword p = fromString . fromMaybe "" <$> Line.getPassword (Just '*') p
129
getPassword p = fromString . fromMaybe "" <$> Line.getPassword (Just '*') p
75
false
true
0
8
18
51
24
27
null
null
ezyang/ghc
compiler/deSugar/DsBinds.hs
bsd-3-clause
decomposeRuleLhs :: [Var] -> CoreExpr -> Either SDoc ([Var], Id, [CoreExpr]) -- (decomposeRuleLhs bndrs lhs) takes apart the LHS of a RULE, -- The 'bndrs' are the quantified binders of the rules, but decomposeRuleLhs -- may add some extra dictionary binders (see Note [Free dictionaries]) -- -- Returns an error message ...
12,019
decomposeRuleLhs :: [Var] -> CoreExpr -> Either SDoc ([Var], Id, [CoreExpr]) decomposeRuleLhs orig_bndrs orig_lhs | not (null unbound) -- Check for things unbound on LHS -- See Note [Unused spec binders] = Left (vcat (map dead_msg unbound)) | Var funId <- fun2 , Just con <- isDataCo...
11,686
decomposeRuleLhs orig_bndrs orig_lhs | not (null unbound) -- Check for things unbound on LHS -- See Note [Unused spec binders] = Left (vcat (map dead_msg unbound)) | Var funId <- fun2 , Just con <- isDataConId_maybe funId = Left (constructor_msg con) -- See Note [No RULES on datac...
11,609
true
true
22
11
3,379
1,219
588
631
null
null
ameingast/slisp
src/SLISP/Eval.hs
bsd-3-clause
mapNumOp f xs = List $ map (numUnOp f) xs
41
mapNumOp f xs = List $ map (numUnOp f) xs
41
mapNumOp f xs = List $ map (numUnOp f) xs
41
false
false
0
8
9
26
12
14
null
null
GaloisInc/ivory-tower-stm32
ivory-bsp-stm32/src/Ivory/BSP/STM32F405/MemoryMap.hs
bsd-3-clause
ram2_base = 0x2001C000
28
sram2_base = 0x2001C000
28
sram2_base = 0x2001C000
28
false
false
0
4
8
6
3
3
null
null
tensorflow/haskell
tensorflow-records/tests/Main.hs
apache-2.0
main :: IO () main = defaultMain tests
38
main :: IO () main = defaultMain tests
38
main = defaultMain tests
24
false
true
0
7
7
25
10
15
null
null
tejon/diagrams-contrib
src/Diagrams/TwoD/Path/Metafont/Internal.hs
bsd-3-clause
curlEnds p = p & segs %~ leftEnd where leftEnd [s] = [s & pj.d1 %~ curlIfEmpty & pj.d2 %~ curlIfEmpty] leftEnd (s:ss) = (s & pj.d1 %~ curlIfEmpty) : rightEnd ss leftEnd [] = [] rightEnd [] = [] rightEnd [s] = [s & pj.d2 %~ curlIfEmpty] rightEnd (s:ss) ...
422
curlEnds p = p & segs %~ leftEnd where leftEnd [s] = [s & pj.d1 %~ curlIfEmpty & pj.d2 %~ curlIfEmpty] leftEnd (s:ss) = (s & pj.d1 %~ curlIfEmpty) : rightEnd ss leftEnd [] = [] rightEnd [] = [] rightEnd [s] = [s & pj.d2 %~ curlIfEmpty] rightEnd (s:ss) ...
422
curlEnds p = p & segs %~ leftEnd where leftEnd [s] = [s & pj.d1 %~ curlIfEmpty & pj.d2 %~ curlIfEmpty] leftEnd (s:ss) = (s & pj.d1 %~ curlIfEmpty) : rightEnd ss leftEnd [] = [] rightEnd [] = [] rightEnd [s] = [s & pj.d2 %~ curlIfEmpty] rightEnd (s:ss) ...
422
false
false
6
10
150
200
93
107
null
null
bacchanalia/KitchenSink
KitchenSink/Qualified.hs
gpl-3.0
-- |'MapS.lookup' ms_lookup = MapS.lookup
41
ms_lookup = MapS.lookup
23
ms_lookup = MapS.lookup
23
true
false
0
5
4
9
5
4
null
null
kawu/nerf-misc
src/Text/NKJP.hs
bsd-3-clause
morphP :: XmlParser String [MorphSent] morphP = true //> morphSentP
67
morphP :: XmlParser String [MorphSent] morphP = true //> morphSentP
67
morphP = true //> morphSentP
28
false
true
0
6
9
23
12
11
null
null
cpennington/h4sh
testsuite/TestFramework.hs
gpl-2.0
showPath nodes = foldr1 f (map showNode (filterNodes (reverse nodes))) where f a b = a ++ ":" ++ b showNode (HU.ListItem n) = show n showNode (HU.Label label) = safe label (show label) safe s ss = if ':' `elem` s || "\"" ++ s ++ "\"" /= ss then ss else s filterNodes (HU.ListItem _ : l@(HU.L...
725
showPath nodes = foldr1 f (map showNode (filterNodes (reverse nodes))) where f a b = a ++ ":" ++ b showNode (HU.ListItem n) = show n showNode (HU.Label label) = safe label (show label) safe s ss = if ':' `elem` s || "\"" ++ s ++ "\"" /= ss then ss else s filterNodes (HU.ListItem _ : l@(HU.L...
725
showPath nodes = foldr1 f (map showNode (filterNodes (reverse nodes))) where f a b = a ++ ":" ++ b showNode (HU.ListItem n) = show n showNode (HU.Label label) = safe label (show label) safe s ss = if ':' `elem` s || "\"" ++ s ++ "\"" /= ss then ss else s filterNodes (HU.ListItem _ : l@(HU.L...
725
false
false
0
12
175
218
109
109
null
null
kongo2002/minfo
Data/MInfo/Parser.hs
apache-2.0
hms :: Parser (Integer, Integer, Integer, Integer) hms = do h <- decimal _ <- char ':' m <- decimal _ <- char ':' s <- decimal ms <- millis return (h, m, s, ms) where -- not every mongodb logs with milliseconds precision millis = char '.' *> decimal <|> return 0
286
hms :: Parser (Integer, Integer, Integer, Integer) hms = do h <- decimal _ <- char ':' m <- decimal _ <- char ':' s <- decimal ms <- millis return (h, m, s, ms) where -- not every mongodb logs with milliseconds precision millis = char '.' *> decimal <|> return 0
286
hms = do h <- decimal _ <- char ':' m <- decimal _ <- char ':' s <- decimal ms <- millis return (h, m, s, ms) where -- not every mongodb logs with milliseconds precision millis = char '.' *> decimal <|> return 0
235
false
true
0
8
76
115
56
59
null
null
silkapp/generic-aeson
src/Generics/Generic/Aeson/Util.hs
bsd-3-clause
conNameT set x = formatLabel set . T.pack . conName $ x
55
conNameT set x = formatLabel set . T.pack . conName $ x
55
conNameT set x = formatLabel set . T.pack . conName $ x
55
false
false
0
8
11
28
13
15
null
null
snoyberg/ghc
compiler/codeGen/StgCmmClosure.hs
bsd-3-clause
indStaticInfoTable :: CmmInfoTable indStaticInfoTable = CmmInfoTable { cit_lbl = mkIndStaticInfoLabel , cit_rep = indStaticRep , cit_prof = NoProfilingInfo , cit_srt = NoC_SRT }
233
indStaticInfoTable :: CmmInfoTable indStaticInfoTable = CmmInfoTable { cit_lbl = mkIndStaticInfoLabel , cit_rep = indStaticRep , cit_prof = NoProfilingInfo , cit_srt = NoC_SRT }
233
indStaticInfoTable = CmmInfoTable { cit_lbl = mkIndStaticInfoLabel , cit_rep = indStaticRep , cit_prof = NoProfilingInfo , cit_srt = NoC_SRT }
198
false
true
0
6
78
40
23
17
null
null
Proclivis/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_HP_IDENTIFIER :: Int wxSTC_HP_IDENTIFIER = 102
52
wxSTC_HP_IDENTIFIER :: Int wxSTC_HP_IDENTIFIER = 102
52
wxSTC_HP_IDENTIFIER = 102
25
false
true
0
4
5
11
6
5
null
null
Arguggi/irc-log
backend/app/bot/Main.hs
gpl-3.0
-- Parse Irc message: -- :NICKNAME!~NICKNAME@HOST PRIVMSG #haskell.it :MESSAGE ircParser :: UTCTime -> Parser PrivMsg ircParser time = PrivMsg <$> ircNickname <*> pure time <*> ircMessage where ircNickname = char ':' *> takeTill (== '!') -- Only save PRIVMSGs checkPriv = skipWhile (/= ' ') <...
543
ircParser :: UTCTime -> Parser PrivMsg ircParser time = PrivMsg <$> ircNickname <*> pure time <*> ircMessage where ircNickname = char ':' *> takeTill (== '!') -- Only save PRIVMSGs checkPriv = skipWhile (/= ' ') <* string " PRIVMSG " -- sent to the channel we connect to (so this igno...
464
ircParser time = PrivMsg <$> ircNickname <*> pure time <*> ircMessage where ircNickname = char ':' *> takeTill (== '!') -- Only save PRIVMSGs checkPriv = skipWhile (/= ' ') <* string " PRIVMSG " -- sent to the channel we connect to (so this ignores PRIVMSGs to the bot) skipCh...
425
true
true
0
10
134
119
62
57
null
null
peterokagey/haskellOEIS
test/External/A180714Spec.hs
apache-2.0
main :: IO () main = hspec spec
31
main :: IO () main = hspec spec
31
main = hspec spec
17
false
true
0
7
7
24
10
14
null
null
sayon/lenses-talk
lenses.hs
gpl-2.0
makePoint :: (Double, Double) -> Point makePoint (x, y) = Point x y
67
makePoint :: (Double, Double) -> Point makePoint (x, y) = Point x y
67
makePoint (x, y) = Point x y
28
false
true
0
6
12
39
20
19
null
null
Sgoettschkes/learning
haskell/LearnYouAHaskell/04.hs
mit
tell' :: (Show a) => [a] -> String tell' [] = "Empty"
53
tell' :: (Show a) => [a] -> String tell' [] = "Empty"
53
tell' [] = "Empty"
18
false
true
0
9
11
38
18
20
null
null
mpickering/hlint-refactor
src/Refact/Fixity.hs
bsd-3-clause
expFix :: LHsExpr GhcPs -> M (LHsExpr GhcPs) expFix (L loc (OpApp _ l op r)) = mkOpAppRn baseFixities loc l op (findFixity baseFixities op) r
143
expFix :: LHsExpr GhcPs -> M (LHsExpr GhcPs) expFix (L loc (OpApp _ l op r)) = mkOpAppRn baseFixities loc l op (findFixity baseFixities op) r
143
expFix (L loc (OpApp _ l op r)) = mkOpAppRn baseFixities loc l op (findFixity baseFixities op) r
98
false
true
0
9
27
71
34
37
null
null
573/leksah
src/IDE/Completion.hs
gpl-2.0
cancel :: IDEAction cancel = do currentState' <- readIDE currentState (_, completion') <- readIDE completion case (currentState',completion') of (IsCompleting conn , Just (CompletionWindow window tv st)) -> do cancelCompletion window tv st conn _ -> return ()
313
cancel :: IDEAction cancel = do currentState' <- readIDE currentState (_, completion') <- readIDE completion case (currentState',completion') of (IsCompleting conn , Just (CompletionWindow window tv st)) -> do cancelCompletion window tv st conn _ -> return ()
313
cancel = do currentState' <- readIDE currentState (_, completion') <- readIDE completion case (currentState',completion') of (IsCompleting conn , Just (CompletionWindow window tv st)) -> do cancelCompletion window tv st conn _ -> return ()
293
false
true
0
14
90
108
50
58
null
null
kmels/xmonad-launcher
XMonad/Hooks/FadeWindows.hs
bsd-3-clause
-- ^ An alias for 'transparency'. translucence = transparency
61
translucence = transparency
27
translucence = transparency
27
true
false
0
4
8
7
4
3
null
null
mcmaniac/bindrop
src/Utils/FileUtils.hs
apache-2.0
randomString :: RandomGen g => Int -> g -> String randomString len gen = let alphanum = ['0'..'9'] ++ ['a'..'z'] ++ ['A'..'Z'] indxs = take len $ randomRs (0, length alphanum - 1) gen in map (alphanum !!) indxs
224
randomString :: RandomGen g => Int -> g -> String randomString len gen = let alphanum = ['0'..'9'] ++ ['a'..'z'] ++ ['A'..'Z'] indxs = take len $ randomRs (0, length alphanum - 1) gen in map (alphanum !!) indxs
224
randomString len gen = let alphanum = ['0'..'9'] ++ ['a'..'z'] ++ ['A'..'Z'] indxs = take len $ randomRs (0, length alphanum - 1) gen in map (alphanum !!) indxs
174
false
true
0
13
52
111
54
57
null
null
rfranek/duckling
Duckling/Time/Helpers.hs
bsd-3-clause
inDuration :: DurationData -> TimeData inDuration dd = TTime.timedata' { TTime.timePred = shiftDuration (takeNth 0 False $ timeCycle TG.Second) dd , TTime.timeGrain = TDuration.grain dd }
193
inDuration :: DurationData -> TimeData inDuration dd = TTime.timedata' { TTime.timePred = shiftDuration (takeNth 0 False $ timeCycle TG.Second) dd , TTime.timeGrain = TDuration.grain dd }
193
inDuration dd = TTime.timedata' { TTime.timePred = shiftDuration (takeNth 0 False $ timeCycle TG.Second) dd , TTime.timeGrain = TDuration.grain dd }
154
false
true
0
12
31
74
35
39
null
null
urbanslug/ghc
compiler/utils/ExtsCompat46.hs
bsd-3-clause
sameMVar# :: MVar# s a -> MVar# s a -> Bool sameMVar# a b = isTrue# (E.sameMVar# a b)
85
sameMVar# :: MVar# s a -> MVar# s a -> Bool sameMVar# a b = isTrue# (E.sameMVar# a b)
85
sameMVar# a b = isTrue# (E.sameMVar# a b)
41
false
true
0
8
18
47
22
25
null
null
ekr/tamarin-prover
lib/theory/src/Theory/Constraint/System/Guarded.hs
gpl-3.0
matchTerm :: SkTerm -> SkTerm -> WithMaude [SkSubst] matchTerm s t = solveMatchLTerm sortOfSkol (s `matchWith` t) where sortOfSkol (SkName n) = sortOfName n sortOfSkol (SkConst v) = lvarSort v ------------------------------------------------------------------------------ -- Pretty Printing ------------...
416
matchTerm :: SkTerm -> SkTerm -> WithMaude [SkSubst] matchTerm s t = solveMatchLTerm sortOfSkol (s `matchWith` t) where sortOfSkol (SkName n) = sortOfName n sortOfSkol (SkConst v) = lvarSort v ------------------------------------------------------------------------------ -- Pretty Printing ------------...
416
matchTerm s t = solveMatchLTerm sortOfSkol (s `matchWith` t) where sortOfSkol (SkName n) = sortOfName n sortOfSkol (SkConst v) = lvarSort v ------------------------------------------------------------------------------ -- Pretty Printing ------------------------------------------------------------------...
362
false
true
0
9
58
91
45
46
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/HTMLTextAreaElement.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement.select Mozilla HTMLTextAreaElement.select documentation> select :: (MonadDOM m) => HTMLTextAreaElement -> m () select self = liftDOM (void (self ^. jsf "select" ()))
241
select :: (MonadDOM m) => HTMLTextAreaElement -> m () select self = liftDOM (void (self ^. jsf "select" ()))
108
select self = liftDOM (void (self ^. jsf "select" ()))
54
true
true
0
11
25
60
29
31
null
null
ertes/pipes-bytestring
test/Bench.hs
bsd-3-clause
main :: IO () main = defaultMain []
35
main :: IO () main = defaultMain []
35
main = defaultMain []
21
false
true
0
6
7
21
10
11
null
null
s9gf4ult/yesod
yesod-bin/AddHandler.hs
mit
addHandlerInteractive :: IO () addHandlerInteractive = do cabal <- getCabal let routeInput = do putStr "Name of route (without trailing R): " hFlush stdout name <- getLine checked <- checkRoute name cabal case checked of Left err@EmptyRoute -> (error . show) e...
862
addHandlerInteractive :: IO () addHandlerInteractive = do cabal <- getCabal let routeInput = do putStr "Name of route (without trailing R): " hFlush stdout name <- getLine checked <- checkRoute name cabal case checked of Left err@EmptyRoute -> (error . show) e...
862
addHandlerInteractive = do cabal <- getCabal let routeInput = do putStr "Name of route (without trailing R): " hFlush stdout name <- getLine checked <- checkRoute name cabal case checked of Left err@EmptyRoute -> (error . show) err Left err@RouteCa...
831
false
true
0
18
276
213
91
122
null
null
tsahyt/clingo-haskell
src/Clingo/Internal/AST.hs
mit
fromRawConditionalLiteral :: AstConditionalLiteral -> IO (ConditionalLiteral (Symbol s)) fromRawConditionalLiteral (AstConditionalLiteral l ls n) = ConditionalLiteral <$> fromRawLiteral l <*> (mapM fromRawLiteral =<< peekArray (fromIntegral n) ls)
283
fromRawConditionalLiteral :: AstConditionalLiteral -> IO (ConditionalLiteral (Symbol s)) fromRawConditionalLiteral (AstConditionalLiteral l ls n) = ConditionalLiteral <$> fromRawLiteral l <*> (mapM fromRawLiteral =<< peekArray (fromIntegral n) ls)
283
fromRawConditionalLiteral (AstConditionalLiteral l ls n) = ConditionalLiteral <$> fromRawLiteral l <*> (mapM fromRawLiteral =<< peekArray (fromIntegral n) ls)
167
false
true
5
10
61
80
38
42
null
null
dstruthers/Pyrite
Main.hs
mit
repl :: VM -> IO () repl vm = do putStr prompt src <- getLine if src == "" then repl vm else case parse src >>= mapM compile >>= foldM eval vm of Left e -> (putStrLn $ "***" ++ show e) >> repl vm Right vm' -> (putStrLn $ show vm') >> repl vm' where prompt = "Pyrite> "
292
repl :: VM -> IO () repl vm = do putStr prompt src <- getLine if src == "" then repl vm else case parse src >>= mapM compile >>= foldM eval vm of Left e -> (putStrLn $ "***" ++ show e) >> repl vm Right vm' -> (putStrLn $ show vm') >> repl vm' where prompt = "Pyrite> "
292
repl vm = do putStr prompt src <- getLine if src == "" then repl vm else case parse src >>= mapM compile >>= foldM eval vm of Left e -> (putStrLn $ "***" ++ show e) >> repl vm Right vm' -> (putStrLn $ show vm') >> repl vm' where prompt = "Pyrite> "
272
false
true
0
14
84
141
65
76
null
null
haskell-distributed/distributed-process-platform
src/Control/Distributed/Process/Platform/Execution/EventManager.hs
bsd-3-clause
start :: Process EventManager start = broadcastExchange >>= return . EventManager
81
start :: Process EventManager start = broadcastExchange >>= return . EventManager
81
start = broadcastExchange >>= return . EventManager
51
false
true
0
6
10
22
11
11
null
null
brendanhay/gogol
gogol-cloudtasks/gen/Network/Google/Resource/CloudTasks/Projects/Locations/Queues/SetIAMPolicy.hs
mpl-2.0
-- | REQUIRED: The resource for which the policy is being specified. See the -- operation documentation for the appropriate value for this field. plqsipResource :: Lens' ProjectsLocationsQueuesSetIAMPolicy Text plqsipResource = lens _plqsipResource (\ s a -> s{_plqsipResource = a})
290
plqsipResource :: Lens' ProjectsLocationsQueuesSetIAMPolicy Text plqsipResource = lens _plqsipResource (\ s a -> s{_plqsipResource = a})
144
plqsipResource = lens _plqsipResource (\ s a -> s{_plqsipResource = a})
79
true
true
1
9
47
46
23
23
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Reports/Update.hs
mpl-2.0
-- | The DFA user profile ID. ruProFileId :: Lens' ReportsUpdate Int64 ruProFileId = lens _ruProFileId (\ s a -> s{_ruProFileId = a}) . _Coerce
151
ruProFileId :: Lens' ReportsUpdate Int64 ruProFileId = lens _ruProFileId (\ s a -> s{_ruProFileId = a}) . _Coerce
121
ruProFileId = lens _ruProFileId (\ s a -> s{_ruProFileId = a}) . _Coerce
80
true
true
1
9
32
50
24
26
null
null
osa1/chsc
Core/Parser.hs
bsd-3-clause
argOf :: Description -> Description argOf = ArgumentOf
54
argOf :: Description -> Description argOf = ArgumentOf
54
argOf = ArgumentOf
18
false
true
0
5
7
15
8
7
null
null
creichert/disque.hs
src/Database/Disque.hs
bsd-3-clause
astack :: [ByteString] -> Disque (Either Reply ByteString) fastack js = Disque $ sendRequest $ ["FASTACK"] ++ js
113
fastack :: [ByteString] -> Disque (Either Reply ByteString) fastack js = Disque $ sendRequest $ ["FASTACK"] ++ js
113
fastack js = Disque $ sendRequest $ ["FASTACK"] ++ js
53
false
true
0
8
18
50
25
25
null
null
DSLsofMath/Hatlab
src/Hatlab/ParametricCurves.hs
bsd-3-clause
polarCurve :: (Double -> Double) -> (Double, Double) -> String -> Parametric polarCurve r_fun interval name = Par (\theta -> (cos theta)*(r_fun theta)) (\theta -> (sin theta)*(r_fun theta)) interval name
221
polarCurve :: (Double -> Double) -> (Double, Double) -> String -> Parametric polarCurve r_fun interval name = Par (\theta -> (cos theta)*(r_fun theta)) (\theta -> (sin theta)*(r_fun theta)) interval name
221
polarCurve r_fun interval name = Par (\theta -> (cos theta)*(r_fun theta)) (\theta -> (sin theta)*(r_fun theta)) interval name
144
false
true
0
10
47
100
53
47
null
null
urv/fixhs
src/Data/FIX/Spec/FIX43.hs
lgpl-2.1
tHighPx :: FIXTag tHighPx = FIXTag { tName = "HighPx" , tnum = 332 , tparser = toFIXDouble , arbitraryValue = FIXDouble <$> (return (-2.112 :: Double)) }
166
tHighPx :: FIXTag tHighPx = FIXTag { tName = "HighPx" , tnum = 332 , tparser = toFIXDouble , arbitraryValue = FIXDouble <$> (return (-2.112 :: Double)) }
166
tHighPx = FIXTag { tName = "HighPx" , tnum = 332 , tparser = toFIXDouble , arbitraryValue = FIXDouble <$> (return (-2.112 :: Double)) }
148
false
true
0
12
40
59
34
25
null
null
Paow/encore
src/back/CodeGen/DTrace.hs
bsd-3-clause
dtraceMethodCall :: CCode Lval -> ID.Name -> [CCode Lval] -> CCode Stat dtraceMethodCall target name args = dtrace "METHOD_CALL" $ ["(uintptr_t)*_ctx", "(uintptr_t)" ++ pp target, show $ show name]
199
dtraceMethodCall :: CCode Lval -> ID.Name -> [CCode Lval] -> CCode Stat dtraceMethodCall target name args = dtrace "METHOD_CALL" $ ["(uintptr_t)*_ctx", "(uintptr_t)" ++ pp target, show $ show name]
199
dtraceMethodCall target name args = dtrace "METHOD_CALL" $ ["(uintptr_t)*_ctx", "(uintptr_t)" ++ pp target, show $ show name]
127
false
true
0
9
30
74
36
38
null
null
GU-CLASP/TypedFlow
TypedFlow/Abstract.hs
lgpl-3.0
-- | maxpool layer. window size is the first type argument. maxPool1D :: forall window width channels t. KnownNat width => KnownNat channels => (KnownNat window,KnownBits t) => T '[window*width,channels] (Flt t) -> T '[width,channels] (Flt t) maxPool1D x = squeeze0 (Pool (natSat @1) (typeSShap...
399
maxPool1D :: forall window width channels t. KnownNat width => KnownNat channels => (KnownNat window,KnownBits t) => T '[window*width,channels] (Flt t) -> T '[width,channels] (Flt t) maxPool1D x = squeeze0 (Pool (natSat @1) (typeSShape @'[window]) MaxPool (natSat @channels) (typeSShape @'[widt...
339
maxPool1D x = squeeze0 (Pool (natSat @1) (typeSShape @'[window]) MaxPool (natSat @channels) (typeSShape @'[width]) (expandDim0 x))
130
true
true
0
13
78
166
86
80
null
null
rueshyna/gogol
gogol-identity-toolkit/gen/Network/Google/IdentityToolkit/Types/Product.hs
mpl-2.0
-- | If idToken is STS id token, then this field will be refresh token. varRefreshToken :: Lens' VerifyAssertionResponse (Maybe Text) varRefreshToken = lens _varRefreshToken (\ s a -> s{_varRefreshToken = a})
216
varRefreshToken :: Lens' VerifyAssertionResponse (Maybe Text) varRefreshToken = lens _varRefreshToken (\ s a -> s{_varRefreshToken = a})
144
varRefreshToken = lens _varRefreshToken (\ s a -> s{_varRefreshToken = a})
82
true
true
1
9
39
52
25
27
null
null
brendanhay/gogol
gogol-bigtableadmin/gen/Network/Google/Resource/BigtableAdmin/Projects/Instances/GetIAMPolicy.hs
mpl-2.0
-- | OAuth access token. pigipAccessToken :: Lens' ProjectsInstancesGetIAMPolicy (Maybe Text) pigipAccessToken = lens _pigipAccessToken (\ s a -> s{_pigipAccessToken = a})
179
pigipAccessToken :: Lens' ProjectsInstancesGetIAMPolicy (Maybe Text) pigipAccessToken = lens _pigipAccessToken (\ s a -> s{_pigipAccessToken = a})
154
pigipAccessToken = lens _pigipAccessToken (\ s a -> s{_pigipAccessToken = a})
85
true
true
1
9
29
51
25
26
null
null
nomeata/list-fusion-lab
driver.hs
bsd-3-clause
scaledShow :: [Double] -> Double -> Text scaledShow list = \v -> showDouble (v/factor) <> singleton ' ' <> unit where -- is it really that complicated? showDouble = toStrict . toLazyText . formatRealFloat Fixed (Just 3) max = maximum list (unit, factor) = fromMaybe ("s", 1) $ find (\(u...
421
scaledShow :: [Double] -> Double -> Text scaledShow list = \v -> showDouble (v/factor) <> singleton ' ' <> unit where -- is it really that complicated? showDouble = toStrict . toLazyText . formatRealFloat Fixed (Just 3) max = maximum list (unit, factor) = fromMaybe ("s", 1) $ find (\(u...
421
scaledShow list = \v -> showDouble (v/factor) <> singleton ' ' <> unit where -- is it really that complicated? showDouble = toStrict . toLazyText . formatRealFloat Fixed (Just 3) max = maximum list (unit, factor) = fromMaybe ("s", 1) $ find (\(u,s) -> max < 1000 * s) [ ("ns", 1...
380
false
true
0
10
131
166
91
75
null
null
ducis/haAni
hs/common/Graphics/UI/GLUT/Raw/Tokens.hs
gpl-2.0
glut_WINDOW_HEIGHT :: GLenum glut_WINDOW_HEIGHT = 0x0067
56
glut_WINDOW_HEIGHT :: GLenum glut_WINDOW_HEIGHT = 0x0067
56
glut_WINDOW_HEIGHT = 0x0067
27
false
true
0
4
5
11
6
5
null
null
GU-CLASP/FraCoq
Logic.hs
gpl-3.0
eqAmount n eqs(AtLeast x) (AtLeast x') = eqNat n eqs x x'
57
eqAmount n eqs(AtLeast x) (AtLeast x') = eqNat n eqs x x'
57
eqAmount n eqs(AtLeast x) (AtLeast x') = eqNat n eqs x x'
57
false
false
0
7
11
36
17
19
null
null
schell/lamdu
Lamdu/GUI/ExpressionEdit/HoleEdit/Closed.hs
gpl-3.0
makeWrapperEventMap :: (MonadA m, MonadA f) => Bool -> Sugar.HoleArg f (Sugar.ExpressionN f a) -> Widget.Id -> ExprGuiM m (Widget.EventHandlers (T f)) makeWrapperEventMap argIsFocused arg myId = do config <- ExprGuiM.widgetEnv WE.readConfig let tryUnwrapEventMap = case arg ^? Sugar.haUnwrap . Sugar....
1,254
makeWrapperEventMap :: (MonadA m, MonadA f) => Bool -> Sugar.HoleArg f (Sugar.ExpressionN f a) -> Widget.Id -> ExprGuiM m (Widget.EventHandlers (T f)) makeWrapperEventMap argIsFocused arg myId = do config <- ExprGuiM.widgetEnv WE.readConfig let tryUnwrapEventMap = case arg ^? Sugar.haUnwrap . Sugar....
1,254
makeWrapperEventMap argIsFocused arg myId = do config <- ExprGuiM.widgetEnv WE.readConfig let tryUnwrapEventMap = case arg ^? Sugar.haUnwrap . Sugar._UnwrapMAction . Lens._Just of Just unwrap -> Widget.keysEventMapMovesCursor (Config.acceptKeys config ++ Config.delKeys config) (E.Doc...
1,097
false
true
0
25
284
388
189
199
null
null
wxzh/fcore
lib/Src.hs
bsd-2-clause
-- Precedence of operators based on the table in: -- http://en.wikipedia.org/wiki/Order_of_operations#Programming_languages opPrec :: Num a => Operator -> a opPrec (Arith J.Mult) = 3
186
opPrec :: Num a => Operator -> a opPrec (Arith J.Mult) = 3
62
opPrec (Arith J.Mult) = 3
29
true
true
0
8
27
35
18
17
null
null
msakai/ptq
src/Translation.hs
lgpl-2.1
-- T10 translate (F8 phi psi) = case cat :: Cat c of Sen -> Op2 And (translate phi) (translate psi) -- T11a IV -> lambda x $ Op2 And (translate phi :@ FVar x) (translate psi :@ FVar x) -- T12a where x = ("x", E)
227
translate (F8 phi psi) = case cat :: Cat c of Sen -> Op2 And (translate phi) (translate psi) -- T11a IV -> lambda x $ Op2 And (translate phi :@ FVar x) (translate psi :@ FVar x) -- T12a where x = ("x", E)
220
translate (F8 phi psi) = case cat :: Cat c of Sen -> Op2 And (translate phi) (translate psi) -- T11a IV -> lambda x $ Op2 And (translate phi :@ FVar x) (translate psi :@ FVar x) -- T12a where x = ("x", E)
220
true
false
1
12
62
119
57
62
null
null
bkoropoff/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v LStrLt [l,r] = v ++ "idris_strlt(vm, " ++ creg l ++ ", " ++ creg r ++ ")"
80
doOp v LStrLt [l,r] = v ++ "idris_strlt(vm, " ++ creg l ++ ", " ++ creg r ++ ")"
80
doOp v LStrLt [l,r] = v ++ "idris_strlt(vm, " ++ creg l ++ ", " ++ creg r ++ ")"
80
false
false
0
9
19
48
22
26
null
null
lucasbraun/mt-rewrite
src/MtUtils.hs
bsd-3-clause
remover ([],ss) = ([],ss)
25
remover ([],ss) = ([],ss)
25
remover ([],ss) = ([],ss)
25
false
false
0
6
3
26
14
12
null
null
TomMD/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
translateOp dflags IntRemOp = Just (mo_wordSRem dflags)
62
translateOp dflags IntRemOp = Just (mo_wordSRem dflags)
62
translateOp dflags IntRemOp = Just (mo_wordSRem dflags)
62
false
false
0
7
13
22
9
13
null
null
BartAdv/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reifyTTBinderApp reif f [t] | f == reflm "PVTy" = liftM PVTy (reif t)
91
reifyTTBinderApp reif f [t] | f == reflm "PVTy" = liftM PVTy (reif t)
91
reifyTTBinderApp reif f [t] | f == reflm "PVTy" = liftM PVTy (reif t)
91
false
false
0
9
35
40
18
22
null
null