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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
atsukotakahashi/wi
|
src/library/Yi/Buffer/Misc.hs
|
gpl-2.0
|
revertPendingUpdatesB :: BufferM ()
revertPendingUpdatesB = do
updates <- use pendingUpdatesA
modifyBuffer (flip (foldr (\u bi -> applyUpdateI (reverseUpdateI u) bi)) [u | TextUpdate u <- updates])
-- | Write an element into the buffer at the current point.
| 262 |
revertPendingUpdatesB :: BufferM ()
revertPendingUpdatesB = do
updates <- use pendingUpdatesA
modifyBuffer (flip (foldr (\u bi -> applyUpdateI (reverseUpdateI u) bi)) [u | TextUpdate u <- updates])
-- | Write an element into the buffer at the current point.
| 262 |
revertPendingUpdatesB = do
updates <- use pendingUpdatesA
modifyBuffer (flip (foldr (\u bi -> applyUpdateI (reverseUpdateI u) bi)) [u | TextUpdate u <- updates])
-- | Write an element into the buffer at the current point.
| 226 | false | true | 0 | 16 | 43 | 82 | 40 | 42 | null | null |
tectronics/rockdodger
|
helpers/make_colourfile.hs
|
gpl-2.0
|
formSpacedots = Cons (chunkIdFromString "SPDT") $ Form [ chunkSparkleNDOT ]
| 75 |
formSpacedots = Cons (chunkIdFromString "SPDT") $ Form [ chunkSparkleNDOT ]
| 75 |
formSpacedots = Cons (chunkIdFromString "SPDT") $ Form [ chunkSparkleNDOT ]
| 75 | false | false | 0 | 8 | 9 | 25 | 12 | 13 | null | null |
kishoredbn/barrelfish
|
hake/TreeDB.hs
|
mit
|
-- Keeps the list sorted by extension
dlAddByExt :: String -> String -> DirList -> DirList
dlAddByExt ext name [] = [(ext, [name])]
| 132 |
dlAddByExt :: String -> String -> DirList -> DirList
dlAddByExt ext name [] = [(ext, [name])]
| 94 |
dlAddByExt ext name [] = [(ext, [name])]
| 40 | true | true | 0 | 10 | 23 | 51 | 26 | 25 | null | null |
brendanhay/gogol
|
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Orders/Get.hs
|
mpl-2.0
|
-- | OAuth access token.
ogAccessToken :: Lens' OrdersGet (Maybe Text)
ogAccessToken
= lens _ogAccessToken
(\ s a -> s{_ogAccessToken = a})
| 147 |
ogAccessToken :: Lens' OrdersGet (Maybe Text)
ogAccessToken
= lens _ogAccessToken
(\ s a -> s{_ogAccessToken = a})
| 122 |
ogAccessToken
= lens _ogAccessToken
(\ s a -> s{_ogAccessToken = a})
| 76 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
rahulmutt/ghcvm
|
compiler/Eta/TypeCheck/TcDefaults.hs
|
bsd-3-clause
|
polyDefErr :: LHsType Name -> SDoc
polyDefErr ty
= hang (ptext (sLit "Illegal polymorphic type in default declaration") <> colon) 2 (ppr ty)
| 142 |
polyDefErr :: LHsType Name -> SDoc
polyDefErr ty
= hang (ptext (sLit "Illegal polymorphic type in default declaration") <> colon) 2 (ppr ty)
| 142 |
polyDefErr ty
= hang (ptext (sLit "Illegal polymorphic type in default declaration") <> colon) 2 (ppr ty)
| 107 | false | true | 0 | 10 | 24 | 50 | 24 | 26 | null | null |
HJvT/hdirect
|
src/Parser.hs
|
bsd-3-clause
|
action_556 x = happyTcHack x happyFail
| 38 |
action_556 x = happyTcHack x happyFail
| 38 |
action_556 x = happyTcHack x happyFail
| 38 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
tolysz/yesod
|
yesod-auth/Yesod/Auth/Email.hs
|
mit
|
-- | Salt a password with a randomly generated salt.
saltPass :: Text -> IO Text
saltPass = fmap (decodeUtf8With lenientDecode)
. flip PS.makePassword 16
. encodeUtf8
| 184 |
saltPass :: Text -> IO Text
saltPass = fmap (decodeUtf8With lenientDecode)
. flip PS.makePassword 16
. encodeUtf8
| 131 |
saltPass = fmap (decodeUtf8With lenientDecode)
. flip PS.makePassword 16
. encodeUtf8
| 103 | true | true | 2 | 7 | 44 | 52 | 22 | 30 | null | null |
wavewave/madgraph-auto-dataset
|
src/HEP/Automation/MadGraph/Dataset/Set20110315set12.hs
|
gpl-3.0
|
psetuplist :: [ProcessSetup]
psetuplist = [ psetup_six_ttbar01j ]
| 65 |
psetuplist :: [ProcessSetup]
psetuplist = [ psetup_six_ttbar01j ]
| 65 |
psetuplist = [ psetup_six_ttbar01j ]
| 36 | false | true | 0 | 5 | 7 | 17 | 10 | 7 | null | null |
bno1/adventofcode_2016
|
d10/main.hs
|
mit
|
clearBot _ = error "Cannot clear non-full bot"
| 46 |
clearBot _ = error "Cannot clear non-full bot"
| 46 |
clearBot _ = error "Cannot clear non-full bot"
| 46 | false | false | 0 | 5 | 7 | 12 | 5 | 7 | null | null |
TrevorBender/lithp
|
src/Lisp.hs
|
gpl-3.0
|
readAll :: [LispVal] -> IOThrowsError LispVal
readAll [String filename] = List <$> (load filename)
| 98 |
readAll :: [LispVal] -> IOThrowsError LispVal
readAll [String filename] = List <$> (load filename)
| 98 |
readAll [String filename] = List <$> (load filename)
| 52 | false | true | 0 | 7 | 13 | 40 | 20 | 20 | null | null |
rueshyna/gogol
|
gogol-compute/gen/Network/Google/Resource/Compute/ForwardingRules/List.hs
|
mpl-2.0
|
-- | Creates a value of 'ForwardingRulesList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'frlOrderBy'
--
-- * 'frlProject'
--
-- * 'frlFilter'
--
-- * 'frlRegion'
--
-- * 'frlPageToken'
--
-- * 'frlMaxResults'
forwardingRulesList
:: Text -- ^ 'frlProject'
-> Text -- ^ 'frlRegion'
-> ForwardingRulesList
forwardingRulesList pFrlProject_ pFrlRegion_ =
ForwardingRulesList'
{ _frlOrderBy = Nothing
, _frlProject = pFrlProject_
, _frlFilter = Nothing
, _frlRegion = pFrlRegion_
, _frlPageToken = Nothing
, _frlMaxResults = 500
}
| 659 |
forwardingRulesList
:: Text -- ^ 'frlProject'
-> Text -- ^ 'frlRegion'
-> ForwardingRulesList
forwardingRulesList pFrlProject_ pFrlRegion_ =
ForwardingRulesList'
{ _frlOrderBy = Nothing
, _frlProject = pFrlProject_
, _frlFilter = Nothing
, _frlRegion = pFrlRegion_
, _frlPageToken = Nothing
, _frlMaxResults = 500
}
| 359 |
forwardingRulesList pFrlProject_ pFrlRegion_ =
ForwardingRulesList'
{ _frlOrderBy = Nothing
, _frlProject = pFrlProject_
, _frlFilter = Nothing
, _frlRegion = pFrlRegion_
, _frlPageToken = Nothing
, _frlMaxResults = 500
}
| 253 | true | true | 0 | 6 | 140 | 79 | 54 | 25 | null | null |
rueshyna/gogol
|
gogol-maps-coordinate/gen/Network/Google/Resource/Coordinate/Jobs/Update.hs
|
mpl-2.0
|
-- | Multipart request metadata.
juPayload :: Lens' JobsUpdate Job
juPayload
= lens _juPayload (\ s a -> s{_juPayload = a})
| 125 |
juPayload :: Lens' JobsUpdate Job
juPayload
= lens _juPayload (\ s a -> s{_juPayload = a})
| 92 |
juPayload
= lens _juPayload (\ s a -> s{_juPayload = a})
| 58 | true | true | 0 | 9 | 22 | 42 | 22 | 20 | null | null |
brendanhay/pagerduty
|
src/Network/PagerDuty/REST/Services.hs
|
mpl-2.0
|
-- | Enable a previously disabled service.
--
-- @PUT services\/\:id\/enable@
--
-- /See:/ <http://developer.pagerduty.com/documentation/rest/services/enable>
enableService :: RequesterId -> ServiceId -> Request Empty s Empty
enableService r i =
auth (enableServiceBasic i) & query .~ [("requester_id", r)]
| 310 |
enableService :: RequesterId -> ServiceId -> Request Empty s Empty
enableService r i =
auth (enableServiceBasic i) & query .~ [("requester_id", r)]
| 151 |
enableService r i =
auth (enableServiceBasic i) & query .~ [("requester_id", r)]
| 84 | true | true | 0 | 9 | 40 | 62 | 34 | 28 | null | null |
robdockins/edison
|
edison-core/src/Data/Edison/Seq/Defaults.hs
|
mit
|
reduce1'UsingLists :: Sequence s => (a -> a -> a) -> s a -> a
reduce1'UsingLists f s = L.reduce1' f (toList s)
| 110 |
reduce1'UsingLists :: Sequence s => (a -> a -> a) -> s a -> a
reduce1'UsingLists f s = L.reduce1' f (toList s)
| 110 |
reduce1'UsingLists f s = L.reduce1' f (toList s)
| 48 | false | true | 0 | 9 | 22 | 58 | 28 | 30 | null | null |
nevrenato/HetsAlloy
|
Temporal/Sign.hs
|
gpl-2.0
|
-- | The empty signature
emptySig :: Sign
emptySig = Sign {items = Set.empty}
| 77 |
emptySig :: Sign
emptySig = Sign {items = Set.empty}
| 52 |
emptySig = Sign {items = Set.empty}
| 35 | true | true | 0 | 8 | 13 | 32 | 15 | 17 | null | null |
sapek/pandoc
|
src/Text/Pandoc/Writers/DokuWiki.hs
|
gpl-2.0
|
-- | Convert Pandoc to DokuWiki.
writeDokuWiki :: WriterOptions -> Pandoc -> String
writeDokuWiki opts document =
runDokuWiki (pandocToDokuWiki opts $ normalize document)
| 172 |
writeDokuWiki :: WriterOptions -> Pandoc -> String
writeDokuWiki opts document =
runDokuWiki (pandocToDokuWiki opts $ normalize document)
| 139 |
writeDokuWiki opts document =
runDokuWiki (pandocToDokuWiki opts $ normalize document)
| 88 | true | true | 0 | 8 | 24 | 41 | 20 | 21 | null | null |
hephaestus-pl/hephaestus
|
alexandre/feature-modeling/src/FeatureModel/Parsers/SPLOT/SPLOT2FeatureModel.hs
|
mit
|
group :: [Child] -> FM.GroupType
group [(SetRelation _ c _)] =
case c of
(Cardinality 1 1) -> FM.AlternativeFeature
(Cardinality _ 1) -> FM.OrFeature
| 156 |
group :: [Child] -> FM.GroupType
group [(SetRelation _ c _)] =
case c of
(Cardinality 1 1) -> FM.AlternativeFeature
(Cardinality _ 1) -> FM.OrFeature
| 156 |
group [(SetRelation _ c _)] =
case c of
(Cardinality 1 1) -> FM.AlternativeFeature
(Cardinality _ 1) -> FM.OrFeature
| 123 | false | true | 0 | 9 | 30 | 77 | 38 | 39 | null | null |
green-haskell/ghc
|
compiler/stgSyn/CoreToStg.hs
|
bsd-3-clause
|
is_join_var :: Id -> Bool
-- A hack (used only for compiler debuggging) to tell if
-- a variable started life as a join point ($j)
is_join_var j = occNameString (getOccName j) == "$j"
| 183 |
is_join_var :: Id -> Bool
is_join_var j = occNameString (getOccName j) == "$j"
| 78 |
is_join_var j = occNameString (getOccName j) == "$j"
| 52 | true | true | 0 | 8 | 33 | 33 | 17 | 16 | null | null |
Cahu/krpc-hs
|
src/KRPCHS/SpaceCenter.hs
|
gpl-3.0
|
{-
- The <a href="https://en.wikipedia.org/wiki/Mean_anomaly">mean anomaly at epoch.
-}
getOrbitMeanAnomalyAtEpoch :: KRPCHS.SpaceCenter.Orbit -> RPCContext (Double)
getOrbitMeanAnomalyAtEpoch thisArg = do
let r = makeRequest "SpaceCenter" "Orbit_get_MeanAnomalyAtEpoch" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res
| 350 |
getOrbitMeanAnomalyAtEpoch :: KRPCHS.SpaceCenter.Orbit -> RPCContext (Double)
getOrbitMeanAnomalyAtEpoch thisArg = do
let r = makeRequest "SpaceCenter" "Orbit_get_MeanAnomalyAtEpoch" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res
| 260 |
getOrbitMeanAnomalyAtEpoch thisArg = do
let r = makeRequest "SpaceCenter" "Orbit_get_MeanAnomalyAtEpoch" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res
| 182 | true | true | 0 | 13 | 47 | 72 | 33 | 39 | null | null |
leepike/SmartCheck
|
regression/Heap/Heap_Program.hs
|
bsd-3-clause
|
empty :: Heap a
empty = Nil
| 27 |
empty :: Heap a
empty = Nil
| 27 |
empty = Nil
| 11 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
Arguggi/heed
|
heed-backend/src/Heed/Server.hs
|
bsd-3-clause
|
-- |Execute an action forever, feeding the result of each execution as the
-- input to the next.
iterateM_
:: Monad m
=> (a -> m a) -> a -> m b
iterateM_ f = g
where
g x = f x >>= g
-- | A new thead has been started for a feed that we maybe already had in the db.
-- If we already had the feed we have to kill the old thread
-- This also has to be done when we modify a feed info since we may have modified
-- the updateEvery field
| 452 |
iterateM_
:: Monad m
=> (a -> m a) -> a -> m b
iterateM_ f = g
where
g x = f x >>= g
-- | A new thead has been started for a feed that we maybe already had in the db.
-- If we already had the feed we have to kill the old thread
-- This also has to be done when we modify a feed info since we may have modified
-- the updateEvery field
| 355 |
iterateM_ f = g
where
g x = f x >>= g
-- | A new thead has been started for a feed that we maybe already had in the db.
-- If we already had the feed we have to kill the old thread
-- This also has to be done when we modify a feed info since we may have modified
-- the updateEvery field
| 300 | true | true | 0 | 9 | 119 | 65 | 34 | 31 | null | null |
romanb/amazonka
|
amazonka-cognito-identity/gen/Network/AWS/CognitoIdentity/SetIdentityPoolRoles.hs
|
mpl-2.0
|
-- | An identity pool ID in the format REGION:GUID.
siprIdentityPoolId :: Lens' SetIdentityPoolRoles Text
siprIdentityPoolId =
lens _siprIdentityPoolId (\s a -> s { _siprIdentityPoolId = a })
| 195 |
siprIdentityPoolId :: Lens' SetIdentityPoolRoles Text
siprIdentityPoolId =
lens _siprIdentityPoolId (\s a -> s { _siprIdentityPoolId = a })
| 143 |
siprIdentityPoolId =
lens _siprIdentityPoolId (\s a -> s { _siprIdentityPoolId = a })
| 89 | true | true | 0 | 9 | 31 | 40 | 22 | 18 | null | null |
AlexeyRaga/eta
|
compiler/ETA/CodeGen/Rts.hs
|
bsd-3-clause
|
bufferType :: FieldType
bufferType = obj buffer
| 47 |
bufferType :: FieldType
bufferType = obj buffer
| 47 |
bufferType = obj buffer
| 23 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
brendanhay/gogol
|
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
|
mpl-2.0
|
-- | Creates a value of 'ListCollectionStatusesResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lcsrNextPageToken'
--
-- * 'lcsrResources'
listCollectionStatusesResponse
:: ListCollectionStatusesResponse
listCollectionStatusesResponse =
ListCollectionStatusesResponse'
{_lcsrNextPageToken = Nothing, _lcsrResources = Nothing}
| 430 |
listCollectionStatusesResponse
:: ListCollectionStatusesResponse
listCollectionStatusesResponse =
ListCollectionStatusesResponse'
{_lcsrNextPageToken = Nothing, _lcsrResources = Nothing}
| 196 |
listCollectionStatusesResponse =
ListCollectionStatusesResponse'
{_lcsrNextPageToken = Nothing, _lcsrResources = Nothing}
| 127 | true | true | 1 | 7 | 59 | 39 | 23 | 16 | null | null |
GaloisInc/ivory
|
ivory-backend-c/src/Ivory/Compile/C/CmdlineFrontend.hs
|
bsd-3-clause
|
runArtifactCompiler :: [Located Artifact] -> FilePath -> FilePath -> FilePath
-> IO ()
runArtifactCompiler las root_dir src_dir incl_dir = do
mes <- sequence
[ case la of
Root a -> putArtifact root_dir a
Src a -> putArtifact src_dir a
Incl a -> putArtifact incl_dir a
| la <- las ]
case catMaybes mes of
[] -> return ()
errs -> error (unlines errs)
--------------------------------------------------------------------------------
| 492 |
runArtifactCompiler :: [Located Artifact] -> FilePath -> FilePath -> FilePath
-> IO ()
runArtifactCompiler las root_dir src_dir incl_dir = do
mes <- sequence
[ case la of
Root a -> putArtifact root_dir a
Src a -> putArtifact src_dir a
Incl a -> putArtifact incl_dir a
| la <- las ]
case catMaybes mes of
[] -> return ()
errs -> error (unlines errs)
--------------------------------------------------------------------------------
| 492 |
runArtifactCompiler las root_dir src_dir incl_dir = do
mes <- sequence
[ case la of
Root a -> putArtifact root_dir a
Src a -> putArtifact src_dir a
Incl a -> putArtifact incl_dir a
| la <- las ]
case catMaybes mes of
[] -> return ()
errs -> error (unlines errs)
--------------------------------------------------------------------------------
| 385 | false | true | 0 | 13 | 126 | 153 | 71 | 82 | null | null |
bergmark/hakyll
|
tests/Hakyll/Web/Template/Context/Tests.hs
|
bsd-3-clause
|
testContextDone :: Store -> Provider -> Identifier -> String
-> Context String -> IO String
testContextDone store provider identifier key context =
testCompilerDone store provider identifier $ do
item <- getResourceBody
unContext context key item
| 282 |
testContextDone :: Store -> Provider -> Identifier -> String
-> Context String -> IO String
testContextDone store provider identifier key context =
testCompilerDone store provider identifier $ do
item <- getResourceBody
unContext context key item
| 282 |
testContextDone store provider identifier key context =
testCompilerDone store provider identifier $ do
item <- getResourceBody
unContext context key item
| 174 | false | true | 0 | 10 | 70 | 76 | 35 | 41 | null | null |
sdiehl/ghc
|
compiler/nativeGen/AsmCodeGen.hs
|
bsd-3-clause
|
cmmToCmm dflags this_mod (CmmProc info lbl live graph)
= runCmmOpt dflags this_mod $
do blocks' <- mapM cmmBlockConFold (toBlockList graph)
return $ CmmProc info lbl live (ofBlockList (g_entry graph) blocks')
-- Avoids using unboxed tuples when loading into GHCi
#if !defined(GHC_LOADED_INTO_GHCI)
| 317 |
cmmToCmm dflags this_mod (CmmProc info lbl live graph)
= runCmmOpt dflags this_mod $
do blocks' <- mapM cmmBlockConFold (toBlockList graph)
return $ CmmProc info lbl live (ofBlockList (g_entry graph) blocks')
-- Avoids using unboxed tuples when loading into GHCi
#if !defined(GHC_LOADED_INTO_GHCI)
| 317 |
cmmToCmm dflags this_mod (CmmProc info lbl live graph)
= runCmmOpt dflags this_mod $
do blocks' <- mapM cmmBlockConFold (toBlockList graph)
return $ CmmProc info lbl live (ofBlockList (g_entry graph) blocks')
-- Avoids using unboxed tuples when loading into GHCi
#if !defined(GHC_LOADED_INTO_GHCI)
| 317 | false | false | 0 | 13 | 60 | 84 | 40 | 44 | null | null |
ghc-android/ghc
|
testsuite/tests/ghci/should_run/ghcirun004.hs
|
bsd-3-clause
|
2182 = 2181
| 11 |
2182 = 2181
| 11 |
2182 = 2181
| 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
ghorn/hois
|
OIS/OISEvents.hs
|
bsd-3-clause
|
eventArg_with :: Object -> (EventArg -> IO a) -> IO a
eventArg_with p1 f = do
obj <- eventArg_new p1
res <- f obj
eventArg_delete obj
return res
| 160 |
eventArg_with :: Object -> (EventArg -> IO a) -> IO a
eventArg_with p1 f = do
obj <- eventArg_new p1
res <- f obj
eventArg_delete obj
return res
| 160 |
eventArg_with p1 f = do
obj <- eventArg_new p1
res <- f obj
eventArg_delete obj
return res
| 106 | false | true | 0 | 10 | 43 | 74 | 31 | 43 | null | null |
IanConnolly/aws-sdk-fork
|
AWS/EC2/Acl.hs
|
bsd-3-clause
|
deleteNetworkAclEntry
:: (MonadResource m, MonadBaseControl IO m)
=> Text -- ^ NetworkAclId
-> Int -- ^ RuleNumber
-> Bool -- ^ Egress
-> EC2 m Bool
deleteNetworkAclEntry aclid rule egress =
ec2Query "DeleteNetworkAclEntry" params $ getT "return"
where
params =
[ "NetworkAclId" |= aclid
, "RuleNumber" |= toText rule
, "Egress" |= boolToText egress
]
| 413 |
deleteNetworkAclEntry
:: (MonadResource m, MonadBaseControl IO m)
=> Text -- ^ NetworkAclId
-> Int -- ^ RuleNumber
-> Bool -- ^ Egress
-> EC2 m Bool
deleteNetworkAclEntry aclid rule egress =
ec2Query "DeleteNetworkAclEntry" params $ getT "return"
where
params =
[ "NetworkAclId" |= aclid
, "RuleNumber" |= toText rule
, "Egress" |= boolToText egress
]
| 413 |
deleteNetworkAclEntry aclid rule egress =
ec2Query "DeleteNetworkAclEntry" params $ getT "return"
where
params =
[ "NetworkAclId" |= aclid
, "RuleNumber" |= toText rule
, "Egress" |= boolToText egress
]
| 244 | false | true | 0 | 10 | 116 | 107 | 53 | 54 | null | null |
vaibhavsagar/duffer.hs
|
duffer/src/Duffer/Pack/Entries.hs
|
bsd-3-clause
|
toAssoc :: PackIndexEntry -> (Int, Ref)
toAssoc (PackIndexEntry o r _) = (o, r)
| 79 |
toAssoc :: PackIndexEntry -> (Int, Ref)
toAssoc (PackIndexEntry o r _) = (o, r)
| 79 |
toAssoc (PackIndexEntry o r _) = (o, r)
| 39 | false | true | 0 | 6 | 13 | 44 | 23 | 21 | null | null |
Noeda/rwpas
|
src/RWPAS/BresenhamLine.hs
|
mit
|
bresenhamLine :: Monad f
=> V2 Int -- ^ Start here.
-> V2 Int -- ^ End here.
-> (V2 Int -> f Bool) -- ^ Return `False` to stop line shooting.
-> f (V2 Int) -- ^ Returns the last point invoked.
bresenhamLine (V2 x1 y1) (V2 x2 y2) fun
| abs (y2-y1) > abs (x2-x1) = do
V2 ry rx <- bresenhamLine (V2 y1 x1) (V2 y2 x2)
(\(V2 y x) -> fun (V2 x y))
return (V2 rx ry)
| x2 < x1 = do
V2 rx ry <- bresenhamLine (V2 (-x1) y1) (V2 (-x2) y2)
(\(V2 x y) -> fun (V2 (-x) y))
return (V2 (-rx) ry)
| y2 < y1 = do
V2 rx ry <- bresenhamLine (V2 x1 (-y1)) (V2 x2 (-y2))
(\(V2 x y) -> fun (V2 x (-y)))
return (V2 rx (-ry))
| otherwise = bresenhamLineG (V2 x1 y1) (V2 x2 y2) fun
| 864 |
bresenhamLine :: Monad f
=> V2 Int -- ^ Start here.
-> V2 Int -- ^ End here.
-> (V2 Int -> f Bool) -- ^ Return `False` to stop line shooting.
-> f (V2 Int)
bresenhamLine (V2 x1 y1) (V2 x2 y2) fun
| abs (y2-y1) > abs (x2-x1) = do
V2 ry rx <- bresenhamLine (V2 y1 x1) (V2 y2 x2)
(\(V2 y x) -> fun (V2 x y))
return (V2 rx ry)
| x2 < x1 = do
V2 rx ry <- bresenhamLine (V2 (-x1) y1) (V2 (-x2) y2)
(\(V2 x y) -> fun (V2 (-x) y))
return (V2 (-rx) ry)
| y2 < y1 = do
V2 rx ry <- bresenhamLine (V2 x1 (-y1)) (V2 x2 (-y2))
(\(V2 x y) -> fun (V2 x (-y)))
return (V2 rx (-ry))
| otherwise = bresenhamLineG (V2 x1 y1) (V2 x2 y2) fun
| 819 |
bresenhamLine (V2 x1 y1) (V2 x2 y2) fun
| abs (y2-y1) > abs (x2-x1) = do
V2 ry rx <- bresenhamLine (V2 y1 x1) (V2 y2 x2)
(\(V2 y x) -> fun (V2 x y))
return (V2 rx ry)
| x2 < x1 = do
V2 rx ry <- bresenhamLine (V2 (-x1) y1) (V2 (-x2) y2)
(\(V2 x y) -> fun (V2 (-x) y))
return (V2 (-rx) ry)
| y2 < y1 = do
V2 rx ry <- bresenhamLine (V2 x1 (-y1)) (V2 x2 (-y2))
(\(V2 x y) -> fun (V2 x (-y)))
return (V2 rx (-ry))
| otherwise = bresenhamLineG (V2 x1 y1) (V2 x2 y2) fun
| 603 | true | true | 3 | 16 | 358 | 442 | 215 | 227 | null | null |
jmgimeno/haskell-playground
|
src/Zippers/Life.hs
|
unlicense
|
get1 g = [extract g]
| 20 |
get1 g = [extract g]
| 20 |
get1 g = [extract g]
| 20 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
epsilonhalbe/accelerate-typelits
|
bench/Data/Array/Accelerate/TypeLits/Random.hs
|
isc
|
rndVector :: forall n e. (KnownNat n, Elt e) => (GenIO -> IO e) -> IO (Vector n e)
-- | mwc random provides a fast and "statistically-safe" random function
rndVector cdf = undefined -- do _r <- randomArray (const $ cdf) sh
{-return undefined-}
where n' = fromInteger $ natVal (Proxy :: Proxy n)
sh = Z:.n'
| 334 |
rndVector :: forall n e. (KnownNat n, Elt e) => (GenIO -> IO e) -> IO (Vector n e)
rndVector cdf = undefined -- do _r <- randomArray (const $ cdf) sh
{-return undefined-}
where n' = fromInteger $ natVal (Proxy :: Proxy n)
sh = Z:.n'
| 261 |
rndVector cdf = undefined -- do _r <- randomArray (const $ cdf) sh
{-return undefined-}
where n' = fromInteger $ natVal (Proxy :: Proxy n)
sh = Z:.n'
| 178 | true | true | 1 | 10 | 86 | 97 | 51 | 46 | null | null |
arcticmatt/happy-site
|
src/SqlTable.hs
|
bsd-3-clause
|
-- Inefficient, but doesn't matter
stripS :: String -> String
stripS = takeWhile (not . isControl) . dropWhile isControl . strip
| 128 |
stripS :: String -> String
stripS = takeWhile (not . isControl) . dropWhile isControl . strip
| 93 |
stripS = takeWhile (not . isControl) . dropWhile isControl . strip
| 66 | true | true | 0 | 9 | 20 | 37 | 19 | 18 | null | null |
gwright83/Wheeler
|
src/Math/Symbolic/Wheeler/CanonicalizeDebug.hs
|
bsd-3-clause
|
isDivideByZero :: Expr -> Bool
isDivideByZero (Const (Q _ 0)) = True
| 68 |
isDivideByZero :: Expr -> Bool
isDivideByZero (Const (Q _ 0)) = True
| 68 |
isDivideByZero (Const (Q _ 0)) = True
| 37 | false | true | 0 | 9 | 11 | 32 | 16 | 16 | null | null |
isturdy/q
|
tests/Data/Queue/SeqTests.hs
|
unlicense
|
prop_id_addList l1 l2 l3 = fromList (l1++l2++l3) == addList q l3
where q = toQueue l1 l2 :: Seq Int
-- Makes a queue from two lists; equivalent to '\l1 l2 -> fromList (l1++l2)'
| 179 |
prop_id_addList l1 l2 l3 = fromList (l1++l2++l3) == addList q l3
where q = toQueue l1 l2 :: Seq Int
-- Makes a queue from two lists; equivalent to '\l1 l2 -> fromList (l1++l2)'
| 179 |
prop_id_addList l1 l2 l3 = fromList (l1++l2++l3) == addList q l3
where q = toQueue l1 l2 :: Seq Int
-- Makes a queue from two lists; equivalent to '\l1 l2 -> fromList (l1++l2)'
| 179 | false | false | 3 | 9 | 36 | 67 | 27 | 40 | null | null |
kishoredbn/barrelfish
|
tools/mackerel/Checks.hs
|
mit
|
check_dups :: [String] -> ( String -> MacError ) -> [ MacError ]
check_dups names errfn = [ errfn n | n <- names \\ nub names ]
| 127 |
check_dups :: [String] -> ( String -> MacError ) -> [ MacError ]
check_dups names errfn = [ errfn n | n <- names \\ nub names ]
| 127 |
check_dups names errfn = [ errfn n | n <- names \\ nub names ]
| 62 | false | true | 0 | 9 | 27 | 58 | 30 | 28 | null | null |
ekr/tamarin-prover
|
lib/term/src/Term/Builtin/Rules.hs
|
gpl-3.0
|
msetRules :: Set (RRule LNTerm)
msetRules = S.empty
| 51 |
msetRules :: Set (RRule LNTerm)
msetRules = S.empty
| 51 |
msetRules = S.empty
| 19 | false | true | 2 | 6 | 7 | 29 | 11 | 18 | null | null |
siddhanathan/ghc
|
libraries/base/Data/OldList.hs
|
bsd-3-clause
|
isPrefixOf (x:xs) (y:ys)= x == y && isPrefixOf xs ys
| 53 |
isPrefixOf (x:xs) (y:ys)= x == y && isPrefixOf xs ys
| 53 |
isPrefixOf (x:xs) (y:ys)= x == y && isPrefixOf xs ys
| 53 | false | false | 0 | 7 | 10 | 38 | 19 | 19 | null | null |
Peaker/lamdu
|
test/Tests/Sugar.hs
|
gpl-3.0
|
assertEq :: (Monad m, Show a, Eq a) => String -> a -> a -> m ()
assertEq msg expected got
| expected == got = pure ()
| otherwise =
"Assertion failed: " ++ msg ++
"\n expected to be: " ++ show expected ++
"\n but was: " ++ show got
& error
| 296 |
assertEq :: (Monad m, Show a, Eq a) => String -> a -> a -> m ()
assertEq msg expected got
| expected == got = pure ()
| otherwise =
"Assertion failed: " ++ msg ++
"\n expected to be: " ++ show expected ++
"\n but was: " ++ show got
& error
| 296 |
assertEq msg expected got
| expected == got = pure ()
| otherwise =
"Assertion failed: " ++ msg ++
"\n expected to be: " ++ show expected ++
"\n but was: " ++ show got
& error
| 232 | false | true | 1 | 10 | 111 | 109 | 52 | 57 | null | null |
hasufell/CGA
|
Algorithms/PolygonIntersection.hs
|
gpl-2.0
|
sortLexPolys _ = []
| 19 |
sortLexPolys _ = []
| 19 |
sortLexPolys _ = []
| 19 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
ryakad/hanagram
|
main.hs
|
mit
|
fixLength (Just x) = (read x :: Int)
| 36 |
fixLength (Just x) = (read x :: Int)
| 36 |
fixLength (Just x) = (read x :: Int)
| 36 | false | false | 0 | 7 | 7 | 24 | 12 | 12 | null | null |
tjakway/ghcjvm
|
compiler/nativeGen/X86/CodeGen.hs
|
bsd-3-clause
|
jumpTableEntry :: DynFlags -> Maybe BlockId -> CmmStatic
jumpTableEntry dflags Nothing = CmmStaticLit (CmmInt 0 (wordWidth dflags))
| 131 |
jumpTableEntry :: DynFlags -> Maybe BlockId -> CmmStatic
jumpTableEntry dflags Nothing = CmmStaticLit (CmmInt 0 (wordWidth dflags))
| 131 |
jumpTableEntry dflags Nothing = CmmStaticLit (CmmInt 0 (wordWidth dflags))
| 74 | false | true | 0 | 9 | 16 | 49 | 22 | 27 | null | null |
bitemyapp/ganeti
|
src/Ganeti/DataCollectors/Diagnose.hs
|
bsd-2-clause
|
-- | The category of this data collector.
dcCategory :: Maybe DCCategory
dcCategory = Just DCNode
| 97 |
dcCategory :: Maybe DCCategory
dcCategory = Just DCNode
| 55 |
dcCategory = Just DCNode
| 24 | true | true | 1 | 5 | 15 | 21 | 9 | 12 | null | null |
keera-studios/hsQt
|
Qtc/Classes/Types.hs
|
bsd-2-clause
|
withElementResult :: IO (Ptr (TElement a)) -> IO (Element a)
withElementResult f
= withObjectResult qtc_Element_getFinalizer f
| 128 |
withElementResult :: IO (Ptr (TElement a)) -> IO (Element a)
withElementResult f
= withObjectResult qtc_Element_getFinalizer f
| 128 |
withElementResult f
= withObjectResult qtc_Element_getFinalizer f
| 67 | false | true | 0 | 10 | 17 | 47 | 22 | 25 | null | null |
kaashif/haskell-muon
|
lib/Muon/Main.hs
|
bsd-2-clause
|
init_ = Init { dir = "." &= argPos 0 &= typDir
} &= help "Initialise a site in DIR"
| 96 |
init_ = Init { dir = "." &= argPos 0 &= typDir
} &= help "Initialise a site in DIR"
| 96 |
init_ = Init { dir = "." &= argPos 0 &= typDir
} &= help "Initialise a site in DIR"
| 96 | false | false | 0 | 10 | 32 | 32 | 16 | 16 | null | null |
sleepomeno/TForth
|
src/TF/Printer.hs
|
apache-2.0
|
controlStructure (DoLoop xs) = text "DO" $+$ nested (pprint xs) $+$ text "LOOP"
| 79 |
controlStructure (DoLoop xs) = text "DO" $+$ nested (pprint xs) $+$ text "LOOP"
| 79 |
controlStructure (DoLoop xs) = text "DO" $+$ nested (pprint xs) $+$ text "LOOP"
| 79 | false | false | 0 | 9 | 12 | 38 | 17 | 21 | null | null |
tolysz/prepare-ghcjs
|
spec-lts8/base/GHC/TopHandler.hs
|
bsd-3-clause
|
fastExit = exitHelper useFastExit
| 33 |
fastExit = exitHelper useFastExit
| 33 |
fastExit = exitHelper useFastExit
| 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mcapodici/dotsandboxes
|
test/Data/DotsAndBoxes/Test/StringsAndCoins.hs
|
gpl-3.0
|
c2 = mkUGraph [0..3] $ andBack [(1, 2), (2, 0), (2, 3)] :: Gr () ()
| 67 |
c2 = mkUGraph [0..3] $ andBack [(1, 2), (2, 0), (2, 3)] :: Gr () ()
| 67 |
c2 = mkUGraph [0..3] $ andBack [(1, 2), (2, 0), (2, 3)] :: Gr () ()
| 67 | false | false | 0 | 8 | 15 | 60 | 34 | 26 | null | null |
danr/hipspec
|
testsuite/prod/zeno_version/PropT44.hs
|
gpl-3.0
|
qfac :: Nat -> Nat -> Nat
qfac Z acc = acc
| 42 |
qfac :: Nat -> Nat -> Nat
qfac Z acc = acc
| 42 |
qfac Z acc = acc
| 16 | false | true | 0 | 8 | 11 | 30 | 13 | 17 | null | null |
krakrjak/ImplicitCAD
|
Graphics/Implicit/ExtOpenScad/Eval/Statement.hs
|
agpl-3.0
|
runStatementI (StatementI sourcePos (ModuleCall (Symbol name) argsExpr suite)) = do
maybeMod <- lookupVar (Symbol name)
varlookup <- getVarLookup
newVals <- case maybeMod of
Just (OUModule _ args mod') -> do
-- Find what arguments are satisfied by a named parameter.
valNamed <- forM argsExpr $ \(argName, _) ->
case argName of
Just (Symbol symbol) ->
case lookup (Symbol symbol) (fromMaybe [] args) of
Just _ -> do
maybeVar <- lookupVar (Symbol symbol)
when (isJust maybeVar)
(warnC sourcePos $ "Supplied parameter shadows variable from the calling scope: " ++ symbol)
return (Just (Symbol symbol), True)
Nothing -> do
-- FIXME: maybe is a workaround here.
when (isJust args)
(warnC sourcePos $ "Supplied parameter not listed in module declaration: " ++ symbol)
return (Nothing, False)
Nothing -> return (Nothing, False)
-- Find what arguments are satisfied by a default value, or were given in a named parameter..
valFound <- forM argsExpr $ \(argName, _) ->
case argName of
Just symbol -> do
let supplied = fromMaybe False $ lookup (Just symbol) valNamed
case lookup symbol (fromMaybe [] args) of
Just hasDefault -> return (Just symbol, hasDefault || supplied)
Nothing -> if supplied
then return (Just symbol, supplied)
else return (Nothing, False)
Nothing -> return (Nothing, False)
-- Find what unnamed parameters were passed in.
valUnnamed <- forM argsExpr $ \(argName, expr) ->
case argName of
Just _ -> return Nothing
Nothing -> return $ Just expr
let
-- ... and count them.
valNamedCount = length $ filter snd valNamed
valFoundCount = length $ filter snd valFound
valUnnamedCount = length $ filter isJust valUnnamed
noArgs = length (fromMaybe [] args)
parameterReport = "Found " ++ show valNamedCount ++
(if valNamedCount == 1 then " named parameter, and " else " named parameters, and ")
++ show valUnnamedCount ++
(if valUnnamedCount == 1 then " un-named parameter. Expected " else " un-named parameters. Expected ")
++ show noArgs ++
(if noArgs == 1 then " parameter." else " parameters.")
-- Check that the number of arguments match, and if they don't, error a report.
-- FIXME: take into account the ordering of unnamed value application.
when (valFoundCount + valUnnamedCount < noArgs)
(errorC sourcePos $ "Insufficient parameters. " ++ parameterReport)
when (valFoundCount + valUnnamedCount > noArgs && isJust args)
(errorC sourcePos $ "Too many parameters. " ++ parameterReport)
-- Evaluate all of the arguments.
argsVal <- forM argsExpr $ \(posName, expr) -> do
val <- evalExpr sourcePos expr
return (posName, val)
-- Run the function.
childVals <- runSuiteCapture varlookup suite
let
argsMapped = argMap argsVal $ mod' childVals
forM_ (snd argsMapped) $ errorC sourcePos
fromMaybe (return []) (fst argsMapped)
Just (OModule _ _ mod') -> do
-- Evaluate all of the arguments.
argsVal <- forM argsExpr $ \(posName, expr) -> do
val <- evalExpr sourcePos expr
return (posName, val)
-- Run the function.
childVals <- runSuiteCapture varlookup suite
let
argsMapped = argMap argsVal $ mod' childVals
ioNewVals = fromMaybe (return []) (fst argsMapped)
forM_ (snd argsMapped) $ errorC sourcePos
liftIO ioNewVals
Just foo -> do
case getErrors foo of
Just err -> errorC sourcePos err
Nothing -> errorC sourcePos $ "Object " ++ name ++ " is not a module!"
return []
Nothing -> do
errorC sourcePos $ "Module " ++ name ++ " not in scope."
return []
pushVals newVals
-- | Interpret an include or use statement.
| 4,891 |
runStatementI (StatementI sourcePos (ModuleCall (Symbol name) argsExpr suite)) = do
maybeMod <- lookupVar (Symbol name)
varlookup <- getVarLookup
newVals <- case maybeMod of
Just (OUModule _ args mod') -> do
-- Find what arguments are satisfied by a named parameter.
valNamed <- forM argsExpr $ \(argName, _) ->
case argName of
Just (Symbol symbol) ->
case lookup (Symbol symbol) (fromMaybe [] args) of
Just _ -> do
maybeVar <- lookupVar (Symbol symbol)
when (isJust maybeVar)
(warnC sourcePos $ "Supplied parameter shadows variable from the calling scope: " ++ symbol)
return (Just (Symbol symbol), True)
Nothing -> do
-- FIXME: maybe is a workaround here.
when (isJust args)
(warnC sourcePos $ "Supplied parameter not listed in module declaration: " ++ symbol)
return (Nothing, False)
Nothing -> return (Nothing, False)
-- Find what arguments are satisfied by a default value, or were given in a named parameter..
valFound <- forM argsExpr $ \(argName, _) ->
case argName of
Just symbol -> do
let supplied = fromMaybe False $ lookup (Just symbol) valNamed
case lookup symbol (fromMaybe [] args) of
Just hasDefault -> return (Just symbol, hasDefault || supplied)
Nothing -> if supplied
then return (Just symbol, supplied)
else return (Nothing, False)
Nothing -> return (Nothing, False)
-- Find what unnamed parameters were passed in.
valUnnamed <- forM argsExpr $ \(argName, expr) ->
case argName of
Just _ -> return Nothing
Nothing -> return $ Just expr
let
-- ... and count them.
valNamedCount = length $ filter snd valNamed
valFoundCount = length $ filter snd valFound
valUnnamedCount = length $ filter isJust valUnnamed
noArgs = length (fromMaybe [] args)
parameterReport = "Found " ++ show valNamedCount ++
(if valNamedCount == 1 then " named parameter, and " else " named parameters, and ")
++ show valUnnamedCount ++
(if valUnnamedCount == 1 then " un-named parameter. Expected " else " un-named parameters. Expected ")
++ show noArgs ++
(if noArgs == 1 then " parameter." else " parameters.")
-- Check that the number of arguments match, and if they don't, error a report.
-- FIXME: take into account the ordering of unnamed value application.
when (valFoundCount + valUnnamedCount < noArgs)
(errorC sourcePos $ "Insufficient parameters. " ++ parameterReport)
when (valFoundCount + valUnnamedCount > noArgs && isJust args)
(errorC sourcePos $ "Too many parameters. " ++ parameterReport)
-- Evaluate all of the arguments.
argsVal <- forM argsExpr $ \(posName, expr) -> do
val <- evalExpr sourcePos expr
return (posName, val)
-- Run the function.
childVals <- runSuiteCapture varlookup suite
let
argsMapped = argMap argsVal $ mod' childVals
forM_ (snd argsMapped) $ errorC sourcePos
fromMaybe (return []) (fst argsMapped)
Just (OModule _ _ mod') -> do
-- Evaluate all of the arguments.
argsVal <- forM argsExpr $ \(posName, expr) -> do
val <- evalExpr sourcePos expr
return (posName, val)
-- Run the function.
childVals <- runSuiteCapture varlookup suite
let
argsMapped = argMap argsVal $ mod' childVals
ioNewVals = fromMaybe (return []) (fst argsMapped)
forM_ (snd argsMapped) $ errorC sourcePos
liftIO ioNewVals
Just foo -> do
case getErrors foo of
Just err -> errorC sourcePos err
Nothing -> errorC sourcePos $ "Object " ++ name ++ " is not a module!"
return []
Nothing -> do
errorC sourcePos $ "Module " ++ name ++ " not in scope."
return []
pushVals newVals
-- | Interpret an include or use statement.
| 4,891 |
runStatementI (StatementI sourcePos (ModuleCall (Symbol name) argsExpr suite)) = do
maybeMod <- lookupVar (Symbol name)
varlookup <- getVarLookup
newVals <- case maybeMod of
Just (OUModule _ args mod') -> do
-- Find what arguments are satisfied by a named parameter.
valNamed <- forM argsExpr $ \(argName, _) ->
case argName of
Just (Symbol symbol) ->
case lookup (Symbol symbol) (fromMaybe [] args) of
Just _ -> do
maybeVar <- lookupVar (Symbol symbol)
when (isJust maybeVar)
(warnC sourcePos $ "Supplied parameter shadows variable from the calling scope: " ++ symbol)
return (Just (Symbol symbol), True)
Nothing -> do
-- FIXME: maybe is a workaround here.
when (isJust args)
(warnC sourcePos $ "Supplied parameter not listed in module declaration: " ++ symbol)
return (Nothing, False)
Nothing -> return (Nothing, False)
-- Find what arguments are satisfied by a default value, or were given in a named parameter..
valFound <- forM argsExpr $ \(argName, _) ->
case argName of
Just symbol -> do
let supplied = fromMaybe False $ lookup (Just symbol) valNamed
case lookup symbol (fromMaybe [] args) of
Just hasDefault -> return (Just symbol, hasDefault || supplied)
Nothing -> if supplied
then return (Just symbol, supplied)
else return (Nothing, False)
Nothing -> return (Nothing, False)
-- Find what unnamed parameters were passed in.
valUnnamed <- forM argsExpr $ \(argName, expr) ->
case argName of
Just _ -> return Nothing
Nothing -> return $ Just expr
let
-- ... and count them.
valNamedCount = length $ filter snd valNamed
valFoundCount = length $ filter snd valFound
valUnnamedCount = length $ filter isJust valUnnamed
noArgs = length (fromMaybe [] args)
parameterReport = "Found " ++ show valNamedCount ++
(if valNamedCount == 1 then " named parameter, and " else " named parameters, and ")
++ show valUnnamedCount ++
(if valUnnamedCount == 1 then " un-named parameter. Expected " else " un-named parameters. Expected ")
++ show noArgs ++
(if noArgs == 1 then " parameter." else " parameters.")
-- Check that the number of arguments match, and if they don't, error a report.
-- FIXME: take into account the ordering of unnamed value application.
when (valFoundCount + valUnnamedCount < noArgs)
(errorC sourcePos $ "Insufficient parameters. " ++ parameterReport)
when (valFoundCount + valUnnamedCount > noArgs && isJust args)
(errorC sourcePos $ "Too many parameters. " ++ parameterReport)
-- Evaluate all of the arguments.
argsVal <- forM argsExpr $ \(posName, expr) -> do
val <- evalExpr sourcePos expr
return (posName, val)
-- Run the function.
childVals <- runSuiteCapture varlookup suite
let
argsMapped = argMap argsVal $ mod' childVals
forM_ (snd argsMapped) $ errorC sourcePos
fromMaybe (return []) (fst argsMapped)
Just (OModule _ _ mod') -> do
-- Evaluate all of the arguments.
argsVal <- forM argsExpr $ \(posName, expr) -> do
val <- evalExpr sourcePos expr
return (posName, val)
-- Run the function.
childVals <- runSuiteCapture varlookup suite
let
argsMapped = argMap argsVal $ mod' childVals
ioNewVals = fromMaybe (return []) (fst argsMapped)
forM_ (snd argsMapped) $ errorC sourcePos
liftIO ioNewVals
Just foo -> do
case getErrors foo of
Just err -> errorC sourcePos err
Nothing -> errorC sourcePos $ "Object " ++ name ++ " is not a module!"
return []
Nothing -> do
errorC sourcePos $ "Module " ++ name ++ " not in scope."
return []
pushVals newVals
-- | Interpret an include or use statement.
| 4,891 | false | false | 0 | 28 | 2,031 | 1,107 | 533 | 574 | null | null |
capello/Haskell_Premier
|
Premier.hs
|
bsd-2-clause
|
prem'' = 2:[a | a <- [3,5..], (all (/= 0) (map (\x -> mod a x) (takeWhile (<= truncate(sqrt (fromIntegral a::Float))) prem''))) ]
| 129 |
prem'' = 2:[a | a <- [3,5..], (all (/= 0) (map (\x -> mod a x) (takeWhile (<= truncate(sqrt (fromIntegral a::Float))) prem''))) ]
| 129 |
prem'' = 2:[a | a <- [3,5..], (all (/= 0) (map (\x -> mod a x) (takeWhile (<= truncate(sqrt (fromIntegral a::Float))) prem''))) ]
| 129 | false | false | 3 | 19 | 22 | 100 | 51 | 49 | null | null |
phaazon/OpenGLRaw
|
RegistryProcessor/src/Main.hs
|
bsd-3-clause
|
lookup' :: (Ord k, Show k) => k -> M.Map k a -> a
lookup' k m = M.findWithDefault (error ("unknown name " ++ show k)) k m
| 121 |
lookup' :: (Ord k, Show k) => k -> M.Map k a -> a
lookup' k m = M.findWithDefault (error ("unknown name " ++ show k)) k m
| 121 |
lookup' k m = M.findWithDefault (error ("unknown name " ++ show k)) k m
| 71 | false | true | 0 | 10 | 27 | 71 | 35 | 36 | null | null |
CulpaBS/wbBach
|
src/Futhark/CodeGen/Backends/GenericC.hs
|
bsd-3-clause
|
decl :: C.InitGroup -> CompilerM op s ()
decl x = item [C.citem|$decl:x;|]
| 74 |
decl :: C.InitGroup -> CompilerM op s ()
decl x = item [C.citem|$decl:x;|]
| 74 |
decl x = item [C.citem|$decl:x;|]
| 33 | false | true | 0 | 7 | 12 | 38 | 20 | 18 | null | null |
rickardlindberg/codemonitor
|
tests/KillThreadThatIsAlreadyDead.hs
|
bsd-3-clause
|
main = do
id <- forkIO runAThread
threadDelay $ 2*1000000
putStrLn $ "time to kill" ++ show id
killThread id
putStrLn "done"
| 147 |
main = do
id <- forkIO runAThread
threadDelay $ 2*1000000
putStrLn $ "time to kill" ++ show id
killThread id
putStrLn "done"
| 147 |
main = do
id <- forkIO runAThread
threadDelay $ 2*1000000
putStrLn $ "time to kill" ++ show id
killThread id
putStrLn "done"
| 147 | false | false | 0 | 8 | 44 | 53 | 22 | 31 | null | null |
sherwoodwang/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxSTC_CHARSET_HEBREW :: Int
wxSTC_CHARSET_HEBREW = 177
| 54 |
wxSTC_CHARSET_HEBREW :: Int
wxSTC_CHARSET_HEBREW = 177
| 54 |
wxSTC_CHARSET_HEBREW = 177
| 26 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
jkoppel/compstrat
|
examples/Examples/Multi/Strat.hs
|
bsd-3-clause
|
countConsts :: ProgLab :=> Int
countConsts = getSum . runIdentity . (crushtdT $ promoteTF countConsts')
| 103 |
countConsts :: ProgLab :=> Int
countConsts = getSum . runIdentity . (crushtdT $ promoteTF countConsts')
| 103 |
countConsts = getSum . runIdentity . (crushtdT $ promoteTF countConsts')
| 72 | false | true | 2 | 8 | 14 | 42 | 18 | 24 | null | null |
aquatir/remember_java_api
|
code-sample-haskell/typed_fp_basics_cource/02_function_in_haskell/code.hs
|
mit
|
lastElem (x:[]) = x
| 19 |
lastElem (x:[]) = x
| 19 |
lastElem (x:[]) = x
| 19 | false | false | 0 | 8 | 3 | 18 | 9 | 9 | null | null |
atom-haskell/language-haskell
|
spec/fixture/multilineSignatures.hs
|
mit
|
someFunc'
:: String
-- ^^^^^^ meta.multiline.type-declaration meta.type-signature entity.name.type support.class.prelude.String
-> String
-- ^^^^^^ entity.name.tag
someFunc = undefined
| 195 |
someFunc'
:: String
-- ^^^^^^ meta.multiline.type-declaration meta.type-signature entity.name.type support.class.prelude.String
-> String
someFunc = undefined
| 167 |
someFunc = undefined
| 20 | true | true | 0 | 7 | 27 | 24 | 11 | 13 | null | null |
MadSciGuys/trebuchet
|
src/Treb/Demo.hs
|
mit
|
dropN n (x:xs) = x : dropN n (drop (n-1) xs)
| 44 |
dropN n (x:xs) = x : dropN n (drop (n-1) xs)
| 44 |
dropN n (x:xs) = x : dropN n (drop (n-1) xs)
| 44 | false | false | 0 | 10 | 10 | 44 | 21 | 23 | null | null |
mattias-lundell/timber-llvm
|
src/Kindle.hs
|
bsd-3-clause
|
rngType (FunT vs ts t) = t
| 43 |
rngType (FunT vs ts t) = t
| 43 |
rngType (FunT vs ts t) = t
| 43 | false | false | 0 | 7 | 23 | 19 | 9 | 10 | null | null |
alexander-at-github/eta
|
compiler/ETA/Utils/Util.hs
|
bsd-3-clause
|
isWindowsHost = True
| 20 |
isWindowsHost = True
| 20 |
isWindowsHost = True
| 20 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
ezyang/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
withPprStyle :: PprStyle -> SDoc -> SDoc
withPprStyle sty d = SDoc $ \ctxt -> runSDoc d ctxt{sdocStyle=sty}
| 107 |
withPprStyle :: PprStyle -> SDoc -> SDoc
withPprStyle sty d = SDoc $ \ctxt -> runSDoc d ctxt{sdocStyle=sty}
| 107 |
withPprStyle sty d = SDoc $ \ctxt -> runSDoc d ctxt{sdocStyle=sty}
| 66 | false | true | 0 | 9 | 17 | 46 | 24 | 22 | null | null |
nevrenato/Hets_Fork
|
RDF/StaticAnalysis.hs
|
gpl-2.0
|
collectionToPOList :: [Object] -> [PredicateObjectList]
collectionToPOList objs = case objs of
[] -> []
h : t -> [ PredicateObjectList (Predicate rdfFirst) [h]
, PredicateObjectList (Predicate rdfRest) [Object $ if null t
then Subject rdfNil else SubjectList $ collectionToPOList t]]
| 320 |
collectionToPOList :: [Object] -> [PredicateObjectList]
collectionToPOList objs = case objs of
[] -> []
h : t -> [ PredicateObjectList (Predicate rdfFirst) [h]
, PredicateObjectList (Predicate rdfRest) [Object $ if null t
then Subject rdfNil else SubjectList $ collectionToPOList t]]
| 320 |
collectionToPOList objs = case objs of
[] -> []
h : t -> [ PredicateObjectList (Predicate rdfFirst) [h]
, PredicateObjectList (Predicate rdfRest) [Object $ if null t
then Subject rdfNil else SubjectList $ collectionToPOList t]]
| 264 | false | true | 3 | 10 | 76 | 106 | 55 | 51 | null | null |
d0kt0r0/Tidal
|
old/tests/test.hs
|
gpl-3.0
|
rep :: Int -> String -> Pattern String
rep n v = p $ intercalate " " $ take n $ repeat v
| 88 |
rep :: Int -> String -> Pattern String
rep n v = p $ intercalate " " $ take n $ repeat v
| 88 |
rep n v = p $ intercalate " " $ take n $ repeat v
| 49 | false | true | 0 | 8 | 22 | 52 | 23 | 29 | null | null |
mitchellwrosen/sloc
|
Main.hs
|
bsd-3-clause
|
isEndBlockComment Unknown = none
| 34 |
isEndBlockComment Unknown = none
| 34 |
isEndBlockComment Unknown = none
| 34 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
vTurbine/w3dhs
|
src/Game/Agent.hs
|
mit
|
statusLines :: Int
statusLines = 40
| 35 |
statusLines :: Int
statusLines = 40
| 35 |
statusLines = 40
| 16 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
BartAdv/Idris-dev
|
src/Idris/Reflection.hs
|
bsd-3-clause
|
reflectName (SN sn) = raw_apply (Var (reflm "SN")) [reflectSpecialName sn]
| 74 |
reflectName (SN sn) = raw_apply (Var (reflm "SN")) [reflectSpecialName sn]
| 74 |
reflectName (SN sn) = raw_apply (Var (reflm "SN")) [reflectSpecialName sn]
| 74 | false | false | 0 | 9 | 9 | 38 | 18 | 20 | null | null |
beni55/haste-compiler
|
libraries/ghc-7.8/base/System/IO.hs
|
bsd-3-clause
|
-- | The 'getContents' operation returns all user input as a single string,
-- which is read lazily as it is needed
-- (same as 'hGetContents' 'stdin').
getContents :: IO String
getContents = hGetContents stdin
| 220 |
getContents :: IO String
getContents = hGetContents stdin
| 66 |
getContents = hGetContents stdin
| 37 | true | true | 0 | 5 | 44 | 20 | 11 | 9 | null | null |
TakSuyu/mahjong
|
src/Mahjong/Game.hs
|
mit
|
-- | For suits that allow runs we can use `Segment` to find areas of interest
-- for us to solve while looking for short circuits if we would rather not solve
-- a hand that isn't finished.
findSegments :: (Ord a, Bounded a, Enum a) => MS.MultiSet a -> Maybe (Segment a)
findSegments ms = let min' = MS.findMin ms in
nonEmpty . mapMaybe (nonEmpty . MS.toAscOccurList) $ splitSegments (missingMembers min' ms) ms
where
missingMembers :: (Ord a, Bounded a, Enum a) => a -> MS.MultiSet a -> [a]
missingMembers a ms'
| a == maxBound
= []
| MS.notMember (succ a) ms'
= succ a : missingMembers (succ a) ms'
| otherwise
= missingMembers (succ a) ms'
splitSegments :: (Ord a, Bounded a, Enum a) => [a] -> MS.MultiSet a -> [MS.MultiSet a]
splitSegments [] ms' = [ms']
splitSegments (x : xs) ms' = let (a, b) = MS.split x ms' in
if MS.null b
then [a]
else a : splitSegments xs b
-- | An edge allows us to short circuit any segment calculation on suit tiles.
--
-- Segments really should only be used on suits and the assumption is that is
-- the case. If you have a case where that isn't the case please open a bug
-- report explaining the situation.
| 1,256 |
findSegments :: (Ord a, Bounded a, Enum a) => MS.MultiSet a -> Maybe (Segment a)
findSegments ms = let min' = MS.findMin ms in
nonEmpty . mapMaybe (nonEmpty . MS.toAscOccurList) $ splitSegments (missingMembers min' ms) ms
where
missingMembers :: (Ord a, Bounded a, Enum a) => a -> MS.MultiSet a -> [a]
missingMembers a ms'
| a == maxBound
= []
| MS.notMember (succ a) ms'
= succ a : missingMembers (succ a) ms'
| otherwise
= missingMembers (succ a) ms'
splitSegments :: (Ord a, Bounded a, Enum a) => [a] -> MS.MultiSet a -> [MS.MultiSet a]
splitSegments [] ms' = [ms']
splitSegments (x : xs) ms' = let (a, b) = MS.split x ms' in
if MS.null b
then [a]
else a : splitSegments xs b
-- | An edge allows us to short circuit any segment calculation on suit tiles.
--
-- Segments really should only be used on suits and the assumption is that is
-- the case. If you have a case where that isn't the case please open a bug
-- report explaining the situation.
| 1,066 |
findSegments ms = let min' = MS.findMin ms in
nonEmpty . mapMaybe (nonEmpty . MS.toAscOccurList) $ splitSegments (missingMembers min' ms) ms
where
missingMembers :: (Ord a, Bounded a, Enum a) => a -> MS.MultiSet a -> [a]
missingMembers a ms'
| a == maxBound
= []
| MS.notMember (succ a) ms'
= succ a : missingMembers (succ a) ms'
| otherwise
= missingMembers (succ a) ms'
splitSegments :: (Ord a, Bounded a, Enum a) => [a] -> MS.MultiSet a -> [MS.MultiSet a]
splitSegments [] ms' = [ms']
splitSegments (x : xs) ms' = let (a, b) = MS.split x ms' in
if MS.null b
then [a]
else a : splitSegments xs b
-- | An edge allows us to short circuit any segment calculation on suit tiles.
--
-- Segments really should only be used on suits and the assumption is that is
-- the case. If you have a case where that isn't the case please open a bug
-- report explaining the situation.
| 985 | true | true | 0 | 12 | 333 | 369 | 185 | 184 | null | null |
kranich/haste-compiler
|
libraries/ghc-7.8/base/Data/Typeable/Internal.hs
|
bsd-3-clause
|
funTc :: TyCon
funTc = typeRepTyCon (typeRep (Proxy :: Proxy (->)))
| 67 |
funTc :: TyCon
funTc = typeRepTyCon (typeRep (Proxy :: Proxy (->)))
| 67 |
funTc = typeRepTyCon (typeRep (Proxy :: Proxy (->)))
| 52 | false | true | 0 | 10 | 10 | 32 | 17 | 15 | null | null |
rudyardrichter/MCTS
|
old/source/Game/GamesLibrary/TicTacToe.hs
|
mit
|
allowedMove :: TTTGame -> Point -> Bool
allowedMove = flip elem . allowedMoves
| 78 |
allowedMove :: TTTGame -> Point -> Bool
allowedMove = flip elem . allowedMoves
| 78 |
allowedMove = flip elem . allowedMoves
| 38 | false | true | 1 | 8 | 12 | 34 | 14 | 20 | null | null |
glebovitz/demo
|
src/Data/Conduit/Analysis.hs
|
mit
|
stats :: (Num a, Monad m)
=> L.Getter i a
-> Consumer i m (Stats a)
stats lens =
CL.foldMap go
where
go i = Stats
{ statsCount = 1
, statsTotal = i L.^. lens
}
-- | Pack n incoming values into a vector and yield it.
-- Then read the subsequence value in the stream, drop the
-- first value from the vector, append the new value to the end,
-- and yield the new vector. Continue until the input stream is empty.
--
-- For example, if n is 3, and the input is [1, 2, 3, 4, 5], the yielded
-- values would be [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
| 586 |
stats :: (Num a, Monad m)
=> L.Getter i a
-> Consumer i m (Stats a)
stats lens =
CL.foldMap go
where
go i = Stats
{ statsCount = 1
, statsTotal = i L.^. lens
}
-- | Pack n incoming values into a vector and yield it.
-- Then read the subsequence value in the stream, drop the
-- first value from the vector, append the new value to the end,
-- and yield the new vector. Continue until the input stream is empty.
--
-- For example, if n is 3, and the input is [1, 2, 3, 4, 5], the yielded
-- values would be [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
| 586 |
stats lens =
CL.foldMap go
where
go i = Stats
{ statsCount = 1
, statsTotal = i L.^. lens
}
-- | Pack n incoming values into a vector and yield it.
-- Then read the subsequence value in the stream, drop the
-- first value from the vector, append the new value to the end,
-- and yield the new vector. Continue until the input stream is empty.
--
-- For example, if n is 3, and the input is [1, 2, 3, 4, 5], the yielded
-- values would be [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
| 506 | false | true | 0 | 9 | 164 | 96 | 52 | 44 | null | null |
gcampax/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
mkPrimEqPred :: Type -> Type -> Type
mkPrimEqPred ty1 ty2
= WARN( not (k `eqKind` typeKind ty2), ppr ty1 $$ ppr ty2 )
TyConApp eqPrimTyCon [k, ty1, ty2]
where
k = typeKind ty1
| 188 |
mkPrimEqPred :: Type -> Type -> Type
mkPrimEqPred ty1 ty2
= WARN( not (k `eqKind` typeKind ty2), ppr ty1 $$ ppr ty2 )
TyConApp eqPrimTyCon [k, ty1, ty2]
where
k = typeKind ty1
| 188 |
mkPrimEqPred ty1 ty2
= WARN( not (k `eqKind` typeKind ty2), ppr ty1 $$ ppr ty2 )
TyConApp eqPrimTyCon [k, ty1, ty2]
where
k = typeKind ty1
| 151 | false | true | 0 | 10 | 45 | 86 | 43 | 43 | null | null |
mariefarrell/Hets
|
Temporal/Mu.hs
|
gpl-2.0
|
d (Nu x' phi) x = if x' == x then Just (Nu x' phi) else d phi x
| 63 |
d (Nu x' phi) x = if x' == x then Just (Nu x' phi) else d phi x
| 63 |
d (Nu x' phi) x = if x' == x then Just (Nu x' phi) else d phi x
| 63 | false | false | 1 | 9 | 18 | 50 | 23 | 27 | null | null |
bbangert/gozer
|
Main.hs
|
mit
|
convertTwitterTime :: String -> UTCTime
convertTwitterTime = zonedTimeToUTC . readTime defaultTimeLocale "%a %b %d %T %Z %Y"
| 124 |
convertTwitterTime :: String -> UTCTime
convertTwitterTime = zonedTimeToUTC . readTime defaultTimeLocale "%a %b %d %T %Z %Y"
| 124 |
convertTwitterTime = zonedTimeToUTC . readTime defaultTimeLocale "%a %b %d %T %Z %Y"
| 84 | false | true | 0 | 6 | 16 | 24 | 12 | 12 | null | null |
anthezium/rcu
|
examples/MoveStringSTM.hs
|
bsd-2-clause
|
compactShow :: (Show a, Eq a) => [a] -> String
compactShow xs = intercalate ", " $ map (\xs -> show (length xs) ++ " x " ++ show (head xs)) $ group xs
| 150 |
compactShow :: (Show a, Eq a) => [a] -> String
compactShow xs = intercalate ", " $ map (\xs -> show (length xs) ++ " x " ++ show (head xs)) $ group xs
| 150 |
compactShow xs = intercalate ", " $ map (\xs -> show (length xs) ++ " x " ++ show (head xs)) $ group xs
| 103 | false | true | 0 | 14 | 33 | 92 | 44 | 48 | null | null |
joshcough/Scrabble
|
src/Scrabble/Search.hs
|
mit
|
matchAny :: [Search] -> Search
matchAny = Scrabble.Search.any
| 62 |
matchAny :: [Search] -> Search
matchAny = Scrabble.Search.any
| 62 |
matchAny = Scrabble.Search.any
| 31 | false | true | 0 | 7 | 8 | 28 | 13 | 15 | null | null |
beni55/hs-monte-carlo
|
examples/Poker.hs
|
bsd-3-clause
|
-- | An empty frequency count.
emptyCounts :: HandCounts
emptyCounts = Map.empty
| 80 |
emptyCounts :: HandCounts
emptyCounts = Map.empty
| 49 |
emptyCounts = Map.empty
| 23 | true | true | 0 | 5 | 11 | 14 | 8 | 6 | null | null |
jonaprieto/athena
|
src/Athena/Utils/PrettyPrint.hs
|
mit
|
-- | The document @(hcat xs)@ concatenates all documents @xs@
-- horizontally with @(\<\>)@.
hcat ∷ [Doc] → Doc
hcat = fold (<>)
| 130 |
hcat ∷ [Doc] → Doc
hcat = fold (<>)
| 35 |
hcat = fold (<>)
| 16 | true | true | 0 | 7 | 24 | 32 | 16 | 16 | null | null |
brendanhay/gogol
|
gogol-servicenetworking/gen/Network/Google/ServiceNetworking/Types/Product.hs
|
mpl-2.0
|
-- | Required. The prefix length of the subnet\'s IP address range. Use CIDR
-- range notation, such as \`30\` to provision a subnet with an
-- \`x.x.x.x\/30\` CIDR range. The IP address range is drawn from a pool of
-- available ranges in the service consumer\'s allocated range.
asrIPPrefixLength :: Lens' AddSubnetworkRequest (Maybe Int32)
asrIPPrefixLength
= lens _asrIPPrefixLength
(\ s a -> s{_asrIPPrefixLength = a})
. mapping _Coerce
| 455 |
asrIPPrefixLength :: Lens' AddSubnetworkRequest (Maybe Int32)
asrIPPrefixLength
= lens _asrIPPrefixLength
(\ s a -> s{_asrIPPrefixLength = a})
. mapping _Coerce
| 174 |
asrIPPrefixLength
= lens _asrIPPrefixLength
(\ s a -> s{_asrIPPrefixLength = a})
. mapping _Coerce
| 112 | true | true | 0 | 10 | 82 | 58 | 31 | 27 | null | null |
bendiksolheim/roy
|
src/Lib.hs
|
bsd-3-clause
|
minMaybe a Nothing = a
| 22 |
minMaybe a Nothing = a
| 22 |
minMaybe a Nothing = a
| 22 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
edwardwas/FRPNow-Vty
|
src/Lib/Control/FRPNow/Vty/Core.hs
|
mit
|
justKeys :: EvStream V.Event -> EvStream Key
justKeys = catMaybesEs . fmap helper
where helper (EvKey a _) = Just a
helper _ = Nothing
| 148 |
justKeys :: EvStream V.Event -> EvStream Key
justKeys = catMaybesEs . fmap helper
where helper (EvKey a _) = Just a
helper _ = Nothing
| 148 |
justKeys = catMaybesEs . fmap helper
where helper (EvKey a _) = Just a
helper _ = Nothing
| 103 | false | true | 1 | 7 | 38 | 59 | 28 | 31 | null | null |
leksah/ltk
|
src/Graphics/UI/Editor/Parameters.hs
|
gpl-2.0
|
paraName _ = Nothing
| 43 |
paraName _ = Nothing
| 43 |
paraName _ = Nothing
| 43 | false | false | 0 | 4 | 26 | 10 | 4 | 6 | null | null |
dmjio/miso
|
src/Miso/Svg/Attribute.hs
|
bsd-3-clause
|
-- | <https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/k>
k_ :: MisoString -> Attribute action
k_ = attr "k"
| 119 |
k_ :: MisoString -> Attribute action
k_ = attr "k"
| 51 |
k_ = attr "k"
| 13 | true | true | 0 | 7 | 13 | 27 | 12 | 15 | null | null |
nushio3/ghc
|
compiler/utils/Util.hs
|
bsd-3-clause
|
thdOf3 :: (a,b,c) -> c
fstOf3 (a,_,_) = a
| 49 |
thdOf3 :: (a,b,c) -> c
fstOf3 (a,_,_) = a
| 49 |
fstOf3 (a,_,_) = a
| 24 | false | true | 0 | 8 | 16 | 42 | 22 | 20 | null | null |
ddssff/lens
|
src/Data/Set/Lens.hs
|
bsd-3-clause
|
setmapped = setting Set.map
| 27 |
setmapped = setting Set.map
| 27 |
setmapped = setting Set.map
| 27 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
stefanocerruti/haskell-primer-alpha
|
src/Playground17.hs
|
bsd-3-clause
|
second :: Triple a -> a
second (Triple _ x _ ) = x
| 50 |
second :: Triple a -> a
second (Triple _ x _ ) = x
| 50 |
second (Triple _ x _ ) = x
| 26 | false | true | 0 | 9 | 13 | 37 | 16 | 21 | null | null |
rumblesan/improviz
|
test/Tests/Language/Parser/If.hs
|
bsd-3-clause
|
parserIfTests :: Test
parserIfTests = testGroup
"If Tests"
[ testCase "parses simple if" test_parses_simple_if
, testCase "parses if else" test_parses_if_else
, testCase "parses if elif else" test_parses_if_elif_else
]
| 236 |
parserIfTests :: Test
parserIfTests = testGroup
"If Tests"
[ testCase "parses simple if" test_parses_simple_if
, testCase "parses if else" test_parses_if_else
, testCase "parses if elif else" test_parses_if_elif_else
]
| 236 |
parserIfTests = testGroup
"If Tests"
[ testCase "parses simple if" test_parses_simple_if
, testCase "parses if else" test_parses_if_else
, testCase "parses if elif else" test_parses_if_elif_else
]
| 214 | false | true | 0 | 6 | 45 | 41 | 20 | 21 | null | null |
rrnewton/stack
|
src/test/Stack/PackageDumpSpec.hs
|
bsd-3-clause
|
checkDepsPresent :: [PruneCheck] -> Map Int (Int, Char) -> Bool
checkDepsPresent prunes selected =
all hasDeps $ Set.toList allIds
where
depMap = Map.fromList prunes
allIds = Set.fromList $ Map.elems selected
hasDeps ident =
case Map.lookup ident depMap of
Nothing -> error "checkDepsPresent: missing in depMap"
Just deps -> Set.null $ Set.difference (Set.fromList deps) allIds
| 428 |
checkDepsPresent :: [PruneCheck] -> Map Int (Int, Char) -> Bool
checkDepsPresent prunes selected =
all hasDeps $ Set.toList allIds
where
depMap = Map.fromList prunes
allIds = Set.fromList $ Map.elems selected
hasDeps ident =
case Map.lookup ident depMap of
Nothing -> error "checkDepsPresent: missing in depMap"
Just deps -> Set.null $ Set.difference (Set.fromList deps) allIds
| 428 |
checkDepsPresent prunes selected =
all hasDeps $ Set.toList allIds
where
depMap = Map.fromList prunes
allIds = Set.fromList $ Map.elems selected
hasDeps ident =
case Map.lookup ident depMap of
Nothing -> error "checkDepsPresent: missing in depMap"
Just deps -> Set.null $ Set.difference (Set.fromList deps) allIds
| 364 | false | true | 2 | 14 | 104 | 138 | 66 | 72 | null | null |
kawu/named
|
examples/readTei.hs
|
bsd-2-clause
|
main = do
[teiPath] <- getArgs
parts <- readNamed teiPath
forM_ parts $ \(path, para) -> do
putStrLn $ "### " ++ path
let sents = concatMap sentences para
forests = map (mkForest . names) sents
forM_ forests $ \forest -> do
putStrLn $ T.drawForest (map (fmap show) forest)
| 333 |
main = do
[teiPath] <- getArgs
parts <- readNamed teiPath
forM_ parts $ \(path, para) -> do
putStrLn $ "### " ++ path
let sents = concatMap sentences para
forests = map (mkForest . names) sents
forM_ forests $ \forest -> do
putStrLn $ T.drawForest (map (fmap show) forest)
| 333 |
main = do
[teiPath] <- getArgs
parts <- readNamed teiPath
forM_ parts $ \(path, para) -> do
putStrLn $ "### " ++ path
let sents = concatMap sentences para
forests = map (mkForest . names) sents
forM_ forests $ \forest -> do
putStrLn $ T.drawForest (map (fmap show) forest)
| 333 | false | false | 1 | 21 | 109 | 134 | 62 | 72 | null | null |
naoto-ogawa/h-xproto-mysql
|
src/DataBase/MySQLX/Model.hs
|
mit
|
mkInsertX :: String -> String -> String -> PI.Insert
mkInsertX schema table json = PB.defaultValue {
PI.collection = mkCollection schema table
,PI.data_model = Just PDM.DOCUMENT
,PI.projection = Seq.empty
,PI.row = Seq.singleton $ mkExpr2TypedRow' $ expr json
,PI.args = Seq.empty
}
| 324 |
mkInsertX :: String -> String -> String -> PI.Insert
mkInsertX schema table json = PB.defaultValue {
PI.collection = mkCollection schema table
,PI.data_model = Just PDM.DOCUMENT
,PI.projection = Seq.empty
,PI.row = Seq.singleton $ mkExpr2TypedRow' $ expr json
,PI.args = Seq.empty
}
| 323 |
mkInsertX schema table json = PB.defaultValue {
PI.collection = mkCollection schema table
,PI.data_model = Just PDM.DOCUMENT
,PI.projection = Seq.empty
,PI.row = Seq.singleton $ mkExpr2TypedRow' $ expr json
,PI.args = Seq.empty
}
| 270 | false | true | 0 | 10 | 81 | 109 | 56 | 53 | null | null |
forked-upstream-packages-for-ghcjs/ghc
|
testsuite/tests/programs/joao-circular/LrcPrelude.hs
|
bsd-3-clause
|
-- XXXXXXXXXXXXXXXX
lrc_string_index :: String -> Int -> Char
lrc_string_index s i = s!!i
| 91 |
lrc_string_index :: String -> Int -> Char
lrc_string_index s i = s!!i
| 69 |
lrc_string_index s i = s!!i
| 27 | true | true | 0 | 6 | 15 | 29 | 15 | 14 | null | null |
christiaanb/fpprac
|
src/FPPrac/Events.hs
|
bsd-3-clause
|
registerDoubleClick _ _ (MouseDown (x,y)) = (0 ,[MouseDoubleClick (x,y)])
| 74 |
registerDoubleClick _ _ (MouseDown (x,y)) = (0 ,[MouseDoubleClick (x,y)])
| 74 |
registerDoubleClick _ _ (MouseDown (x,y)) = (0 ,[MouseDoubleClick (x,y)])
| 74 | false | false | 0 | 8 | 9 | 43 | 24 | 19 | null | null |
Altech/haScm
|
src/Scheme/Internal/Environment.hs
|
gpl-3.0
|
newFrame = newIORef []
| 22 |
newFrame = newIORef []
| 22 |
newFrame = newIORef []
| 22 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
rueshyna/gogol
|
gogol-compute/gen/Network/Google/Compute/Types/Product.hs
|
mpl-2.0
|
-- | URL of the source disk used to create this image. This can be a full or
-- valid partial URL. You must provide either this property or the
-- rawDisk.source property but not both to create an image. For example,
-- the following are valid values: -
-- https:\/\/www.googleapis.com\/compute\/v1\/projects\/project\/zones\/zone\/disks\/disk
-- - projects\/project\/zones\/zone\/disks\/disk - zones\/zone\/disks\/disk
iSourceDisk :: Lens' Image (Maybe Text)
iSourceDisk
= lens _iSourceDisk (\ s a -> s{_iSourceDisk = a})
| 524 |
iSourceDisk :: Lens' Image (Maybe Text)
iSourceDisk
= lens _iSourceDisk (\ s a -> s{_iSourceDisk = a})
| 104 |
iSourceDisk
= lens _iSourceDisk (\ s a -> s{_iSourceDisk = a})
| 64 | true | true | 2 | 9 | 74 | 60 | 30 | 30 | null | null |
bluepeppers/DigitalOcean
|
src/Net/DigitalOcean/Droplets.hs
|
agpl-3.0
|
getDropletSnapshots :: (Error e, MonadError e m, MonadIO m) =>
T.Text -> Config -> m [Snapshot]
getDropletSnapshots n = get (dropletEndpoint n ++ "/snapshots") "snapshots"
| 194 |
getDropletSnapshots :: (Error e, MonadError e m, MonadIO m) =>
T.Text -> Config -> m [Snapshot]
getDropletSnapshots n = get (dropletEndpoint n ++ "/snapshots") "snapshots"
| 194 |
getDropletSnapshots n = get (dropletEndpoint n ++ "/snapshots") "snapshots"
| 75 | false | true | 0 | 9 | 47 | 68 | 34 | 34 | null | null |
Gabriel439/succinct
|
src/Succinct/Internal/Binomial.hs
|
bsd-2-clause
|
-- | Calculate the offset of a Word16 into its class.
--
-- You can use @popCount@ to calculate the class, given @w <= 0x7fff@
--
-- @
-- 'bitmap' ('popCount' w) ('offset' w) = w
-- @
offset :: Word16 -> Word16
offset w = fromIntegral (offsets P.! fromIntegral w)
| 263 |
offset :: Word16 -> Word16
offset w = fromIntegral (offsets P.! fromIntegral w)
| 79 |
offset w = fromIntegral (offsets P.! fromIntegral w)
| 52 | true | true | 0 | 8 | 50 | 40 | 23 | 17 | null | null |
rohitjha/DiMPL
|
src/Vector.hs
|
bsd-2-clause
|
{-|
The '<.>' operator can also be used to calculate the inner product.
For example:
>>> (Vector [1,1,1]) <.> (Vector [1..10])
6
-}
(<.>) :: Num a => Vector a -> Vector a -> a
(<.>) = innerProd
| 220 |
(<.>) :: Num a => Vector a -> Vector a -> a
(<.>) = innerProd
| 61 |
(<.>) = innerProd
| 17 | true | true | 0 | 9 | 64 | 44 | 21 | 23 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.