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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
swistak35/symmetrical-chainsaw | backend/Application.hs | mit | getApplicationRepl :: IO (Int, App, Application)
getApplicationRepl = do
settings <- getAppSettings
foundation <- makeFoundation settings
wsettings <- getDevSettings $ warpSettings foundation
app1 <- makeApplication foundation
return (getPort wsettings, foundation, app1) | 291 | getApplicationRepl :: IO (Int, App, Application)
getApplicationRepl = do
settings <- getAppSettings
foundation <- makeFoundation settings
wsettings <- getDevSettings $ warpSettings foundation
app1 <- makeApplication foundation
return (getPort wsettings, foundation, app1) | 291 | getApplicationRepl = do
settings <- getAppSettings
foundation <- makeFoundation settings
wsettings <- getDevSettings $ warpSettings foundation
app1 <- makeApplication foundation
return (getPort wsettings, foundation, app1) | 242 | false | true | 0 | 9 | 50 | 82 | 39 | 43 | null | null |
yairchu/ad | src/Numeric/AD/Mode/Forward.hs | bsd-3-clause | -- | Compute a vector of answers and directional derivatives for a function given a zipped up 'Functor' of the input values and their derivatives.
duF' :: (Functor f, Functor g, Num a) => (forall s. Mode s => f (AD s a) -> g (AD s a)) -> f (a, a) -> g (a, a)
duF' f = fmap unbundle . f . fmap (uncurry bundle) | 309 | duF' :: (Functor f, Functor g, Num a) => (forall s. Mode s => f (AD s a) -> g (AD s a)) -> f (a, a) -> g (a, a)
duF' f = fmap unbundle . f . fmap (uncurry bundle) | 162 | duF' f = fmap unbundle . f . fmap (uncurry bundle) | 50 | true | true | 0 | 13 | 66 | 123 | 62 | 61 | null | null |
snoyberg/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | -- | Add two 'IntWithInf's
plusWithInf :: IntWithInf -> IntWithInf -> IntWithInf
plusWithInf Infinity _ = Infinity | 121 | plusWithInf :: IntWithInf -> IntWithInf -> IntWithInf
plusWithInf Infinity _ = Infinity | 94 | plusWithInf Infinity _ = Infinity | 40 | true | true | 0 | 6 | 23 | 30 | 14 | 16 | null | null |
ghc-android/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | translateOp dflags SameMutableArrayArrayOp= Just (mo_wordEq dflags) | 67 | translateOp dflags SameMutableArrayArrayOp= Just (mo_wordEq dflags) | 67 | translateOp dflags SameMutableArrayArrayOp= Just (mo_wordEq dflags) | 67 | false | false | 0 | 7 | 5 | 20 | 9 | 11 | null | null |
HS-Carbon/hs-carbon-aggregator | 3rd-party/python-pickle/Language/Python/Pickle.hs | apache-2.0 | tuple1 = string "\133" *> return TUPLE1 | 39 | tuple1 = string "\133" *> return TUPLE1 | 39 | tuple1 = string "\133" *> return TUPLE1 | 39 | false | false | 0 | 6 | 6 | 16 | 7 | 9 | null | null |
spacekitteh/smcghc | compiler/codeGen/StgCmmUtils.hs | bsd-3-clause | baseRegOffset dflags CurrentTSO = oFFSET_StgRegTable_rCurrentTSO dflags | 75 | baseRegOffset dflags CurrentTSO = oFFSET_StgRegTable_rCurrentTSO dflags | 75 | baseRegOffset dflags CurrentTSO = oFFSET_StgRegTable_rCurrentTSO dflags | 75 | false | false | 0 | 5 | 9 | 16 | 6 | 10 | null | null |
GaloisInc/halvm-ghc | compiler/stranal/WwLib.hs | bsd-3-clause | mkWWstr dflags fam_envs (arg : args) = do
(useful1, args1, wrap_fn1, work_fn1) <- mkWWstr_one dflags fam_envs arg
(useful2, args2, wrap_fn2, work_fn2) <- mkWWstr dflags fam_envs args
return (useful1 || useful2, args1 ++ args2, wrap_fn1 . wrap_fn2, work_fn1 . work_fn2)
{-
Note [Unpacking arguments with prod... | 1,512 | mkWWstr dflags fam_envs (arg : args) = do
(useful1, args1, wrap_fn1, work_fn1) <- mkWWstr_one dflags fam_envs arg
(useful2, args2, wrap_fn2, work_fn2) <- mkWWstr dflags fam_envs args
return (useful1 || useful2, args1 ++ args2, wrap_fn1 . wrap_fn2, work_fn1 . work_fn2)
{-
Note [Unpacking arguments with prod... | 1,512 | mkWWstr dflags fam_envs (arg : args) = do
(useful1, args1, wrap_fn1, work_fn1) <- mkWWstr_one dflags fam_envs arg
(useful2, args2, wrap_fn2, work_fn2) <- mkWWstr dflags fam_envs args
return (useful1 || useful2, args1 ++ args2, wrap_fn1 . wrap_fn2, work_fn1 . work_fn2)
{-
Note [Unpacking arguments with prod... | 1,512 | false | false | 0 | 9 | 298 | 115 | 63 | 52 | null | null |
jrraymond/ray-tracer | src/RayTracer.hs | gpl-3.0 | {- naive packet traversal -}
pHitBVH :: Packet -> BVH -> [Maybe HitRec]
pHitBVH (Packet _ rays) Empty = replicate (length rays) Nothing | 135 | pHitBVH :: Packet -> BVH -> [Maybe HitRec]
pHitBVH (Packet _ rays) Empty = replicate (length rays) Nothing | 106 | pHitBVH (Packet _ rays) Empty = replicate (length rays) Nothing | 63 | true | true | 0 | 10 | 22 | 55 | 26 | 29 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F09.hs | bsd-3-clause | ptr_glGetColorTableSGI :: FunPtr (GLenum -> GLenum -> GLenum -> Ptr a -> IO ())
ptr_glGetColorTableSGI = unsafePerformIO $ getCommand "glGetColorTableSGI" | 154 | ptr_glGetColorTableSGI :: FunPtr (GLenum -> GLenum -> GLenum -> Ptr a -> IO ())
ptr_glGetColorTableSGI = unsafePerformIO $ getCommand "glGetColorTableSGI" | 154 | ptr_glGetColorTableSGI = unsafePerformIO $ getCommand "glGetColorTableSGI" | 74 | false | true | 0 | 12 | 19 | 48 | 23 | 25 | null | null |
agrafix/legoDSL | Examples/ExampleCode.hs | bsd-3-clause | tree = mkTree $
do followF <- newFun
def followF follow
mainF <- newFun
def mainF $ do vCallF1 setSensorLight _IN_3_
curVal <- newVar
curVal $= callF1 sensor _IN_3_
while (true) $
curVal $= callF1 followF curVal
... | 363 | tree = mkTree $
do followF <- newFun
def followF follow
mainF <- newFun
def mainF $ do vCallF1 setSensorLight _IN_3_
curVal <- newVar
curVal $= callF1 sensor _IN_3_
while (true) $
curVal $= callF1 followF curVal
... | 363 | tree = mkTree $
do followF <- newFun
def followF follow
mainF <- newFun
def mainF $ do vCallF1 setSensorLight _IN_3_
curVal <- newVar
curVal $= callF1 sensor _IN_3_
while (true) $
curVal $= callF1 followF curVal
... | 363 | false | false | 0 | 14 | 169 | 103 | 43 | 60 | null | null |
romanb/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/CreateConfigurationTemplate.hs | mpl-2.0 | -- | If this configuration set is associated with an environment, the 'DeploymentStatus' parameter indicates the deployment status of this configuration set:
--
-- 'null': This configuration is not associated with a running environment.
--
-- 'pending': This is a draft configuration that is not deployed to the
-- assoc... | 1,177 | cctrDeploymentStatus :: Lens' CreateConfigurationTemplateResponse (Maybe ConfigurationDeploymentStatus)
cctrDeploymentStatus =
lens _cctrDeploymentStatus (\s a -> s { _cctrDeploymentStatus = a }) | 199 | cctrDeploymentStatus =
lens _cctrDeploymentStatus (\s a -> s { _cctrDeploymentStatus = a }) | 95 | true | true | 1 | 9 | 179 | 69 | 42 | 27 | null | null |
dbp/positionsites | src/Handler/Site.hs | bsd-3-clause | addDataFieldHandler :: Site -> AppHandler ()
addDataFieldHandler site = do
mid <- getParam "id"
case bsId mid of
Nothing -> pass
Just id' -> do
md <- getDataById site id'
case md of
Nothing -> pass
Just d -> do
newGenHandler site addDataFieldForm "data/add_field" $
... | 749 | addDataFieldHandler :: Site -> AppHandler ()
addDataFieldHandler site = do
mid <- getParam "id"
case bsId mid of
Nothing -> pass
Just id' -> do
md <- getDataById site id'
case md of
Nothing -> pass
Just d -> do
newGenHandler site addDataFieldForm "data/add_field" $
... | 749 | addDataFieldHandler site = do
mid <- getParam "id"
case bsId mid of
Nothing -> pass
Just id' -> do
md <- getDataById site id'
case md of
Nothing -> pass
Just d -> do
newGenHandler site addDataFieldForm "data/add_field" $
\(name, typ) ->
do items ... | 704 | false | true | 0 | 30 | 360 | 208 | 99 | 109 | null | null |
SamirTalwar/advent-of-code | 2021/AOC_16_1.hs | mit | hexCharToBin 'F' = [X, X, X, X] | 31 | hexCharToBin 'F' = [X, X, X, X] | 31 | hexCharToBin 'F' = [X, X, X, X] | 31 | false | false | 1 | 5 | 6 | 24 | 12 | 12 | null | null |
beni55/hermit | src/HERMIT/Name.hs | bsd-2-clause | cmpHN2Var :: HermitName -> Var -> Bool
cmpHN2Var hn = cmpHN2Name hn . varName | 77 | cmpHN2Var :: HermitName -> Var -> Bool
cmpHN2Var hn = cmpHN2Name hn . varName | 77 | cmpHN2Var hn = cmpHN2Name hn . varName | 38 | false | true | 0 | 8 | 13 | 35 | 15 | 20 | null | null |
WraithM/peertrader-backend | src/PeerTrader/Route/User.hs | bsd-3-clause | handleLogin :: Maybe T.Text -> AuthAppHandler ()
handleLogin authError = heistLocal (I.bindSplices errs) $ render "login"
where
errs = maybe mempty splice authError
splice err = "loginError" ## I.textSplice err
-- | Handle Login Submit | 246 | handleLogin :: Maybe T.Text -> AuthAppHandler ()
handleLogin authError = heistLocal (I.bindSplices errs) $ render "login"
where
errs = maybe mempty splice authError
splice err = "loginError" ## I.textSplice err
-- | Handle Login Submit | 246 | handleLogin authError = heistLocal (I.bindSplices errs) $ render "login"
where
errs = maybe mempty splice authError
splice err = "loginError" ## I.textSplice err
-- | Handle Login Submit | 197 | false | true | 0 | 9 | 45 | 79 | 37 | 42 | null | null |
np/hlatex | Language/LaTeX/Builder/Internal.hs | bsd-3-clause | parEnv :: String -> [Arg AnyItem] -> AnyItem -> ParItem
parEnv x ys = liftM2 (ParEnv x) (mapM (mapM anyItmM) ys) . anyItmM | 122 | parEnv :: String -> [Arg AnyItem] -> AnyItem -> ParItem
parEnv x ys = liftM2 (ParEnv x) (mapM (mapM anyItmM) ys) . anyItmM | 122 | parEnv x ys = liftM2 (ParEnv x) (mapM (mapM anyItmM) ys) . anyItmM | 66 | false | true | 0 | 10 | 22 | 63 | 31 | 32 | null | null |
nevrenato/Hets_Fork | Search/SPASS/FormulaWrapper.hs | gpl-2.0 | wrapTerm (SPComplexTerm SPImplied args) = wrapTerm (SPComplexTerm SPImplies (reverse args)) | 91 | wrapTerm (SPComplexTerm SPImplied args) = wrapTerm (SPComplexTerm SPImplies (reverse args)) | 91 | wrapTerm (SPComplexTerm SPImplied args) = wrapTerm (SPComplexTerm SPImplies (reverse args)) | 91 | false | false | 0 | 9 | 9 | 35 | 16 | 19 | null | null |
Airtnp/Freshman_Simple_Haskell_Lib | Intro/TAPL/subtying.hs | mit | typeShiftAbove d c tyT =
tyMap
(\c x n -> if x >= c then TyVar (x+d) (n+d) else TyVar x (n+d))
c tyT | 122 | typeShiftAbove d c tyT =
tyMap
(\c x n -> if x >= c then TyVar (x+d) (n+d) else TyVar x (n+d))
c tyT | 122 | typeShiftAbove d c tyT =
tyMap
(\c x n -> if x >= c then TyVar (x+d) (n+d) else TyVar x (n+d))
c tyT | 122 | false | false | 0 | 11 | 45 | 75 | 39 | 36 | null | null |
manyoo/reflex-dom | src/Reflex/Dom/Old.hs | bsd-3-clause | unsafePlaceElement :: MonadWidget t m => DOM.HTMLElement -> m (Element EventResult (DomBuilderSpace m) t)
unsafePlaceElement e = do
placeRawElement e
wrapRawElement e def | 174 | unsafePlaceElement :: MonadWidget t m => DOM.HTMLElement -> m (Element EventResult (DomBuilderSpace m) t)
unsafePlaceElement e = do
placeRawElement e
wrapRawElement e def | 174 | unsafePlaceElement e = do
placeRawElement e
wrapRawElement e def | 68 | false | true | 0 | 11 | 26 | 62 | 28 | 34 | null | null |
headprogrammingczar/cabal | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | dropExeExtension :: FilePath -> FilePath
dropExeExtension filepath =
case splitExtension filepath of
(filepath', extension) | extension `elem` exeExtensions -> filepath'
| otherwise -> filepath
-- | List of possible executable file extensions on the current platfor... | 322 | dropExeExtension :: FilePath -> FilePath
dropExeExtension filepath =
case splitExtension filepath of
(filepath', extension) | extension `elem` exeExtensions -> filepath'
| otherwise -> filepath
-- | List of possible executable file extensions on the current platfor... | 322 | dropExeExtension filepath =
case splitExtension filepath of
(filepath', extension) | extension `elem` exeExtensions -> filepath'
| otherwise -> filepath
-- | List of possible executable file extensions on the current platform. | 281 | false | true | 0 | 11 | 90 | 59 | 30 | 29 | null | null |
cbowdon/TDOP | Test/expr.hs | gpl-3.0 | evalResult = eval M.empty testExpr | 34 | evalResult = eval M.empty testExpr | 34 | evalResult = eval M.empty testExpr | 34 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
ocramz/yampy-cube | src/Input.hs | bsd-3-clause | nextAppInput inp (SDL.KeyboardEvent _ _ SDL.KeyPressed _ keysym) =
inp { inpKeyPressed = Just $ SDL.keysymScancode keysym } | 127 | nextAppInput inp (SDL.KeyboardEvent _ _ SDL.KeyPressed _ keysym) =
inp { inpKeyPressed = Just $ SDL.keysymScancode keysym } | 127 | nextAppInput inp (SDL.KeyboardEvent _ _ SDL.KeyPressed _ keysym) =
inp { inpKeyPressed = Just $ SDL.keysymScancode keysym } | 127 | false | false | 0 | 10 | 21 | 52 | 24 | 28 | null | null |
brendanhay/gogol | gogol-containerbuilder/gen/Network/Google/Resource/Cloudbuild/Projects/Locations/Triggers/Patch.hs | mpl-2.0 | -- | Multipart request metadata.
pltpPayload :: Lens' ProjectsLocationsTriggersPatch BuildTrigger
pltpPayload
= lens _pltpPayload (\ s a -> s{_pltpPayload = a}) | 162 | pltpPayload :: Lens' ProjectsLocationsTriggersPatch BuildTrigger
pltpPayload
= lens _pltpPayload (\ s a -> s{_pltpPayload = a}) | 129 | pltpPayload
= lens _pltpPayload (\ s a -> s{_pltpPayload = a}) | 64 | true | true | 0 | 9 | 22 | 42 | 22 | 20 | null | null |
kelnage/tamarin-prover | lib/theory/src/Theory/Constraint/Solver/ProofMethod.hs | gpl-3.0 | -- | Use a heuristic to schedule a 'GoalRanking' according to the given
-- proof-depth.
useHeuristic :: Heuristic -> Int -> GoalRanking
useHeuristic (Heuristic [] ) = error "useHeuristic: empty list of rankings" | 216 | useHeuristic :: Heuristic -> Int -> GoalRanking
useHeuristic (Heuristic [] ) = error "useHeuristic: empty list of rankings" | 128 | useHeuristic (Heuristic [] ) = error "useHeuristic: empty list of rankings" | 80 | true | true | 0 | 8 | 37 | 35 | 18 | 17 | null | null |
rueshyna/gogol | gogol-autoscaler/gen/Network/Google/Autoscaler/Types/Product.hs | mpl-2.0 | oZone :: Lens' Operation (Maybe Text)
oZone = lens _oZone (\ s a -> s{_oZone = a}) | 82 | oZone :: Lens' Operation (Maybe Text)
oZone = lens _oZone (\ s a -> s{_oZone = a}) | 82 | oZone = lens _oZone (\ s a -> s{_oZone = a}) | 44 | false | true | 0 | 9 | 16 | 45 | 24 | 21 | null | null |
IreneKnapp/Faction | faction/Distribution/Client/Targets.hs | bsd-3-clause | readPackageTarget :: Verbosity
-> PackageTarget (PackageLocation FilePath)
-> IO (PackageTarget SourcePackage)
readPackageTarget verbosity target = case target of
PackageTargetNamed pkgname constraints userTarget ->
return (PackageTargetNamed pkgname constraints userTarget... | 3,590 | readPackageTarget :: Verbosity
-> PackageTarget (PackageLocation FilePath)
-> IO (PackageTarget SourcePackage)
readPackageTarget verbosity target = case target of
PackageTargetNamed pkgname constraints userTarget ->
return (PackageTargetNamed pkgname constraints userTarget... | 3,590 | readPackageTarget verbosity target = case target of
PackageTargetNamed pkgname constraints userTarget ->
return (PackageTargetNamed pkgname constraints userTarget)
PackageTargetNamedFuzzy pkgname constraints userTarget ->
return (PackageTargetNamedFuzzy pkgname constraints userTarget)
Package... | 3,443 | false | true | 17 | 16 | 1,169 | 691 | 346 | 345 | null | null |
sol/aeson | tests/Encoders.hs | bsd-3-clause | thSomeTypeLiftToJSON2ElemArray :: LiftToJSON SomeType a
thSomeTypeLiftToJSON2ElemArray = $(mkLiftToJSON opts2ElemArray ''SomeType) | 130 | thSomeTypeLiftToJSON2ElemArray :: LiftToJSON SomeType a
thSomeTypeLiftToJSON2ElemArray = $(mkLiftToJSON opts2ElemArray ''SomeType) | 130 | thSomeTypeLiftToJSON2ElemArray = $(mkLiftToJSON opts2ElemArray ''SomeType) | 74 | false | true | 0 | 8 | 9 | 27 | 13 | 14 | null | null |
grnet/snf-ganeti | src/Ganeti/Types.hs | bsd-2-clause | diskTemplateMovable DTGluster = True | 40 | diskTemplateMovable DTGluster = True | 40 | diskTemplateMovable DTGluster = True | 40 | false | false | 0 | 4 | 7 | 10 | 4 | 6 | null | null |
rahulmutt/ghcvm | compiler/Eta/Types/TyCon.hs | bsd-3-clause | isProductTyCon :: TyCon -> Bool
-- True of datatypes or newtypes that have
-- one, vanilla, data constructor
isProductTyCon tc@(AlgTyCon {}) = case algTcRhs tc of
DataTyCon{ data_cons = [data_con] }
-> isVanillaDataCon data_con
... | 426 | isProductTyCon :: TyCon -> Bool
isProductTyCon tc@(AlgTyCon {}) = case algTcRhs tc of
DataTyCon{ data_cons = [data_con] }
-> isVanillaDataCon data_con
NewTyCon {} -> True
... | 347 | isProductTyCon tc@(AlgTyCon {}) = case algTcRhs tc of
DataTyCon{ data_cons = [data_con] }
-> isVanillaDataCon data_con
NewTyCon {} -> True
_ -> False | 315 | true | true | 6 | 6 | 208 | 59 | 35 | 24 | null | null |
zenhack/haskell-capnp | cmd/capnpc-haskell/Trans/Stage1ToFlat.hs | mit | applyBrandParams :: [C.TypeParamRef Flat.Node] -> C.MapBrand Flat.Node -> C.ListBrand Flat.Node
applyBrandParams params m = C.ListBrand $ map (`applyBrandParam` m) params | 170 | applyBrandParams :: [C.TypeParamRef Flat.Node] -> C.MapBrand Flat.Node -> C.ListBrand Flat.Node
applyBrandParams params m = C.ListBrand $ map (`applyBrandParam` m) params | 170 | applyBrandParams params m = C.ListBrand $ map (`applyBrandParam` m) params | 74 | false | true | 0 | 8 | 19 | 69 | 34 | 35 | null | null |
AlexanderPankiv/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprInstr (CVTSS2SD from to) = pprRegReg (sLit "cvtss2sd") from to | 70 | pprInstr (CVTSS2SD from to) = pprRegReg (sLit "cvtss2sd") from to | 70 | pprInstr (CVTSS2SD from to) = pprRegReg (sLit "cvtss2sd") from to | 70 | false | false | 0 | 7 | 14 | 30 | 14 | 16 | null | null |
olsner/ghc | testsuite/tests/ado/T12490.hs | bsd-3-clause | join :: Monad f => f (f a) -> f a
join = undefined | 50 | join :: Monad f => f (f a) -> f a
join = undefined | 50 | join = undefined | 16 | false | true | 0 | 10 | 13 | 40 | 17 | 23 | null | null |
kadena-io/pact | src-ghc/Pact/GasModel/GasTests.hs | bsd-3-clause | decryptCc20p1305Tests :: NativeDefName -> GasUnitTests
decryptCc20p1305Tests = defGasUnitTests allExprs
where
decryptExpr =
defPactExpression [text| (decrypt-cc20p1305
"Zi1REj5-iA"
"AAAAAAECAwQFBgcI"
"YWFk"
"FYP6lG7xq7aExvoaHIH8Jg"
"8520f... | 504 | decryptCc20p1305Tests :: NativeDefName -> GasUnitTests
decryptCc20p1305Tests = defGasUnitTests allExprs
where
decryptExpr =
defPactExpression [text| (decrypt-cc20p1305
"Zi1REj5-iA"
"AAAAAAECAwQFBgcI"
"YWFk"
"FYP6lG7xq7aExvoaHIH8Jg"
"8520f... | 504 | decryptCc20p1305Tests = defGasUnitTests allExprs
where
decryptExpr =
defPactExpression [text| (decrypt-cc20p1305
"Zi1REj5-iA"
"AAAAAAECAwQFBgcI"
"YWFk"
"FYP6lG7xq7aExvoaHIH8Jg"
"8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b... | 449 | false | true | 1 | 6 | 132 | 45 | 24 | 21 | null | null |
ivokosir/cogh | src/Graphics/Cogh/Color.hs | mit | transparent :: Color
transparent = Color 0 0 0 0 | 48 | transparent :: Color
transparent = Color 0 0 0 0 | 48 | transparent = Color 0 0 0 0 | 27 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
TakeLab/gpkex | runGP.hs | bsd-3-clause | rankCandidates :: (Candidate -> Maybe Float) -> M.Map [String] Candidate -> M.Map [String] Int
rankCandidates evF m = foldl (\m' (i,(_,k)) -> M.insert k i m') M.empty l
where l = zip [1..] $ sort $ M.foldWithKey (\k c s -> (solve (evF c), k) : s) [] m
solve (Nothing) = infi
solve (Just a ) = a | 312 | rankCandidates :: (Candidate -> Maybe Float) -> M.Map [String] Candidate -> M.Map [String] Int
rankCandidates evF m = foldl (\m' (i,(_,k)) -> M.insert k i m') M.empty l
where l = zip [1..] $ sort $ M.foldWithKey (\k c s -> (solve (evF c), k) : s) [] m
solve (Nothing) = infi
solve (Just a ) = a | 312 | rankCandidates evF m = foldl (\m' (i,(_,k)) -> M.insert k i m') M.empty l
where l = zip [1..] $ sort $ M.foldWithKey (\k c s -> (solve (evF c), k) : s) [] m
solve (Nothing) = infi
solve (Just a ) = a | 217 | false | true | 2 | 13 | 76 | 183 | 95 | 88 | null | null |
olorin/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/Types/Product.hs | mpl-2.0 | -- | Represents the color indicator that gives you information about the
-- health of the EC2 instance. For more information, see
-- <http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html Health Colors and Statuses>.
sihColor :: Lens' SingleInstanceHealth (Maybe Text)
sihColor = lens _sihCol... | 350 | sihColor :: Lens' SingleInstanceHealth (Maybe Text)
sihColor = lens _sihColor (\ s a -> s{_sihColor = a}) | 105 | sihColor = lens _sihColor (\ s a -> s{_sihColor = a}) | 53 | true | true | 1 | 9 | 44 | 51 | 27 | 24 | null | null |
keera-studios/hsQt | Qtc/ClassTypes/Gui.hs | bsd-2-clause | withQListQTextEditResult :: (Ptr (Ptr (TQTextEdit a)) -> IO CInt) -> IO [QTextEdit a]
withQListQTextEditResult f
= withQListObjectResult qtc_QTextEdit_getFinalizer f | 167 | withQListQTextEditResult :: (Ptr (Ptr (TQTextEdit a)) -> IO CInt) -> IO [QTextEdit a]
withQListQTextEditResult f
= withQListObjectResult qtc_QTextEdit_getFinalizer f | 167 | withQListQTextEditResult f
= withQListObjectResult qtc_QTextEdit_getFinalizer f | 81 | false | true | 0 | 12 | 20 | 57 | 27 | 30 | null | null |
aartifact/aartifact-verifier | src/ValidationPropositional.hs | mit | vAsu s (App (C Iff) (T[e1,e2])) (SrcL ts [s1,s2]) = SrcL ts [vAsu s e1 s1, vAsu s e2 s2] | 88 | vAsu s (App (C Iff) (T[e1,e2])) (SrcL ts [s1,s2]) = SrcL ts [vAsu s e1 s1, vAsu s e2 s2] | 88 | vAsu s (App (C Iff) (T[e1,e2])) (SrcL ts [s1,s2]) = SrcL ts [vAsu s e1 s1, vAsu s e2 s2] | 88 | false | false | 1 | 10 | 19 | 81 | 40 | 41 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Seq/JoinList.hs | mit | unzipWith = unzipWithUsingFoldr | 31 | unzipWith = unzipWithUsingFoldr | 31 | unzipWith = unzipWithUsingFoldr | 31 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
ekmett/wxHaskell | samples/wx/CustomControl.hs | lgpl-2.1 | -- main gui.
main
= start $
do f <- frame [text := "Custom color box controls"]
c <- colorBox f [boxcolor := red]
set f [layout := floatCenter $ widget c
,clientSize := sz 280 100]
-- Define a new custom "ColorBox" as a subclass of "Window". | 285 | main
= start $
do f <- frame [text := "Custom color box controls"]
c <- colorBox f [boxcolor := red]
set f [layout := floatCenter $ widget c
,clientSize := sz 280 100]
-- Define a new custom "ColorBox" as a subclass of "Window". | 272 | main
= start $
do f <- frame [text := "Custom color box controls"]
c <- colorBox f [boxcolor := red]
set f [layout := floatCenter $ widget c
,clientSize := sz 280 100]
-- Define a new custom "ColorBox" as a subclass of "Window". | 272 | true | false | 1 | 12 | 91 | 86 | 40 | 46 | null | null |
NerdGGuy/wai-middleware-oauth2 | src/Network/Wai/Middleware/OAuth2.hs | mit | getJSON :: FromJSON a => Manager -> AccessToken -> URI -> IO (OAuth2Result a)
getJSON = authGetJSON | 99 | getJSON :: FromJSON a => Manager -> AccessToken -> URI -> IO (OAuth2Result a)
getJSON = authGetJSON | 99 | getJSON = authGetJSON | 21 | false | true | 0 | 12 | 16 | 45 | 20 | 25 | null | null |
shockkolate/containers | tests/set-properties.hs | bsd-3-clause | ----------------------------------------------------------------
-- Unit tests
----------------------------------------------------------------
test_lookupLT :: Assertion
test_lookupLT = do
lookupLT 3 (fromList [3, 5]) @?= Nothing
lookupLT 5 (fromList [3, 5]) @?= Just 3 | 279 | test_lookupLT :: Assertion
test_lookupLT = do
lookupLT 3 (fromList [3, 5]) @?= Nothing
lookupLT 5 (fromList [3, 5]) @?= Just 3 | 134 | test_lookupLT = do
lookupLT 3 (fromList [3, 5]) @?= Nothing
lookupLT 5 (fromList [3, 5]) @?= Just 3 | 107 | true | true | 0 | 11 | 34 | 65 | 34 | 31 | null | null |
barischj/threepenny-gui-contextmenu | src/Graphics/UI/Threepenny/Ext/Contextmenu/Style.hs | bsd-3-clause | -- |Full-screen transparent target to close the menu.
rmTargetStyle = [
("height" , "0" )
, ("left" , "0" )
, ("position", "absolute")
, ("top" , "0" )
, ("width" , "0" )
] | 220 | rmTargetStyle = [
("height" , "0" )
, ("left" , "0" )
, ("position", "absolute")
, ("top" , "0" )
, ("width" , "0" )
] | 166 | rmTargetStyle = [
("height" , "0" )
, ("left" , "0" )
, ("position", "absolute")
, ("top" , "0" )
, ("width" , "0" )
] | 166 | true | false | 0 | 6 | 81 | 52 | 34 | 18 | null | null |
matterhorn-chat/matterhorn | src/Matterhorn/Config.hs | bsd-3-clause | findConfig (Just path) =
runExceptT $ do (warns, config) <- getConfig path
config' <- fixupPaths config
return (warns, config')
-- | Fix path references in the configuration:
--
-- * Rewrite the syntax directory path list with 'fixupSyntaxDirs'
-- * Expand "~" encountered in... | 359 | findConfig (Just path) =
runExceptT $ do (warns, config) <- getConfig path
config' <- fixupPaths config
return (warns, config')
-- | Fix path references in the configuration:
--
-- * Rewrite the syntax directory path list with 'fixupSyntaxDirs'
-- * Expand "~" encountered in... | 359 | findConfig (Just path) =
runExceptT $ do (warns, config) <- getConfig path
config' <- fixupPaths config
return (warns, config')
-- | Fix path references in the configuration:
--
-- * Rewrite the syntax directory path list with 'fixupSyntaxDirs'
-- * Expand "~" encountered in... | 359 | false | false | 0 | 9 | 95 | 61 | 31 | 30 | null | null |
brendanhay/gogol | gogol-classroom/gen/Network/Google/Classroom/Types/Product.hs | mpl-2.0 | -- | Possible choices.
mcqChoices :: Lens' MultipleChoiceQuestion [Text]
mcqChoices
= lens _mcqChoices (\ s a -> s{_mcqChoices = a}) .
_Default
. _Coerce | 167 | mcqChoices :: Lens' MultipleChoiceQuestion [Text]
mcqChoices
= lens _mcqChoices (\ s a -> s{_mcqChoices = a}) .
_Default
. _Coerce | 144 | mcqChoices
= lens _mcqChoices (\ s a -> s{_mcqChoices = a}) .
_Default
. _Coerce | 94 | true | true | 2 | 9 | 37 | 58 | 28 | 30 | null | null |
Munksgaard/SFOT | Asm/Parser.hs | mit | nop :: Parser Operation
nop = do
token "NOP"
return NOP | 59 | nop :: Parser Operation
nop = do
token "NOP"
return NOP | 59 | nop = do
token "NOP"
return NOP | 35 | false | true | 0 | 7 | 14 | 26 | 11 | 15 | null | null |
taylor1791/cis-194-spring | test/Test/Week10.hs | mit | week10 :: TestTree
week10 = testGroup "Week 10 - Applicative functors, Part I"
[
exercise1
, exercise2
, exercise3
, exercise4
, exercise5
] | 156 | week10 :: TestTree
week10 = testGroup "Week 10 - Applicative functors, Part I"
[
exercise1
, exercise2
, exercise3
, exercise4
, exercise5
] | 156 | week10 = testGroup "Week 10 - Applicative functors, Part I"
[
exercise1
, exercise2
, exercise3
, exercise4
, exercise5
] | 137 | false | true | 0 | 5 | 39 | 32 | 18 | 14 | null | null |
krapsh/kraps-haskell | src/Spark/Core/Internal/Utilities.hs | apache-2.0 | -- | show with Text
show' :: (Show a) => a -> Text
show' x = T.pack (show x) | 76 | show' :: (Show a) => a -> Text
show' x = T.pack (show x) | 56 | show' x = T.pack (show x) | 25 | true | true | 0 | 8 | 18 | 45 | 21 | 24 | null | null |
brendanhay/gogol | gogol-books/gen/Network/Google/Books/Types/Product.hs | mpl-2.0 | -- | A list of layer summary items.
layItems :: Lens' Layersummaries [Layersummary]
layItems
= lens _layItems (\ s a -> s{_layItems = a}) .
_Default
. _Coerce | 172 | layItems :: Lens' Layersummaries [Layersummary]
layItems
= lens _layItems (\ s a -> s{_layItems = a}) .
_Default
. _Coerce | 136 | layItems
= lens _layItems (\ s a -> s{_layItems = a}) .
_Default
. _Coerce | 88 | true | true | 1 | 10 | 41 | 55 | 28 | 27 | null | null |
brendanhay/gogol | gogol-oslogin/gen/Network/Google/Resource/OSLogin/Users/SSHPublicKeys/Patch.hs | mpl-2.0 | -- | Mask to control which fields get updated. Updates all if not present.
uspkpUpdateMask :: Lens' UsersSSHPublicKeysPatch (Maybe GFieldMask)
uspkpUpdateMask
= lens _uspkpUpdateMask
(\ s a -> s{_uspkpUpdateMask = a}) | 225 | uspkpUpdateMask :: Lens' UsersSSHPublicKeysPatch (Maybe GFieldMask)
uspkpUpdateMask
= lens _uspkpUpdateMask
(\ s a -> s{_uspkpUpdateMask = a}) | 150 | uspkpUpdateMask
= lens _uspkpUpdateMask
(\ s a -> s{_uspkpUpdateMask = a}) | 82 | true | true | 1 | 9 | 38 | 51 | 25 | 26 | null | null |
ekmett/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | toSlowEntryLbl :: CLabel -> CLabel
toSlowEntryLbl (IdLabel n c _) = IdLabel n c Slow | 84 | toSlowEntryLbl :: CLabel -> CLabel
toSlowEntryLbl (IdLabel n c _) = IdLabel n c Slow | 84 | toSlowEntryLbl (IdLabel n c _) = IdLabel n c Slow | 49 | false | true | 0 | 7 | 14 | 35 | 17 | 18 | null | null |
spechub/Hets | Taxonomy/MMiSSOntology.hs | gpl-2.0 | -- | convert to another monad
fromWithError :: (Monad m) => WithError a -> m a
fromWithError = either fail return | 113 | fromWithError :: (Monad m) => WithError a -> m a
fromWithError = either fail return | 83 | fromWithError = either fail return | 34 | true | true | 0 | 8 | 20 | 43 | 19 | 24 | null | null |
codders/gp3 | src/GP3GUI.hs | gpl-3.0 | loadPixmap :: MapInfo -> IO (Pixmap)
loadPixmap info = do
tileSet <- BPCK.parseImageFile (tileSetFile info)
let justTileSet = fromJust tileSet
tileMap <- BPCK.parseMapFile (mapFile info)
let justTileMap = fromJust tileMap
tiledPixmap <- createTiledPixmap justTileSet justTileMap
return tiledPixma... | 356 | loadPixmap :: MapInfo -> IO (Pixmap)
loadPixmap info = do
tileSet <- BPCK.parseImageFile (tileSetFile info)
let justTileSet = fromJust tileSet
tileMap <- BPCK.parseMapFile (mapFile info)
let justTileMap = fromJust tileMap
tiledPixmap <- createTiledPixmap justTileSet justTileMap
return tiledPixma... | 356 | loadPixmap info = do
tileSet <- BPCK.parseImageFile (tileSetFile info)
let justTileSet = fromJust tileSet
tileMap <- BPCK.parseMapFile (mapFile info)
let justTileMap = fromJust tileMap
tiledPixmap <- createTiledPixmap justTileSet justTileMap
return tiledPixmap
-- Creates a fresh blank MapState | 319 | false | true | 0 | 11 | 67 | 108 | 47 | 61 | null | null |
thomasdziedzic/hs-spotify | src/Spotify/Error.hs | mit | unwrapError Error_Lastfm_Auth_Error = sp_error_lastfm_auth_error | 72 | unwrapError Error_Lastfm_Auth_Error = sp_error_lastfm_auth_error | 72 | unwrapError Error_Lastfm_Auth_Error = sp_error_lastfm_auth_error | 72 | false | false | 0 | 4 | 11 | 10 | 4 | 6 | null | null |
conal/lambda-ccc | src/LambdaCCC/ReifySimple.hs | bsd-3-clause | {--------------------------------------------------------------------
Primitives
--------------------------------------------------------------------}
findIdP :: String -> TransformH a Id
findIdP = findIdT . primName | 221 | findIdP :: String -> TransformH a Id
findIdP = findIdT . primName | 65 | findIdP = findIdT . primName | 28 | true | true | 0 | 6 | 19 | 25 | 13 | 12 | null | null |
learnyou/lypaste | sdb.hs | agpl-3.0 | usageText :: Text -> Shell ()
usageText this = mapM_ err | 56 | usageText :: Text -> Shell ()
usageText this = mapM_ err | 56 | usageText this = mapM_ err | 26 | false | true | 0 | 8 | 10 | 30 | 13 | 17 | null | null |
forste/haReFork | tools/hs2isabelle/PropDecorate2Isabelle.hs | bsd-3-clause | transOAssertion (OA xs ds a) = {- ... -} transAssertion a | 57 | transOAssertion (OA xs ds a) = {- ... -} transAssertion a | 57 | transOAssertion (OA xs ds a) = {- ... -} transAssertion a | 57 | false | false | 0 | 7 | 10 | 23 | 11 | 12 | null | null |
michalkonecny/aern2 | aern2-mfun/src/AERN2/BoxFunMinMax/Expressions/Parsers/Smt.hs | bsd-3-clause | findVariablesInExpressions (EUnOp _ e) = findVariablesInExpressions e | 69 | findVariablesInExpressions (EUnOp _ e) = findVariablesInExpressions e | 69 | findVariablesInExpressions (EUnOp _ e) = findVariablesInExpressions e | 69 | false | false | 0 | 6 | 6 | 21 | 9 | 12 | null | null |
573/leksah | src/IDE/Package.hs | gpl-2.0 | delModFromBuildInfoExe :: ModuleName -> (String, CondTree ConfVar [Dependency] Executable) ->
(String, CondTree ConfVar [Dependency] Executable)
delModFromBuildInfoExe modName (str,ct@CondNode{condTreeData = exe}) =
(str, ct{condTreeData = exe{buildInfo = (buildInfo exe){otherModules =
delete modName (o... | 352 | delModFromBuildInfoExe :: ModuleName -> (String, CondTree ConfVar [Dependency] Executable) ->
(String, CondTree ConfVar [Dependency] Executable)
delModFromBuildInfoExe modName (str,ct@CondNode{condTreeData = exe}) =
(str, ct{condTreeData = exe{buildInfo = (buildInfo exe){otherModules =
delete modName (o... | 352 | delModFromBuildInfoExe modName (str,ct@CondNode{condTreeData = exe}) =
(str, ct{condTreeData = exe{buildInfo = (buildInfo exe){otherModules =
delete modName (otherModules (buildInfo exe))}}}) | 203 | false | true | 0 | 17 | 49 | 132 | 72 | 60 | null | null |
expipiplus1/vulkan | examples/offscreen/Main.hs | bsd-3-clause | -- Getters for global handles
getInstance :: V Instance
getInstance = V (asks ghInstance) | 90 | getInstance :: V Instance
getInstance = V (asks ghInstance) | 59 | getInstance = V (asks ghInstance) | 33 | true | true | 0 | 7 | 14 | 24 | 12 | 12 | null | null |
jtobin/sampling | lib/Numeric/Sampling.hs | mit | -- | (/O(n log n)/) 'psample' specialized to IO.
psampleIO :: Foldable f => Int -> f (Double, a) -> IO (Maybe [a])
psampleIO n weighted = withSystemRandom . asGenIO $ psample n weighted | 185 | psampleIO :: Foldable f => Int -> f (Double, a) -> IO (Maybe [a])
psampleIO n weighted = withSystemRandom . asGenIO $ psample n weighted | 136 | psampleIO n weighted = withSystemRandom . asGenIO $ psample n weighted | 70 | true | true | 0 | 11 | 33 | 66 | 33 | 33 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 33059981 = 3548 | 35 | getValueFromProduct 33059981 = 3548 | 35 | getValueFromProduct 33059981 = 3548 | 35 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
facebookincubator/duckling | Duckling/Time/EN/Rules.hs | bsd-3-clause | ruleIntersect :: Rule
ruleIntersect = Rule
{ name = "intersect"
, pattern =
[ Predicate $ isGrainFinerThan TG.Year
, Predicate $ or . sequence [isNotLatent, isGrainOfTime TG.Year]
]
, prod = \tokens -> case tokens of
(Token Time td1:Token Time td2:_)
| not (TTime.latent td1) || not (TTim... | 412 | ruleIntersect :: Rule
ruleIntersect = Rule
{ name = "intersect"
, pattern =
[ Predicate $ isGrainFinerThan TG.Year
, Predicate $ or . sequence [isNotLatent, isGrainOfTime TG.Year]
]
, prod = \tokens -> case tokens of
(Token Time td1:Token Time td2:_)
| not (TTime.latent td1) || not (TTim... | 412 | ruleIntersect = Rule
{ name = "intersect"
, pattern =
[ Predicate $ isGrainFinerThan TG.Year
, Predicate $ or . sequence [isNotLatent, isGrainOfTime TG.Year]
]
, prod = \tokens -> case tokens of
(Token Time td1:Token Time td2:_)
| not (TTime.latent td1) || not (TTime.latent td2) ->
... | 390 | false | true | 0 | 19 | 109 | 168 | 82 | 86 | null | null |
Arguggi/Frinfo | src/Frinfo/Config.hs | mit | ramColor :: Color
ramColor = "#e86f0c" | 38 | ramColor :: Color
ramColor = "#e86f0c" | 38 | ramColor = "#e86f0c" | 20 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
matterhorn-chat/matterhorn | src/Matterhorn/Types.hs | bsd-3-clause | getScheduledUserFetches :: MH [UserFetch]
getScheduledUserFetches = MH $ St.gets mhUsersToFetch | 95 | getScheduledUserFetches :: MH [UserFetch]
getScheduledUserFetches = MH $ St.gets mhUsersToFetch | 95 | getScheduledUserFetches = MH $ St.gets mhUsersToFetch | 53 | false | true | 0 | 7 | 9 | 26 | 13 | 13 | null | null |
MiroslavVitkov/voiceid | src/test.hs | mit | main :: IO ()
main = print "go" | 31 | main :: IO ()
main = print "go" | 31 | main = print "go" | 17 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
urbanslug/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | collectArgs :: Expr b -> (Expr b, [Arg b])
collectArgs expr
= go expr []
where
go (App f a) as = go f (a:as)
go e as = (e, as)
-- | Like @collectArgs@, but also collects looks through floatable
-- ticks if it means that we can find more arguments. | 268 | collectArgs :: Expr b -> (Expr b, [Arg b])
collectArgs expr
= go expr []
where
go (App f a) as = go f (a:as)
go e as = (e, as)
-- | Like @collectArgs@, but also collects looks through floatable
-- ticks if it means that we can find more arguments. | 268 | collectArgs expr
= go expr []
where
go (App f a) as = go f (a:as)
go e as = (e, as)
-- | Like @collectArgs@, but also collects looks through floatable
-- ticks if it means that we can find more arguments. | 225 | false | true | 2 | 10 | 72 | 109 | 49 | 60 | null | null |
AlexanderPankiv/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprInstr (MULLD reg1 reg2 ri@(RIImm _)) = pprLogic (sLit "mull") reg1 reg2 ri | 77 | pprInstr (MULLD reg1 reg2 ri@(RIImm _)) = pprLogic (sLit "mull") reg1 reg2 ri | 77 | pprInstr (MULLD reg1 reg2 ri@(RIImm _)) = pprLogic (sLit "mull") reg1 reg2 ri | 77 | false | false | 0 | 9 | 12 | 44 | 21 | 23 | null | null |
jwvg0425/HaskellScratchPad | src/solve_graph.hs | mit | dfs :: Node -> Node -> [Arc] -> [Node] -> Bool
dfs e n arcs visited
| e == n = True
| otherwise = foldl check False routes
where routes = [x | x@(a,b) <- arcs, a == n]
check acc x@(a,b) = if b `elem` visit then acc
else acc || (dfs e b arcs visit)
where visit = n:visi... | 323 | dfs :: Node -> Node -> [Arc] -> [Node] -> Bool
dfs e n arcs visited
| e == n = True
| otherwise = foldl check False routes
where routes = [x | x@(a,b) <- arcs, a == n]
check acc x@(a,b) = if b `elem` visit then acc
else acc || (dfs e b arcs visit)
where visit = n:visi... | 323 | dfs e n arcs visited
| e == n = True
| otherwise = foldl check False routes
where routes = [x | x@(a,b) <- arcs, a == n]
check acc x@(a,b) = if b `elem` visit then acc
else acc || (dfs e b arcs visit)
where visit = n:visited | 276 | false | true | 1 | 10 | 113 | 169 | 88 | 81 | null | null |
PierreR/basic-prelude | test-is-a-prelude.hs | mit | fst = P.fst | 11 | fst = P.fst | 11 | fst = P.fst | 11 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
sdiehl/ghc | libraries/base/Data/List/NonEmpty.hs | bsd-3-clause | nonEmpty (a:as) = Just (a :| as) | 32 | nonEmpty (a:as) = Just (a :| as) | 32 | nonEmpty (a:as) = Just (a :| as) | 32 | false | false | 0 | 7 | 6 | 26 | 13 | 13 | null | null |
tolysz/postgresql-simple | src/Database/PostgreSQL/Simple/FromField.hs | bsd-3-clause | fromArray :: FieldParser a -> TypeInfo -> Field -> Parser (Conversion [a])
fromArray fieldParser typeInfo f = sequence . (parseIt <$>) <$> array delim
where
delim = typdelim (typelem typeInfo)
fElem = f{ typeOid = typoid (typelem typeInfo) }
parseIt item =
fieldParser f' $ if item' == "NULL" then... | 471 | fromArray :: FieldParser a -> TypeInfo -> Field -> Parser (Conversion [a])
fromArray fieldParser typeInfo f = sequence . (parseIt <$>) <$> array delim
where
delim = typdelim (typelem typeInfo)
fElem = f{ typeOid = typoid (typelem typeInfo) }
parseIt item =
fieldParser f' $ if item' == "NULL" then... | 471 | fromArray fieldParser typeInfo f = sequence . (parseIt <$>) <$> array delim
where
delim = typdelim (typelem typeInfo)
fElem = f{ typeOid = typoid (typelem typeInfo) }
parseIt item =
fieldParser f' $ if item' == "NULL" then Nothing else Just item'
where
item' = fmt delim item
... | 396 | false | true | 0 | 12 | 140 | 170 | 84 | 86 | null | null |
Pitometsu/bake | src/Development/Bake/Server/Brain.hs | bsd-3-clause | update mem@Memory{..} (AddSkip author test)
| test `Map.member` storeSkip store = return $ Left "already skipped"
| otherwise = do
store <- storeUpdate store [SUAdd test author]
return $ Right mem{store = store} | 235 | update mem@Memory{..} (AddSkip author test)
| test `Map.member` storeSkip store = return $ Left "already skipped"
| otherwise = do
store <- storeUpdate store [SUAdd test author]
return $ Right mem{store = store} | 235 | update mem@Memory{..} (AddSkip author test)
| test `Map.member` storeSkip store = return $ Left "already skipped"
| otherwise = do
store <- storeUpdate store [SUAdd test author]
return $ Right mem{store = store} | 235 | false | false | 1 | 11 | 56 | 98 | 47 | 51 | null | null |
newmana/lets-lens | src/Lets/GetSetLens.hs | bsd-3-clause | -- | An alias for @product@.
(***) ::
Lens a b
-> Lens c d
-> Lens (a, c) (b, d)
(***) =
product | 104 | (***) ::
Lens a b
-> Lens c d
-> Lens (a, c) (b, d)
(***) =
product | 75 | (***) =
product | 17 | true | true | 0 | 9 | 31 | 53 | 29 | 24 | null | null |
fgaray/shakespeare | test/Text/Shakespeare/TextSpec.hs | mit | encodeUrlChar c@'_' = [c] | 25 | encodeUrlChar c@'_' = [c] | 25 | encodeUrlChar c@'_' = [c] | 25 | false | false | 0 | 6 | 3 | 15 | 8 | 7 | null | null |
atemerev/icfpc2013 | src/solver-lib/ProgramCounting.hs | apache-2.0 | defaultContext :: Context
defaultContext = newContext defaultAllowedOp1 defaultAllowedOp2 True True | 99 | defaultContext :: Context
defaultContext = newContext defaultAllowedOp1 defaultAllowedOp2 True True | 99 | defaultContext = newContext defaultAllowedOp1 defaultAllowedOp2 True True | 73 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | "dt" `closes` t | t `elem` ["dt","dd"] = True | 45 | "dt" `closes` t | t `elem` ["dt","dd"] = True | 45 | "dt" `closes` t | t `elem` ["dt","dd"] = True | 45 | false | false | 0 | 9 | 8 | 32 | 17 | 15 | null | null |
ktvoelker/AParsec | src/Text/Parsec/Applicative/Internal.hs | gpl-3.0 | strMsg :: [Char] -> ParseError
strMsg = flip (ParseError Nothing) Nothing . Just . T.pack | 89 | strMsg :: [Char] -> ParseError
strMsg = flip (ParseError Nothing) Nothing . Just . T.pack | 89 | strMsg = flip (ParseError Nothing) Nothing . Just . T.pack | 58 | false | true | 0 | 9 | 14 | 39 | 20 | 19 | null | null |
timtian090/Playground | Haskell/words/src/Lib.hs | mit | completed :: Game -> Bool
completed game = score game == totalWords game | 72 | completed :: Game -> Bool
completed game = score game == totalWords game | 72 | completed game = score game == totalWords game | 46 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
jota191/PLang | src/Parser.hs | gpl-3.0 | Assign = (\v _ e -> Assign v e) <$> pTVar <*> pTAssignSym <*> pExpr
| 69 | pAssign = (\v _ e -> Assign v e) <$> pTVar <*> pTAssignSym <*> pExpr | 69 | pAssign = (\v _ e -> Assign v e) <$> pTVar <*> pTAssignSym <*> pExpr | 69 | false | false | 1 | 10 | 16 | 38 | 18 | 20 | null | null |
christiaanb/SoOSiM-components | src/SoOSiM/Components/Thread/Behaviour.hs | mit | threadIState :: TH_State
threadIState = TH_State (-1) (-1) Nothing "" | 69 | threadIState :: TH_State
threadIState = TH_State (-1) (-1) Nothing "" | 69 | threadIState = TH_State (-1) (-1) Nothing "" | 44 | false | true | 0 | 7 | 9 | 30 | 16 | 14 | null | null |
spaceships/circuit-synthesis | src/Circuit/Format/Graphviz.hs | mit | -- Same as showCircuitT but resulting in a String
showCircuit :: Circuit ArithGate -> String
showCircuit = T.unpack . showCircuitT | 130 | showCircuit :: Circuit ArithGate -> String
showCircuit = T.unpack . showCircuitT | 80 | showCircuit = T.unpack . showCircuitT | 37 | true | true | 0 | 6 | 19 | 25 | 13 | 12 | null | null |
cryptica/slapnet | src/Solver/CommFreeReachability.hs | gpl-3.0 | checkCommFreeReachability :: PetriNet -> Formula -> ModelSI -> SBool
checkCommFreeReachability net f m =
checkStateEquation net f [] m &&&
checkMarkableSubnet net m | 180 | checkCommFreeReachability :: PetriNet -> Formula -> ModelSI -> SBool
checkCommFreeReachability net f m =
checkStateEquation net f [] m &&&
checkMarkableSubnet net m | 180 | checkCommFreeReachability net f m =
checkStateEquation net f [] m &&&
checkMarkableSubnet net m | 111 | false | true | 0 | 7 | 38 | 50 | 24 | 26 | null | null |
google/cabal2bazel | src/Google/Google3/Tools/Cabal2Build/Actions.hs | apache-2.0 | isSubPackage :: FilePath -> IO Bool
isSubPackage f = do
let metadataPath = takeDirectory f </> "METADATA"
exists <- doesFileExist metadataPath
if not exists
then return False
else not . isVersionsMetadata <$> Text.readFile metadataPath
-- TODO(judahjacobson): the correct implementation requ... | 346 | isSubPackage :: FilePath -> IO Bool
isSubPackage f = do
let metadataPath = takeDirectory f </> "METADATA"
exists <- doesFileExist metadataPath
if not exists
then return False
else not . isVersionsMetadata <$> Text.readFile metadataPath
-- TODO(judahjacobson): the correct implementation requ... | 346 | isSubPackage f = do
let metadataPath = takeDirectory f </> "METADATA"
exists <- doesFileExist metadataPath
if not exists
then return False
else not . isVersionsMetadata <$> Text.readFile metadataPath
-- TODO(judahjacobson): the correct implementation requires an internal protobuf. | 310 | false | true | 1 | 11 | 71 | 78 | 36 | 42 | null | null |
ivokosir/cogh | src/Graphics/Cogh/Vector.hs | mit | setLength :: Vector -> Float -> Vector
setLength v newLength
| oldLength == 0 = Point 0 0
| otherwise = scale lengthRatio v
where
oldLength = viewLength v
lengthRatio = newLength / oldLength | 204 | setLength :: Vector -> Float -> Vector
setLength v newLength
| oldLength == 0 = Point 0 0
| otherwise = scale lengthRatio v
where
oldLength = viewLength v
lengthRatio = newLength / oldLength | 204 | setLength v newLength
| oldLength == 0 = Point 0 0
| otherwise = scale lengthRatio v
where
oldLength = viewLength v
lengthRatio = newLength / oldLength | 165 | false | true | 2 | 8 | 47 | 73 | 34 | 39 | null | null |
KaneTW/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | mkPrompt [x] = "*" ++ dropExtension x | 37 | mkPrompt [x] = "*" ++ dropExtension x | 37 | mkPrompt [x] = "*" ++ dropExtension x | 37 | false | false | 0 | 6 | 6 | 19 | 9 | 10 | null | null |
co-dan/NPNTool | src/NPNTool/CTL.hs | bsd-3-clause | succSt g (Right (_,s)) = [toState s] | 36 | succSt g (Right (_,s)) = [toState s] | 36 | succSt g (Right (_,s)) = [toState s] | 36 | false | false | 0 | 8 | 6 | 29 | 15 | 14 | null | null |
christiaanb/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | needsCDecl (IdLabel _ _ _) = True | 46 | needsCDecl (IdLabel _ _ _) = True | 46 | needsCDecl (IdLabel _ _ _) = True | 46 | false | false | 0 | 7 | 19 | 19 | 9 | 10 | null | null |
epsilonhalbe/Sammelsurium | PXM-Parser/Raw/Parser.hs | bsd-3-clause | gray :: Depth -> Parser Word8
gray d = do let d' = fromIntegral d
g <- anyWord8
return $ assert (g <= d') g | 131 | gray :: Depth -> Parser Word8
gray d = do let d' = fromIntegral d
g <- anyWord8
return $ assert (g <= d') g | 131 | gray d = do let d' = fromIntegral d
g <- anyWord8
return $ assert (g <= d') g | 101 | false | true | 0 | 11 | 48 | 63 | 28 | 35 | null | null |
zaxtax/hakaru | haskell/Language/Hakaru/Pretty/Maple.hs | bsd-3-clause | mapleSCon (Summate _ _) = \(e1 :* e2 :* e3 :* End) ->
caseBind e3 $ \x e3' ->
showString "Sum("
. arg e3'
. showString ", "
. var1 x
. showChar '='
. arg e1
. showString "..("
. arg e2
. showString ")-1)" | 280 | mapleSCon (Summate _ _) = \(e1 :* e2 :* e3 :* End) ->
caseBind e3 $ \x e3' ->
showString "Sum("
. arg e3'
. showString ", "
. var1 x
. showChar '='
. arg e1
. showString "..("
. arg e2
. showString ")-1)" | 280 | mapleSCon (Summate _ _) = \(e1 :* e2 :* e3 :* End) ->
caseBind e3 $ \x e3' ->
showString "Sum("
. arg e3'
. showString ", "
. var1 x
. showChar '='
. arg e1
. showString "..("
. arg e2
. showString ")-1)" | 280 | false | false | 10 | 9 | 121 | 120 | 51 | 69 | null | null |
lenary/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | pprintRaw bound RType = text "RType" | 36 | pprintRaw bound RType = text "RType" | 36 | pprintRaw bound RType = text "RType" | 36 | false | false | 1 | 5 | 5 | 19 | 6 | 13 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/TermPrinter.hs | mit | isBlank :: String -> Bool
isBlank ('_' : rest) | (isJust ((readMaybe rest) :: Maybe Int)) = True | 96 | isBlank :: String -> Bool
isBlank ('_' : rest) | (isJust ((readMaybe rest) :: Maybe Int)) = True | 96 | isBlank ('_' : rest) | (isJust ((readMaybe rest) :: Maybe Int)) = True | 70 | false | true | 0 | 12 | 17 | 58 | 27 | 31 | null | null |
ChrisCoffey/haskell_sandbox | hackerRank/convexHull.hs | mit | clockwise :: Point -> Point -> Point -> Bool
clockwise o a b = (a `sub` o) `cross` (b `sub` o) <= 0 | 99 | clockwise :: Point -> Point -> Point -> Bool
clockwise o a b = (a `sub` o) `cross` (b `sub` o) <= 0 | 99 | clockwise o a b = (a `sub` o) `cross` (b `sub` o) <= 0 | 54 | false | true | 0 | 9 | 22 | 64 | 34 | 30 | null | null |
tidalcycles/Tidal | src/Sound/Tidal/UI.hs | gpl-3.0 | always :: (Pattern a -> Pattern a) -> Pattern a -> Pattern a
always = id | 72 | always :: (Pattern a -> Pattern a) -> Pattern a -> Pattern a
always = id | 72 | always = id | 11 | false | true | 0 | 9 | 15 | 44 | 19 | 25 | null | null |
wavewave/lhc-analysis-collection | heavyhiggs/combine2.hs | gpl-3.0 | sigoversqrtbkg ((b0,b1,b2,b3),(s0,s1,s2,s3)) = (sbf b0 s0, sbf b1 s1, sbf b2 s2, sbf b3 s3)
where sbf b s = s / sqrt b | 120 | sigoversqrtbkg ((b0,b1,b2,b3),(s0,s1,s2,s3)) = (sbf b0 s0, sbf b1 s1, sbf b2 s2, sbf b3 s3)
where sbf b s = s / sqrt b | 120 | sigoversqrtbkg ((b0,b1,b2,b3),(s0,s1,s2,s3)) = (sbf b0 s0, sbf b1 s1, sbf b2 s2, sbf b3 s3)
where sbf b s = s / sqrt b | 120 | false | false | 3 | 6 | 25 | 97 | 49 | 48 | null | null |
ekmett/ghc | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | bsd-3-clause | -- | Memory barrier instruction for LLVM >= 3.0
barrier :: LlvmM StmtData
barrier = do
let s = Fence False SyncSeqCst
return (unitOL s, [])
-- | Memory barrier instruction for LLVM < 3.0 | 195 | barrier :: LlvmM StmtData
barrier = do
let s = Fence False SyncSeqCst
return (unitOL s, [])
-- | Memory barrier instruction for LLVM < 3.0 | 147 | barrier = do
let s = Fence False SyncSeqCst
return (unitOL s, [])
-- | Memory barrier instruction for LLVM < 3.0 | 121 | true | true | 0 | 10 | 43 | 47 | 23 | 24 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/course/2014-10-edx-delft-fp101x-intro-to-fp-erik-meijer/hw07-parsing.hs | unlicense | ------------------------------------------------------------------------------
-- EXERCISE 2
e2 :: [Test]
e2 = U.t "e2"
(parse (return (1::Int)) "hello")
[(1,"hello")] | 178 | e2 :: [Test]
e2 = U.t "e2"
(parse (return (1::Int)) "hello")
[(1,"hello")] | 84 | e2 = U.t "e2"
(parse (return (1::Int)) "hello")
[(1,"hello")] | 71 | true | true | 0 | 9 | 26 | 62 | 32 | 30 | null | null |
ihc/futhark | src/futhark-test.hs | isc | interpretTestProgram :: String -> FilePath -> T.Text -> TestRun -> TestM ()
interpretTestProgram futharki program entry (TestRun _ inputValues expectedResult _) = do
input <- T.unlines . map prettyText <$> getValues dir inputValues
expectedResult' <- getExpectedResult dir expectedResult
(code, output, err) <-
... | 644 | interpretTestProgram :: String -> FilePath -> T.Text -> TestRun -> TestM ()
interpretTestProgram futharki program entry (TestRun _ inputValues expectedResult _) = do
input <- T.unlines . map prettyText <$> getValues dir inputValues
expectedResult' <- getExpectedResult dir expectedResult
(code, output, err) <-
... | 644 | interpretTestProgram futharki program entry (TestRun _ inputValues expectedResult _) = do
input <- T.unlines . map prettyText <$> getValues dir inputValues
expectedResult' <- getExpectedResult dir expectedResult
(code, output, err) <-
io $ readProcessWithExitCode futharki ["-e", T.unpack entry, program] $
... | 568 | false | true | 1 | 13 | 132 | 207 | 97 | 110 | null | null |
snoyberg/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | ppr_expr (HsArrForm op _ args)
= hang (text "(|" <+> ppr_lexpr op)
4 (sep (map (pprCmdArg.unLoc) args) <+> text "|)") | 128 | ppr_expr (HsArrForm op _ args)
= hang (text "(|" <+> ppr_lexpr op)
4 (sep (map (pprCmdArg.unLoc) args) <+> text "|)") | 128 | ppr_expr (HsArrForm op _ args)
= hang (text "(|" <+> ppr_lexpr op)
4 (sep (map (pprCmdArg.unLoc) args) <+> text "|)") | 128 | false | false | 0 | 11 | 30 | 68 | 31 | 37 | null | null |
alexander-at-github/eta | compiler/ETA/Utils/FastBool.hs | bsd-3-clause | isFastTrue 0# = False | 21 | isFastTrue 0# = False | 21 | isFastTrue 0# = False | 21 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.