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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
david-caro/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
prop_checkNumberComparisons4 = verify checkNumberComparisons "[[ $foo > 2.72 ]]"
| 80
|
prop_checkNumberComparisons4 = verify checkNumberComparisons "[[ $foo > 2.72 ]]"
| 80
|
prop_checkNumberComparisons4 = verify checkNumberComparisons "[[ $foo > 2.72 ]]"
| 80
| false
| false
| 0
| 5
| 8
| 11
| 5
| 6
| null | null |
lambdageek/insomnia
|
src/Insomnia/Typecheck/ClarifySignature.hs
|
bsd-3-clause
|
-- | Given the signature of the given path (ie, assume that the module
-- with that path has the given signature), return a signature that's
-- been made partly transluscent by equating all its type components
-- (and the types of its submodule components...) to the corresponding
-- components of the given path.
--
-- Examples:
-- clarifySignature X.Y { type t = t' ; ... } = { type t = t' ; ... }
-- clarifySignature X.Y { type t :: k ; ... } = { type t = X.Y.t ; ... }
-- clarifySignature X.Y { module M :: { decls } ; ... } = { module M :: clarifySignature X.Y.M { decls } ; ... }
--
-- TODO: share the value constructors of a generative type definition.
-- The purpose of clarifying a signature is for code like:
--
-- model Z { data IntList = Nil | Cons ... }
-- model Y = Z
--
-- here it should be the case that Y.IntList and Z.IntList are the
-- same data type, and Y.Cons and Z.Cons are interchangeable.
clarifySignature :: Path -> Signature -> TC Signature
clarifySignature _pmod UnitSig = return UnitSig
| 1,031
|
clarifySignature :: Path -> Signature -> TC Signature
clarifySignature _pmod UnitSig = return UnitSig
| 101
|
clarifySignature _pmod UnitSig = return UnitSig
| 47
| true
| true
| 0
| 8
| 217
| 53
| 34
| 19
| null | null |
jml/graphql-api
|
src/GraphQL/Internal/Value.hs
|
bsd-3-clause
|
astToScalar (AST.ValueBoolean x) = pure $ Right $ ConstBoolean x
| 64
|
astToScalar (AST.ValueBoolean x) = pure $ Right $ ConstBoolean x
| 64
|
astToScalar (AST.ValueBoolean x) = pure $ Right $ ConstBoolean x
| 64
| false
| false
| 0
| 8
| 9
| 28
| 13
| 15
| null | null |
kmels/xmonad-launcher
|
XMonad/Actions/TagWindows.hs
|
bsd-3-clause
|
focusUpTaggedGlobal = focusTagged' (reverse . wsToListGlobal)
| 63
|
focusUpTaggedGlobal = focusTagged' (reverse . wsToListGlobal)
| 63
|
focusUpTaggedGlobal = focusTagged' (reverse . wsToListGlobal)
| 63
| false
| false
| 0
| 7
| 7
| 16
| 8
| 8
| null | null |
kelnage/tamarin-prover
|
lib/theory/src/Theory/Proof.hs
|
gpl-3.0
|
parLTreeDFS :: Strategy (LTree l a)
parLTreeDFS (LNode x0 cs0) = do
cs0' <- (`parTraversable` cs0) $ \(LNode x cs) -> LNode x <$> rseq cs
return $ LNode x0 (M.map (runEval . parLTreeDFS) cs0')
------------------------------------------------------------------------------
-- Utility: Merging maps
------------------------------------------------------------------------------
-- | /O(n+m)/. A generalized union operator for maps with differing types.
| 460
|
parLTreeDFS :: Strategy (LTree l a)
parLTreeDFS (LNode x0 cs0) = do
cs0' <- (`parTraversable` cs0) $ \(LNode x cs) -> LNode x <$> rseq cs
return $ LNode x0 (M.map (runEval . parLTreeDFS) cs0')
------------------------------------------------------------------------------
-- Utility: Merging maps
------------------------------------------------------------------------------
-- | /O(n+m)/. A generalized union operator for maps with differing types.
| 460
|
parLTreeDFS (LNode x0 cs0) = do
cs0' <- (`parTraversable` cs0) $ \(LNode x cs) -> LNode x <$> rseq cs
return $ LNode x0 (M.map (runEval . parLTreeDFS) cs0')
------------------------------------------------------------------------------
-- Utility: Merging maps
------------------------------------------------------------------------------
-- | /O(n+m)/. A generalized union operator for maps with differing types.
| 424
| false
| true
| 0
| 12
| 62
| 106
| 55
| 51
| null | null |
hvr/containers
|
Data/Map/Base.hs
|
bsd-3-clause
|
hedgeUnion blo bhi Tip (Bin _ kx x l r) = link kx x (filterGt blo l) (filterLt bhi r)
| 85
|
hedgeUnion blo bhi Tip (Bin _ kx x l r) = link kx x (filterGt blo l) (filterLt bhi r)
| 85
|
hedgeUnion blo bhi Tip (Bin _ kx x l r) = link kx x (filterGt blo l) (filterLt bhi r)
| 85
| false
| false
| 0
| 7
| 19
| 58
| 26
| 32
| null | null |
YoshikuniJujo/funpaala
|
samples/35_monad_class/monadComprehensions.hs
|
bsd-3-clause
|
bindS :: State a -> (a -> State b) -> State b
m `bindS` f = State $ \s -> let (x, s') = runState m s in runState (f x) s'
| 121
|
bindS :: State a -> (a -> State b) -> State b
m `bindS` f = State $ \s -> let (x, s') = runState m s in runState (f x) s'
| 121
|
m `bindS` f = State $ \s -> let (x, s') = runState m s in runState (f x) s'
| 75
| false
| true
| 0
| 11
| 31
| 89
| 43
| 46
| null | null |
vladimir-ipatov/ganeti
|
src/Ganeti/Query/Server.hs
|
gpl-2.0
|
handleCall _ (QueryFields qkind qfields) = do
let result = queryFields (Qlang.QueryFields qkind qfields)
return $ J.showJSON <$> result
| 139
|
handleCall _ (QueryFields qkind qfields) = do
let result = queryFields (Qlang.QueryFields qkind qfields)
return $ J.showJSON <$> result
| 139
|
handleCall _ (QueryFields qkind qfields) = do
let result = queryFields (Qlang.QueryFields qkind qfields)
return $ J.showJSON <$> result
| 139
| false
| false
| 0
| 13
| 22
| 54
| 25
| 29
| null | null |
leshchevds/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
hvInitrdPath :: String
hvInitrdPath = "initrd_path"
| 51
|
hvInitrdPath :: String
hvInitrdPath = "initrd_path"
| 51
|
hvInitrdPath = "initrd_path"
| 28
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
abbradar/comps
|
src/Lab4.hs
|
bsd-3-clause
|
evalA st (Binary (evalA st -> r1) op (evalA st -> r2)) = case op of
"+" -> r1 + r2
"-" -> r1 - r2
"*" -> r1 * r2
"/" -> r1 `div` r2
| 139
|
evalA st (Binary (evalA st -> r1) op (evalA st -> r2)) = case op of
"+" -> r1 + r2
"-" -> r1 - r2
"*" -> r1 * r2
"/" -> r1 `div` r2
| 139
|
evalA st (Binary (evalA st -> r1) op (evalA st -> r2)) = case op of
"+" -> r1 + r2
"-" -> r1 - r2
"*" -> r1 * r2
"/" -> r1 `div` r2
| 139
| false
| false
| 0
| 10
| 43
| 88
| 44
| 44
| null | null |
scslab/iterIO
|
Examples/simple.hs
|
bsd-3-clause
|
test1 :: IO ()
test1 = inumCatch (enumPure "test") skipError |. inumBad |$ nullI
| 80
|
test1 :: IO ()
test1 = inumCatch (enumPure "test") skipError |. inumBad |$ nullI
| 80
|
test1 = inumCatch (enumPure "test") skipError |. inumBad |$ nullI
| 65
| false
| true
| 0
| 9
| 13
| 42
| 18
| 24
| null | null |
ideas-edu/ideas
|
src/Ideas/Common/Traversal/Navigator.hs
|
apache-2.0
|
makeLevelOrder :: a -> LevelOrder a
makeLevelOrder = wrap
| 58
|
makeLevelOrder :: a -> LevelOrder a
makeLevelOrder = wrap
| 57
|
makeLevelOrder = wrap
| 21
| false
| true
| 0
| 6
| 9
| 18
| 9
| 9
| null | null |
glguy/th-abstraction
|
test/Main.hs
|
isc
|
regressionTest44 :: IO ()
regressionTest44 =
$(do intToInt <- [t| Int -> Int |]
unified <- unifyTypes [intToInt, intToInt]
unless (Map.null unified) (fail "regression test for ticket #44 failed")
[| return () |])
| 236
|
regressionTest44 :: IO ()
regressionTest44 =
$(do intToInt <- [t| Int -> Int |]
unified <- unifyTypes [intToInt, intToInt]
unless (Map.null unified) (fail "regression test for ticket #44 failed")
[| return () |])
| 236
|
regressionTest44 =
$(do intToInt <- [t| Int -> Int |]
unified <- unifyTypes [intToInt, intToInt]
unless (Map.null unified) (fail "regression test for ticket #44 failed")
[| return () |])
| 210
| false
| true
| 0
| 13
| 56
| 81
| 40
| 41
| null | null |
jgm/haddock
|
src/Haddock/Interface/Create.hs
|
bsd-2-clause
|
hiDecl :: DynFlags -> Name -> ErrMsgGhc (Maybe (LHsDecl Name))
hiDecl dflags t = do
mayTyThing <- liftGhcToErrMsgGhc $ lookupName t
case mayTyThing of
Nothing -> do
liftErrMsg $ tell ["Warning: Not found in environment: " ++ pretty dflags t]
return Nothing
Just x -> return (Just (tyThingToLHsDecl x))
| 325
|
hiDecl :: DynFlags -> Name -> ErrMsgGhc (Maybe (LHsDecl Name))
hiDecl dflags t = do
mayTyThing <- liftGhcToErrMsgGhc $ lookupName t
case mayTyThing of
Nothing -> do
liftErrMsg $ tell ["Warning: Not found in environment: " ++ pretty dflags t]
return Nothing
Just x -> return (Just (tyThingToLHsDecl x))
| 325
|
hiDecl dflags t = do
mayTyThing <- liftGhcToErrMsgGhc $ lookupName t
case mayTyThing of
Nothing -> do
liftErrMsg $ tell ["Warning: Not found in environment: " ++ pretty dflags t]
return Nothing
Just x -> return (Just (tyThingToLHsDecl x))
| 262
| false
| true
| 0
| 17
| 72
| 123
| 55
| 68
| null | null |
siddhanathan/ghc
|
compiler/cmm/PprC.hs
|
bsd-3-clause
|
-- ---------------------------------------------------------------------------
-- Utils
wordShift :: DynFlags -> Int
wordShift dflags = widthInLog (wordWidth dflags)
| 166
|
wordShift :: DynFlags -> Int
wordShift dflags = widthInLog (wordWidth dflags)
| 77
|
wordShift dflags = widthInLog (wordWidth dflags)
| 48
| true
| true
| 0
| 7
| 15
| 35
| 16
| 19
| null | null |
DanielWaterworth/Idris-dev
|
src/Idris/ParseHelpers.hs
|
bsd-3-clause
|
fileName :: Delta -> String
fileName (Directed fn _ _ _ _) = UTF8.toString fn
| 77
|
fileName :: Delta -> String
fileName (Directed fn _ _ _ _) = UTF8.toString fn
| 77
|
fileName (Directed fn _ _ _ _) = UTF8.toString fn
| 49
| false
| true
| 0
| 9
| 14
| 42
| 19
| 23
| null | null |
edsko/hackage-server
|
tests/HackageClientUtils.hs
|
bsd-3-clause
|
find :: FilePath -> (FilePath -> Bool) -> IO [FilePath]
find dir p = (map (dir </>) . filter p) `liftM` getDirectoryContents dir
| 128
|
find :: FilePath -> (FilePath -> Bool) -> IO [FilePath]
find dir p = (map (dir </>) . filter p) `liftM` getDirectoryContents dir
| 128
|
find dir p = (map (dir </>) . filter p) `liftM` getDirectoryContents dir
| 72
| false
| true
| 0
| 9
| 22
| 63
| 33
| 30
| null | null |
sukhmel/algorithms.intro
|
part_1/chapter_4/MatrixProduct.hs
|
mit
|
prop_CorrectSplit :: Int -> [Int] -> Property
prop_CorrectSplit n xs = n > 0 && (not . null . drop (n' ^2)) xs
==> x == (joinFromFour . splitInFour) x
where n' = n `mod` 7 + 1
x = prepareNxN n' xs
-- | Make sure that splitInFour is an inverse of joinFromFour
| 319
|
prop_CorrectSplit :: Int -> [Int] -> Property
prop_CorrectSplit n xs = n > 0 && (not . null . drop (n' ^2)) xs
==> x == (joinFromFour . splitInFour) x
where n' = n `mod` 7 + 1
x = prepareNxN n' xs
-- | Make sure that splitInFour is an inverse of joinFromFour
| 319
|
prop_CorrectSplit n xs = n > 0 && (not . null . drop (n' ^2)) xs
==> x == (joinFromFour . splitInFour) x
where n' = n `mod` 7 + 1
x = prepareNxN n' xs
-- | Make sure that splitInFour is an inverse of joinFromFour
| 273
| false
| true
| 0
| 13
| 114
| 105
| 55
| 50
| null | null |
ocharles/Web-MusicBrainz
|
Web/MusicBrainz/XML.hs
|
bsd-2-clause
|
parseReleaseGroupRelationship :: (Functor m, Applicative m, Failure XmlException m) => Cursor -> m Relationship
parseReleaseGroupRelationship el = parseRelationship' ReleaseGroupRelationship el "release-group"
| 210
|
parseReleaseGroupRelationship :: (Functor m, Applicative m, Failure XmlException m) => Cursor -> m Relationship
parseReleaseGroupRelationship el = parseRelationship' ReleaseGroupRelationship el "release-group"
| 210
|
parseReleaseGroupRelationship el = parseRelationship' ReleaseGroupRelationship el "release-group"
| 97
| false
| true
| 0
| 7
| 21
| 51
| 25
| 26
| null | null |
FranklinChen/hugs98-plus-Sep2006
|
packages/network/Network/URI.hs
|
bsd-3-clause
|
unEscapeString (c:s) = c : unEscapeString s
| 43
|
unEscapeString (c:s) = c : unEscapeString s
| 43
|
unEscapeString (c:s) = c : unEscapeString s
| 43
| false
| false
| 0
| 7
| 6
| 23
| 11
| 12
| null | null |
WSCU/JSEuterpea
|
Euterpea Examples/SimpleEuterpea.hs
|
gpl-3.0
|
r c@(Chord k b "major") = case getInversion c of
0 -> Chord ((k+9) `mod` 12) b "minor"
1 -> Chord ((k+9) `mod` 12) b "minor"
2 -> Chord ((k+9) `mod` 12) (b+2) "minor"
| 179
|
tr c@(Chord k b "major") = case getInversion c of
0 -> Chord ((k+9) `mod` 12) b "minor"
1 -> Chord ((k+9) `mod` 12) b "minor"
2 -> Chord ((k+9) `mod` 12) (b+2) "minor"
| 179
|
tr c@(Chord k b "major") = case getInversion c of
0 -> Chord ((k+9) `mod` 12) b "minor"
1 -> Chord ((k+9) `mod` 12) b "minor"
2 -> Chord ((k+9) `mod` 12) (b+2) "minor"
| 179
| false
| false
| 0
| 12
| 46
| 124
| 66
| 58
| null | null |
ekmett/ghc
|
includes/CodeGen.Platform.hs
|
bsd-3-clause
|
globalRegMaybe (DoubleReg 3) =
# if MACHREGS_sparc
Just (RealRegPair REG_D3 (REG_D3 + 1))
# else
Just (RealRegSingle REG_D3)
| 221
|
globalRegMaybe (DoubleReg 3) =
# if MACHREGS_sparc
Just (RealRegPair REG_D3 (REG_D3 + 1))
# else
Just (RealRegSingle REG_D3)
| 221
|
globalRegMaybe (DoubleReg 3) =
# if MACHREGS_sparc
Just (RealRegPair REG_D3 (REG_D3 + 1))
# else
Just (RealRegSingle REG_D3)
| 221
| false
| false
| 0
| 9
| 114
| 45
| 23
| 22
| null | null |
pauldoo/scratch
|
RealWorldHaskell/ch06/mypretty/Prettify.hs
|
isc
|
flatten Line = Char ' '
| 23
|
flatten Line = Char ' '
| 23
|
flatten Line = Char ' '
| 23
| false
| false
| 0
| 5
| 5
| 12
| 5
| 7
| null | null |
romildo/gsynt
|
src/LR0.hs
|
isc
|
allTransitions i ns grammar sts =
go (i, ns, grammar, sts, []) []
where
go x stsDone =
case stNumbers \\ stsDone of
st : _ -> go (transitions x st) (st : stsDone)
[] -> x
where
(_, _, _, sts', _) = x
stNumbers = map (info . fst . info) sts'
| 292
|
allTransitions i ns grammar sts =
go (i, ns, grammar, sts, []) []
where
go x stsDone =
case stNumbers \\ stsDone of
st : _ -> go (transitions x st) (st : stsDone)
[] -> x
where
(_, _, _, sts', _) = x
stNumbers = map (info . fst . info) sts'
| 292
|
allTransitions i ns grammar sts =
go (i, ns, grammar, sts, []) []
where
go x stsDone =
case stNumbers \\ stsDone of
st : _ -> go (transitions x st) (st : stsDone)
[] -> x
where
(_, _, _, sts', _) = x
stNumbers = map (info . fst . info) sts'
| 292
| false
| false
| 5
| 7
| 105
| 140
| 74
| 66
| null | null |
godsme/haskell-adt
|
src/TRIPLE.hs
|
bsd-3-clause
|
tri_2 :: TRIPLE a b c -> b
tri_2 = prj1 . prj2
| 46
|
tri_2 :: TRIPLE a b c -> b
tri_2 = prj1 . prj2
| 46
|
tri_2 = prj1 . prj2
| 19
| false
| true
| 0
| 6
| 12
| 26
| 13
| 13
| null | null |
Cognimeta/cognimeta-utils
|
src/Cgm/Debug/Trace.hs
|
apache-2.0
|
traceF :: (a -> String) -> a -> a
traceF f a = trace (f a) a
| 60
|
traceF :: (a -> String) -> a -> a
traceF f a = trace (f a) a
| 60
|
traceF f a = trace (f a) a
| 26
| false
| true
| 0
| 8
| 16
| 47
| 22
| 25
| null | null |
kim/amazonka
|
amazonka-redshift/gen/Network/AWS/Redshift/ModifySnapshotCopyRetentionPeriod.hs
|
mpl-2.0
|
-- | The number of days to retain automated snapshots in the destination region
-- after they are copied from the source region.
--
-- If you decrease the retention period for automated snapshots that are
-- copied to a destination region, Amazon Redshift will delete any existing
-- automated snapshots that were copied to the destination region and that fall
-- outside of the new retention period.
--
-- Constraints: Must be at least 1 and no more than 35.
mscrpRetentionPeriod :: Lens' ModifySnapshotCopyRetentionPeriod Int
mscrpRetentionPeriod =
lens _mscrpRetentionPeriod (\s a -> s { _mscrpRetentionPeriod = a })
| 623
|
mscrpRetentionPeriod :: Lens' ModifySnapshotCopyRetentionPeriod Int
mscrpRetentionPeriod =
lens _mscrpRetentionPeriod (\s a -> s { _mscrpRetentionPeriod = a })
| 163
|
mscrpRetentionPeriod =
lens _mscrpRetentionPeriod (\s a -> s { _mscrpRetentionPeriod = a })
| 95
| true
| true
| 0
| 9
| 102
| 49
| 30
| 19
| null | null |
d0kt0r0/InnerEar
|
src/InnerEar/Exercises/Intervals1.hs
|
gpl-3.0
|
renderAnswer _ _ _ (Just interval) = buildSynth_ $ do
osc <- oscillator Triangle baseTone
let amp = Db $ fromIntegral (-20)
g <- rectEnv (Millis 100) (Sec 1) amp
let firstDur = (Millis $ 2 * 100) + (Sec 1)
let rest = Sec 0.5
-- Change the frequency of the oscillator after the first playback.
setParamValue "frequency" (inHz $ Midi $ answerToSemitones interval + inMidi baseTone) firstDur osc
-- Reset for second note and have another rectEnv at firstDur.
setParamValue "gain" 0 (firstDur + rest) g
linearRampToParamValue "gain" (inAmp amp) (firstDur + rest + Millis 100) g
setParamValue "gain" (inAmp amp) (firstDur + rest + Millis 100 + Sec 1) g
linearRampToParamValue "gain" 0 (firstDur + rest + Millis (2 * 100) + Sec 1) g
destination
setDeletionTime (firstDur*2+rest +(Sec 0.5))
| 811
|
renderAnswer _ _ _ (Just interval) = buildSynth_ $ do
osc <- oscillator Triangle baseTone
let amp = Db $ fromIntegral (-20)
g <- rectEnv (Millis 100) (Sec 1) amp
let firstDur = (Millis $ 2 * 100) + (Sec 1)
let rest = Sec 0.5
-- Change the frequency of the oscillator after the first playback.
setParamValue "frequency" (inHz $ Midi $ answerToSemitones interval + inMidi baseTone) firstDur osc
-- Reset for second note and have another rectEnv at firstDur.
setParamValue "gain" 0 (firstDur + rest) g
linearRampToParamValue "gain" (inAmp amp) (firstDur + rest + Millis 100) g
setParamValue "gain" (inAmp amp) (firstDur + rest + Millis 100 + Sec 1) g
linearRampToParamValue "gain" 0 (firstDur + rest + Millis (2 * 100) + Sec 1) g
destination
setDeletionTime (firstDur*2+rest +(Sec 0.5))
| 811
|
renderAnswer _ _ _ (Just interval) = buildSynth_ $ do
osc <- oscillator Triangle baseTone
let amp = Db $ fromIntegral (-20)
g <- rectEnv (Millis 100) (Sec 1) amp
let firstDur = (Millis $ 2 * 100) + (Sec 1)
let rest = Sec 0.5
-- Change the frequency of the oscillator after the first playback.
setParamValue "frequency" (inHz $ Midi $ answerToSemitones interval + inMidi baseTone) firstDur osc
-- Reset for second note and have another rectEnv at firstDur.
setParamValue "gain" 0 (firstDur + rest) g
linearRampToParamValue "gain" (inAmp amp) (firstDur + rest + Millis 100) g
setParamValue "gain" (inAmp amp) (firstDur + rest + Millis 100 + Sec 1) g
linearRampToParamValue "gain" 0 (firstDur + rest + Millis (2 * 100) + Sec 1) g
destination
setDeletionTime (firstDur*2+rest +(Sec 0.5))
| 811
| false
| false
| 1
| 15
| 160
| 321
| 150
| 171
| null | null |
robdockins/canonical-lf
|
toyml/Simplify.hs
|
bsd-3-clause
|
lookupContData :: BindData γ
-> Var γ
-> Maybe (LF γ TERM)
lookupContData = go WeakRefl
where go :: Weakening γ γ' -> BindData γ -> Var γ -> Maybe (LF γ' TERM)
go w (BindLetcont bd _) (F v) = go (WeakRight w) bd v
go w (BindOpaque bd) (F v) = go (WeakRight w) bd v
go w (BindLetval bd _ _ _) (F v) = go (WeakRight w) bd v
go w (BindLetproj bd _ _) (F v) = go (WeakRight w) bd v
go w (BindLetcont _ v) B = Just (weaken (WeakRight w) v)
go _ _ _ = Nothing
| 574
|
lookupContData :: BindData γ
-> Var γ
-> Maybe (LF γ TERM)
lookupContData = go WeakRefl
where go :: Weakening γ γ' -> BindData γ -> Var γ -> Maybe (LF γ' TERM)
go w (BindLetcont bd _) (F v) = go (WeakRight w) bd v
go w (BindOpaque bd) (F v) = go (WeakRight w) bd v
go w (BindLetval bd _ _ _) (F v) = go (WeakRight w) bd v
go w (BindLetproj bd _ _) (F v) = go (WeakRight w) bd v
go w (BindLetcont _ v) B = Just (weaken (WeakRight w) v)
go _ _ _ = Nothing
| 574
|
lookupContData = go WeakRefl
where go :: Weakening γ γ' -> BindData γ -> Var γ -> Maybe (LF γ' TERM)
go w (BindLetcont bd _) (F v) = go (WeakRight w) bd v
go w (BindOpaque bd) (F v) = go (WeakRight w) bd v
go w (BindLetval bd _ _ _) (F v) = go (WeakRight w) bd v
go w (BindLetproj bd _ _) (F v) = go (WeakRight w) bd v
go w (BindLetcont _ v) B = Just (weaken (WeakRight w) v)
go _ _ _ = Nothing
| 485
| false
| true
| 5
| 11
| 225
| 311
| 140
| 171
| null | null |
kosmoskatten/linx-gateway
|
test/Generators.hs
|
mit
|
sendRequest :: Gen Message
sendRequest = mkSendRequest <$> arbitrary <*> arbitrary <*> arbitrary
| 96
|
sendRequest :: Gen Message
sendRequest = mkSendRequest <$> arbitrary <*> arbitrary <*> arbitrary
| 96
|
sendRequest = mkSendRequest <$> arbitrary <*> arbitrary <*> arbitrary
| 69
| false
| true
| 0
| 7
| 12
| 26
| 13
| 13
| null | null |
timjb/protocol-buffers
|
hprotoc/Text/ProtocolBuffers/ProtoCompile/Gen.hs
|
apache-2.0
|
isCon :: String -> Bool
isCon (x:_) = isUpper x
| 47
|
isCon :: String -> Bool
isCon (x:_) = isUpper x
| 47
|
isCon (x:_) = isUpper x
| 23
| false
| true
| 0
| 9
| 9
| 33
| 15
| 18
| null | null |
shlevy/ghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
translateOp dflags IntLeOp = Just (mo_wordSLe dflags)
| 60
|
translateOp dflags IntLeOp = Just (mo_wordSLe dflags)
| 60
|
translateOp dflags IntLeOp = Just (mo_wordSLe dflags)
| 60
| false
| false
| 0
| 7
| 13
| 22
| 9
| 13
| null | null |
benjaminselfridge/logix
|
src/Calculi.hs
|
bsd-3-clause
|
gamma' = SetPat "Γ'"
| 20
|
gamma' = SetPat "Γ'"
| 20
|
gamma' = SetPat "Γ'"
| 20
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
snoyberg/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
to1_RDR = varQual_RDR gHC_GENERICS (fsLit "to1")
| 50
|
to1_RDR = varQual_RDR gHC_GENERICS (fsLit "to1")
| 50
|
to1_RDR = varQual_RDR gHC_GENERICS (fsLit "to1")
| 50
| false
| false
| 0
| 7
| 7
| 17
| 8
| 9
| null | null |
akc/sym
|
Sym/Perm/Component.hs
|
bsd-3-clause
|
records :: (a -> a -> Bool) -> [a] -> [a]
records _ [] = []
| 63
|
records :: (a -> a -> Bool) -> [a] -> [a]
records _ [] = []
| 63
|
records _ [] = []
| 21
| false
| true
| 0
| 9
| 19
| 51
| 25
| 26
| null | null |
typeable/dom-parser
|
src/Text/XML/DOM/Parser/Combinators.hs
|
mit
|
ignoreBlank
:: (Monad m)
=> DomParserT Identity m a
-> DomParserT Identity m (Maybe a)
ignoreBlank = ignoreElem test
where
test e =
let
elems = e ^.. nodes . folded . _Element
cont = mconcat $ e ^.. nodes . folded . _Content
in if | not $ L.null elems -> False
| T.null $ T.strip cont -> True
| otherwise -> False
| 392
|
ignoreBlank
:: (Monad m)
=> DomParserT Identity m a
-> DomParserT Identity m (Maybe a)
ignoreBlank = ignoreElem test
where
test e =
let
elems = e ^.. nodes . folded . _Element
cont = mconcat $ e ^.. nodes . folded . _Content
in if | not $ L.null elems -> False
| T.null $ T.strip cont -> True
| otherwise -> False
| 392
|
ignoreBlank = ignoreElem test
where
test e =
let
elems = e ^.. nodes . folded . _Element
cont = mconcat $ e ^.. nodes . folded . _Content
in if | not $ L.null elems -> False
| T.null $ T.strip cont -> True
| otherwise -> False
| 299
| false
| true
| 0
| 13
| 142
| 154
| 72
| 82
| null | null |
bergmark/hlint
|
src/Util.hs
|
bsd-3-clause
|
fst3 :: (a,b,c) -> a
fst3 (a,b,c) = a
| 37
|
fst3 :: (a,b,c) -> a
fst3 (a,b,c) = a
| 37
|
fst3 (a,b,c) = a
| 16
| false
| true
| 0
| 6
| 8
| 36
| 21
| 15
| null | null |
mightybyte/reflex
|
src/Reflex/Class.hs
|
bsd-3-clause
|
gate :: Reflex t => Behavior t Bool -> Event t a -> Event t a
gate = attachWithMaybe $ \allow a -> if allow then Just a else Nothing
| 132
|
gate :: Reflex t => Behavior t Bool -> Event t a -> Event t a
gate = attachWithMaybe $ \allow a -> if allow then Just a else Nothing
| 132
|
gate = attachWithMaybe $ \allow a -> if allow then Just a else Nothing
| 70
| false
| true
| 0
| 8
| 29
| 63
| 31
| 32
| null | null |
siers/sudoku-solver
|
Sudoku.hs
|
mit
|
poses :: Board Pos
poses = map (flip map [0..8] . (,)) [0..8]
| 61
|
poses :: Board Pos
poses = map (flip map [0..8] . (,)) [0..8]
| 61
|
poses = map (flip map [0..8] . (,)) [0..8]
| 42
| false
| true
| 0
| 9
| 12
| 50
| 24
| 26
| null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/showsPrec_2.hs
|
mit
|
primModNatP0 x y MyTrue = primModNatP (primMinusNatS x (Succ y)) (Succ (Succ y))
| 80
|
primModNatP0 x y MyTrue = primModNatP (primMinusNatS x (Succ y)) (Succ (Succ y))
| 80
|
primModNatP0 x y MyTrue = primModNatP (primMinusNatS x (Succ y)) (Succ (Succ y))
| 80
| false
| false
| 0
| 9
| 12
| 44
| 21
| 23
| null | null |
drbean/pdrt-sandbox
|
src/Data/PDRS/Show.hs
|
apache-2.0
|
showMAPs :: [MAP] -> String
showMAPs m = showUnique m []
where showUnique :: [MAP] -> [MAP] -> String
showUnique [] _ = " "
showUnique (m'@(pv1,pv2):ms) sms
| pv2 < 0 = show (abs pv2) ++ " " ++ modStrictSubord ++ " " ++ show pv1 ++ " " ++ showUnique ms ((abs pv2,abs pv1):sms)
| swap m' `elem` ms || (pv2,-pv1) `elem` ms = showUnique ms (m':sms)
| swap m' `elem` sms = show pv1 ++ " " ++ modEquals ++ " " ++ show pv2 ++ " " ++ showUnique ms (m':sms)
| otherwise = show pv1 ++ " " ++ modWeakSubord ++ " " ++ show pv2 ++ " " ++ showUnique ms (m':sms)
---------------------------------------------------------------------------
-- | Shows the 'MAP's @m@ of a 'PDRS' as tuples.
---------------------------------------------------------------------------
| 920
|
showMAPs :: [MAP] -> String
showMAPs m = showUnique m []
where showUnique :: [MAP] -> [MAP] -> String
showUnique [] _ = " "
showUnique (m'@(pv1,pv2):ms) sms
| pv2 < 0 = show (abs pv2) ++ " " ++ modStrictSubord ++ " " ++ show pv1 ++ " " ++ showUnique ms ((abs pv2,abs pv1):sms)
| swap m' `elem` ms || (pv2,-pv1) `elem` ms = showUnique ms (m':sms)
| swap m' `elem` sms = show pv1 ++ " " ++ modEquals ++ " " ++ show pv2 ++ " " ++ showUnique ms (m':sms)
| otherwise = show pv1 ++ " " ++ modWeakSubord ++ " " ++ show pv2 ++ " " ++ showUnique ms (m':sms)
---------------------------------------------------------------------------
-- | Shows the 'MAP's @m@ of a 'PDRS' as tuples.
---------------------------------------------------------------------------
| 920
|
showMAPs m = showUnique m []
where showUnique :: [MAP] -> [MAP] -> String
showUnique [] _ = " "
showUnique (m'@(pv1,pv2):ms) sms
| pv2 < 0 = show (abs pv2) ++ " " ++ modStrictSubord ++ " " ++ show pv1 ++ " " ++ showUnique ms ((abs pv2,abs pv1):sms)
| swap m' `elem` ms || (pv2,-pv1) `elem` ms = showUnique ms (m':sms)
| swap m' `elem` sms = show pv1 ++ " " ++ modEquals ++ " " ++ show pv2 ++ " " ++ showUnique ms (m':sms)
| otherwise = show pv1 ++ " " ++ modWeakSubord ++ " " ++ show pv2 ++ " " ++ showUnique ms (m':sms)
---------------------------------------------------------------------------
-- | Shows the 'MAP's @m@ of a 'PDRS' as tuples.
---------------------------------------------------------------------------
| 892
| false
| true
| 11
| 33
| 301
| 315
| 162
| 153
| null | null |
ekmett/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxLANGUAGE_MALAY :: Int
wxLANGUAGE_MALAY = 130
| 46
|
wxLANGUAGE_MALAY :: Int
wxLANGUAGE_MALAY = 130
| 46
|
wxLANGUAGE_MALAY = 130
| 22
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
codemac/yi-editor
|
src/Yi/Mode/JavaScript.hs
|
gpl-2.0
|
-- | The "compiler."
jsCompile :: Tree TT -> YiM ()
jsCompile tree = do
fwriteE
Just filename <- withBuffer $ gets file
buf <- getJSBuffer
withOtherWindow $ withEditor $ switchToBufferE buf
jsErrors filename buf (D.toList $ execWriter $ verify tree)
-- | Returns the JS verifier buffer, creating it if necessary.
| 323
|
jsCompile :: Tree TT -> YiM ()
jsCompile tree = do
fwriteE
Just filename <- withBuffer $ gets file
buf <- getJSBuffer
withOtherWindow $ withEditor $ switchToBufferE buf
jsErrors filename buf (D.toList $ execWriter $ verify tree)
-- | Returns the JS verifier buffer, creating it if necessary.
| 302
|
jsCompile tree = do
fwriteE
Just filename <- withBuffer $ gets file
buf <- getJSBuffer
withOtherWindow $ withEditor $ switchToBufferE buf
jsErrors filename buf (D.toList $ execWriter $ verify tree)
-- | Returns the JS verifier buffer, creating it if necessary.
| 271
| true
| true
| 0
| 11
| 62
| 95
| 43
| 52
| null | null |
distillation/language-core
|
Language/Core/Syntax.hs
|
gpl-3.0
|
bound' d bs (Con _ ts) = foldr (flip (bound' d)) bs ts
| 54
|
bound' d bs (Con _ ts) = foldr (flip (bound' d)) bs ts
| 54
|
bound' d bs (Con _ ts) = foldr (flip (bound' d)) bs ts
| 54
| false
| false
| 0
| 9
| 12
| 41
| 19
| 22
| null | null |
kim/amazonka
|
amazonka-kms/gen/Network/AWS/KMS/Encrypt.hs
|
mpl-2.0
|
-- | For more information, see <http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token Grant Tokens>.
eGrantTokens :: Lens' Encrypt [Text]
eGrantTokens = lens _eGrantTokens (\s a -> s { _eGrantTokens = a }) . _List
| 238
|
eGrantTokens :: Lens' Encrypt [Text]
eGrantTokens = lens _eGrantTokens (\s a -> s { _eGrantTokens = a }) . _List
| 112
|
eGrantTokens = lens _eGrantTokens (\s a -> s { _eGrantTokens = a }) . _List
| 75
| true
| true
| 0
| 10
| 28
| 47
| 26
| 21
| null | null |
nishiuramakoto/logiku
|
app/Prolog.hs
|
gpl-3.0
|
prologExecuteTestRuntimeErrorHtml :: RuntimeError -> CCPrologHandler Html
prologExecuteTestRuntimeErrorHtml err =
lift $ defaultLayout $ [whamlet| #{show err}|]
| 163
|
prologExecuteTestRuntimeErrorHtml :: RuntimeError -> CCPrologHandler Html
prologExecuteTestRuntimeErrorHtml err =
lift $ defaultLayout $ [whamlet| #{show err}|]
| 163
|
prologExecuteTestRuntimeErrorHtml err =
lift $ defaultLayout $ [whamlet| #{show err}|]
| 88
| false
| true
| 0
| 6
| 18
| 33
| 18
| 15
| null | null |
entropia/tip-toi-reveng
|
src/GMEWriter.hs
|
mit
|
putInitialRegs :: [Word16] -> SPut
putInitialRegs = putArray putWord16 . map putWord16
| 86
|
putInitialRegs :: [Word16] -> SPut
putInitialRegs = putArray putWord16 . map putWord16
| 86
|
putInitialRegs = putArray putWord16 . map putWord16
| 51
| false
| true
| 0
| 6
| 11
| 28
| 14
| 14
| null | null |
ComputationWithBoundedResources/jat
|
src/Jat/PState/MemoryModel/UnSharing.hs
|
bsd-3-clause
|
newUS :: (Monad m, IntDomain i) => US i -> P.ClassId -> JatM m (PStep(US i))
newUS (PState hp (Frame loc stk cn mn pc :frms) us) newcn = do
p <- getProgram
let obt = mkInstance p newcn
(adr,hp') = insertHA obt hp
stk' = RefVal adr :stk
return $ topEvaluation (PState hp' (Frame loc stk' cn mn (pc+1) :frms) us)
| 340
|
newUS :: (Monad m, IntDomain i) => US i -> P.ClassId -> JatM m (PStep(US i))
newUS (PState hp (Frame loc stk cn mn pc :frms) us) newcn = do
p <- getProgram
let obt = mkInstance p newcn
(adr,hp') = insertHA obt hp
stk' = RefVal adr :stk
return $ topEvaluation (PState hp' (Frame loc stk' cn mn (pc+1) :frms) us)
| 340
|
newUS (PState hp (Frame loc stk cn mn pc :frms) us) newcn = do
p <- getProgram
let obt = mkInstance p newcn
(adr,hp') = insertHA obt hp
stk' = RefVal adr :stk
return $ topEvaluation (PState hp' (Frame loc stk' cn mn (pc+1) :frms) us)
| 263
| false
| true
| 0
| 16
| 91
| 189
| 91
| 98
| null | null |
hpacheco/HAAP
|
examples/gameworker/li1g100/Avanca.hs
|
mit
|
getArea st ((0,0,x,y):t) l = getArea st t l
| 43
|
getArea st ((0,0,x,y):t) l = getArea st t l
| 43
|
getArea st ((0,0,x,y):t) l = getArea st t l
| 43
| false
| false
| 0
| 8
| 8
| 39
| 21
| 18
| null | null |
facebookincubator/duckling
|
Duckling/Time/GA/Rules.hs
|
bsd-3-clause
|
ruleTimeSeo :: Rule
ruleTimeSeo = Rule
{ name = "<time> seo"
, pattern =
[ dimension Time
, regex "seo"
]
, prod = \tokens -> case tokens of
(Token Time td:_) ->
tt $ predNth 0 False td
_ -> Nothing
}
| 240
|
ruleTimeSeo :: Rule
ruleTimeSeo = Rule
{ name = "<time> seo"
, pattern =
[ dimension Time
, regex "seo"
]
, prod = \tokens -> case tokens of
(Token Time td:_) ->
tt $ predNth 0 False td
_ -> Nothing
}
| 240
|
ruleTimeSeo = Rule
{ name = "<time> seo"
, pattern =
[ dimension Time
, regex "seo"
]
, prod = \tokens -> case tokens of
(Token Time td:_) ->
tt $ predNth 0 False td
_ -> Nothing
}
| 220
| false
| true
| 0
| 14
| 82
| 91
| 48
| 43
| null | null |
maueroats/teaching
|
docs/ap-cs/haskell/connect-four/testcases/change-entry.hs
|
gpl-3.0
|
changeEntryRow (b:bs) col row newVal =
currentValue' : moreResult
where moreResult = changeEntryRow bs col (row - 1) newVal
changedValue = changeEntryCol b col newVal
currentValue' = if (row /= 0) then b else changedValue
| 261
|
changeEntryRow (b:bs) col row newVal =
currentValue' : moreResult
where moreResult = changeEntryRow bs col (row - 1) newVal
changedValue = changeEntryCol b col newVal
currentValue' = if (row /= 0) then b else changedValue
| 261
|
changeEntryRow (b:bs) col row newVal =
currentValue' : moreResult
where moreResult = changeEntryRow bs col (row - 1) newVal
changedValue = changeEntryCol b col newVal
currentValue' = if (row /= 0) then b else changedValue
| 261
| false
| false
| 0
| 9
| 74
| 81
| 43
| 38
| null | null |
emaphis/Haskell-Practice
|
cis194/src/Week01/Lecture01.hs
|
bsd-3-clause
|
sumPairs ((x,y):zs) = x+y : sumPairs zs
| 39
|
sumPairs ((x,y):zs) = x+y : sumPairs zs
| 39
|
sumPairs ((x,y):zs) = x+y : sumPairs zs
| 39
| false
| false
| 2
| 7
| 6
| 36
| 17
| 19
| null | null |
alanz/htelehash
|
src/Network/TeleHash/Old/Switch.hs
|
bsd-3-clause
|
{-
self.isHashname = function(hex){return isHEX(hex, 64)};
-}
-- ---------------------------------------------------------------------
{-
/* CHANNELS API
hn.channel(type, arg, callback)
- used by app to create a reliable channel of given type
- arg contains .js and .body for the first packet
- callback(err, arg, chan, cbDone)
- called when any packet is received (or error/fail)
- given the response .js .body in arg
- cbDone when arg is processed
- chan.send() to send packets
- chan.wrap(bulk|stream) to modify interface, replaces this callback handler
- chan.bulk(str, cbDone) / onBulk(cbDone(err, str))
- chan.read/write
hn.raw(type, arg, callback)
- arg contains .js and .body to create an unreliable channel
- callback(err, arg, chan)
- called on any packet or error
- given the response .js .body in arg
- chan.send() to send packets
self.channel(type, callback)
- used to listen for incoming reliable channel starts
- callback(err, arg, chan, cbDone)
- called for any answer or subsequent packets
- chan.wrap() to modify
self.raw(type, callback)
- used to listen for incoming unreliable channel starts
- callback(err, arg, chan)
- called for any incoming packets
*/
-}
channelWraps :: IO ()
channelWraps = (assert False undefined)
| 1,320
|
channelWraps :: IO ()
channelWraps = (assert False undefined)
| 61
|
channelWraps = (assert False undefined)
| 39
| true
| true
| 0
| 6
| 265
| 27
| 15
| 12
| null | null |
aartifact/aartifact-verifier
|
src/ValidationPropositional.hs
|
mit
|
execs :: Context -> [Stmt] -> ([Stmt], Context)
execs state [] = ([], state)
| 80
|
execs :: Context -> [Stmt] -> ([Stmt], Context)
execs state [] = ([], state)
| 80
|
execs state [] = ([], state)
| 32
| false
| true
| 0
| 10
| 17
| 52
| 27
| 25
| null | null |
elieux/ghc
|
compiler/basicTypes/RdrName.hs
|
bsd-3-clause
|
lookupLocalRdrEnv _ _ = Nothing
| 64
|
lookupLocalRdrEnv _ _ = Nothing
| 64
|
lookupLocalRdrEnv _ _ = Nothing
| 64
| false
| false
| 0
| 5
| 37
| 11
| 5
| 6
| null | null |
Helium4Haskell/helium
|
src/Helium/Parser/Lexer.hs
|
gpl-3.0
|
contains :: Eq a => [a] -> [a] -> Bool
[] `contains` _ = False
| 62
|
contains :: Eq a => [a] -> [a] -> Bool
[] `contains` _ = False
| 62
|
[] `contains` _ = False
| 23
| false
| true
| 0
| 8
| 14
| 46
| 23
| 23
| null | null |
uduki/hsQt
|
Qtc/Enums/Core/QAbstractFileEngine.hs
|
bsd-2-clause
|
ieFileOwner :: Int -> FileOwner
ieFileOwner x = QEnum (CFileOwner x)
| 68
|
ieFileOwner :: Int -> FileOwner
ieFileOwner x = QEnum (CFileOwner x)
| 68
|
ieFileOwner x = QEnum (CFileOwner x)
| 36
| false
| true
| 0
| 7
| 10
| 27
| 13
| 14
| null | null |
harendra-kumar/stack
|
src/Stack/Package.hs
|
bsd-3-clause
|
flagMap :: [Flag] -> Map FlagName Bool
flagMap = M.fromList . map pair
where pair :: Flag -> (FlagName, Bool)
pair (MkFlag (fromCabalFlagName -> name) _desc def _manual) = (name,def)
| 192
|
flagMap :: [Flag] -> Map FlagName Bool
flagMap = M.fromList . map pair
where pair :: Flag -> (FlagName, Bool)
pair (MkFlag (fromCabalFlagName -> name) _desc def _manual) = (name,def)
| 192
|
flagMap = M.fromList . map pair
where pair :: Flag -> (FlagName, Bool)
pair (MkFlag (fromCabalFlagName -> name) _desc def _manual) = (name,def)
| 153
| false
| true
| 0
| 9
| 39
| 89
| 45
| 44
| null | null |
sdiehl/ghc
|
compiler/GHC/Hs/Pat.hs
|
bsd-3-clause
|
pprConArgs :: (OutputableBndrId p)
=> HsConPatDetails (GhcPass p) -> SDoc
pprConArgs (PrefixCon pats) = fsep (map (pprParendLPat appPrec) pats)
| 154
|
pprConArgs :: (OutputableBndrId p)
=> HsConPatDetails (GhcPass p) -> SDoc
pprConArgs (PrefixCon pats) = fsep (map (pprParendLPat appPrec) pats)
| 154
|
pprConArgs (PrefixCon pats) = fsep (map (pprParendLPat appPrec) pats)
| 69
| false
| true
| 0
| 9
| 29
| 59
| 29
| 30
| null | null |
rodrigo-machado/verigraph
|
src/repl/GrLang.hs
|
gpl-3.0
|
putMemSpace :: Lua.LuaInteger -> a -> MemSpace a -> ExceptT GrLang.Error LuaGrLang ()
putMemSpace idx' val memSpace = do
let idx = fromEnum idx'
liftIO $ writeArray (cells memSpace) idx (Just val)
| 200
|
putMemSpace :: Lua.LuaInteger -> a -> MemSpace a -> ExceptT GrLang.Error LuaGrLang ()
putMemSpace idx' val memSpace = do
let idx = fromEnum idx'
liftIO $ writeArray (cells memSpace) idx (Just val)
| 200
|
putMemSpace idx' val memSpace = do
let idx = fromEnum idx'
liftIO $ writeArray (cells memSpace) idx (Just val)
| 114
| false
| true
| 0
| 10
| 35
| 84
| 39
| 45
| null | null |
davmre/matrizer
|
web/Application.hs
|
gpl-2.0
|
-- | The @main@ function for an executable running this site.
appMain :: IO ()
appMain = do
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environment variables to override
useEnv
-- Generate the foundation from the settings
foundation <- makeFoundation settings
-- Generate a WAI Application from the foundation
app <- makeApplication foundation
-- Run the application with Warp
runSettings (warpSettings foundation) app
--------------------------------------------------------------
-- Functions for DevelMain.hs (a way to run the app from GHCi)
--------------------------------------------------------------
| 821
|
appMain :: IO ()
appMain = do
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environment variables to override
useEnv
-- Generate the foundation from the settings
foundation <- makeFoundation settings
-- Generate a WAI Application from the foundation
app <- makeApplication foundation
-- Run the application with Warp
runSettings (warpSettings foundation) app
--------------------------------------------------------------
-- Functions for DevelMain.hs (a way to run the app from GHCi)
--------------------------------------------------------------
| 759
|
appMain = do
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environment variables to override
useEnv
-- Generate the foundation from the settings
foundation <- makeFoundation settings
-- Generate a WAI Application from the foundation
app <- makeApplication foundation
-- Run the application with Warp
runSettings (warpSettings foundation) app
--------------------------------------------------------------
-- Functions for DevelMain.hs (a way to run the app from GHCi)
--------------------------------------------------------------
| 742
| true
| true
| 0
| 10
| 167
| 81
| 40
| 41
| null | null |
nfrisby/invariant-functors
|
test/InvariantSpec.hs
|
bsd-2-clause
|
-----
-- These test could probably be simplified by appealing to parametricity.
spec :: Spec
spec = do
describe "Invariant" . prop "satisfies the composition law" $
composition1 (Proxy :: Proxy Integer)
(Proxy :: Proxy Bool)
(Proxy :: Proxy [Bool])
describe "Invariant2" . prop "satisfies the composition law" $
composition2 (Proxy :: Proxy Integer)
(Proxy :: Proxy Bool)
(Proxy :: Proxy Integer)
(Proxy :: Proxy Bool)
(Proxy :: Proxy (Bool,Bool))
-----
| 570
|
spec :: Spec
spec = do
describe "Invariant" . prop "satisfies the composition law" $
composition1 (Proxy :: Proxy Integer)
(Proxy :: Proxy Bool)
(Proxy :: Proxy [Bool])
describe "Invariant2" . prop "satisfies the composition law" $
composition2 (Proxy :: Proxy Integer)
(Proxy :: Proxy Bool)
(Proxy :: Proxy Integer)
(Proxy :: Proxy Bool)
(Proxy :: Proxy (Bool,Bool))
-----
| 489
|
spec = do
describe "Invariant" . prop "satisfies the composition law" $
composition1 (Proxy :: Proxy Integer)
(Proxy :: Proxy Bool)
(Proxy :: Proxy [Bool])
describe "Invariant2" . prop "satisfies the composition law" $
composition2 (Proxy :: Proxy Integer)
(Proxy :: Proxy Bool)
(Proxy :: Proxy Integer)
(Proxy :: Proxy Bool)
(Proxy :: Proxy (Bool,Bool))
-----
| 476
| true
| true
| 0
| 11
| 187
| 147
| 77
| 70
| null | null |
kawu/dawg
|
src/Data/DAWG/Static/Node.hs
|
bsd-2-clause
|
onSym :: Sym -> Node a b -> Maybe ID
onSym x (Branch _ t _) = T.lookup x t
| 75
|
onSym :: Sym -> Node a b -> Maybe ID
onSym x (Branch _ t _) = T.lookup x t
| 75
|
onSym x (Branch _ t _) = T.lookup x t
| 38
| false
| true
| 0
| 7
| 20
| 49
| 23
| 26
| null | null |
pzel/slowotok
|
src/Lib.hs
|
bsd-3-clause
|
randomKV :: (RandomGen g) => M.Map k v -> Rand g (k,v)
randomKV m = getRandomR (0, M.size m - 1) >>= return . (M.assocs m !!)
| 126
|
randomKV :: (RandomGen g) => M.Map k v -> Rand g (k,v)
randomKV m = getRandomR (0, M.size m - 1) >>= return . (M.assocs m !!)
| 126
|
randomKV m = getRandomR (0, M.size m - 1) >>= return . (M.assocs m !!)
| 71
| false
| true
| 0
| 11
| 27
| 85
| 42
| 43
| null | null |
trskop/cabal
|
Cabal/Distribution/Simple/LHC.hs
|
bsd-3-clause
|
configureToolchain :: ConfiguredProgram -> ProgramConfiguration
-> ProgramConfiguration
configureToolchain lhcProg =
addKnownProgram gccProgram {
programFindLocation = findProg gccProgram (baseDir </> "gcc.exe"),
programPostConf = configureGcc
}
. addKnownProgram ldProgram {
programFindLocation = findProg ldProgram (libDir </> "ld.exe"),
programPostConf = configureLd
}
where
compilerDir = takeDirectory (programPath lhcProg)
baseDir = takeDirectory compilerDir
libDir = baseDir </> "gcc-lib"
includeDir = baseDir </> "include" </> "mingw"
isWindows = case buildOS of Windows -> True; _ -> False
-- on Windows finding and configuring ghc's gcc and ld is a bit special
findProg :: Program -> FilePath
-> Verbosity -> ProgramSearchPath -> IO (Maybe FilePath)
findProg prog location | isWindows = \verbosity searchpath -> do
exists <- doesFileExist location
if exists then return (Just location)
else do warn verbosity ("Couldn't find " ++ programName prog ++ " where I expected it. Trying the search path.")
programFindLocation prog verbosity searchpath
| otherwise = programFindLocation prog
configureGcc :: Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
configureGcc
| isWindows = \_ gccProg -> case programLocation gccProg of
-- if it's found on system then it means we're using the result
-- of programFindLocation above rather than a user-supplied path
-- that means we should add this extra flag to tell ghc's gcc
-- where it lives and thus where gcc can find its various files:
FoundOnSystem {} -> return gccProg {
programDefaultArgs = ["-B" ++ libDir,
"-I" ++ includeDir]
}
UserSpecified {} -> return gccProg
| otherwise = \_ gccProg -> return gccProg
-- we need to find out if ld supports the -x flag
configureLd :: Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
configureLd verbosity ldProg = do
tempDir <- getTemporaryDirectory
ldx <- withTempFile tempDir ".c" $ \testcfile testchnd ->
withTempFile tempDir ".o" $ \testofile testohnd -> do
hPutStrLn testchnd "int foo() { return 0; }"
hClose testchnd; hClose testohnd
rawSystemProgram verbosity lhcProg ["-c", testcfile,
"-o", testofile]
withTempFile tempDir ".o" $ \testofile' testohnd' ->
do
hClose testohnd'
_ <- rawSystemProgramStdout verbosity ldProg
["-x", "-r", testofile, "-o", testofile']
return True
`catchIO` (\_ -> return False)
`catchExit` (\_ -> return False)
if ldx
then return ldProg { programDefaultArgs = ["-x"] }
else return ldProg
| 3,138
|
configureToolchain :: ConfiguredProgram -> ProgramConfiguration
-> ProgramConfiguration
configureToolchain lhcProg =
addKnownProgram gccProgram {
programFindLocation = findProg gccProgram (baseDir </> "gcc.exe"),
programPostConf = configureGcc
}
. addKnownProgram ldProgram {
programFindLocation = findProg ldProgram (libDir </> "ld.exe"),
programPostConf = configureLd
}
where
compilerDir = takeDirectory (programPath lhcProg)
baseDir = takeDirectory compilerDir
libDir = baseDir </> "gcc-lib"
includeDir = baseDir </> "include" </> "mingw"
isWindows = case buildOS of Windows -> True; _ -> False
-- on Windows finding and configuring ghc's gcc and ld is a bit special
findProg :: Program -> FilePath
-> Verbosity -> ProgramSearchPath -> IO (Maybe FilePath)
findProg prog location | isWindows = \verbosity searchpath -> do
exists <- doesFileExist location
if exists then return (Just location)
else do warn verbosity ("Couldn't find " ++ programName prog ++ " where I expected it. Trying the search path.")
programFindLocation prog verbosity searchpath
| otherwise = programFindLocation prog
configureGcc :: Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
configureGcc
| isWindows = \_ gccProg -> case programLocation gccProg of
-- if it's found on system then it means we're using the result
-- of programFindLocation above rather than a user-supplied path
-- that means we should add this extra flag to tell ghc's gcc
-- where it lives and thus where gcc can find its various files:
FoundOnSystem {} -> return gccProg {
programDefaultArgs = ["-B" ++ libDir,
"-I" ++ includeDir]
}
UserSpecified {} -> return gccProg
| otherwise = \_ gccProg -> return gccProg
-- we need to find out if ld supports the -x flag
configureLd :: Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
configureLd verbosity ldProg = do
tempDir <- getTemporaryDirectory
ldx <- withTempFile tempDir ".c" $ \testcfile testchnd ->
withTempFile tempDir ".o" $ \testofile testohnd -> do
hPutStrLn testchnd "int foo() { return 0; }"
hClose testchnd; hClose testohnd
rawSystemProgram verbosity lhcProg ["-c", testcfile,
"-o", testofile]
withTempFile tempDir ".o" $ \testofile' testohnd' ->
do
hClose testohnd'
_ <- rawSystemProgramStdout verbosity ldProg
["-x", "-r", testofile, "-o", testofile']
return True
`catchIO` (\_ -> return False)
`catchExit` (\_ -> return False)
if ldx
then return ldProg { programDefaultArgs = ["-x"] }
else return ldProg
| 3,138
|
configureToolchain lhcProg =
addKnownProgram gccProgram {
programFindLocation = findProg gccProgram (baseDir </> "gcc.exe"),
programPostConf = configureGcc
}
. addKnownProgram ldProgram {
programFindLocation = findProg ldProgram (libDir </> "ld.exe"),
programPostConf = configureLd
}
where
compilerDir = takeDirectory (programPath lhcProg)
baseDir = takeDirectory compilerDir
libDir = baseDir </> "gcc-lib"
includeDir = baseDir </> "include" </> "mingw"
isWindows = case buildOS of Windows -> True; _ -> False
-- on Windows finding and configuring ghc's gcc and ld is a bit special
findProg :: Program -> FilePath
-> Verbosity -> ProgramSearchPath -> IO (Maybe FilePath)
findProg prog location | isWindows = \verbosity searchpath -> do
exists <- doesFileExist location
if exists then return (Just location)
else do warn verbosity ("Couldn't find " ++ programName prog ++ " where I expected it. Trying the search path.")
programFindLocation prog verbosity searchpath
| otherwise = programFindLocation prog
configureGcc :: Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
configureGcc
| isWindows = \_ gccProg -> case programLocation gccProg of
-- if it's found on system then it means we're using the result
-- of programFindLocation above rather than a user-supplied path
-- that means we should add this extra flag to tell ghc's gcc
-- where it lives and thus where gcc can find its various files:
FoundOnSystem {} -> return gccProg {
programDefaultArgs = ["-B" ++ libDir,
"-I" ++ includeDir]
}
UserSpecified {} -> return gccProg
| otherwise = \_ gccProg -> return gccProg
-- we need to find out if ld supports the -x flag
configureLd :: Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
configureLd verbosity ldProg = do
tempDir <- getTemporaryDirectory
ldx <- withTempFile tempDir ".c" $ \testcfile testchnd ->
withTempFile tempDir ".o" $ \testofile testohnd -> do
hPutStrLn testchnd "int foo() { return 0; }"
hClose testchnd; hClose testohnd
rawSystemProgram verbosity lhcProg ["-c", testcfile,
"-o", testofile]
withTempFile tempDir ".o" $ \testofile' testohnd' ->
do
hClose testohnd'
_ <- rawSystemProgramStdout verbosity ldProg
["-x", "-r", testofile, "-o", testofile']
return True
`catchIO` (\_ -> return False)
`catchExit` (\_ -> return False)
if ldx
then return ldProg { programDefaultArgs = ["-x"] }
else return ldProg
| 3,010
| false
| true
| 10
| 23
| 1,062
| 680
| 327
| 353
| null | null |
maurer/ptrace
|
src/System/PTrace/Types.hs
|
bsd-3-clause
|
toCReq SysEmuSingle = 32
| 24
|
toCReq SysEmuSingle = 32
| 24
|
toCReq SysEmuSingle = 32
| 24
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
christiaanb/ghc
|
compiler/hsSyn/HsPat.hs
|
bsd-3-clause
|
pprPat (SigPatOut pat ty) = ppr pat <+> dcolon <+> ppr ty
| 59
|
pprPat (SigPatOut pat ty) = ppr pat <+> dcolon <+> ppr ty
| 59
|
pprPat (SigPatOut pat ty) = ppr pat <+> dcolon <+> ppr ty
| 59
| false
| false
| 0
| 7
| 13
| 32
| 14
| 18
| null | null |
capn-freako/lambda-ccc
|
src/LambdaCCC/ReifySimple.hs
|
bsd-3-clause
|
reifyS = "reifyEP"
| 18
|
reifyS = "reifyEP"
| 18
|
reifyS = "reifyEP"
| 18
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
rueshyna/gogol
|
gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/Products/GetAppRestrictionsSchema.hs
|
mpl-2.0
|
-- | The BCP47 tag for the user\'s preferred language (e.g. \"en-US\",
-- \"de\").
pgarsLanguage :: Lens' ProductsGetAppRestrictionsSchema (Maybe Text)
pgarsLanguage
= lens _pgarsLanguage
(\ s a -> s{_pgarsLanguage = a})
| 228
|
pgarsLanguage :: Lens' ProductsGetAppRestrictionsSchema (Maybe Text)
pgarsLanguage
= lens _pgarsLanguage
(\ s a -> s{_pgarsLanguage = a})
| 145
|
pgarsLanguage
= lens _pgarsLanguage
(\ s a -> s{_pgarsLanguage = a})
| 76
| true
| true
| 0
| 8
| 38
| 50
| 26
| 24
| null | null |
snoyberg/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar")
| 48
|
gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar")
| 48
|
gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar")
| 48
| false
| false
| 0
| 7
| 4
| 15
| 7
| 8
| null | null |
Forec/learn
|
2017.1/haskell-interpreter/h2lang.hs
|
mit
|
interp (Call e1 e2) env = case v2 of
Value _ -> callExp
Boolean _ -> callExp
String' _ -> callExp
_ -> Error "syntax error"
where
v2 = interp e2 env
col = interp e1 env
callExp = case col of
(Closure (Lambda (Param x) e) env') -> interp e (extEnv x v2 env')
_ -> Error "syntax error"
| 505
|
interp (Call e1 e2) env = case v2 of
Value _ -> callExp
Boolean _ -> callExp
String' _ -> callExp
_ -> Error "syntax error"
where
v2 = interp e2 env
col = interp e1 env
callExp = case col of
(Closure (Lambda (Param x) e) env') -> interp e (extEnv x v2 env')
_ -> Error "syntax error"
| 505
|
interp (Call e1 e2) env = case v2 of
Value _ -> callExp
Boolean _ -> callExp
String' _ -> callExp
_ -> Error "syntax error"
where
v2 = interp e2 env
col = interp e1 env
callExp = case col of
(Closure (Lambda (Param x) e) env') -> interp e (extEnv x v2 env')
_ -> Error "syntax error"
| 505
| false
| false
| 2
| 14
| 281
| 144
| 68
| 76
| null | null |
zinfra/khan
|
khan-cli/src/Khan/CLI/Cluster.hs
|
mpl-2.0
|
-- Convenience to define the names for the alarms
metricAlarmName :: Text -> Text -> Text
metricAlarmName p s = p <> "-CPUUtilizationForScaling" <> s
| 149
|
metricAlarmName :: Text -> Text -> Text
metricAlarmName p s = p <> "-CPUUtilizationForScaling" <> s
| 99
|
metricAlarmName p s = p <> "-CPUUtilizationForScaling" <> s
| 59
| true
| true
| 2
| 8
| 24
| 39
| 18
| 21
| null | null |
acowley/ghc
|
compiler/deSugar/DsUtils.hs
|
bsd-3-clause
|
mkCoSynCaseMatchResult :: Id -> Type -> CaseAlt PatSyn -> MatchResult
mkCoSynCaseMatchResult var ty alt = MatchResult CanFail $ mkPatSynCase var ty alt
| 151
|
mkCoSynCaseMatchResult :: Id -> Type -> CaseAlt PatSyn -> MatchResult
mkCoSynCaseMatchResult var ty alt = MatchResult CanFail $ mkPatSynCase var ty alt
| 151
|
mkCoSynCaseMatchResult var ty alt = MatchResult CanFail $ mkPatSynCase var ty alt
| 81
| false
| true
| 0
| 9
| 21
| 52
| 23
| 29
| null | null |
mimi1vx/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
prop_checkEchoSed1 = verify checkEchoSed "FOO=$(echo \"$cow\" | sed 's/foo/bar/g')"
| 83
|
prop_checkEchoSed1 = verify checkEchoSed "FOO=$(echo \"$cow\" | sed 's/foo/bar/g')"
| 83
|
prop_checkEchoSed1 = verify checkEchoSed "FOO=$(echo \"$cow\" | sed 's/foo/bar/g')"
| 83
| false
| false
| 1
| 5
| 8
| 15
| 5
| 10
| null | null |
edsko/ChinesePodAPI
|
src/Servant/ChinesePod/Analysis.hs
|
bsd-3-clause
|
splits [x] = [[[x]]]
| 23
|
splits [x] = [[[x]]]
| 23
|
splits [x] = [[[x]]]
| 23
| false
| false
| 0
| 7
| 6
| 22
| 12
| 10
| null | null |
zouppen/siluetti
|
Silu.hs
|
gpl-3.0
|
-- Horizontal iteration step.
iterateH :: [LineInfo] -> Grid -> Grid
iterateH infos grid = zipWith matchIterate infos grid
| 122
|
iterateH :: [LineInfo] -> Grid -> Grid
iterateH infos grid = zipWith matchIterate infos grid
| 92
|
iterateH infos grid = zipWith matchIterate infos grid
| 53
| true
| true
| 0
| 8
| 18
| 40
| 19
| 21
| null | null |
paulajessicab/DBReport-SQLite3
|
DBReport.hs
|
gpl-3.0
|
get_title_font :: Repo -> PDFFont
get_title_font repo = let (TStyle font pos) = get_title_stl repo
in font
| 128
|
get_title_font :: Repo -> PDFFont
get_title_font repo = let (TStyle font pos) = get_title_stl repo
in font
| 128
|
get_title_font repo = let (TStyle font pos) = get_title_stl repo
in font
| 94
| false
| true
| 0
| 10
| 38
| 41
| 19
| 22
| null | null |
shlevy/ghc
|
compiler/cmm/CmmMachOp.hs
|
bsd-3-clause
|
mo_wordUShr dflags = MO_U_Shr (wordWidth dflags)
| 52
|
mo_wordUShr dflags = MO_U_Shr (wordWidth dflags)
| 52
|
mo_wordUShr dflags = MO_U_Shr (wordWidth dflags)
| 52
| false
| false
| 0
| 7
| 9
| 18
| 8
| 10
| null | null |
hpacheco/HAAP
|
examples/gameworker/li1g175/Bomberman.hs
|
mit
|
parsePower ('+':t) = P Bombs (x,y)
where x = read $ (words t)!!0
y = read $ (words t)!!1
| 102
|
parsePower ('+':t) = P Bombs (x,y)
where x = read $ (words t)!!0
y = read $ (words t)!!1
| 102
|
parsePower ('+':t) = P Bombs (x,y)
where x = read $ (words t)!!0
y = read $ (words t)!!1
| 102
| false
| false
| 0
| 10
| 32
| 67
| 35
| 32
| null | null |
roberth/uu-helium
|
demo/ParserLibrary.hs
|
gpl-3.0
|
token' :: (s -> s -> Bool) -> [s] -> Parser s [s]
token' eq k xs | (eqList eq) k (take n xs) = [ (drop n xs, k) ]
| otherwise = []
where n :: Int
n = length k
------------------------------------------------------------
-- Parser combinators
| 354
|
token' :: (s -> s -> Bool) -> [s] -> Parser s [s]
token' eq k xs | (eqList eq) k (take n xs) = [ (drop n xs, k) ]
| otherwise = []
where n :: Int
n = length k
------------------------------------------------------------
-- Parser combinators
| 354
|
token' eq k xs | (eqList eq) k (take n xs) = [ (drop n xs, k) ]
| otherwise = []
where n :: Int
n = length k
------------------------------------------------------------
-- Parser combinators
| 288
| false
| true
| 0
| 10
| 159
| 115
| 59
| 56
| null | null |
kishoredbn/barrelfish
|
tools/flounder/Local.hs
|
mit
|
change_waitset_fn_def :: String -> C.Unit
change_waitset_fn_def ifn =
C.FunctionDef C.Static (C.TypeName "errval_t") (change_waitset_fn_name ifn) params [
C.Return $ C.Variable "ERR_NOTIMP"
]
where
params = [C.Param (C.Ptr $ C.Struct $ intf_bind_type ifn) intf_bind_var,
C.Param (C.Ptr $ C.Struct "waitset") "ws"]
| 359
|
change_waitset_fn_def :: String -> C.Unit
change_waitset_fn_def ifn =
C.FunctionDef C.Static (C.TypeName "errval_t") (change_waitset_fn_name ifn) params [
C.Return $ C.Variable "ERR_NOTIMP"
]
where
params = [C.Param (C.Ptr $ C.Struct $ intf_bind_type ifn) intf_bind_var,
C.Param (C.Ptr $ C.Struct "waitset") "ws"]
| 359
|
change_waitset_fn_def ifn =
C.FunctionDef C.Static (C.TypeName "errval_t") (change_waitset_fn_name ifn) params [
C.Return $ C.Variable "ERR_NOTIMP"
]
where
params = [C.Param (C.Ptr $ C.Struct $ intf_bind_type ifn) intf_bind_var,
C.Param (C.Ptr $ C.Struct "waitset") "ws"]
| 317
| false
| true
| 0
| 12
| 83
| 122
| 61
| 61
| null | null |
fpco/th-utilities
|
src/TH/Utilities.hs
|
mit
|
-- | Utility to conveniently handle change to 'InstanceD' API in
-- template-haskell-2.11.0
plainInstanceD :: Cxt -> Type -> [Dec] -> Dec
plainInstanceD =
#if MIN_VERSION_template_haskell(2,11,0)
InstanceD Nothing
| 217
|
plainInstanceD :: Cxt -> Type -> [Dec] -> Dec
plainInstanceD =
#if MIN_VERSION_template_haskell(2,11,0)
InstanceD Nothing
| 125
|
plainInstanceD =
#if MIN_VERSION_template_haskell(2,11,0)
InstanceD Nothing
| 79
| true
| true
| 0
| 9
| 31
| 39
| 19
| 20
| null | null |
pjones/xmonad-test
|
vendor/xmonad-contrib/XMonad/Hooks/FadeInactive.hs
|
bsd-2-clause
|
fadeOut :: Rational -> Window -> X ()
fadeOut = flip setOpacity
| 63
|
fadeOut :: Rational -> Window -> X ()
fadeOut = flip setOpacity
| 63
|
fadeOut = flip setOpacity
| 25
| false
| true
| 0
| 9
| 11
| 33
| 14
| 19
| null | null |
ssaavedra/liquidhaskell
|
benchmarks/vector-0.10.0.1/Data/Vector.hs
|
bsd-3-clause
|
scanl1' = G.scanl1'
| 19
|
scanl1' = G.scanl1'
| 19
|
scanl1' = G.scanl1'
| 19
| false
| false
| 0
| 5
| 2
| 8
| 4
| 4
| null | null |
iteloo/tsuru-sample
|
iteratee-0.8.9.6/bench/BenchBase.hs
|
bsd-3-clause
|
takeUpToBenches = [takeUpTo1, takeUpTo2, takeUpTo3, takeUpTo4, takeUpTo5, takeUpTo6]
| 84
|
takeUpToBenches = [takeUpTo1, takeUpTo2, takeUpTo3, takeUpTo4, takeUpTo5, takeUpTo6]
| 84
|
takeUpToBenches = [takeUpTo1, takeUpTo2, takeUpTo3, takeUpTo4, takeUpTo5, takeUpTo6]
| 84
| false
| false
| 1
| 5
| 7
| 27
| 15
| 12
| null | null |
fmapfmapfmap/amazonka
|
amazonka-route53/gen/Network/AWS/Route53/ChangeResourceRecordSets.hs
|
mpl-2.0
|
-- | Creates a value of 'ChangeResourceRecordSetsResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'crrsrsResponseStatus'
--
-- * 'crrsrsChangeInfo'
changeResourceRecordSetsResponse
:: Int -- ^ 'crrsrsResponseStatus'
-> ChangeInfo -- ^ 'crrsrsChangeInfo'
-> ChangeResourceRecordSetsResponse
changeResourceRecordSetsResponse pResponseStatus_ pChangeInfo_ =
ChangeResourceRecordSetsResponse'
{ _crrsrsResponseStatus = pResponseStatus_
, _crrsrsChangeInfo = pChangeInfo_
}
| 590
|
changeResourceRecordSetsResponse
:: Int -- ^ 'crrsrsResponseStatus'
-> ChangeInfo -- ^ 'crrsrsChangeInfo'
-> ChangeResourceRecordSetsResponse
changeResourceRecordSetsResponse pResponseStatus_ pChangeInfo_ =
ChangeResourceRecordSetsResponse'
{ _crrsrsResponseStatus = pResponseStatus_
, _crrsrsChangeInfo = pChangeInfo_
}
| 348
|
changeResourceRecordSetsResponse pResponseStatus_ pChangeInfo_ =
ChangeResourceRecordSetsResponse'
{ _crrsrsResponseStatus = pResponseStatus_
, _crrsrsChangeInfo = pChangeInfo_
}
| 194
| true
| true
| 0
| 8
| 92
| 56
| 32
| 24
| null | null |
isomorphism/webgl
|
src/Graphics/Rendering/WebGL/Constants.hs
|
mit
|
gl_CLIP_DISTANCE3 :: GLenum
gl_CLIP_DISTANCE3 = 0x3003
| 54
|
gl_CLIP_DISTANCE3 :: GLenum
gl_CLIP_DISTANCE3 = 0x3003
| 54
|
gl_CLIP_DISTANCE3 = 0x3003
| 26
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
johnjcamilleri/maltese-functional-morphology
|
lib-1.1/General.hs
|
lgpl-3.0
|
(+*) :: String -> Str -> Str
s +* (Str ss) = Str [s ++ p | p <- ss]
| 68
|
(+*) :: String -> Str -> Str
s +* (Str ss) = Str [s ++ p | p <- ss]
| 68
|
s +* (Str ss) = Str [s ++ p | p <- ss]
| 39
| false
| true
| 0
| 10
| 20
| 55
| 27
| 28
| null | null |
Heather/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
inferOpts = []
| 14
|
inferOpts = []
| 14
|
inferOpts = []
| 14
| false
| false
| 0
| 5
| 2
| 8
| 4
| 4
| null | null |
MatiasNAmendola/lamdu
|
Lamdu/Main.hs
|
gpl-3.0
|
runEditor :: FilePath -> Maybe FilePath -> IO ()
runEditor lamduDir mFontPath = do
Directory.createDirectoryIfMissing False lamduDir
-- GLFW changes the directory from start directory, at least on macs.
startDir <- Directory.getCurrentDirectory
-- Load config as early as possible, before we open any windows/etc
(_, getConfig) <- sampler $ accessDataFile startDir loadConfig "config.json"
GLFWUtils.withGLFW $ do
Vector2 displayWidth displayHeight <- GLFWUtils.getVideoModeSize
win <- GLFWUtils.createWindow displayWidth displayHeight "Lamdu"
-- Fonts must be loaded after the GL context is created..
let
getFont path = do
exists <- Directory.doesFileExist path
unless exists . ioError . userError $ path ++ " does not exist!"
Draw.openFont path
font <-
case mFontPath of
Nothing -> accessDataFile startDir getFont "fonts/DejaVuSans.ttf"
Just path -> getFont path
Db.withDb (lamduDir </> "codeedit.db") $ runDb win getConfig font
| 1,016
|
runEditor :: FilePath -> Maybe FilePath -> IO ()
runEditor lamduDir mFontPath = do
Directory.createDirectoryIfMissing False lamduDir
-- GLFW changes the directory from start directory, at least on macs.
startDir <- Directory.getCurrentDirectory
-- Load config as early as possible, before we open any windows/etc
(_, getConfig) <- sampler $ accessDataFile startDir loadConfig "config.json"
GLFWUtils.withGLFW $ do
Vector2 displayWidth displayHeight <- GLFWUtils.getVideoModeSize
win <- GLFWUtils.createWindow displayWidth displayHeight "Lamdu"
-- Fonts must be loaded after the GL context is created..
let
getFont path = do
exists <- Directory.doesFileExist path
unless exists . ioError . userError $ path ++ " does not exist!"
Draw.openFont path
font <-
case mFontPath of
Nothing -> accessDataFile startDir getFont "fonts/DejaVuSans.ttf"
Just path -> getFont path
Db.withDb (lamduDir </> "codeedit.db") $ runDb win getConfig font
| 1,016
|
runEditor lamduDir mFontPath = do
Directory.createDirectoryIfMissing False lamduDir
-- GLFW changes the directory from start directory, at least on macs.
startDir <- Directory.getCurrentDirectory
-- Load config as early as possible, before we open any windows/etc
(_, getConfig) <- sampler $ accessDataFile startDir loadConfig "config.json"
GLFWUtils.withGLFW $ do
Vector2 displayWidth displayHeight <- GLFWUtils.getVideoModeSize
win <- GLFWUtils.createWindow displayWidth displayHeight "Lamdu"
-- Fonts must be loaded after the GL context is created..
let
getFont path = do
exists <- Directory.doesFileExist path
unless exists . ioError . userError $ path ++ " does not exist!"
Draw.openFont path
font <-
case mFontPath of
Nothing -> accessDataFile startDir getFont "fonts/DejaVuSans.ttf"
Just path -> getFont path
Db.withDb (lamduDir </> "codeedit.db") $ runDb win getConfig font
| 967
| false
| true
| 0
| 20
| 212
| 238
| 107
| 131
| null | null |
damoxc/ganeti
|
src/Ganeti/Query/Common.hs
|
gpl-2.0
|
rpcErrorToStatus _ = RSNoData
| 29
|
rpcErrorToStatus _ = RSNoData
| 29
|
rpcErrorToStatus _ = RSNoData
| 29
| false
| false
| 0
| 4
| 3
| 10
| 4
| 6
| null | null |
YuichiroSato/GameOfSymbolGrounding
|
src/Update/TimeEvolution.hs
|
bsd-3-clause
|
fromList2Mid :: [Cell] -> Mid
fromList2Mid cs0 = toXY $ toTuple $ groupBy eq $ sortBy comp cs0
where
comp (Cell a _) (Cell b _) = (xy a) `compare` (xy b)
eq (Cell a _) (Cell b _) = (xy a) == (xy b)
toTuple cs = map (\ls -> (head ls, ls)) cs
toXY cs = map (\(Cell ext _, ls) -> (xy ext, ls)) cs
| 311
|
fromList2Mid :: [Cell] -> Mid
fromList2Mid cs0 = toXY $ toTuple $ groupBy eq $ sortBy comp cs0
where
comp (Cell a _) (Cell b _) = (xy a) `compare` (xy b)
eq (Cell a _) (Cell b _) = (xy a) == (xy b)
toTuple cs = map (\ls -> (head ls, ls)) cs
toXY cs = map (\(Cell ext _, ls) -> (xy ext, ls)) cs
| 311
|
fromList2Mid cs0 = toXY $ toTuple $ groupBy eq $ sortBy comp cs0
where
comp (Cell a _) (Cell b _) = (xy a) `compare` (xy b)
eq (Cell a _) (Cell b _) = (xy a) == (xy b)
toTuple cs = map (\ls -> (head ls, ls)) cs
toXY cs = map (\(Cell ext _, ls) -> (xy ext, ls)) cs
| 281
| false
| true
| 4
| 9
| 85
| 216
| 104
| 112
| null | null |
juhp/stack
|
src/windows/System/Terminal.hs
|
bsd-3-clause
|
hIsTerminalDeviceOrMinTTY :: MonadIO m => Handle -> m Bool
hIsTerminalDeviceOrMinTTY h = do
isTD <- hIsTerminalDevice h
if isTD
then return True
else liftIO $ withHandleToHANDLE h isMinTTYHandle
| 206
|
hIsTerminalDeviceOrMinTTY :: MonadIO m => Handle -> m Bool
hIsTerminalDeviceOrMinTTY h = do
isTD <- hIsTerminalDevice h
if isTD
then return True
else liftIO $ withHandleToHANDLE h isMinTTYHandle
| 206
|
hIsTerminalDeviceOrMinTTY h = do
isTD <- hIsTerminalDevice h
if isTD
then return True
else liftIO $ withHandleToHANDLE h isMinTTYHandle
| 147
| false
| true
| 0
| 9
| 39
| 61
| 28
| 33
| null | null |
glguy/ssh-hans
|
src/Network/SSH/Keys.hs
|
bsd-3-clause
|
runCurve25519dh ::
IO (S.ByteString, S.ByteString -> Maybe S.ByteString)
{- ^ local public, remote public -> shared key -}
runCurve25519dh =
-- fails if key isn't 32 bytes long
do CryptoPassed priv <-
fmap C25519.secretKey (getRandomBytes 32 :: IO S.ByteString)
-- Section 2: Transmit public key as "string"
let raw_pub_s = convert $ C25519.toPublic priv
computeSecret raw_pub_c
-- fails if key isn't 32 bytes long
| CryptoPassed pub_c <-
C25519.publicKey raw_pub_c
-- Section 4.3: Treat shared key bytes as "integer"
= Just $ runPut $ putMpInt $ os2ip $ C25519.dh pub_c priv
| otherwise = Nothing
return (raw_pub_s, computeSecret)
| 755
|
runCurve25519dh ::
IO (S.ByteString, S.ByteString -> Maybe S.ByteString)
runCurve25519dh =
-- fails if key isn't 32 bytes long
do CryptoPassed priv <-
fmap C25519.secretKey (getRandomBytes 32 :: IO S.ByteString)
-- Section 2: Transmit public key as "string"
let raw_pub_s = convert $ C25519.toPublic priv
computeSecret raw_pub_c
-- fails if key isn't 32 bytes long
| CryptoPassed pub_c <-
C25519.publicKey raw_pub_c
-- Section 4.3: Treat shared key bytes as "integer"
= Just $ runPut $ putMpInt $ os2ip $ C25519.dh pub_c priv
| otherwise = Nothing
return (raw_pub_s, computeSecret)
| 703
|
runCurve25519dh =
-- fails if key isn't 32 bytes long
do CryptoPassed priv <-
fmap C25519.secretKey (getRandomBytes 32 :: IO S.ByteString)
-- Section 2: Transmit public key as "string"
let raw_pub_s = convert $ C25519.toPublic priv
computeSecret raw_pub_c
-- fails if key isn't 32 bytes long
| CryptoPassed pub_c <-
C25519.publicKey raw_pub_c
-- Section 4.3: Treat shared key bytes as "integer"
= Just $ runPut $ putMpInt $ os2ip $ C25519.dh pub_c priv
| otherwise = Nothing
return (raw_pub_s, computeSecret)
| 628
| true
| true
| 2
| 16
| 221
| 160
| 76
| 84
| null | null |
sherwoodwang/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxLANGUAGE_MALAY_MALAYSIA :: Int
wxLANGUAGE_MALAY_MALAYSIA = 133
| 64
|
wxLANGUAGE_MALAY_MALAYSIA :: Int
wxLANGUAGE_MALAY_MALAYSIA = 133
| 64
|
wxLANGUAGE_MALAY_MALAYSIA = 133
| 31
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
GaloisInc/haskell-tor
|
src/Tor/Link/CipherSuites.hs
|
bsd-3-clause
|
suiteTLS_DHE_RSA_WITH_AES_256_CBC_SHA256 :: Cipher
suiteTLS_DHE_RSA_WITH_AES_256_CBC_SHA256 =
Cipher {
cipherID = 0x006B
, cipherName = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256"
, cipherBulk = bulkAES256
, cipherHash = SHA256
, cipherKeyExchange = CipherKeyExchange_DHE_RSA
, cipherMinVer = Just TLS12
}
| 352
|
suiteTLS_DHE_RSA_WITH_AES_256_CBC_SHA256 :: Cipher
suiteTLS_DHE_RSA_WITH_AES_256_CBC_SHA256 =
Cipher {
cipherID = 0x006B
, cipherName = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256"
, cipherBulk = bulkAES256
, cipherHash = SHA256
, cipherKeyExchange = CipherKeyExchange_DHE_RSA
, cipherMinVer = Just TLS12
}
| 352
|
suiteTLS_DHE_RSA_WITH_AES_256_CBC_SHA256 =
Cipher {
cipherID = 0x006B
, cipherName = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256"
, cipherBulk = bulkAES256
, cipherHash = SHA256
, cipherKeyExchange = CipherKeyExchange_DHE_RSA
, cipherMinVer = Just TLS12
}
| 301
| false
| true
| 0
| 7
| 84
| 52
| 32
| 20
| null | null |
shockkolate/containers
|
tests/set-properties.hs
|
bsd-3-clause
|
prop_InsertDelete :: Int -> Set Int -> Property
prop_InsertDelete k t = not (member k t) ==> delete k (insert k t) == t
| 119
|
prop_InsertDelete :: Int -> Set Int -> Property
prop_InsertDelete k t = not (member k t) ==> delete k (insert k t) == t
| 119
|
prop_InsertDelete k t = not (member k t) ==> delete k (insert k t) == t
| 71
| false
| true
| 0
| 9
| 23
| 59
| 28
| 31
| null | null |
haraldsteinlechner/lambdaWolf
|
src/ModelLoader.hs
|
gpl-3.0
|
getEigiRenderAction :: IO (IO ())
getEigiRenderAction = do
let objs = [ ("body.obj","EigiBodyColor.jpg","EigiBody_NORMAL.jpg")
-- , ("drool.obj","EigiDrool_COLOR.png","EigiDrool_NORMAL.jpg")
, ("eyes.obj","EigiEye_COLOR.jpg","EigiEye_NORMAL.jpg")
, ("lowerTeeth.obj","EigiTeeth_COLOR.jpg","EigiTeeth_NORMAL.jpg")
, ("upperTeeth.obj","EigiTeeth_COLOR.jpg","EigiTeeth_NORMAL.jpg")
]
let prefix = "../data/Eigi/"
renderActions <- mapM (\(obj,color,normal) -> loadObj (prefix++obj) (prefix++color) (prefix++normal)) objs
return $ sequence_ renderActions
| 630
|
getEigiRenderAction :: IO (IO ())
getEigiRenderAction = do
let objs = [ ("body.obj","EigiBodyColor.jpg","EigiBody_NORMAL.jpg")
-- , ("drool.obj","EigiDrool_COLOR.png","EigiDrool_NORMAL.jpg")
, ("eyes.obj","EigiEye_COLOR.jpg","EigiEye_NORMAL.jpg")
, ("lowerTeeth.obj","EigiTeeth_COLOR.jpg","EigiTeeth_NORMAL.jpg")
, ("upperTeeth.obj","EigiTeeth_COLOR.jpg","EigiTeeth_NORMAL.jpg")
]
let prefix = "../data/Eigi/"
renderActions <- mapM (\(obj,color,normal) -> loadObj (prefix++obj) (prefix++color) (prefix++normal)) objs
return $ sequence_ renderActions
| 630
|
getEigiRenderAction = do
let objs = [ ("body.obj","EigiBodyColor.jpg","EigiBody_NORMAL.jpg")
-- , ("drool.obj","EigiDrool_COLOR.png","EigiDrool_NORMAL.jpg")
, ("eyes.obj","EigiEye_COLOR.jpg","EigiEye_NORMAL.jpg")
, ("lowerTeeth.obj","EigiTeeth_COLOR.jpg","EigiTeeth_NORMAL.jpg")
, ("upperTeeth.obj","EigiTeeth_COLOR.jpg","EigiTeeth_NORMAL.jpg")
]
let prefix = "../data/Eigi/"
renderActions <- mapM (\(obj,color,normal) -> loadObj (prefix++obj) (prefix++color) (prefix++normal)) objs
return $ sequence_ renderActions
| 596
| false
| true
| 0
| 13
| 121
| 156
| 87
| 69
| null | null |
harendra-kumar/asyncly
|
src/Streamly/Internal/Data/Fold.hs
|
bsd-3-clause
|
genericLength :: (Monad m, Num b) => Fold m a b
genericLength = Fold (\n _ -> return $ n + 1) (return 0) return
| 111
|
genericLength :: (Monad m, Num b) => Fold m a b
genericLength = Fold (\n _ -> return $ n + 1) (return 0) return
| 111
|
genericLength = Fold (\n _ -> return $ n + 1) (return 0) return
| 63
| false
| true
| 0
| 9
| 24
| 70
| 34
| 36
| null | null |
osa1/Idris-dev
|
src/Idris/IBC.hs
|
bsd-3-clause
|
loadIBC :: Bool -- ^ True = reexport, False = make everything private
-> FilePath -> Idris ()
loadIBC reexport fp
= do imps <- getImported
let redo = case lookup fp imps of
Nothing -> True
Just p -> not p && reexport
when redo $
do logLvl 1 $ "Loading ibc " ++ fp ++ " " ++ show reexport
archiveFile <- runIO $ B.readFile fp
case toArchiveOrFail archiveFile of
Left _ -> ifail $ fp ++ " isn't loadable, it may have an old ibc format.\n"
++ "Please clean and rebuild it."
Right archive -> do process reexport archive fp
addImported reexport fp
-- | Load an entire package from its index file
| 900
|
loadIBC :: Bool -- ^ True = reexport, False = make everything private
-> FilePath -> Idris ()
loadIBC reexport fp
= do imps <- getImported
let redo = case lookup fp imps of
Nothing -> True
Just p -> not p && reexport
when redo $
do logLvl 1 $ "Loading ibc " ++ fp ++ " " ++ show reexport
archiveFile <- runIO $ B.readFile fp
case toArchiveOrFail archiveFile of
Left _ -> ifail $ fp ++ " isn't loadable, it may have an old ibc format.\n"
++ "Please clean and rebuild it."
Right archive -> do process reexport archive fp
addImported reexport fp
-- | Load an entire package from its index file
| 900
|
loadIBC reexport fp
= do imps <- getImported
let redo = case lookup fp imps of
Nothing -> True
Just p -> not p && reexport
when redo $
do logLvl 1 $ "Loading ibc " ++ fp ++ " " ++ show reexport
archiveFile <- runIO $ B.readFile fp
case toArchiveOrFail archiveFile of
Left _ -> ifail $ fp ++ " isn't loadable, it may have an old ibc format.\n"
++ "Please clean and rebuild it."
Right archive -> do process reexport archive fp
addImported reexport fp
-- | Load an entire package from its index file
| 798
| false
| true
| 0
| 17
| 425
| 193
| 85
| 108
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.