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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TransformingMusicology/adb-test-framework
|
src/AudioDB/Test.hs
|
gpl-3.0
|
runEitherTest :: Bool -> Bool -> Either ParseException Test -> IO ()
runEitherTest False withEval@False (Right t) = runTest withEval t >>= dumpRun
| 146
|
runEitherTest :: Bool -> Bool -> Either ParseException Test -> IO ()
runEitherTest False withEval@False (Right t) = runTest withEval t >>= dumpRun
| 146
|
runEitherTest False withEval@False (Right t) = runTest withEval t >>= dumpRun
| 77
| false
| true
| 0
| 9
| 22
| 58
| 28
| 30
| null | null |
DronovIlya/filemanager-hs
|
src/Files/Data.hs
|
gpl-2.0
|
compareData (RegularFile _ _) (UnkhownFile _ _) = GT
| 56
|
compareData (RegularFile _ _) (UnkhownFile _ _) = GT
| 56
|
compareData (RegularFile _ _) (UnkhownFile _ _) = GT
| 56
| false
| false
| 0
| 7
| 12
| 27
| 13
| 14
| null | null |
lukexi/cabal
|
Cabal/tests/UnitTests/Distribution/Version.hs
|
bsd-3-clause
|
--------------------------------
-- equivalentVersionRange helper
prop_equivalentVersionRange :: VersionRange -> VersionRange
-> Version -> Property
prop_equivalentVersionRange range range' version =
equivalentVersionRange range range' && range /= range' ==>
withinRange version range == withinRange version range'
| 350
|
prop_equivalentVersionRange :: VersionRange -> VersionRange
-> Version -> Property
prop_equivalentVersionRange range range' version =
equivalentVersionRange range range' && range /= range' ==>
withinRange version range == withinRange version range'
| 283
|
prop_equivalentVersionRange range range' version =
equivalentVersionRange range range' && range /= range' ==>
withinRange version range == withinRange version range'
| 171
| true
| true
| 0
| 9
| 68
| 63
| 31
| 32
| null | null |
anchor/synchronise
|
lib/Synchronise/Network/Server.hs
|
bsd-3-clause
|
mergeAll
:: MergePolicy
-> [Patch]
-> (Patch, [RejectedOp])
mergeAll pol =
foldr (\p1 (p2, r) -> (r <>) <$> merge pol p1 p2)
(emptyPatch, mempty)
| 167
|
mergeAll
:: MergePolicy
-> [Patch]
-> (Patch, [RejectedOp])
mergeAll pol =
foldr (\p1 (p2, r) -> (r <>) <$> merge pol p1 p2)
(emptyPatch, mempty)
| 167
|
mergeAll pol =
foldr (\p1 (p2, r) -> (r <>) <$> merge pol p1 p2)
(emptyPatch, mempty)
| 95
| false
| true
| 0
| 10
| 46
| 81
| 44
| 37
| null | null |
imh/plover
|
src/Language/Plover/Reduce.hs
|
mit
|
recurse :: RWContext -> CExpr -> M CExpr
recurse ctxt (Free x) = fmap Free $ T.traverse (compileStep ctxt) x
| 108
|
recurse :: RWContext -> CExpr -> M CExpr
recurse ctxt (Free x) = fmap Free $ T.traverse (compileStep ctxt) x
| 108
|
recurse ctxt (Free x) = fmap Free $ T.traverse (compileStep ctxt) x
| 67
| false
| true
| 0
| 8
| 19
| 53
| 25
| 28
| null | null |
fmthoma/ghc
|
compiler/main/TidyPgm.hs
|
bsd-3-clause
|
tidyTopBind :: DynFlags
-> PackageKey
-> Module
-> (Integer -> CoreExpr)
-> UnfoldEnv
-> TidyEnv
-> CoreBind
-> (TidyEnv, CoreBind)
tidyTopBind dflags this_pkg this_mod cvt_integer unfold_env
(occ_env,subst1) (NonRec bndr rhs)
= (tidy_env2, NonRec bndr' rhs')
where
Just (name',show_unfold) = lookupVarEnv unfold_env bndr
caf_info = hasCafRefs dflags this_pkg this_mod (subst1, cvt_integer) (idArity bndr) rhs
(bndr', rhs') = tidyTopPair dflags show_unfold tidy_env2 caf_info name' (bndr, rhs)
subst2 = extendVarEnv subst1 bndr bndr'
tidy_env2 = (occ_env, subst2)
| 709
|
tidyTopBind :: DynFlags
-> PackageKey
-> Module
-> (Integer -> CoreExpr)
-> UnfoldEnv
-> TidyEnv
-> CoreBind
-> (TidyEnv, CoreBind)
tidyTopBind dflags this_pkg this_mod cvt_integer unfold_env
(occ_env,subst1) (NonRec bndr rhs)
= (tidy_env2, NonRec bndr' rhs')
where
Just (name',show_unfold) = lookupVarEnv unfold_env bndr
caf_info = hasCafRefs dflags this_pkg this_mod (subst1, cvt_integer) (idArity bndr) rhs
(bndr', rhs') = tidyTopPair dflags show_unfold tidy_env2 caf_info name' (bndr, rhs)
subst2 = extendVarEnv subst1 bndr bndr'
tidy_env2 = (occ_env, subst2)
| 708
|
tidyTopBind dflags this_pkg this_mod cvt_integer unfold_env
(occ_env,subst1) (NonRec bndr rhs)
= (tidy_env2, NonRec bndr' rhs')
where
Just (name',show_unfold) = lookupVarEnv unfold_env bndr
caf_info = hasCafRefs dflags this_pkg this_mod (subst1, cvt_integer) (idArity bndr) rhs
(bndr', rhs') = tidyTopPair dflags show_unfold tidy_env2 caf_info name' (bndr, rhs)
subst2 = extendVarEnv subst1 bndr bndr'
tidy_env2 = (occ_env, subst2)
| 484
| false
| true
| 2
| 15
| 219
| 210
| 107
| 103
| null | null |
toonn/wyah
|
src/CalcParser.hs
|
bsd-2-clause
|
reserved :: String -> Parser ()
reserved = Tok.reserved lexer
| 61
|
reserved :: String -> Parser ()
reserved = Tok.reserved lexer
| 61
|
reserved = Tok.reserved lexer
| 29
| false
| true
| 0
| 7
| 9
| 25
| 12
| 13
| null | null |
ezyang/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
nonDetCmpTypesX env (t1:tys1) (t2:tys2) = nonDetCmpTypeX env t1 t2
`thenCmp` nonDetCmpTypesX env tys1 tys2
| 144
|
nonDetCmpTypesX env (t1:tys1) (t2:tys2) = nonDetCmpTypeX env t1 t2
`thenCmp` nonDetCmpTypesX env tys1 tys2
| 144
|
nonDetCmpTypesX env (t1:tys1) (t2:tys2) = nonDetCmpTypeX env t1 t2
`thenCmp` nonDetCmpTypesX env tys1 tys2
| 144
| false
| false
| 1
| 8
| 51
| 50
| 24
| 26
| null | null |
dselsam/tc
|
src/Kernel/Level/Internal.hs
|
gpl-3.0
|
collectMaxArgs (Max (MaxCoreData False l1 l2)) = collectMaxArgs l1 ++ collectMaxArgs l2
| 87
|
collectMaxArgs (Max (MaxCoreData False l1 l2)) = collectMaxArgs l1 ++ collectMaxArgs l2
| 87
|
collectMaxArgs (Max (MaxCoreData False l1 l2)) = collectMaxArgs l1 ++ collectMaxArgs l2
| 87
| false
| false
| 0
| 9
| 11
| 35
| 16
| 19
| null | null |
fmthoma/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
emptyTvSubst :: TvSubst
emptyTvSubst = TvSubst emptyInScopeSet emptyTvSubstEnv
| 78
|
emptyTvSubst :: TvSubst
emptyTvSubst = TvSubst emptyInScopeSet emptyTvSubstEnv
| 78
|
emptyTvSubst = TvSubst emptyInScopeSet emptyTvSubstEnv
| 54
| false
| true
| 0
| 5
| 7
| 16
| 8
| 8
| null | null |
bitemyapp/ghc
|
compiler/basicTypes/RdrName.hs
|
bsd-3-clause
|
isOrig :: RdrName -> Bool
isOrig (Orig _ _) = True
| 50
|
isOrig :: RdrName -> Bool
isOrig (Orig _ _) = True
| 50
|
isOrig (Orig _ _) = True
| 24
| false
| true
| 0
| 7
| 10
| 26
| 13
| 13
| null | null |
benkolera/phb
|
hs/Phb/Output/Email.hs
|
mit
|
projectsHtml :: [Project] -> Html
projectsHtml pp = sectionTable "Projects"
[ ("Project",15)
, ("Customer",10)
, ("Status",10)
, ("Stakeholders",12)
, ("Target Completion",15)
, ("Effort / Duration",8)
, ("Notes / Next Steps",30)
] pp $ \ p ->
[ p^.projectName . to toHtml . to noStyle
, p^.projectCustomers . to textListHtml . to noStyle
, p^.projectStatus . to projectStatusHtml
, p^.projectStakeholders . to textListHtml . to noStyle
, noStyle $ mapM_ targetDateHtml (p^.projectTargetDates)
, p^.projectEffortSpent . to effortSpentHtml . to noStyle
, p^.projectNotes . to textListHtml . to noStyle
]
where
projectStatusHtml ps =
(ps ^. projectStatusColour . to projectStatusColourStyle,)
. H.p $ do
(ps ^. projectStatusPhase . to toHtml)
forM_ (ps ^. projectStatusDesc) $ \ d -> do
H.br
toHtml ("(" <> d <> ")")
targetDateHtml t = H.p . toHtml $ do
(t ^. targetDateDay . to formatDay) <> (t ^. targetDateDesc . unpacked)
effortSpentHtml es = H.p $ do
toHtml $ (es ^. effortSpentDays . to show) <> " Person Days"
H.br
void "Started: "
es ^. effortSpentStartDay . to formatDay . to toHtml
projectStatusColourStyle StatusGreen = green
projectStatusColourStyle StatusAmber = amber
projectStatusColourStyle StatusRed = red
| 1,376
|
projectsHtml :: [Project] -> Html
projectsHtml pp = sectionTable "Projects"
[ ("Project",15)
, ("Customer",10)
, ("Status",10)
, ("Stakeholders",12)
, ("Target Completion",15)
, ("Effort / Duration",8)
, ("Notes / Next Steps",30)
] pp $ \ p ->
[ p^.projectName . to toHtml . to noStyle
, p^.projectCustomers . to textListHtml . to noStyle
, p^.projectStatus . to projectStatusHtml
, p^.projectStakeholders . to textListHtml . to noStyle
, noStyle $ mapM_ targetDateHtml (p^.projectTargetDates)
, p^.projectEffortSpent . to effortSpentHtml . to noStyle
, p^.projectNotes . to textListHtml . to noStyle
]
where
projectStatusHtml ps =
(ps ^. projectStatusColour . to projectStatusColourStyle,)
. H.p $ do
(ps ^. projectStatusPhase . to toHtml)
forM_ (ps ^. projectStatusDesc) $ \ d -> do
H.br
toHtml ("(" <> d <> ")")
targetDateHtml t = H.p . toHtml $ do
(t ^. targetDateDay . to formatDay) <> (t ^. targetDateDesc . unpacked)
effortSpentHtml es = H.p $ do
toHtml $ (es ^. effortSpentDays . to show) <> " Person Days"
H.br
void "Started: "
es ^. effortSpentStartDay . to formatDay . to toHtml
projectStatusColourStyle StatusGreen = green
projectStatusColourStyle StatusAmber = amber
projectStatusColourStyle StatusRed = red
| 1,376
|
projectsHtml pp = sectionTable "Projects"
[ ("Project",15)
, ("Customer",10)
, ("Status",10)
, ("Stakeholders",12)
, ("Target Completion",15)
, ("Effort / Duration",8)
, ("Notes / Next Steps",30)
] pp $ \ p ->
[ p^.projectName . to toHtml . to noStyle
, p^.projectCustomers . to textListHtml . to noStyle
, p^.projectStatus . to projectStatusHtml
, p^.projectStakeholders . to textListHtml . to noStyle
, noStyle $ mapM_ targetDateHtml (p^.projectTargetDates)
, p^.projectEffortSpent . to effortSpentHtml . to noStyle
, p^.projectNotes . to textListHtml . to noStyle
]
where
projectStatusHtml ps =
(ps ^. projectStatusColour . to projectStatusColourStyle,)
. H.p $ do
(ps ^. projectStatusPhase . to toHtml)
forM_ (ps ^. projectStatusDesc) $ \ d -> do
H.br
toHtml ("(" <> d <> ")")
targetDateHtml t = H.p . toHtml $ do
(t ^. targetDateDay . to formatDay) <> (t ^. targetDateDesc . unpacked)
effortSpentHtml es = H.p $ do
toHtml $ (es ^. effortSpentDays . to show) <> " Person Days"
H.br
void "Started: "
es ^. effortSpentStartDay . to formatDay . to toHtml
projectStatusColourStyle StatusGreen = green
projectStatusColourStyle StatusAmber = amber
projectStatusColourStyle StatusRed = red
| 1,342
| false
| true
| 0
| 15
| 342
| 482
| 244
| 238
| null | null |
Gabriel439/Haskell-Bears-Library
|
src/Bears.hs
|
bsd-3-clause
|
ge :: Ord key => key -> Table key row -> Table key row
ge k (Table m v) = Table m'' v
where
(_, mv, m') = Data.Map.Strict.splitLookup k m
m'' = case mv of
Nothing -> m'
Just v' -> Data.Map.Strict.insert k v' m'
-- | Filter out all groups whose key is less than the given key
| 330
|
ge :: Ord key => key -> Table key row -> Table key row
ge k (Table m v) = Table m'' v
where
(_, mv, m') = Data.Map.Strict.splitLookup k m
m'' = case mv of
Nothing -> m'
Just v' -> Data.Map.Strict.insert k v' m'
-- | Filter out all groups whose key is less than the given key
| 330
|
ge k (Table m v) = Table m'' v
where
(_, mv, m') = Data.Map.Strict.splitLookup k m
m'' = case mv of
Nothing -> m'
Just v' -> Data.Map.Strict.insert k v' m'
-- | Filter out all groups whose key is less than the given key
| 275
| false
| true
| 1
| 11
| 115
| 124
| 60
| 64
| null | null |
MichaelMackus/hsrl
|
RL/UI/Sprite.hs
|
mit
|
dgrey = (125, 125, 125)
| 25
|
dgrey = (125, 125, 125)
| 25
|
dgrey = (125, 125, 125)
| 25
| false
| false
| 0
| 5
| 6
| 15
| 9
| 6
| null | null |
NicolasT/kontiki
|
src/Network/Kontiki/Raft/Leader.hs
|
bsd-3-clause
|
handle :: (Functor m, Monad m, MonadLog m a)
=> Handler a Leader m
handle = handleGeneric
handleRequestVote
handleRequestVoteResponse
handleAppendEntries
handleAppendEntriesResponse
handleElectionTimeout
handleHeartbeatTimeout
| 305
|
handle :: (Functor m, Monad m, MonadLog m a)
=> Handler a Leader m
handle = handleGeneric
handleRequestVote
handleRequestVoteResponse
handleAppendEntries
handleAppendEntriesResponse
handleElectionTimeout
handleHeartbeatTimeout
| 305
|
handle = handleGeneric
handleRequestVote
handleRequestVoteResponse
handleAppendEntries
handleAppendEntriesResponse
handleElectionTimeout
handleHeartbeatTimeout
| 231
| false
| true
| 0
| 6
| 101
| 65
| 28
| 37
| null | null |
TOSPIO/yi
|
src/library/Yi/Interact.hs
|
gpl-2.0
|
accepted _ End = []
| 19
|
accepted _ End = []
| 19
|
accepted _ End = []
| 19
| false
| false
| 0
| 5
| 4
| 13
| 6
| 7
| null | null |
enolan/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
| 41
| 18
| 23
| null | null |
fmapfmapfmap/amazonka
|
amazonka-kms/gen/Network/AWS/KMS/ReEncrypt.hs
|
mpl-2.0
|
-- | The re-encrypted data. If you are using the CLI, the value is Base64
-- encoded. Otherwise, it is not encoded.
--
-- /Note:/ This 'Lens' automatically encodes and decodes Base64 data,
-- despite what the AWS documentation might say.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This 'Lens' accepts and returns only raw unencoded data.
rersCiphertextBlob :: Lens' ReEncryptResponse (Maybe ByteString)
rersCiphertextBlob = lens _rersCiphertextBlob (\ s a -> s{_rersCiphertextBlob = a}) . mapping _Base64
| 618
|
rersCiphertextBlob :: Lens' ReEncryptResponse (Maybe ByteString)
rersCiphertextBlob = lens _rersCiphertextBlob (\ s a -> s{_rersCiphertextBlob = a}) . mapping _Base64
| 166
|
rersCiphertextBlob = lens _rersCiphertextBlob (\ s a -> s{_rersCiphertextBlob = a}) . mapping _Base64
| 101
| true
| true
| 0
| 10
| 89
| 60
| 35
| 25
| null | null |
rueshyna/gogol
|
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
|
mpl-2.0
|
-- | Detected bit-rate for video asset. This is a read-only field. Applicable
-- to the following creative types: INSTREAM_VIDEO and all VPAID.
caaBitRate :: Lens' CreativeAsset (Maybe Int32)
caaBitRate
= lens _caaBitRate (\ s a -> s{_caaBitRate = a}) .
mapping _Coerce
| 277
|
caaBitRate :: Lens' CreativeAsset (Maybe Int32)
caaBitRate
= lens _caaBitRate (\ s a -> s{_caaBitRate = a}) .
mapping _Coerce
| 133
|
caaBitRate
= lens _caaBitRate (\ s a -> s{_caaBitRate = a}) .
mapping _Coerce
| 85
| true
| true
| 1
| 10
| 50
| 59
| 29
| 30
| null | null |
snoyberg/ghc
|
compiler/cmm/MkGraph.hs
|
bsd-3-clause
|
mkReturn :: DynFlags -> CmmExpr -> [CmmExpr] -> UpdFrameOffset
-> CmmAGraph
mkReturn dflags e actuals updfr_off =
lastWithArgs dflags Ret Old NativeReturn actuals updfr_off $
toCall e Nothing updfr_off 0
| 233
|
mkReturn :: DynFlags -> CmmExpr -> [CmmExpr] -> UpdFrameOffset
-> CmmAGraph
mkReturn dflags e actuals updfr_off =
lastWithArgs dflags Ret Old NativeReturn actuals updfr_off $
toCall e Nothing updfr_off 0
| 233
|
mkReturn dflags e actuals updfr_off =
lastWithArgs dflags Ret Old NativeReturn actuals updfr_off $
toCall e Nothing updfr_off 0
| 134
| false
| true
| 0
| 10
| 59
| 78
| 33
| 45
| null | null |
ulricha/dsh
|
src/Database/DSH/SL/Opt/Properties/Const.hs
|
bsd-3-clause
|
evalBinOp (SBDateOp _) (DateV _) (DateV _) = CPNoVal
| 60
|
evalBinOp (SBDateOp _) (DateV _) (DateV _) = CPNoVal
| 60
|
evalBinOp (SBDateOp _) (DateV _) (DateV _) = CPNoVal
| 60
| false
| false
| 0
| 8
| 16
| 37
| 17
| 20
| null | null |
berewt/ArduinoML-kernel
|
embeddeds/haskell/src/ArduinoHS/DSL.hs
|
lgpl-3.0
|
addSensor :: S.MonadState AppBuilder m
=> String -> Natural -> m ()
addSensor name port = bricks . L.at name L.?= A.sensor name port
| 142
|
addSensor :: S.MonadState AppBuilder m
=> String -> Natural -> m ()
addSensor name port = bricks . L.at name L.?= A.sensor name port
| 142
|
addSensor name port = bricks . L.at name L.?= A.sensor name port
| 64
| false
| true
| 0
| 9
| 33
| 62
| 29
| 33
| null | null |
jamesyang124/haskell-playground
|
src/Chp92.hs
|
bsd-3-clause
|
main3 = do
rs <- sequence [getLine, getLine, getLine]
print rs
{-- sequence
sequence :: [IO a] -> IO [a]
takes a list of I/O actions and returns an I/O actions that will perform those actions one after the other.
main2 is the same as main3
So sequence [getLine, getLine, getLine] makes an I/O action that will perform getLine three times.
--}
{--
example:
ghci> sequence (map print [1,2,3,4,5])
1
2
3
4
5
[(),(),(),(),()]
What's with the [(),(),(),(),()] at the end?
Well, when we evaluate an I/O action in GHCI, it's performed and then its result is printed out, unless that result is (), in which case it's not printed out.
That's why evaluating putStrLn "hehe" in GHCI just prints out hehe (because the contained result in putStrLn "hehe" is ()).
But when we do getLine in GHCI, the result of that I/O action is printed out, because getLine has a type of IO String.
--}
| 894
|
main3 = do
rs <- sequence [getLine, getLine, getLine]
print rs
{-- sequence
sequence :: [IO a] -> IO [a]
takes a list of I/O actions and returns an I/O actions that will perform those actions one after the other.
main2 is the same as main3
So sequence [getLine, getLine, getLine] makes an I/O action that will perform getLine three times.
--}
{--
example:
ghci> sequence (map print [1,2,3,4,5])
1
2
3
4
5
[(),(),(),(),()]
What's with the [(),(),(),(),()] at the end?
Well, when we evaluate an I/O action in GHCI, it's performed and then its result is printed out, unless that result is (), in which case it's not printed out.
That's why evaluating putStrLn "hehe" in GHCI just prints out hehe (because the contained result in putStrLn "hehe" is ()).
But when we do getLine in GHCI, the result of that I/O action is printed out, because getLine has a type of IO String.
--}
| 894
|
main3 = do
rs <- sequence [getLine, getLine, getLine]
print rs
{-- sequence
sequence :: [IO a] -> IO [a]
takes a list of I/O actions and returns an I/O actions that will perform those actions one after the other.
main2 is the same as main3
So sequence [getLine, getLine, getLine] makes an I/O action that will perform getLine three times.
--}
{--
example:
ghci> sequence (map print [1,2,3,4,5])
1
2
3
4
5
[(),(),(),(),()]
What's with the [(),(),(),(),()] at the end?
Well, when we evaluate an I/O action in GHCI, it's performed and then its result is printed out, unless that result is (), in which case it's not printed out.
That's why evaluating putStrLn "hehe" in GHCI just prints out hehe (because the contained result in putStrLn "hehe" is ()).
But when we do getLine in GHCI, the result of that I/O action is printed out, because getLine has a type of IO String.
--}
| 894
| false
| false
| 0
| 9
| 178
| 33
| 17
| 16
| null | null |
rimmington/unordered-containers
|
tests/HashMapProperties.hs
|
bsd-3-clause
|
pAdjust :: Key -> [(Key, Int)] -> Bool
pAdjust k = M.adjust succ k `eq_` HM.adjust succ k
| 89
|
pAdjust :: Key -> [(Key, Int)] -> Bool
pAdjust k = M.adjust succ k `eq_` HM.adjust succ k
| 89
|
pAdjust k = M.adjust succ k `eq_` HM.adjust succ k
| 50
| false
| true
| 0
| 9
| 17
| 60
| 29
| 31
| null | null |
siddhanathan/ghc
|
testsuite/tests/rename/should_compile/timing001.hs
|
bsd-3-clause
|
a310 = a311
| 11
|
a310 = a311
| 11
|
a310 = a311
| 11
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
chengzh2008/hpffp
|
src/ch15-MonoidSemigroup/monoid.hs
|
bsd-3-clause
|
monoidRightIdentity :: (Eq m, Semigroup m, Monoid m) => m -> Bool
monoidRightIdentity a = (a <> mempty) == a
| 108
|
monoidRightIdentity :: (Eq m, Semigroup m, Monoid m) => m -> Bool
monoidRightIdentity a = (a <> mempty) == a
| 108
|
monoidRightIdentity a = (a <> mempty) == a
| 42
| false
| true
| 0
| 7
| 19
| 50
| 26
| 24
| null | null |
mapinguari/SC_HS_Proxy
|
src/Proxy/Math/Graph.hs
|
mit
|
completeGraph n = buildwGraph n [((i,j),1)| i<- [0..(n-1)], j <- [0..(n-1)]]
| 76
|
completeGraph n = buildwGraph n [((i,j),1)| i<- [0..(n-1)], j <- [0..(n-1)]]
| 76
|
completeGraph n = buildwGraph n [((i,j),1)| i<- [0..(n-1)], j <- [0..(n-1)]]
| 76
| false
| false
| 0
| 11
| 10
| 69
| 38
| 31
| null | null |
sdiehl/ghc
|
testsuite/tests/pmcheck/complete_sigs/T14253.hs
|
bsd-3-clause
|
dynApply :: Dynamic -> Dynamic -> Maybe Dynamic
-- Changing TrFun to Fun also results in failure
dynApply (Dynamic (Fun ta tr) f) (Dynamic ta' x) = undefined
| 157
|
dynApply :: Dynamic -> Dynamic -> Maybe Dynamic
dynApply (Dynamic (Fun ta tr) f) (Dynamic ta' x) = undefined
| 108
|
dynApply (Dynamic (Fun ta tr) f) (Dynamic ta' x) = undefined
| 60
| true
| true
| 0
| 12
| 27
| 57
| 27
| 30
| null | null |
jfischoff/minimal-resource-protocol
|
src/MRP/QuasiQuoter.hs
|
bsd-3-clause
|
cty = quasiquote exts typenames P.parseType
| 46
|
cty = quasiquote exts typenames P.parseType
| 46
|
cty = quasiquote exts typenames P.parseType
| 46
| false
| false
| 1
| 6
| 8
| 18
| 7
| 11
| null | null |
heades/Agda-LLS
|
Source/ALL/Languages/ILL/Parser/Tokenizer.hs
|
bsd-3-clause
|
constParser :: Monad m => ALLTok -> ParsecT [Token] u m ()
constParser t = satisfy p <?> show t
where
p (t',_) | t == t' = Just ()
p _ = Nothing
| 154
|
constParser :: Monad m => ALLTok -> ParsecT [Token] u m ()
constParser t = satisfy p <?> show t
where
p (t',_) | t == t' = Just ()
p _ = Nothing
| 154
|
constParser t = satisfy p <?> show t
where
p (t',_) | t == t' = Just ()
p _ = Nothing
| 95
| false
| true
| 0
| 8
| 43
| 91
| 42
| 49
| null | null |
yanatan16/doczen-generator
|
test/DoczenTest/Test.hs
|
mit
|
case_parse_no_eol_at_eof = testParse "No EOL at EOF" "Title\n---\n## Heading" $ Document (Header "Title") [Section [] [Heading H2 $ ec "Heading"]]
| 146
|
case_parse_no_eol_at_eof = testParse "No EOL at EOF" "Title\n---\n## Heading" $ Document (Header "Title") [Section [] [Heading H2 $ ec "Heading"]]
| 146
|
case_parse_no_eol_at_eof = testParse "No EOL at EOF" "Title\n---\n## Heading" $ Document (Header "Title") [Section [] [Heading H2 $ ec "Heading"]]
| 146
| false
| false
| 0
| 11
| 19
| 49
| 23
| 26
| null | null |
Alasdair/Mella
|
Lang/Tactic/Waldmeister.hs
|
bsd-3-clause
|
decAllUnnameds n x = x
| 22
|
decAllUnnameds n x = x
| 22
|
decAllUnnameds n x = x
| 22
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
39aldo39/klfc
|
src/Util.hs
|
gpl-3.0
|
concatMapM ∷ (Monad m, Traversable t) ⇒ (α → m [β]) → t α → m [β]
concatMapM f = fmap concat ∘ traverse f
| 105
|
concatMapM ∷ (Monad m, Traversable t) ⇒ (α → m [β]) → t α → m [β]
concatMapM f = fmap concat ∘ traverse f
| 105
|
concatMapM f = fmap concat ∘ traverse f
| 39
| false
| true
| 0
| 10
| 24
| 69
| 34
| 35
| null | null |
copton/ocram
|
ocram/src/Ocram/Util.hs
|
gpl-2.0
|
fromJust' err Nothing = err "fromJust failed"
| 45
|
fromJust' err Nothing = err "fromJust failed"
| 45
|
fromJust' err Nothing = err "fromJust failed"
| 45
| false
| false
| 0
| 5
| 6
| 14
| 6
| 8
| null | null |
tekul/cryptonite
|
Crypto/Cipher/CAST5/Primitive.hs
|
bsd-3-clause
|
-- Encryption
-- | Encrypts a block using the specified key
encrypt :: Key -> Word64 -> Word64
encrypt k = comp64 . cast_enc k . decomp64
| 138
|
encrypt :: Key -> Word64 -> Word64
encrypt k = comp64 . cast_enc k . decomp64
| 77
|
encrypt k = comp64 . cast_enc k . decomp64
| 42
| true
| true
| 0
| 7
| 27
| 35
| 18
| 17
| null | null |
oldmanmike/ghc
|
compiler/typecheck/TcType.hs
|
bsd-3-clause
|
pickyEqType :: TcType -> TcType -> Bool
-- Check when two types _look_ the same, _including_ synonyms.
-- So (pickyEqType String [Char]) returns False
-- This ignores kinds and coercions, because this is used only for printing.
pickyEqType ty1 ty2
= isNothing $
tc_eq_type (const Nothing) ty1 ty2
| 302
|
pickyEqType :: TcType -> TcType -> Bool
pickyEqType ty1 ty2
= isNothing $
tc_eq_type (const Nothing) ty1 ty2
| 114
|
pickyEqType ty1 ty2
= isNothing $
tc_eq_type (const Nothing) ty1 ty2
| 74
| true
| true
| 2
| 8
| 53
| 51
| 24
| 27
| null | null |
rzil/honours
|
DeepLearning/Tracking/BoxTrack.hs
|
mit
|
-- finds a labelling that maximises the sum of IOUs, approximately using greedy algorithm
labelBoxesGreedy :: [Box] -> [Box] -> [Int]
labelBoxesGreedy xs ys = labelBoxesGreedy' xs (zip [0..] ys)
where
labelBoxesGreedy' [] _ = []
labelBoxesGreedy' (x:xs) ys = let (idx,(jdx,_)) = maximumBy (on compare (iou x . snd . snd)) (zip [0..] ys) in jdx : labelBoxesGreedy' xs (deleteAt idx ys)
-- finds a labelling that maximises the sum of IOUs, approximately using improved greedy algorithm that looks at all pairs at each step
| 526
|
labelBoxesGreedy :: [Box] -> [Box] -> [Int]
labelBoxesGreedy xs ys = labelBoxesGreedy' xs (zip [0..] ys)
where
labelBoxesGreedy' [] _ = []
labelBoxesGreedy' (x:xs) ys = let (idx,(jdx,_)) = maximumBy (on compare (iou x . snd . snd)) (zip [0..] ys) in jdx : labelBoxesGreedy' xs (deleteAt idx ys)
-- finds a labelling that maximises the sum of IOUs, approximately using improved greedy algorithm that looks at all pairs at each step
| 436
|
labelBoxesGreedy xs ys = labelBoxesGreedy' xs (zip [0..] ys)
where
labelBoxesGreedy' [] _ = []
labelBoxesGreedy' (x:xs) ys = let (idx,(jdx,_)) = maximumBy (on compare (iou x . snd . snd)) (zip [0..] ys) in jdx : labelBoxesGreedy' xs (deleteAt idx ys)
-- finds a labelling that maximises the sum of IOUs, approximately using improved greedy algorithm that looks at all pairs at each step
| 392
| true
| true
| 0
| 15
| 91
| 168
| 86
| 82
| null | null |
HIPERFIT/futhark
|
src/Futhark/Analysis/PrimExp.hs
|
isc
|
-- | Boolean negation smart constructor.
bNot :: TPrimExp Bool v -> TPrimExp Bool v
bNot = TPrimExp . UnOpExp Not . untyped
| 123
|
bNot :: TPrimExp Bool v -> TPrimExp Bool v
bNot = TPrimExp . UnOpExp Not . untyped
| 82
|
bNot = TPrimExp . UnOpExp Not . untyped
| 39
| true
| true
| 0
| 7
| 22
| 37
| 18
| 19
| null | null |
olsner/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 |
sdiehl/ghc
|
testsuite/tests/typecheck/should_run/T1735_Help/Basics.hs
|
bsd-3-clause
|
mkDataType :: String -> [Constr] -> DataType
mkDataType str cs = DataType
{ tycon = str
, datarep = AlgRep cs
}
| 185
|
mkDataType :: String -> [Constr] -> DataType
mkDataType str cs = DataType
{ tycon = str
, datarep = AlgRep cs
}
| 185
|
mkDataType str cs = DataType
{ tycon = str
, datarep = AlgRep cs
}
| 140
| false
| true
| 0
| 7
| 95
| 44
| 24
| 20
| null | null |
rahulmutt/codec-jvm
|
src/Codec/JVM/ASM/Code.hs
|
apache-2.0
|
if_icmpge = intBranch2 OP.if_icmpge
| 35
|
if_icmpge = intBranch2 OP.if_icmpge
| 35
|
if_icmpge = intBranch2 OP.if_icmpge
| 35
| false
| false
| 1
| 6
| 3
| 14
| 5
| 9
| null | null |
ocharles/virtual-dom
|
src/VirtualDom/HTML.hs
|
bsd-3-clause
|
mark_ :: (Term arg result) => arg -> result
mark_ = term "mark"
| 63
|
mark_ :: (Term arg result) => arg -> result
mark_ = term "mark"
| 63
|
mark_ = term "mark"
| 19
| false
| true
| 0
| 8
| 12
| 36
| 16
| 20
| null | null |
robeverest/accelerate
|
Data/Array/Accelerate/Analysis/Type.hs
|
bsd-3-clause
|
-- |Reify the result types of of a scalar expression using the expression AST before tying the
-- knot.
--
preExpType :: forall acc aenv env t.
AccType acc
-> PreOpenExp acc aenv env t
-> TupleType (EltRepr t)
preExpType k e =
case e of
Let _ _ -> eltType (undefined::t)
Var _ -> eltType (undefined::t)
Const _ -> eltType (undefined::t)
Tuple _ -> eltType (undefined::t)
Prj _ _ -> eltType (undefined::t)
IndexNil -> eltType (undefined::t)
IndexCons _ _ -> eltType (undefined::t)
IndexHead _ -> eltType (undefined::t)
IndexTail _ -> eltType (undefined::t)
IndexAny -> eltType (undefined::t)
IndexSlice _ _ _ -> eltType (undefined::t)
IndexFull _ _ _ -> eltType (undefined::t)
ToIndex _ _ -> eltType (undefined::t)
FromIndex _ _ -> eltType (undefined::t)
Cond _ t _ -> preExpType k t
Iterate _ _ _ -> eltType (undefined::t)
PrimConst _ -> eltType (undefined::t)
PrimApp _ _ -> eltType (undefined::t)
Index acc _ -> k acc
LinearIndex acc _ -> k acc
Shape _ -> eltType (undefined::t)
ShapeSize _ -> eltType (undefined::t)
Intersect _ _ -> eltType (undefined::t)
-- |Size of a tuple type, in bytes
--
| 1,376
|
preExpType :: forall acc aenv env t.
AccType acc
-> PreOpenExp acc aenv env t
-> TupleType (EltRepr t)
preExpType k e =
case e of
Let _ _ -> eltType (undefined::t)
Var _ -> eltType (undefined::t)
Const _ -> eltType (undefined::t)
Tuple _ -> eltType (undefined::t)
Prj _ _ -> eltType (undefined::t)
IndexNil -> eltType (undefined::t)
IndexCons _ _ -> eltType (undefined::t)
IndexHead _ -> eltType (undefined::t)
IndexTail _ -> eltType (undefined::t)
IndexAny -> eltType (undefined::t)
IndexSlice _ _ _ -> eltType (undefined::t)
IndexFull _ _ _ -> eltType (undefined::t)
ToIndex _ _ -> eltType (undefined::t)
FromIndex _ _ -> eltType (undefined::t)
Cond _ t _ -> preExpType k t
Iterate _ _ _ -> eltType (undefined::t)
PrimConst _ -> eltType (undefined::t)
PrimApp _ _ -> eltType (undefined::t)
Index acc _ -> k acc
LinearIndex acc _ -> k acc
Shape _ -> eltType (undefined::t)
ShapeSize _ -> eltType (undefined::t)
Intersect _ _ -> eltType (undefined::t)
-- |Size of a tuple type, in bytes
--
| 1,269
|
preExpType k e =
case e of
Let _ _ -> eltType (undefined::t)
Var _ -> eltType (undefined::t)
Const _ -> eltType (undefined::t)
Tuple _ -> eltType (undefined::t)
Prj _ _ -> eltType (undefined::t)
IndexNil -> eltType (undefined::t)
IndexCons _ _ -> eltType (undefined::t)
IndexHead _ -> eltType (undefined::t)
IndexTail _ -> eltType (undefined::t)
IndexAny -> eltType (undefined::t)
IndexSlice _ _ _ -> eltType (undefined::t)
IndexFull _ _ _ -> eltType (undefined::t)
ToIndex _ _ -> eltType (undefined::t)
FromIndex _ _ -> eltType (undefined::t)
Cond _ t _ -> preExpType k t
Iterate _ _ _ -> eltType (undefined::t)
PrimConst _ -> eltType (undefined::t)
PrimApp _ _ -> eltType (undefined::t)
Index acc _ -> k acc
LinearIndex acc _ -> k acc
Shape _ -> eltType (undefined::t)
ShapeSize _ -> eltType (undefined::t)
Intersect _ _ -> eltType (undefined::t)
-- |Size of a tuple type, in bytes
--
| 1,130
| true
| true
| 0
| 11
| 465
| 492
| 246
| 246
| null | null |
facebookincubator/duckling
|
Duckling/Time/FR/Rules.hs
|
bsd-3-clause
|
ruleMilieuDaprsmidi :: Rule
ruleMilieuDaprsmidi = Rule
{ name = "milieu d'après-midi"
, pattern =
[ regex "(au |en )?milieu (d'|de l')apr(e|é|è)s( |\\-)midi"
]
, prod = \_ -> Token Time . partOfDay <$>
interval TTime.Open (hour False 14) (hour False 17)
}
| 277
|
ruleMilieuDaprsmidi :: Rule
ruleMilieuDaprsmidi = Rule
{ name = "milieu d'après-midi"
, pattern =
[ regex "(au |en )?milieu (d'|de l')apr(e|é|è)s( |\\-)midi"
]
, prod = \_ -> Token Time . partOfDay <$>
interval TTime.Open (hour False 14) (hour False 17)
}
| 277
|
ruleMilieuDaprsmidi = Rule
{ name = "milieu d'après-midi"
, pattern =
[ regex "(au |en )?milieu (d'|de l')apr(e|é|è)s( |\\-)midi"
]
, prod = \_ -> Token Time . partOfDay <$>
interval TTime.Open (hour False 14) (hour False 17)
}
| 249
| false
| true
| 0
| 12
| 63
| 82
| 43
| 39
| null | null |
nbloomf/st-haskell
|
src/STH/CharReplace/Main.hs
|
gpl-3.0
|
main :: IO ()
main = do
args <- getArgs
(notflag,from,to) <- do
let
(flag,rest) = case args of
("--not":xs) -> (True,xs)
xs -> (False,xs)
(from,to) <- case rest of
[as] -> case readCharSeq (bsUnEsc as) of
Just xs -> return (xs, "")
Nothing -> argError
[as,bs] -> case readCharSeq (bsUnEsc as) of
Just xs -> return (xs, bsUnEsc bs)
Nothing -> argError
otherwise -> argError
return (flag,from,to)
let
remove = case notflag of
False -> filter (not . (`elem` from))
True -> filter (`elem` from)
let
replace = case notflag of
False -> concatMap
(\x -> if x`elem`from then to else [x])
True -> concatMap
(\x -> if x`elem`from then [x] else to)
case to of
"" -> charFilter remove
otherwise -> charFilter replace
exitSuccess
| 912
|
main :: IO ()
main = do
args <- getArgs
(notflag,from,to) <- do
let
(flag,rest) = case args of
("--not":xs) -> (True,xs)
xs -> (False,xs)
(from,to) <- case rest of
[as] -> case readCharSeq (bsUnEsc as) of
Just xs -> return (xs, "")
Nothing -> argError
[as,bs] -> case readCharSeq (bsUnEsc as) of
Just xs -> return (xs, bsUnEsc bs)
Nothing -> argError
otherwise -> argError
return (flag,from,to)
let
remove = case notflag of
False -> filter (not . (`elem` from))
True -> filter (`elem` from)
let
replace = case notflag of
False -> concatMap
(\x -> if x`elem`from then to else [x])
True -> concatMap
(\x -> if x`elem`from then [x] else to)
case to of
"" -> charFilter remove
otherwise -> charFilter replace
exitSuccess
| 912
|
main = do
args <- getArgs
(notflag,from,to) <- do
let
(flag,rest) = case args of
("--not":xs) -> (True,xs)
xs -> (False,xs)
(from,to) <- case rest of
[as] -> case readCharSeq (bsUnEsc as) of
Just xs -> return (xs, "")
Nothing -> argError
[as,bs] -> case readCharSeq (bsUnEsc as) of
Just xs -> return (xs, bsUnEsc bs)
Nothing -> argError
otherwise -> argError
return (flag,from,to)
let
remove = case notflag of
False -> filter (not . (`elem` from))
True -> filter (`elem` from)
let
replace = case notflag of
False -> concatMap
(\x -> if x`elem`from then to else [x])
True -> concatMap
(\x -> if x`elem`from then [x] else to)
case to of
"" -> charFilter remove
otherwise -> charFilter replace
exitSuccess
| 898
| false
| true
| 0
| 19
| 321
| 385
| 203
| 182
| null | null |
lukexi/gl-pal
|
src/Graphics/GL/Pal/Framebuffer.hs
|
bsd-3-clause
|
msaaSamplesToNum MSAASamples4 = 4
| 33
|
msaaSamplesToNum MSAASamples4 = 4
| 33
|
msaaSamplesToNum MSAASamples4 = 4
| 33
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
jac3km4/haskit
|
src/LuaJIT/ByteCode.hs
|
mit
|
callm a b c = Instruction 61 $ ThreeArgs a b c
| 46
|
callm a b c = Instruction 61 $ ThreeArgs a b c
| 46
|
callm a b c = Instruction 61 $ ThreeArgs a b c
| 46
| false
| false
| 1
| 6
| 11
| 32
| 12
| 20
| null | null |
mpickering/hackage-server
|
Distribution/Server/Pages/Template.hs
|
bsd-3-clause
|
-- URL of the package list
pkgListURL :: URL
pkgListURL = "/packages/"
| 70
|
pkgListURL :: URL
pkgListURL = "/packages/"
| 43
|
pkgListURL = "/packages/"
| 25
| true
| true
| 0
| 4
| 11
| 12
| 7
| 5
| null | null |
ghcjs/jsaddle-dom
|
src/JSDOM/Generated/CanvasRenderingContext2D.hs
|
mit
|
-- | <https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.lineWidth Mozilla CanvasRenderingContext2D.lineWidth documentation>
setLineWidth ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
setLineWidth self val
= liftDOM (self ^. jss "lineWidth" (toJSVal val))
| 309
|
setLineWidth ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
setLineWidth self val
= liftDOM (self ^. jss "lineWidth" (toJSVal val))
| 160
|
setLineWidth self val
= liftDOM (self ^. jss "lineWidth" (toJSVal val))
| 73
| true
| true
| 0
| 10
| 43
| 60
| 30
| 30
| null | null |
TransformingMusicology/tabcode-haskell
|
src/TabCode/Serialiser/MEIXML/Elements.hs
|
gpl-3.0
|
tuning t = error $ "Unknown tuning name: " ++ t
| 47
|
tuning t = error $ "Unknown tuning name: " ++ t
| 47
|
tuning t = error $ "Unknown tuning name: " ++ t
| 47
| false
| false
| 3
| 5
| 10
| 21
| 8
| 13
| null | null |
unisonweb/platform
|
codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs
|
mit
|
loadPrimaryHashByObjectId :: EDB m => ObjectId -> m Base32Hex
loadPrimaryHashByObjectId oId = queryAtom sql (Only oId) >>= orError (UnknownObjectId oId)
where sql = [here|
SELECT hash.base32
FROM hash INNER JOIN object ON object.primary_hash_id = hash.id
WHERE object.id = ?
|]
| 284
|
loadPrimaryHashByObjectId :: EDB m => ObjectId -> m Base32Hex
loadPrimaryHashByObjectId oId = queryAtom sql (Only oId) >>= orError (UnknownObjectId oId)
where sql = [here|
SELECT hash.base32
FROM hash INNER JOIN object ON object.primary_hash_id = hash.id
WHERE object.id = ?
|]
| 284
|
loadPrimaryHashByObjectId oId = queryAtom sql (Only oId) >>= orError (UnknownObjectId oId)
where sql = [here|
SELECT hash.base32
FROM hash INNER JOIN object ON object.primary_hash_id = hash.id
WHERE object.id = ?
|]
| 222
| false
| true
| 0
| 8
| 46
| 64
| 32
| 32
| null | null |
potomak/haskell-player
|
src/Sound/Player.hs
|
bsd-3-clause
|
theMap :: A.AttrMap
theMap = A.attrMap V.defAttr
[ (L.listAttr, V.white `on` V.blue)
, (L.listSelectedAttr, V.blue `on` V.white)
, (P.progressCompleteAttr, V.blue `on` V.white)
]
| 202
|
theMap :: A.AttrMap
theMap = A.attrMap V.defAttr
[ (L.listAttr, V.white `on` V.blue)
, (L.listSelectedAttr, V.blue `on` V.white)
, (P.progressCompleteAttr, V.blue `on` V.white)
]
| 202
|
theMap = A.attrMap V.defAttr
[ (L.listAttr, V.white `on` V.blue)
, (L.listSelectedAttr, V.blue `on` V.white)
, (P.progressCompleteAttr, V.blue `on` V.white)
]
| 182
| false
| true
| 0
| 8
| 46
| 86
| 50
| 36
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/cabal/Cabal/Distribution/Simple/HaskellSuite.hs
|
bsd-3-clause
|
getCompilerVersion :: Verbosity -> ConfiguredProgram -> IO (String, Version)
getCompilerVersion verbosity prog = do
output <- rawSystemStdout verbosity (programPath prog) ["--compiler-version"]
let
parts = words output
name = concat $ init parts -- there shouldn't be any spaces in the name anyway
versionStr = last parts
version <-
maybe (die "haskell-suite: couldn't determine compiler version") return $
simpleParse versionStr
return (name, version)
| 482
|
getCompilerVersion :: Verbosity -> ConfiguredProgram -> IO (String, Version)
getCompilerVersion verbosity prog = do
output <- rawSystemStdout verbosity (programPath prog) ["--compiler-version"]
let
parts = words output
name = concat $ init parts -- there shouldn't be any spaces in the name anyway
versionStr = last parts
version <-
maybe (die "haskell-suite: couldn't determine compiler version") return $
simpleParse versionStr
return (name, version)
| 482
|
getCompilerVersion verbosity prog = do
output <- rawSystemStdout verbosity (programPath prog) ["--compiler-version"]
let
parts = words output
name = concat $ init parts -- there shouldn't be any spaces in the name anyway
versionStr = last parts
version <-
maybe (die "haskell-suite: couldn't determine compiler version") return $
simpleParse versionStr
return (name, version)
| 405
| false
| true
| 0
| 11
| 91
| 126
| 61
| 65
| null | null |
olsner/ghc
|
libraries/compact/tests/compact_mutable.hs
|
bsd-3-clause
|
main = do
m <- newEmptyMVar
compact (HiddenMVar m)
| 54
|
main = do
m <- newEmptyMVar
compact (HiddenMVar m)
| 54
|
main = do
m <- newEmptyMVar
compact (HiddenMVar m)
| 54
| false
| false
| 0
| 9
| 12
| 25
| 11
| 14
| null | null |
urbanslug/ghc
|
compiler/prelude/THNames.hs
|
bsd-3-clause
|
-- data RuleMatch = ...
conLikeDataConName, funLikeDataConName :: Name
conLikeDataConName = thCon (fsLit "ConLike") conLikeDataConKey
| 133
|
conLikeDataConName, funLikeDataConName :: Name
conLikeDataConName = thCon (fsLit "ConLike") conLikeDataConKey
| 109
|
conLikeDataConName = thCon (fsLit "ConLike") conLikeDataConKey
| 62
| true
| true
| 2
| 7
| 14
| 33
| 14
| 19
| null | null |
jwiegley/ghc-release
|
libraries/Cabal/cabal-install/Distribution/Client/Init/Heuristics.hs
|
gpl-3.0
|
findImportsAndExts :: FilePath -> SourceFileEntry -> IO SourceFileEntry
findImportsAndExts projectRoot sf = do
s <- readFile (sfToFileName projectRoot sf)
let modules = mapMaybe
( getModName
. drop 1
. filter (not . null)
. dropWhile (/= "import")
. words
)
. filter (not . ("--" `isPrefixOf`)) -- poor man's comment filtering
. lines
$ s
-- XXX we should probably make a better attempt at parsing
-- comments above. Unfortunately we can't use a full-fledged
-- Haskell parser since cabal's dependencies must be kept at a
-- minimum.
-- A poor man's LANGUAGE pragma parser.
exts = mapMaybe simpleParse
. concatMap getPragmas
. filter isLANGUAGEPragma
. map fst
. drop 1
. takeWhile (not . null . snd)
. iterate (takeBraces . snd)
$ ("",s)
takeBraces = break (== '}') . dropWhile (/= '{')
isLANGUAGEPragma = ("{-# LANGUAGE " `isPrefixOf`)
getPragmas = map trim . splitCommas . takeWhile (/= '#') . drop 13
splitCommas "" = []
splitCommas xs = x : splitCommas (drop 1 y)
where (x,y) = break (==',') xs
return sf { imports = modules
, extensions = exts
}
where getModName :: [String] -> Maybe ModuleName
getModName [] = Nothing
getModName ("qualified":ws) = getModName ws
getModName (ms:_) = simpleParse ms
-- Unfortunately we cannot use the version exported by Distribution.Simple.Program
| 1,667
|
findImportsAndExts :: FilePath -> SourceFileEntry -> IO SourceFileEntry
findImportsAndExts projectRoot sf = do
s <- readFile (sfToFileName projectRoot sf)
let modules = mapMaybe
( getModName
. drop 1
. filter (not . null)
. dropWhile (/= "import")
. words
)
. filter (not . ("--" `isPrefixOf`)) -- poor man's comment filtering
. lines
$ s
-- XXX we should probably make a better attempt at parsing
-- comments above. Unfortunately we can't use a full-fledged
-- Haskell parser since cabal's dependencies must be kept at a
-- minimum.
-- A poor man's LANGUAGE pragma parser.
exts = mapMaybe simpleParse
. concatMap getPragmas
. filter isLANGUAGEPragma
. map fst
. drop 1
. takeWhile (not . null . snd)
. iterate (takeBraces . snd)
$ ("",s)
takeBraces = break (== '}') . dropWhile (/= '{')
isLANGUAGEPragma = ("{-# LANGUAGE " `isPrefixOf`)
getPragmas = map trim . splitCommas . takeWhile (/= '#') . drop 13
splitCommas "" = []
splitCommas xs = x : splitCommas (drop 1 y)
where (x,y) = break (==',') xs
return sf { imports = modules
, extensions = exts
}
where getModName :: [String] -> Maybe ModuleName
getModName [] = Nothing
getModName ("qualified":ws) = getModName ws
getModName (ms:_) = simpleParse ms
-- Unfortunately we cannot use the version exported by Distribution.Simple.Program
| 1,667
|
findImportsAndExts projectRoot sf = do
s <- readFile (sfToFileName projectRoot sf)
let modules = mapMaybe
( getModName
. drop 1
. filter (not . null)
. dropWhile (/= "import")
. words
)
. filter (not . ("--" `isPrefixOf`)) -- poor man's comment filtering
. lines
$ s
-- XXX we should probably make a better attempt at parsing
-- comments above. Unfortunately we can't use a full-fledged
-- Haskell parser since cabal's dependencies must be kept at a
-- minimum.
-- A poor man's LANGUAGE pragma parser.
exts = mapMaybe simpleParse
. concatMap getPragmas
. filter isLANGUAGEPragma
. map fst
. drop 1
. takeWhile (not . null . snd)
. iterate (takeBraces . snd)
$ ("",s)
takeBraces = break (== '}') . dropWhile (/= '{')
isLANGUAGEPragma = ("{-# LANGUAGE " `isPrefixOf`)
getPragmas = map trim . splitCommas . takeWhile (/= '#') . drop 13
splitCommas "" = []
splitCommas xs = x : splitCommas (drop 1 y)
where (x,y) = break (==',') xs
return sf { imports = modules
, extensions = exts
}
where getModName :: [String] -> Maybe ModuleName
getModName [] = Nothing
getModName ("qualified":ws) = getModName ws
getModName (ms:_) = simpleParse ms
-- Unfortunately we cannot use the version exported by Distribution.Simple.Program
| 1,595
| false
| true
| 0
| 20
| 594
| 413
| 215
| 198
| null | null |
printedheart/atomspace
|
opencog/haskell/OpenCog/AtomSpace/Template.hs
|
agpl-3.0
|
toCamelCase :: String -> String
toCamelCase = concat
. map capital
. words
. map repl
where
repl '_' = ' '
repl x = x
capital (x:xs) = toUpper x : map toLower xs
capital [] = []
-- | 'toTypeName' given an atomtype generates a phantom type notation for it.
| 324
|
toCamelCase :: String -> String
toCamelCase = concat
. map capital
. words
. map repl
where
repl '_' = ' '
repl x = x
capital (x:xs) = toUpper x : map toLower xs
capital [] = []
-- | 'toTypeName' given an atomtype generates a phantom type notation for it.
| 324
|
toCamelCase = concat
. map capital
. words
. map repl
where
repl '_' = ' '
repl x = x
capital (x:xs) = toUpper x : map toLower xs
capital [] = []
-- | 'toTypeName' given an atomtype generates a phantom type notation for it.
| 292
| false
| true
| 7
| 7
| 120
| 108
| 46
| 62
| null | null |
Happstack/happstack-server
|
src/Happstack/Server/Internal/Types.hs
|
bsd-3-clause
|
setHeader :: HasHeaders r => String -> String -> r -> r
setHeader key val = setHeaderBS (pack key) (pack val)
| 109
|
setHeader :: HasHeaders r => String -> String -> r -> r
setHeader key val = setHeaderBS (pack key) (pack val)
| 109
|
setHeader key val = setHeaderBS (pack key) (pack val)
| 53
| false
| true
| 0
| 8
| 20
| 52
| 25
| 27
| null | null |
harendra-kumar/asyncly
|
src/Streamly/Internal/Benchmark/Prelude.hs
|
bsd-3-clause
|
eqBy' :: (Monad m, P.Eq a) => Stream m a -> m P.Bool
eqBy' src = S.eqBy (==) src src
| 84
|
eqBy' :: (Monad m, P.Eq a) => Stream m a -> m P.Bool
eqBy' src = S.eqBy (==) src src
| 84
|
eqBy' src = S.eqBy (==) src src
| 31
| false
| true
| 0
| 9
| 19
| 63
| 29
| 34
| null | null |
johnpmayer/sized-index
|
src/Data/BTree/Internal.hs
|
agpl-3.0
|
search' key (Internal (cpts,keys)) = search' key $ choosePointer key cpts keys
| 78
|
search' key (Internal (cpts,keys)) = search' key $ choosePointer key cpts keys
| 78
|
search' key (Internal (cpts,keys)) = search' key $ choosePointer key cpts keys
| 78
| false
| false
| 0
| 8
| 11
| 37
| 18
| 19
| null | null |
ivanperez-keera/SpaceInvaders
|
src/RenderLandscape.hs
|
bsd-3-clause
|
-- Points defining the ground.
groundPoints :: [HGL.Point]
groundPoints = map relativeToGPoint
[ (0.00, 0.00),
(0.00, 0.05),
(1.00, 0.05),
(1.00, 0.00)
]
| 254
|
groundPoints :: [HGL.Point]
groundPoints = map relativeToGPoint
[ (0.00, 0.00),
(0.00, 0.05),
(1.00, 0.05),
(1.00, 0.00)
]
| 223
|
groundPoints = map relativeToGPoint
[ (0.00, 0.00),
(0.00, 0.05),
(1.00, 0.05),
(1.00, 0.00)
]
| 195
| true
| true
| 0
| 7
| 122
| 58
| 36
| 22
| null | null |
deech/stack
|
src/Stack/Solver.hs
|
bsd-3-clause
|
getResolverConstraints
:: (StackM env m, HasConfig env, HasGHCVariant env)
=> Path Abs File
-> Resolver
-> m (CompilerVersion,
Map PackageName (Version, Map FlagName Bool))
getResolverConstraints stackYaml resolver = do
(mbp, _loadedResolver) <- loadResolver (Just stackYaml) resolver
return (mbpCompilerVersion mbp, mbpConstraints mbp)
where
mpiConstraints mpi = (mpiVersion mpi, mpiFlags mpi)
mbpConstraints mbp = fmap mpiConstraints (mbpPackages mbp)
-- | Given a bundle of user packages, flag constraints on those packages and a
-- resolver, determine if the resolver fully, partially or fails to satisfy the
-- dependencies of the user packages.
--
-- If the package flags are passed as 'Nothing' then flags are chosen
-- automatically.
| 786
|
getResolverConstraints
:: (StackM env m, HasConfig env, HasGHCVariant env)
=> Path Abs File
-> Resolver
-> m (CompilerVersion,
Map PackageName (Version, Map FlagName Bool))
getResolverConstraints stackYaml resolver = do
(mbp, _loadedResolver) <- loadResolver (Just stackYaml) resolver
return (mbpCompilerVersion mbp, mbpConstraints mbp)
where
mpiConstraints mpi = (mpiVersion mpi, mpiFlags mpi)
mbpConstraints mbp = fmap mpiConstraints (mbpPackages mbp)
-- | Given a bundle of user packages, flag constraints on those packages and a
-- resolver, determine if the resolver fully, partially or fails to satisfy the
-- dependencies of the user packages.
--
-- If the package flags are passed as 'Nothing' then flags are chosen
-- automatically.
| 786
|
getResolverConstraints stackYaml resolver = do
(mbp, _loadedResolver) <- loadResolver (Just stackYaml) resolver
return (mbpCompilerVersion mbp, mbpConstraints mbp)
where
mpiConstraints mpi = (mpiVersion mpi, mpiFlags mpi)
mbpConstraints mbp = fmap mpiConstraints (mbpPackages mbp)
-- | Given a bundle of user packages, flag constraints on those packages and a
-- resolver, determine if the resolver fully, partially or fails to satisfy the
-- dependencies of the user packages.
--
-- If the package flags are passed as 'Nothing' then flags are chosen
-- automatically.
| 587
| false
| true
| 2
| 13
| 150
| 177
| 86
| 91
| null | null |
stu-smith/project-euler-haskell
|
Euler-027.hs
|
mit
|
numPrimesInQuadratic a b
= length $ takeWhile nthIsPrime [0..]
where nthIsPrime n = isPrime $ toInteger $ abs $ n * n + a * n + b
| 137
|
numPrimesInQuadratic a b
= length $ takeWhile nthIsPrime [0..]
where nthIsPrime n = isPrime $ toInteger $ abs $ n * n + a * n + b
| 137
|
numPrimesInQuadratic a b
= length $ takeWhile nthIsPrime [0..]
where nthIsPrime n = isPrime $ toInteger $ abs $ n * n + a * n + b
| 137
| false
| false
| 0
| 11
| 35
| 61
| 30
| 31
| null | null |
green-haskell/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
text s = docToSDoc $ Pretty.text s
| 39
|
text s = docToSDoc $ Pretty.text s
| 39
|
text s = docToSDoc $ Pretty.text s
| 39
| false
| false
| 0
| 7
| 11
| 18
| 8
| 10
| null | null |
fpco/cabal
|
Cabal/Distribution/Simple/Setup.hs
|
bsd-3-clause
|
fromFlag :: Flag a -> a
fromFlag (Flag x) = x
| 45
|
fromFlag :: Flag a -> a
fromFlag (Flag x) = x
| 45
|
fromFlag (Flag x) = x
| 21
| false
| true
| 0
| 7
| 10
| 27
| 13
| 14
| null | null |
epsilonhalbe/minesweeper
|
tests/Tests.hs
|
bsd-3-clause
|
gameBoard53 = unlines ["xx-" ,"x--" ,"xx-"]
| 43
|
gameBoard53 = unlines ["xx-" ,"x--" ,"xx-"]
| 43
|
gameBoard53 = unlines ["xx-" ,"x--" ,"xx-"]
| 43
| false
| false
| 1
| 5
| 5
| 21
| 10
| 11
| null | null |
dec9ue/jhc_copygc
|
src/Interactive.hs
|
gpl-2.0
|
nameTag Val = 'f'
| 17
|
nameTag Val = 'f'
| 17
|
nameTag Val = 'f'
| 17
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
Fuuzetsu/haddock
|
haddock-api/src/Haddock/Backends/Xhtml.hs
|
bsd-2-clause
|
processExport summary _ _ qual (ExportDoc doc)
= nothingIf summary $ docSection_ Nothing qual doc
| 99
|
processExport summary _ _ qual (ExportDoc doc)
= nothingIf summary $ docSection_ Nothing qual doc
| 99
|
processExport summary _ _ qual (ExportDoc doc)
= nothingIf summary $ docSection_ Nothing qual doc
| 99
| false
| false
| 0
| 7
| 16
| 37
| 17
| 20
| null | null |
andyarvanitis/Idris-dev
|
src/IRTS/CodegenC.hs
|
bsd-3-clause
|
doOp v (LTrunc (ITFixed from) ITChar) [x]
= doOp v (LTrunc (ITFixed from) ITNative) [x]
| 91
|
doOp v (LTrunc (ITFixed from) ITChar) [x]
= doOp v (LTrunc (ITFixed from) ITNative) [x]
| 91
|
doOp v (LTrunc (ITFixed from) ITChar) [x]
= doOp v (LTrunc (ITFixed from) ITNative) [x]
| 91
| false
| false
| 0
| 9
| 18
| 54
| 27
| 27
| null | null |
GaloisInc/pads-haskell
|
Examples/Regression.hs
|
bsd-3-clause
|
result1 = t1 == ppt1
| 20
|
result1 = t1 == ppt1
| 20
|
result1 = t1 == ppt1
| 20
| false
| false
| 0
| 5
| 4
| 10
| 5
| 5
| null | null |
peddie/fingertrees
|
src/Data/FingerTree/OrderedSequence.hs
|
bsd-3-clause
|
deleteAll :: Ord a => OSeq a -> a -> OSeq a
deleteAll (OSeq tree) v = OSeq $ lt <> gt
where
(lt, geq) = split (>= Key v) tree
gt = snd $ split (> Key v) geq
| 166
|
deleteAll :: Ord a => OSeq a -> a -> OSeq a
deleteAll (OSeq tree) v = OSeq $ lt <> gt
where
(lt, geq) = split (>= Key v) tree
gt = snd $ split (> Key v) geq
| 166
|
deleteAll (OSeq tree) v = OSeq $ lt <> gt
where
(lt, geq) = split (>= Key v) tree
gt = snd $ split (> Key v) geq
| 122
| false
| true
| 0
| 8
| 49
| 99
| 49
| 50
| null | null |
xpika/boolean-list
|
Data/BooleanList.hs
|
gpl-3.0
|
booleanListToIntegersTerminated = booleanListToIntegers'' True True
| 67
|
booleanListToIntegersTerminated = booleanListToIntegers'' True True
| 67
|
booleanListToIntegersTerminated = booleanListToIntegers'' True True
| 67
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
ribag/ganeti-experiments
|
src/Ganeti/Constants.hs
|
gpl-2.0
|
dsValidTypes :: FrozenSet String
dsValidTypes = ConstantUtils.mkSet [Types.diskTemplateToRaw DTPlain]
| 101
|
dsValidTypes :: FrozenSet String
dsValidTypes = ConstantUtils.mkSet [Types.diskTemplateToRaw DTPlain]
| 101
|
dsValidTypes = ConstantUtils.mkSet [Types.diskTemplateToRaw DTPlain]
| 68
| false
| true
| 0
| 8
| 8
| 27
| 13
| 14
| null | null |
PavelClaudiuStefan/FMI
|
An_3_Semestru_1/ProgramareDeclarativa/Laboratoare/Laborator1Optional/PicturesSVG.hs
|
cc0-1.0
|
flatten (x,y) (Invert pic) = map flipNeg $ flatten (x,y) pic
| 66
|
flatten (x,y) (Invert pic) = map flipNeg $ flatten (x,y) pic
| 66
|
flatten (x,y) (Invert pic) = map flipNeg $ flatten (x,y) pic
| 66
| false
| false
| 0
| 7
| 16
| 41
| 21
| 20
| null | null |
ulricha/dsh-example-queries
|
Queries/TPCH/Standard/Q15.hs
|
bsd-3-clause
|
-- | TPC-H Query Q15
q15 :: Day -> Q [(Integer, (Text, Text, Text, Decimal))]
q15 startDate =
sortWith fst
[ pair (s_suppkeyQ s)
(tup4 (s_nameQ s)
(s_addressQ s)
(s_phoneQ s)
total_rev)
| s <- suppliers
, (view -> (supplier_no, total_rev)) <- revenueInInterval startDate
, s_suppkeyQ s == supplier_no
, total_rev == (maximum $ map snd $ revenueInInterval startDate)
]
| 457
|
q15 :: Day -> Q [(Integer, (Text, Text, Text, Decimal))]
q15 startDate =
sortWith fst
[ pair (s_suppkeyQ s)
(tup4 (s_nameQ s)
(s_addressQ s)
(s_phoneQ s)
total_rev)
| s <- suppliers
, (view -> (supplier_no, total_rev)) <- revenueInInterval startDate
, s_suppkeyQ s == supplier_no
, total_rev == (maximum $ map snd $ revenueInInterval startDate)
]
| 436
|
q15 startDate =
sortWith fst
[ pair (s_suppkeyQ s)
(tup4 (s_nameQ s)
(s_addressQ s)
(s_phoneQ s)
total_rev)
| s <- suppliers
, (view -> (supplier_no, total_rev)) <- revenueInInterval startDate
, s_suppkeyQ s == supplier_no
, total_rev == (maximum $ map snd $ revenueInInterval startDate)
]
| 379
| true
| true
| 0
| 12
| 149
| 166
| 84
| 82
| null | null |
tlaitinen/mailchimp
|
test/hunit.hs
|
bsd-3-clause
|
lists_clients cfg lid = do
runMailchimpLogging cfg $ do
!_ <- clients lid
return ()
| 93
|
lists_clients cfg lid = do
runMailchimpLogging cfg $ do
!_ <- clients lid
return ()
| 93
|
lists_clients cfg lid = do
runMailchimpLogging cfg $ do
!_ <- clients lid
return ()
| 93
| false
| false
| 0
| 11
| 24
| 40
| 16
| 24
| null | null |
gcampax/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
fromListNClassOpKey = mkPreludeMiscIdUnique 500
| 47
|
fromListNClassOpKey = mkPreludeMiscIdUnique 500
| 47
|
fromListNClassOpKey = mkPreludeMiscIdUnique 500
| 47
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
brendanhay/gogol
|
gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types/Product.hs
|
mpl-2.0
|
-- | End of time span.
tsEndTime :: Lens' TimeSpan (Maybe UTCTime)
tsEndTime
= lens _tsEndTime (\ s a -> s{_tsEndTime = a}) .
mapping _DateTime
| 151
|
tsEndTime :: Lens' TimeSpan (Maybe UTCTime)
tsEndTime
= lens _tsEndTime (\ s a -> s{_tsEndTime = a}) .
mapping _DateTime
| 128
|
tsEndTime
= lens _tsEndTime (\ s a -> s{_tsEndTime = a}) .
mapping _DateTime
| 84
| true
| true
| 0
| 10
| 33
| 55
| 28
| 27
| null | null |
blt/core_erlang
|
Language/Erlang/Parser.hs
|
mit
|
quote :: ParsecT String u Identity String
quote = Lexer.symbol "'"
| 66
|
quote :: ParsecT String u Identity String
quote = Lexer.symbol "'"
| 66
|
quote = Lexer.symbol "'"
| 24
| false
| true
| 0
| 6
| 10
| 25
| 12
| 13
| null | null |
haskell-esp/ejercicios-beginning-haskell
|
cap02/src/2-7-A-TimeMachineRecords.hs
|
mpl-2.0
|
tmList = [ (TimeMachineR "ACME" 123 "Ok1" ToPast 100.0)
, (TimeMachineR "Hskl" 007 "Ok2" ToFuture 150.0)
]
| 126
|
tmList = [ (TimeMachineR "ACME" 123 "Ok1" ToPast 100.0)
, (TimeMachineR "Hskl" 007 "Ok2" ToFuture 150.0)
]
| 126
|
tmList = [ (TimeMachineR "ACME" 123 "Ok1" ToPast 100.0)
, (TimeMachineR "Hskl" 007 "Ok2" ToFuture 150.0)
]
| 126
| false
| false
| 1
| 7
| 36
| 43
| 21
| 22
| null | null |
ctford/Idris-Elba-dev
|
src/IRTS/Java/JTypes.hs
|
bsd-3-clause
|
globalContext :: Exp
globalContext = ExpName $ Name [globalContextID]
| 69
|
globalContext :: Exp
globalContext = ExpName $ Name [globalContextID]
| 69
|
globalContext = ExpName $ Name [globalContextID]
| 48
| false
| true
| 0
| 7
| 8
| 21
| 11
| 10
| null | null |
vincenthz/hs-foundation
|
foundation/Foundation/Format/CSV/Parser.hs
|
bsd-3-clause
|
file :: Parser String CSV
file = do
mh <- optional $ header <* elements crlf
x <- record
xs <- some $ elements crlf *> record
void $ optional $ elements crlf
pure $ fromList $ case mh of
Nothing -> x : xs
Just h -> h : x : xs
| 262
|
file :: Parser String CSV
file = do
mh <- optional $ header <* elements crlf
x <- record
xs <- some $ elements crlf *> record
void $ optional $ elements crlf
pure $ fromList $ case mh of
Nothing -> x : xs
Just h -> h : x : xs
| 262
|
file = do
mh <- optional $ header <* elements crlf
x <- record
xs <- some $ elements crlf *> record
void $ optional $ elements crlf
pure $ fromList $ case mh of
Nothing -> x : xs
Just h -> h : x : xs
| 236
| false
| true
| 1
| 13
| 89
| 120
| 53
| 67
| null | null |
portnov/xtt
|
XMonad/TimeTracker/Syntax.hs
|
bsd-3-clause
|
toStrings (LitList xs) = concatMap toStrings xs
| 47
|
toStrings (LitList xs) = concatMap toStrings xs
| 47
|
toStrings (LitList xs) = concatMap toStrings xs
| 47
| false
| false
| 0
| 7
| 6
| 20
| 9
| 11
| null | null |
lawrencelomax/ResultWorthy
|
ResultWorthy/SwiftParsers.hs
|
bsd-3-clause
|
parseSwiftModule :: String -> Either ParseError SwiftModule
parseSwiftModule = parseString swiftModuleParser
| 108
|
parseSwiftModule :: String -> Either ParseError SwiftModule
parseSwiftModule = parseString swiftModuleParser
| 108
|
parseSwiftModule = parseString swiftModuleParser
| 48
| false
| true
| 0
| 6
| 10
| 23
| 11
| 12
| null | null |
d0kt0r0/Tidal
|
src/Sound/Tidal/ParseBP.hs
|
gpl-3.0
|
pVar :: MyParser (TPat a)
pVar = wrapPos $ do char '^'
name <- many (letter <|> oneOf "0123456789:.-_") <?> "string"
return $ TPat_Var name
| 179
|
pVar :: MyParser (TPat a)
pVar = wrapPos $ do char '^'
name <- many (letter <|> oneOf "0123456789:.-_") <?> "string"
return $ TPat_Var name
| 179
|
pVar = wrapPos $ do char '^'
name <- many (letter <|> oneOf "0123456789:.-_") <?> "string"
return $ TPat_Var name
| 153
| false
| true
| 2
| 13
| 64
| 71
| 30
| 41
| null | null |
mstksg/hledger
|
hledger-lib/Hledger/Reports/TransactionsReports.hs
|
gpl-3.0
|
accountTransactionsReportItems reportq thisacctq bal signfn (torig:ts) =
case i of Just i' -> i':is
Nothing -> is
-- 201403: This is used for both accountTransactionsReport and journalTransactionsReport, which makes it a bit overcomplicated
-- 201407: I've lost my grip on this, let's just hope for the best
-- 201606: we now calculate change and balance from filtered postings, check this still works well for all callers XXX
where
tfiltered@Transaction{tpostings=reportps} = filterTransactionPostings reportq torig
tacct = tfiltered{tdate=transactionRegisterDate reportq thisacctq tfiltered}
(i,bal') = case reportps of
[] -> (Nothing,bal) -- no matched postings in this transaction, skip it
_ -> (Just (torig, tacct, numotheraccts > 1, otheracctstr, a, b), b)
where
(thisacctps, otheracctps) = partition (matchesPosting thisacctq) reportps
numotheraccts = length $ nub $ map paccount otheracctps
otheracctstr | thisacctq == None = summarisePostingAccounts reportps -- no current account ? summarise all matched postings
| numotheraccts == 0 = summarisePostingAccounts thisacctps -- only postings to current account ? summarise those
| otherwise = summarisePostingAccounts otheracctps -- summarise matched postings to other account(s)
a = signfn $ negate $ sum $ map pamount thisacctps
b = bal + a
is = accountTransactionsReportItems reportq thisacctq bal' signfn ts
-- | What is the transaction's date in the context of a particular account
-- (specified with a query) and report query, as in an account register ?
-- It's normally the transaction's general date, but if any posting(s)
-- matched by the report query and affecting the matched account(s) have
-- their own earlier dates, it's the earliest of these dates.
-- Secondary transaction/posting dates are ignored.
| 2,044
|
accountTransactionsReportItems reportq thisacctq bal signfn (torig:ts) =
case i of Just i' -> i':is
Nothing -> is
-- 201403: This is used for both accountTransactionsReport and journalTransactionsReport, which makes it a bit overcomplicated
-- 201407: I've lost my grip on this, let's just hope for the best
-- 201606: we now calculate change and balance from filtered postings, check this still works well for all callers XXX
where
tfiltered@Transaction{tpostings=reportps} = filterTransactionPostings reportq torig
tacct = tfiltered{tdate=transactionRegisterDate reportq thisacctq tfiltered}
(i,bal') = case reportps of
[] -> (Nothing,bal) -- no matched postings in this transaction, skip it
_ -> (Just (torig, tacct, numotheraccts > 1, otheracctstr, a, b), b)
where
(thisacctps, otheracctps) = partition (matchesPosting thisacctq) reportps
numotheraccts = length $ nub $ map paccount otheracctps
otheracctstr | thisacctq == None = summarisePostingAccounts reportps -- no current account ? summarise all matched postings
| numotheraccts == 0 = summarisePostingAccounts thisacctps -- only postings to current account ? summarise those
| otherwise = summarisePostingAccounts otheracctps -- summarise matched postings to other account(s)
a = signfn $ negate $ sum $ map pamount thisacctps
b = bal + a
is = accountTransactionsReportItems reportq thisacctq bal' signfn ts
-- | What is the transaction's date in the context of a particular account
-- (specified with a query) and report query, as in an account register ?
-- It's normally the transaction's general date, but if any posting(s)
-- matched by the report query and affecting the matched account(s) have
-- their own earlier dates, it's the earliest of these dates.
-- Secondary transaction/posting dates are ignored.
| 2,044
|
accountTransactionsReportItems reportq thisacctq bal signfn (torig:ts) =
case i of Just i' -> i':is
Nothing -> is
-- 201403: This is used for both accountTransactionsReport and journalTransactionsReport, which makes it a bit overcomplicated
-- 201407: I've lost my grip on this, let's just hope for the best
-- 201606: we now calculate change and balance from filtered postings, check this still works well for all callers XXX
where
tfiltered@Transaction{tpostings=reportps} = filterTransactionPostings reportq torig
tacct = tfiltered{tdate=transactionRegisterDate reportq thisacctq tfiltered}
(i,bal') = case reportps of
[] -> (Nothing,bal) -- no matched postings in this transaction, skip it
_ -> (Just (torig, tacct, numotheraccts > 1, otheracctstr, a, b), b)
where
(thisacctps, otheracctps) = partition (matchesPosting thisacctq) reportps
numotheraccts = length $ nub $ map paccount otheracctps
otheracctstr | thisacctq == None = summarisePostingAccounts reportps -- no current account ? summarise all matched postings
| numotheraccts == 0 = summarisePostingAccounts thisacctps -- only postings to current account ? summarise those
| otherwise = summarisePostingAccounts otheracctps -- summarise matched postings to other account(s)
a = signfn $ negate $ sum $ map pamount thisacctps
b = bal + a
is = accountTransactionsReportItems reportq thisacctq bal' signfn ts
-- | What is the transaction's date in the context of a particular account
-- (specified with a query) and report query, as in an account register ?
-- It's normally the transaction's general date, but if any posting(s)
-- matched by the report query and affecting the matched account(s) have
-- their own earlier dates, it's the earliest of these dates.
-- Secondary transaction/posting dates are ignored.
| 2,044
| false
| false
| 3
| 14
| 530
| 295
| 158
| 137
| null | null |
acharal/hopes
|
src/frontend/WellForm.hs
|
gpl-2.0
|
-- well formatted program
wfp p = do
(p', env) <- tcProg p
(p'', env) <- restrictProg (p', env)
env <- zonkEnv env
return (p', env)
-- well formatted formula
| 175
|
wfp p = do
(p', env) <- tcProg p
(p'', env) <- restrictProg (p', env)
env <- zonkEnv env
return (p', env)
-- well formatted formula
| 149
|
wfp p = do
(p', env) <- tcProg p
(p'', env) <- restrictProg (p', env)
env <- zonkEnv env
return (p', env)
-- well formatted formula
| 149
| true
| false
| 0
| 9
| 47
| 71
| 36
| 35
| null | null |
mohsen3/csv-conduit
|
src/Data/CSV/Conduit/Conversion/Internal.hs
|
bsd-3-clause
|
realFloat = toByteString . formatRealFloat Generic
| 50
|
realFloat = toByteString . formatRealFloat Generic
| 50
|
realFloat = toByteString . formatRealFloat Generic
| 50
| false
| false
| 0
| 6
| 5
| 13
| 6
| 7
| null | null |
project-oak/silveroak
|
investigations/lava/Lava.hs
|
apache-2.0
|
{-
*Lava> sim1
[True,False,False,True]
-}
sim2 :: [Bool]
sim2 = runIdentity $
and2 ([False, True, False, True],
[False, False, True, True]
)
| 175
|
sim2 :: [Bool]
sim2 = runIdentity $
and2 ([False, True, False, True],
[False, False, True, True]
)
| 132
|
sim2 = runIdentity $
and2 ([False, True, False, True],
[False, False, True, True]
)
| 117
| true
| true
| 0
| 8
| 56
| 52
| 32
| 20
| null | null |
intolerable/GroupProject
|
src/Emulator/Video/TileMode.hs
|
bsd-2-clause
|
mapRow column mapIndex palFormat tileMapRow tileSet (xOff, yOff) palette setBaseAddr =
Tile pixData tileCoords:mapRow (column-1) (mapIndex + 0x00000002) palFormat tileMapRow tileSet (xOff + 8, yOff) palette setBaseAddr
where
pixData = pixelData palFormat palette tile palBank
tile = getTile palFormat tileIdx tileSet
upperByte = (tileMapRow!(mapIndex + 0x00000001))
lowerByte = (tileMapRow!mapIndex)
(tileIdx, _hFlip, _vFlip, palBank) = parseScreenEntry lowerByte upperByte palFormat setBaseAddr
tileCoords = ((xOff, yOff), (xOff+8, yOff), (xOff, yOff+8), (xOff+8, yOff+8))
-- NEED TO SORT HFLIP AND VFLIP WHEN GRAPHICS RUN
-- a is the lower byte, b is the upper
| 691
|
mapRow column mapIndex palFormat tileMapRow tileSet (xOff, yOff) palette setBaseAddr =
Tile pixData tileCoords:mapRow (column-1) (mapIndex + 0x00000002) palFormat tileMapRow tileSet (xOff + 8, yOff) palette setBaseAddr
where
pixData = pixelData palFormat palette tile palBank
tile = getTile palFormat tileIdx tileSet
upperByte = (tileMapRow!(mapIndex + 0x00000001))
lowerByte = (tileMapRow!mapIndex)
(tileIdx, _hFlip, _vFlip, palBank) = parseScreenEntry lowerByte upperByte palFormat setBaseAddr
tileCoords = ((xOff, yOff), (xOff+8, yOff), (xOff, yOff+8), (xOff+8, yOff+8))
-- NEED TO SORT HFLIP AND VFLIP WHEN GRAPHICS RUN
-- a is the lower byte, b is the upper
| 691
|
mapRow column mapIndex palFormat tileMapRow tileSet (xOff, yOff) palette setBaseAddr =
Tile pixData tileCoords:mapRow (column-1) (mapIndex + 0x00000002) palFormat tileMapRow tileSet (xOff + 8, yOff) palette setBaseAddr
where
pixData = pixelData palFormat palette tile palBank
tile = getTile palFormat tileIdx tileSet
upperByte = (tileMapRow!(mapIndex + 0x00000001))
lowerByte = (tileMapRow!mapIndex)
(tileIdx, _hFlip, _vFlip, palBank) = parseScreenEntry lowerByte upperByte palFormat setBaseAddr
tileCoords = ((xOff, yOff), (xOff+8, yOff), (xOff, yOff+8), (xOff+8, yOff+8))
-- NEED TO SORT HFLIP AND VFLIP WHEN GRAPHICS RUN
-- a is the lower byte, b is the upper
| 691
| false
| false
| 7
| 8
| 117
| 256
| 125
| 131
| null | null |
m4dc4p/haskelldb
|
test/old/test-sum.hs
|
bsd-3-clause
|
test db
= do
result <- query db q
mapM_ (putStrLn . show) result
| 81
|
test db
= do
result <- query db q
mapM_ (putStrLn . show) result
| 81
|
test db
= do
result <- query db q
mapM_ (putStrLn . show) result
| 81
| false
| false
| 1
| 10
| 30
| 40
| 16
| 24
| null | null |
tjakway/ghcjvm
|
includes/CodeGen.Platform.hs
|
bsd-3-clause
|
globalRegMaybe (ZmmReg 1) = Just (RealRegSingle REG_ZMM1)
| 71
|
globalRegMaybe (ZmmReg 1) = Just (RealRegSingle REG_ZMM1)
| 71
|
globalRegMaybe (ZmmReg 1) = Just (RealRegSingle REG_ZMM1)
| 71
| false
| false
| 0
| 7
| 20
| 24
| 11
| 13
| null | null |
mfejzer/knuth-bendix-completion
|
KnuthBendixCompletion/Tests.hs
|
bsd-3-clause
|
apply f n args = f (apply f (n-1) args)
| 39
|
apply f n args = f (apply f (n-1) args)
| 39
|
apply f n args = f (apply f (n-1) args)
| 39
| false
| false
| 0
| 9
| 9
| 33
| 16
| 17
| null | null |
tismith/tlisp
|
write-yourself-a-scheme/listings/listing6.1.hs
|
mit
|
primitives :: [(String, [LispVal] -> ThrowsError LispVal)]
primitives = [("+", numericBinop (+)),
("-", numericBinop (-)),
("*", numericBinop (*)),
("/", numericBinop div),
("mod", numericBinop mod),
("quotient", numericBinop quot),
("remainder", numericBinop rem),
("=", numBoolBinop (==)),
("<", numBoolBinop (<)),
(">", numBoolBinop (>)),
("/=", numBoolBinop (/=)),
(">=", numBoolBinop (>=)),
("<=", numBoolBinop (<=)),
("&&", boolBoolBinop (&&)),
("||", boolBoolBinop (||)),
("string=?", strBoolBinop (==)),
("string?", strBoolBinop (>)),
("string<=?", strBoolBinop (<=)),
("string>=?", strBoolBinop (>=))]
| 862
|
primitives :: [(String, [LispVal] -> ThrowsError LispVal)]
primitives = [("+", numericBinop (+)),
("-", numericBinop (-)),
("*", numericBinop (*)),
("/", numericBinop div),
("mod", numericBinop mod),
("quotient", numericBinop quot),
("remainder", numericBinop rem),
("=", numBoolBinop (==)),
("<", numBoolBinop (<)),
(">", numBoolBinop (>)),
("/=", numBoolBinop (/=)),
(">=", numBoolBinop (>=)),
("<=", numBoolBinop (<=)),
("&&", boolBoolBinop (&&)),
("||", boolBoolBinop (||)),
("string=?", strBoolBinop (==)),
("string?", strBoolBinop (>)),
("string<=?", strBoolBinop (<=)),
("string>=?", strBoolBinop (>=))]
| 862
|
primitives = [("+", numericBinop (+)),
("-", numericBinop (-)),
("*", numericBinop (*)),
("/", numericBinop div),
("mod", numericBinop mod),
("quotient", numericBinop quot),
("remainder", numericBinop rem),
("=", numBoolBinop (==)),
("<", numBoolBinop (<)),
(">", numBoolBinop (>)),
("/=", numBoolBinop (/=)),
(">=", numBoolBinop (>=)),
("<=", numBoolBinop (<=)),
("&&", boolBoolBinop (&&)),
("||", boolBoolBinop (||)),
("string=?", strBoolBinop (==)),
("string?", strBoolBinop (>)),
("string<=?", strBoolBinop (<=)),
("string>=?", strBoolBinop (>=))]
| 803
| false
| true
| 0
| 10
| 317
| 295
| 181
| 114
| null | null |
SamirTalwar/Smoke
|
src/lib/Test/Smoke/Plan.hs
|
mit
|
handleMissingFileError :: RelativePath File -> IOError -> SmokeFileError
handleMissingFileError path e =
if isDoesNotExistError e
then MissingFile path
else CouldNotReadFile path e
| 190
|
handleMissingFileError :: RelativePath File -> IOError -> SmokeFileError
handleMissingFileError path e =
if isDoesNotExistError e
then MissingFile path
else CouldNotReadFile path e
| 190
|
handleMissingFileError path e =
if isDoesNotExistError e
then MissingFile path
else CouldNotReadFile path e
| 117
| false
| true
| 0
| 6
| 31
| 46
| 22
| 24
| null | null |
denisenkom/hsmssql
|
TestMain.hs
|
mit
|
test_getInstances =
let s = "\ENQ\179\NULServerName;sqlhost;InstanceName;SQLEXPRESS;" ++
"IsClustered;No;Version;10.0.1600.22;tcp;49849;;" ++
"ServerName;sqlhost;InstanceName;SQL2012;IsClustered;" ++
"No;Version;11.0.2100.60;tcp;59958;;"
bs = BS.pack $ map (fromIntegral . ord) s
ref = [
M.fromList [("InstanceName","SQL2012"),
("IsClustered","No"),
("ServerName","sqlhost"),
("Version","11.0.2100.60"),
("tcp","59958")],
M.fromList [("InstanceName","SQLEXPRESS"),
("IsClustered","No"),
("ServerName","sqlhost"),
("Version","10.0.1600.22"),
("tcp","49849")]]
(decoded, _) = runGet getInstances bs
in
assertEqual (Right ref) decoded
| 923
|
test_getInstances =
let s = "\ENQ\179\NULServerName;sqlhost;InstanceName;SQLEXPRESS;" ++
"IsClustered;No;Version;10.0.1600.22;tcp;49849;;" ++
"ServerName;sqlhost;InstanceName;SQL2012;IsClustered;" ++
"No;Version;11.0.2100.60;tcp;59958;;"
bs = BS.pack $ map (fromIntegral . ord) s
ref = [
M.fromList [("InstanceName","SQL2012"),
("IsClustered","No"),
("ServerName","sqlhost"),
("Version","11.0.2100.60"),
("tcp","59958")],
M.fromList [("InstanceName","SQLEXPRESS"),
("IsClustered","No"),
("ServerName","sqlhost"),
("Version","10.0.1600.22"),
("tcp","49849")]]
(decoded, _) = runGet getInstances bs
in
assertEqual (Right ref) decoded
| 923
|
test_getInstances =
let s = "\ENQ\179\NULServerName;sqlhost;InstanceName;SQLEXPRESS;" ++
"IsClustered;No;Version;10.0.1600.22;tcp;49849;;" ++
"ServerName;sqlhost;InstanceName;SQL2012;IsClustered;" ++
"No;Version;11.0.2100.60;tcp;59958;;"
bs = BS.pack $ map (fromIntegral . ord) s
ref = [
M.fromList [("InstanceName","SQL2012"),
("IsClustered","No"),
("ServerName","sqlhost"),
("Version","11.0.2100.60"),
("tcp","59958")],
M.fromList [("InstanceName","SQLEXPRESS"),
("IsClustered","No"),
("ServerName","sqlhost"),
("Version","10.0.1600.22"),
("tcp","49849")]]
(decoded, _) = runGet getInstances bs
in
assertEqual (Right ref) decoded
| 923
| false
| false
| 0
| 12
| 338
| 191
| 111
| 80
| null | null |
Heather/hackport
|
Main.hs
|
gpl-3.0
|
mergeCommand :: CommandUI MergeFlags
mergeCommand = CommandUI {
commandName = "merge",
commandSynopsis = "Make an ebuild out of hackage package",
commandDescription = Just $ \_pname ->
"TODO: this is the commandDescription for mergeCommand\n",
commandUsage = usagePackages "merge",
commandDefaultFlags = defaultMergeFlags,
commandOptions = \_showOrParseArgs ->
[ optionVerbosity mergeVerbosity (\v flags -> flags { mergeVerbosity = v })
, option "f" ["flags"]
(unlines [ "Set cabal flags to certain state."
, "Example: --flags=-all_extensions"
])
mergeCabalFlags
(\cabal_flags v -> v{ mergeCabalFlags = cabal_flags})
(reqArg' "cabal_flags" (Flag . Just) (\(Flag ms) -> catMaybes [ms]))
]
}
| 806
|
mergeCommand :: CommandUI MergeFlags
mergeCommand = CommandUI {
commandName = "merge",
commandSynopsis = "Make an ebuild out of hackage package",
commandDescription = Just $ \_pname ->
"TODO: this is the commandDescription for mergeCommand\n",
commandUsage = usagePackages "merge",
commandDefaultFlags = defaultMergeFlags,
commandOptions = \_showOrParseArgs ->
[ optionVerbosity mergeVerbosity (\v flags -> flags { mergeVerbosity = v })
, option "f" ["flags"]
(unlines [ "Set cabal flags to certain state."
, "Example: --flags=-all_extensions"
])
mergeCabalFlags
(\cabal_flags v -> v{ mergeCabalFlags = cabal_flags})
(reqArg' "cabal_flags" (Flag . Just) (\(Flag ms) -> catMaybes [ms]))
]
}
| 806
|
mergeCommand = CommandUI {
commandName = "merge",
commandSynopsis = "Make an ebuild out of hackage package",
commandDescription = Just $ \_pname ->
"TODO: this is the commandDescription for mergeCommand\n",
commandUsage = usagePackages "merge",
commandDefaultFlags = defaultMergeFlags,
commandOptions = \_showOrParseArgs ->
[ optionVerbosity mergeVerbosity (\v flags -> flags { mergeVerbosity = v })
, option "f" ["flags"]
(unlines [ "Set cabal flags to certain state."
, "Example: --flags=-all_extensions"
])
mergeCabalFlags
(\cabal_flags v -> v{ mergeCabalFlags = cabal_flags})
(reqArg' "cabal_flags" (Flag . Just) (\(Flag ms) -> catMaybes [ms]))
]
}
| 769
| false
| true
| 0
| 15
| 208
| 181
| 104
| 77
| null | null |
cmahon/mvc-service
|
library/MVC/Socket.hs
|
bsd-3-clause
|
socketService :: SocketConfiguration -> Managed SocketService
socketService SocketConfiguration{..} = do
conn <- managed $ \k -> newEmptyConnection >>= k
(vConnection, cConnection, sConnection) <- managed $ \k -> spawn' unbounded >>= k
cSocketIn <- connectionReader (bounded 1) conn 4096 vConnection
managed $ \k -> do
(vServiceIn , cServiceIn , sServiceIn) <- spawn' unbounded
(vServiceOut, cServiceOut, sServiceOut) <- spawn' unbounded
let
sealAll :: IO ()
sealAll = atomically $ sServiceIn >> sServiceOut >> sConnection
view :: View EventOut
view = mconcat
[ --asSink (putStrLn . ("socketService view: " ++) . show)
handles _ServiceOut (asSink $ void . atomically . send vServiceOut)
, handles _SocketOut (asSink $ connectionWriter conn vConnection)
, handles _ConnectionOut (asSink $ connectionHandler _scSocketParams conn vConnection)
]
controller :: Controller EventIn
controller = mconcat
[ ServiceIn <$> asInput cServiceIn
, SocketIn <$> cSocketIn
, ConnectionIn <$> asInput cConnection
]
external :: Managed (View EventOut, Controller EventIn)
external = return (view,controller)
errorHandler :: SomeException -> IO ()
errorHandler e = do
debugM $ "socketService error: " ++ show e
--TODO: take action depending on whehther async (ThreadKilled)
--or sync exception
closeConnection conn
sealAll
--throwIO e
io :: IO ()
io = do
debugM "socketService start"
handle errorHandler $ void $ runMVC def socketServiceModel external
debugM "socketService end"
stop :: Async () -> IO ()
stop a = do
debugM "socket service stop"
closeConnection conn
cancel a
sealAll
withAsync io $ \a -> k (Service vServiceIn cServiceOut) <* stop a
| 1,942
|
socketService :: SocketConfiguration -> Managed SocketService
socketService SocketConfiguration{..} = do
conn <- managed $ \k -> newEmptyConnection >>= k
(vConnection, cConnection, sConnection) <- managed $ \k -> spawn' unbounded >>= k
cSocketIn <- connectionReader (bounded 1) conn 4096 vConnection
managed $ \k -> do
(vServiceIn , cServiceIn , sServiceIn) <- spawn' unbounded
(vServiceOut, cServiceOut, sServiceOut) <- spawn' unbounded
let
sealAll :: IO ()
sealAll = atomically $ sServiceIn >> sServiceOut >> sConnection
view :: View EventOut
view = mconcat
[ --asSink (putStrLn . ("socketService view: " ++) . show)
handles _ServiceOut (asSink $ void . atomically . send vServiceOut)
, handles _SocketOut (asSink $ connectionWriter conn vConnection)
, handles _ConnectionOut (asSink $ connectionHandler _scSocketParams conn vConnection)
]
controller :: Controller EventIn
controller = mconcat
[ ServiceIn <$> asInput cServiceIn
, SocketIn <$> cSocketIn
, ConnectionIn <$> asInput cConnection
]
external :: Managed (View EventOut, Controller EventIn)
external = return (view,controller)
errorHandler :: SomeException -> IO ()
errorHandler e = do
debugM $ "socketService error: " ++ show e
--TODO: take action depending on whehther async (ThreadKilled)
--or sync exception
closeConnection conn
sealAll
--throwIO e
io :: IO ()
io = do
debugM "socketService start"
handle errorHandler $ void $ runMVC def socketServiceModel external
debugM "socketService end"
stop :: Async () -> IO ()
stop a = do
debugM "socket service stop"
closeConnection conn
cancel a
sealAll
withAsync io $ \a -> k (Service vServiceIn cServiceOut) <* stop a
| 1,942
|
socketService SocketConfiguration{..} = do
conn <- managed $ \k -> newEmptyConnection >>= k
(vConnection, cConnection, sConnection) <- managed $ \k -> spawn' unbounded >>= k
cSocketIn <- connectionReader (bounded 1) conn 4096 vConnection
managed $ \k -> do
(vServiceIn , cServiceIn , sServiceIn) <- spawn' unbounded
(vServiceOut, cServiceOut, sServiceOut) <- spawn' unbounded
let
sealAll :: IO ()
sealAll = atomically $ sServiceIn >> sServiceOut >> sConnection
view :: View EventOut
view = mconcat
[ --asSink (putStrLn . ("socketService view: " ++) . show)
handles _ServiceOut (asSink $ void . atomically . send vServiceOut)
, handles _SocketOut (asSink $ connectionWriter conn vConnection)
, handles _ConnectionOut (asSink $ connectionHandler _scSocketParams conn vConnection)
]
controller :: Controller EventIn
controller = mconcat
[ ServiceIn <$> asInput cServiceIn
, SocketIn <$> cSocketIn
, ConnectionIn <$> asInput cConnection
]
external :: Managed (View EventOut, Controller EventIn)
external = return (view,controller)
errorHandler :: SomeException -> IO ()
errorHandler e = do
debugM $ "socketService error: " ++ show e
--TODO: take action depending on whehther async (ThreadKilled)
--or sync exception
closeConnection conn
sealAll
--throwIO e
io :: IO ()
io = do
debugM "socketService start"
handle errorHandler $ void $ runMVC def socketServiceModel external
debugM "socketService end"
stop :: Async () -> IO ()
stop a = do
debugM "socket service stop"
closeConnection conn
cancel a
sealAll
withAsync io $ \a -> k (Service vServiceIn cServiceOut) <* stop a
| 1,880
| false
| true
| 0
| 20
| 550
| 521
| 253
| 268
| null | null |
siddhanathan/ghc
|
testsuite/tests/rename/should_compile/timing001.hs
|
bsd-3-clause
|
a051 = a052
| 11
|
a051 = a052
| 11
|
a051 = a052
| 11
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
christiaanb/Idris-dev
|
src/Core/Elaborate.hs
|
bsd-3-clause
|
getLog :: Elab' aux String
getLog = do ES p logs _ <- get
return logs
-- The primitives, from ProofState
| 117
|
getLog :: Elab' aux String
getLog = do ES p logs _ <- get
return logs
-- The primitives, from ProofState
| 117
|
getLog = do ES p logs _ <- get
return logs
-- The primitives, from ProofState
| 90
| false
| true
| 1
| 9
| 33
| 41
| 17
| 24
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.