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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kawu/data-morphosyntax | Text/Morphosyntax/Tagset.hs | bsd-2-clause | ruleSec :: Parser (M.Map POS [(Attr, Optional)])
ruleSec = do
secName "RULE" *> spaces
M.fromList <$> ruleLine `endBy` spaces | 133 | ruleSec :: Parser (M.Map POS [(Attr, Optional)])
ruleSec = do
secName "RULE" *> spaces
M.fromList <$> ruleLine `endBy` spaces | 133 | ruleSec = do
secName "RULE" *> spaces
M.fromList <$> ruleLine `endBy` spaces | 84 | false | true | 2 | 9 | 26 | 65 | 30 | 35 | null | null |
mcschroeder/ghc | compiler/basicTypes/Id.hs | bsd-3-clause | setIdOneShotInfo :: Id -> OneShotInfo -> Id
setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id | 118 | setIdOneShotInfo :: Id -> OneShotInfo -> Id
setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id | 118 | setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id | 74 | false | true | 0 | 8 | 14 | 40 | 20 | 20 | null | null |
Baranowski/SourceGraph | Analyse/Colors.hs | gpl-3.0 | cycleColor :: X11Color
cycleColor = DarkOrchid | 46 | cycleColor :: X11Color
cycleColor = DarkOrchid | 46 | cycleColor = DarkOrchid | 23 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
okue/Haskyapi | src/Web/Haskyapi.hs | mit | cshow :: Show a => a -> C.ByteString
cshow = C.pack . show | 58 | cshow :: Show a => a -> C.ByteString
cshow = C.pack . show | 58 | cshow = C.pack . show | 21 | false | true | 0 | 9 | 12 | 37 | 16 | 21 | null | null |
irori/hs2lazy | Optimizer.hs | bsd-3-clause | optExpr (Let bg e) = optLet bg e | 32 | optExpr (Let bg e) = optLet bg e | 32 | optExpr (Let bg e) = optLet bg e | 32 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
JPMoresmau/leksah-server | src/IDE/Metainfo/InterfaceCollector.hs | gpl-2.0 | filterExtras ('R':'e':'c':'F':'l':'a':'g':r)
= filterExtras (skipNextWord r) | 118 | filterExtras ('R':'e':'c':'F':'l':'a':'g':r)
= filterExtras (skipNextWord r) | 118 | filterExtras ('R':'e':'c':'F':'l':'a':'g':r)
= filterExtras (skipNextWord r) | 118 | false | false | 0 | 13 | 47 | 49 | 24 | 25 | null | null |
ezyang/ghc | compiler/types/Kind.hs | bsd-3-clause | tcIsStarKind (TyConApp tc [TyConApp ptr_rep []])
= tc `hasKey` tYPETyConKey
&& ptr_rep `hasKey` liftedRepDataConKey | 125 | tcIsStarKind (TyConApp tc [TyConApp ptr_rep []])
= tc `hasKey` tYPETyConKey
&& ptr_rep `hasKey` liftedRepDataConKey | 125 | tcIsStarKind (TyConApp tc [TyConApp ptr_rep []])
= tc `hasKey` tYPETyConKey
&& ptr_rep `hasKey` liftedRepDataConKey | 125 | false | false | 2 | 10 | 23 | 44 | 23 | 21 | null | null |
x-y-z/cabal | cabal-install/Distribution/Client/Config.hs | bsd-3-clause | defaultExtraPath :: IO [FilePath]
defaultExtraPath = do
dir <- defaultCabalDir
return [dir </> "bin"] | 105 | defaultExtraPath :: IO [FilePath]
defaultExtraPath = do
dir <- defaultCabalDir
return [dir </> "bin"] | 105 | defaultExtraPath = do
dir <- defaultCabalDir
return [dir </> "bin"] | 71 | false | true | 0 | 10 | 17 | 43 | 19 | 24 | null | null |
osa1/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | addAlist ((n, tm) : ds) ctxt = addDef n tm (addAlist ds ctxt) | 61 | addAlist ((n, tm) : ds) ctxt = addDef n tm (addAlist ds ctxt) | 61 | addAlist ((n, tm) : ds) ctxt = addDef n tm (addAlist ds ctxt) | 61 | false | false | 1 | 8 | 12 | 41 | 20 | 21 | null | null |
shouya/thinking-dumps | optics-exercises/test/ExerciseSpec.hs | mit | exercise_ProjectedIsos :: Spec
exercise_ProjectedIsos = do
it "1. Fill in the blank" $ do
("Beauty", "Age") ^. mapping reversed . swapped
`shouldBe` ("egA", "Beauty")
[True, False, True] ^. mapping (involuted not)
`shouldBe` [False, True, False]
[True, False, True] & mapping (involuted not) %~ filter id
`shouldBe` [False]
-- a function is a covariant functor on its return type
(show ^. mapping reversed) 1234
`shouldBe` "4321"
it "2. implement intNot with dimapping" $ do
intNot 0 `shouldBe` 1
intNot 1 `shouldBe` 0
evaluate (intNot 2) `shouldThrow` anyException
intNot' 0 `shouldBe` 1 | 657 | exercise_ProjectedIsos :: Spec
exercise_ProjectedIsos = do
it "1. Fill in the blank" $ do
("Beauty", "Age") ^. mapping reversed . swapped
`shouldBe` ("egA", "Beauty")
[True, False, True] ^. mapping (involuted not)
`shouldBe` [False, True, False]
[True, False, True] & mapping (involuted not) %~ filter id
`shouldBe` [False]
-- a function is a covariant functor on its return type
(show ^. mapping reversed) 1234
`shouldBe` "4321"
it "2. implement intNot with dimapping" $ do
intNot 0 `shouldBe` 1
intNot 1 `shouldBe` 0
evaluate (intNot 2) `shouldThrow` anyException
intNot' 0 `shouldBe` 1 | 657 | exercise_ProjectedIsos = do
it "1. Fill in the blank" $ do
("Beauty", "Age") ^. mapping reversed . swapped
`shouldBe` ("egA", "Beauty")
[True, False, True] ^. mapping (involuted not)
`shouldBe` [False, True, False]
[True, False, True] & mapping (involuted not) %~ filter id
`shouldBe` [False]
-- a function is a covariant functor on its return type
(show ^. mapping reversed) 1234
`shouldBe` "4321"
it "2. implement intNot with dimapping" $ do
intNot 0 `shouldBe` 1
intNot 1 `shouldBe` 0
evaluate (intNot 2) `shouldThrow` anyException
intNot' 0 `shouldBe` 1 | 626 | false | true | 0 | 16 | 158 | 222 | 116 | 106 | null | null |
yliu120/K3 | src/Language/K3/Analysis/HMTypes/Inference.hs | apache-2.0 | tvshallowLower :: K3 QType -> K3 QType -> TInfM (K3 QType)
tvshallowLower a b = tvshallowLowerRcr tvshallowLower a b | 116 | tvshallowLower :: K3 QType -> K3 QType -> TInfM (K3 QType)
tvshallowLower a b = tvshallowLowerRcr tvshallowLower a b | 116 | tvshallowLower a b = tvshallowLowerRcr tvshallowLower a b | 57 | false | true | 0 | 9 | 18 | 46 | 21 | 25 | null | null |
jsavatgy/dit-doo | code/roots-02.hs | gpl-2.0 | treeV r = Map.showTreeWith (\k x -> show (k,x)) True False r | 60 | treeV r = Map.showTreeWith (\k x -> show (k,x)) True False r | 60 | treeV r = Map.showTreeWith (\k x -> show (k,x)) True False r | 60 | false | false | 1 | 9 | 11 | 42 | 20 | 22 | null | null |
reflex-frp/reflex | src/Reflex/Class.hs | bsd-3-clause | -- | Create a new 'Event' that occurs when the supplied 'Event' occurs by
-- combining it with the current value of the 'Behavior'.
attachWith :: Reflex t => (a -> b -> c) -> Behavior t a -> Event t b -> Event t c
attachWith f = attachWithMaybe $ \a b -> Just $ f a b | 267 | attachWith :: Reflex t => (a -> b -> c) -> Behavior t a -> Event t b -> Event t c
attachWith f = attachWithMaybe $ \a b -> Just $ f a b | 135 | attachWith f = attachWithMaybe $ \a b -> Just $ f a b | 53 | true | true | 0 | 9 | 58 | 81 | 40 | 41 | null | null |
MateVM/hs-java | Java/Lang.hs | lgpl-3.0 | stringClass :: FieldType
stringClass = ObjectType string | 57 | stringClass :: FieldType
stringClass = ObjectType string | 57 | stringClass = ObjectType string | 31 | false | true | 0 | 5 | 7 | 14 | 7 | 7 | null | null |
CloudI/CloudI | src/api/haskell/external/bytestring-0.10.10.0/Data/ByteString/Builder/Prim/Internal/Floating.hs | mit | encodeDoubleViaWord64F :: FixedPrim Word64 -> FixedPrim Double
encodeDoubleViaWord64F w64fe
| size w64fe < sizeOf (undefined :: Float) =
error $ "encodeDoubleViaWord64F: encoding not wide enough"
| otherwise = fixedPrim (size w64fe) $ \x op -> do
poke (castPtr op) x
x' <- peek (castPtr op)
runF w64fe x' op | 335 | encodeDoubleViaWord64F :: FixedPrim Word64 -> FixedPrim Double
encodeDoubleViaWord64F w64fe
| size w64fe < sizeOf (undefined :: Float) =
error $ "encodeDoubleViaWord64F: encoding not wide enough"
| otherwise = fixedPrim (size w64fe) $ \x op -> do
poke (castPtr op) x
x' <- peek (castPtr op)
runF w64fe x' op | 335 | encodeDoubleViaWord64F w64fe
| size w64fe < sizeOf (undefined :: Float) =
error $ "encodeDoubleViaWord64F: encoding not wide enough"
| otherwise = fixedPrim (size w64fe) $ \x op -> do
poke (castPtr op) x
x' <- peek (castPtr op)
runF w64fe x' op | 272 | false | true | 2 | 13 | 76 | 127 | 56 | 71 | null | null |
aaronc/Idris-dev | src/Idris/Elab/Data.hs | bsd-3-clause | warnLC :: FC -> Name -> Idris ()
warnLC fc n
= iWarn fc $ annName n <+> text "has a name which may be implicitly bound."
<> line <> text "This is likely to lead to problems!" | 188 | warnLC :: FC -> Name -> Idris ()
warnLC fc n
= iWarn fc $ annName n <+> text "has a name which may be implicitly bound."
<> line <> text "This is likely to lead to problems!" | 188 | warnLC fc n
= iWarn fc $ annName n <+> text "has a name which may be implicitly bound."
<> line <> text "This is likely to lead to problems!" | 155 | false | true | 8 | 9 | 51 | 66 | 27 | 39 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2021/M01/D29/Solution.hs | mit | {--
The output of indexWineriesMap will be the neo4j country mapped to the wiki
winery that's been updated with its corrected country name and indexed with the
neo4j node id.
>>> correctedCountries url
...
>>> let wikiw = it
>>> let iwm = indexWineriesMap ixneo wikiw
--}
-- Also, if the Wiki winery has a corrected country in its key, correct that
-- in the wiki winery value, itself, as well.
correctWikiWinery :: Country -> Winery -> Winery
correctWikiWinery c w@(Winery v c' ll) = Winery v (c' { name = c }) ll | 518 | correctWikiWinery :: Country -> Winery -> Winery
correctWikiWinery c w@(Winery v c' ll) = Winery v (c' { name = c }) ll | 119 | correctWikiWinery c w@(Winery v c' ll) = Winery v (c' { name = c }) ll | 70 | true | true | 0 | 8 | 97 | 58 | 32 | 26 | null | null |
ocharles/hackage-server | Distribution/Server/Pages/Index.hs | bsd-3-clause | normalizeCategory NoCategory = NoCategory | 41 | normalizeCategory NoCategory = NoCategory | 41 | normalizeCategory NoCategory = NoCategory | 41 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
haskellGardener/yusic | src/Yusic.hs | mit | toMidi Fs_Gb5 = 78 | 18 | toMidi Fs_Gb5 = 78 | 18 | toMidi Fs_Gb5 = 78 | 18 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
headprogrammingczar/cabal | cabal-install/Distribution/Solver/Modular/Tree.hs | bsd-3-clause | out (Done x ) = DoneF x | 43 | out (Done x ) = DoneF x | 43 | out (Done x ) = DoneF x | 43 | false | false | 0 | 6 | 26 | 19 | 8 | 11 | null | null |
sdiehl/ghc | compiler/main/Packages.hs | bsd-3-clause | libraryDirsForWay :: DynFlags -> UnitInfo -> [String]
libraryDirsForWay dflags
| WayDyn `elem` ways dflags = libraryDynDirs
| otherwise = libraryDirs | 169 | libraryDirsForWay :: DynFlags -> UnitInfo -> [String]
libraryDirsForWay dflags
| WayDyn `elem` ways dflags = libraryDynDirs
| otherwise = libraryDirs | 169 | libraryDirsForWay dflags
| WayDyn `elem` ways dflags = libraryDynDirs
| otherwise = libraryDirs | 115 | false | true | 1 | 9 | 39 | 48 | 24 | 24 | null | null |
kim/amazonka | amazonka-cognito-identity/gen/Network/AWS/CognitoIdentity/Types.hs | mpl-2.0 | -- | The Session Token portion of the credentials
cSessionToken :: Lens' Credentials (Maybe Text)
cSessionToken = lens _cSessionToken (\s a -> s { _cSessionToken = a }) | 168 | cSessionToken :: Lens' Credentials (Maybe Text)
cSessionToken = lens _cSessionToken (\s a -> s { _cSessionToken = a }) | 118 | cSessionToken = lens _cSessionToken (\s a -> s { _cSessionToken = a }) | 70 | true | true | 1 | 9 | 27 | 49 | 25 | 24 | null | null |
gridaphobe/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprFFormat FF32 = char 's' | 30 | pprFFormat FF32 = char 's' | 30 | pprFFormat FF32 = char 's' | 30 | false | false | 0 | 5 | 8 | 12 | 5 | 7 | null | null |
lukexi/ghc-7.8-arm64 | compiler/cmm/CLabel.hs | bsd-3-clause | mkStaticInfoTableLabel :: Name -> CafInfo -> CLabel
mkClosureLabel name c = IdLabel name c Closure | 115 | mkStaticInfoTableLabel :: Name -> CafInfo -> CLabel
mkClosureLabel name c = IdLabel name c Closure | 115 | mkClosureLabel name c = IdLabel name c Closure | 58 | false | true | 0 | 6 | 31 | 31 | 15 | 16 | null | null |
gnn/Hets | CMDL/DataTypesUtils.hs | gpl-2.0 | generatePrompter :: CmdlState -> String
generatePrompter st = let pst = prompter st in
(case i_state $ intState st of
Nothing -> ""
Just ist ->
let els = case elements ist of
[] -> delExtension (fileLoaded pst)
Element sm _ : r -> theoryName sm ++ if null r then "" else ".."
cm = case elements ist of
[] -> ""
es -> if cComorphism ist /= getIdComorphism es
then "*"
else ""
in els ++ cm) ++ prompterHead pst | 547 | generatePrompter :: CmdlState -> String
generatePrompter st = let pst = prompter st in
(case i_state $ intState st of
Nothing -> ""
Just ist ->
let els = case elements ist of
[] -> delExtension (fileLoaded pst)
Element sm _ : r -> theoryName sm ++ if null r then "" else ".."
cm = case elements ist of
[] -> ""
es -> if cComorphism ist /= getIdComorphism es
then "*"
else ""
in els ++ cm) ++ prompterHead pst | 547 | generatePrompter st = let pst = prompter st in
(case i_state $ intState st of
Nothing -> ""
Just ist ->
let els = case elements ist of
[] -> delExtension (fileLoaded pst)
Element sm _ : r -> theoryName sm ++ if null r then "" else ".."
cm = case elements ist of
[] -> ""
es -> if cComorphism ist /= getIdComorphism es
then "*"
else ""
in els ++ cm) ++ prompterHead pst | 507 | false | true | 0 | 21 | 220 | 185 | 88 | 97 | null | null |
rot26/gitit | plugins/Dot.hs | gpl-2.0 | -- | Generate a unique filename given the file's contents.
uniqueName :: String -> String
uniqueName = showDigest . sha1 . fromString | 133 | uniqueName :: String -> String
uniqueName = showDigest . sha1 . fromString | 74 | uniqueName = showDigest . sha1 . fromString | 43 | true | true | 0 | 6 | 21 | 24 | 13 | 11 | null | null |
henrytill/hecate | src/Data/ByteString64.hs | apache-2.0 | toBase64 :: BS.ByteString -> T.Text
toBase64 = decodeUtf8 . Base64.encode | 73 | toBase64 :: BS.ByteString -> T.Text
toBase64 = decodeUtf8 . Base64.encode | 73 | toBase64 = decodeUtf8 . Base64.encode | 37 | false | true | 0 | 6 | 9 | 25 | 13 | 12 | null | null |
Mahdi89/eTeak | src/ParseTree.hs | bsd-3-clause | exprPos (MaybeTypeExpr pos _) = pos | 35 | exprPos (MaybeTypeExpr pos _) = pos | 35 | exprPos (MaybeTypeExpr pos _) = pos | 35 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
urbanslug/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | thLevel (Brack s _) = thLevel s + 1 | 35 | thLevel (Brack s _) = thLevel s + 1 | 35 | thLevel (Brack s _) = thLevel s + 1 | 35 | false | false | 0 | 7 | 8 | 24 | 11 | 13 | null | null |
nevrenato/Hets_Fork | OWL2/OWL22CommonLogic.hs | gpl-2.0 | mk1QU :: SENTENCE -> SENTENCE
mk1QU = mkQuants . mkUnivQ [mk1NAME] | 66 | mk1QU :: SENTENCE -> SENTENCE
mk1QU = mkQuants . mkUnivQ [mk1NAME] | 66 | mk1QU = mkQuants . mkUnivQ [mk1NAME] | 36 | false | true | 0 | 7 | 10 | 25 | 13 | 12 | null | null |
Zoetermeer/latro | src/Latro/Typecheck.hs | mit | tcTy (SynTyInt _) = return tyInt | 32 | tcTy (SynTyInt _) = return tyInt | 32 | tcTy (SynTyInt _) = return tyInt | 32 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
Zankoku-Okuno/octopus | spotcheck.hs | gpl-3.0 | quoteDef = Cl (mkSq [mkXn [], mkSy "ast"]) (mkSy "ast") (mkXn []) | 65 | quoteDef = Cl (mkSq [mkXn [], mkSy "ast"]) (mkSy "ast") (mkXn []) | 65 | quoteDef = Cl (mkSq [mkXn [], mkSy "ast"]) (mkSy "ast") (mkXn []) | 65 | false | false | 0 | 10 | 11 | 47 | 23 | 24 | null | null |
wuxb45/eval | Eval/DServ.hs | bsd-3-clause | waitCloseSignal :: DServerData -> IO ()
waitCloseSignal dsd = do
(mvar :: MVar ()) <- newEmptyMVar
installH Sig.sigTERM (sigHandler mvar)
installH Sig.sigINT (sigHandler mvar)
installH Sig.sigQUIT (sigHandler mvar)
takeMVar mvar
putStrLn "closed!"
where
sigHandler mvar = do
void $ tryPutMVar mvar ()
Zoo.close (dsdZooKeeper dsd)
installH sig handler = void $
Sig.installHandler sig (Sig.CatchOnce $ handler) Nothing
-- }}}
-- }}}
-- client {{{
-- listServer {{{
-- list online servers, lookup info. from ZK. | 553 | waitCloseSignal :: DServerData -> IO ()
waitCloseSignal dsd = do
(mvar :: MVar ()) <- newEmptyMVar
installH Sig.sigTERM (sigHandler mvar)
installH Sig.sigINT (sigHandler mvar)
installH Sig.sigQUIT (sigHandler mvar)
takeMVar mvar
putStrLn "closed!"
where
sigHandler mvar = do
void $ tryPutMVar mvar ()
Zoo.close (dsdZooKeeper dsd)
installH sig handler = void $
Sig.installHandler sig (Sig.CatchOnce $ handler) Nothing
-- }}}
-- }}}
-- client {{{
-- listServer {{{
-- list online servers, lookup info. from ZK. | 553 | waitCloseSignal dsd = do
(mvar :: MVar ()) <- newEmptyMVar
installH Sig.sigTERM (sigHandler mvar)
installH Sig.sigINT (sigHandler mvar)
installH Sig.sigQUIT (sigHandler mvar)
takeMVar mvar
putStrLn "closed!"
where
sigHandler mvar = do
void $ tryPutMVar mvar ()
Zoo.close (dsdZooKeeper dsd)
installH sig handler = void $
Sig.installHandler sig (Sig.CatchOnce $ handler) Nothing
-- }}}
-- }}}
-- client {{{
-- listServer {{{
-- list online servers, lookup info. from ZK. | 513 | false | true | 4 | 11 | 119 | 192 | 84 | 108 | null | null |
lexml/lexml-linker | src/main/haskell/LexML/URN/Atalhos.hs | gpl-2.0 | selecionaResolucao = selecionaNormaAutoridade' (Just autoridadeSenado) ["resolucao"] | 84 | selecionaResolucao = selecionaNormaAutoridade' (Just autoridadeSenado) ["resolucao"] | 84 | selecionaResolucao = selecionaNormaAutoridade' (Just autoridadeSenado) ["resolucao"] | 84 | false | false | 1 | 7 | 5 | 23 | 10 | 13 | null | null |
rueshyna/gogol | gogol-android-publisher/gen/Network/Google/AndroidPublisher/Types/Product.hs | mpl-2.0 | -- | The name of the permission requested.
ehapkupName :: Lens' ExternallyHostedAPKUsesPermission (Maybe Text)
ehapkupName
= lens _ehapkupName (\ s a -> s{_ehapkupName = a}) | 175 | ehapkupName :: Lens' ExternallyHostedAPKUsesPermission (Maybe Text)
ehapkupName
= lens _ehapkupName (\ s a -> s{_ehapkupName = a}) | 132 | ehapkupName
= lens _ehapkupName (\ s a -> s{_ehapkupName = a}) | 64 | true | true | 0 | 9 | 26 | 48 | 25 | 23 | null | null |
scturtle/InferW | Infer.hs | unlicense | compose :: Sub -> Sub -> Sub
compose s1 s2 = Map.map (apply s1) s2 `Map.union` s1 | 81 | compose :: Sub -> Sub -> Sub
compose s1 s2 = Map.map (apply s1) s2 `Map.union` s1 | 81 | compose s1 s2 = Map.map (apply s1) s2 `Map.union` s1 | 52 | false | true | 0 | 8 | 16 | 45 | 23 | 22 | null | null |
Fuuzetsu/hcore | src/Core/Parser.hs | bsd-3-clause | pAExpr = pApply pVar EVar `pAlt` pApply pNum ENum
`pAlt` pConstr `pAlt` paren pExpr
where
paren p = pThen3 (\_ expr _ -> expr) (pLit "(") p (pLit ")") | 165 | pAExpr = pApply pVar EVar `pAlt` pApply pNum ENum
`pAlt` pConstr `pAlt` paren pExpr
where
paren p = pThen3 (\_ expr _ -> expr) (pLit "(") p (pLit ")") | 165 | pAExpr = pApply pVar EVar `pAlt` pApply pNum ENum
`pAlt` pConstr `pAlt` paren pExpr
where
paren p = pThen3 (\_ expr _ -> expr) (pLit "(") p (pLit ")") | 165 | false | false | 0 | 8 | 43 | 81 | 42 | 39 | null | null |
frantisekfarka/CoALP | tests/CoALP/Tests/Unit/Transform.hs | lgpl-3.0 | annotateTermTests :: TestTree
annotateTermTests = testGroup "Term Annotation Tests" [
testCase "Annotate single Var" $
annotateTermA v1 @?= a1
, testCase "Annotate Function with single Var" $
annotateTermA t1 @?= ta1
, testCase "Annotate Function with multiple Vars" $
annotateTermA t2 @?= ta2
]
where
v1 = Var (Ind 1) :: TermA
a1 = Var (CoInd 1) :: TermA
v2 = map (Var . Ind) [1..10] :: [TermA]
a2 = (map (Var . Ind) [1..9]) ++ [Var (CoInd 10)] :: [TermA]
t1 = Fun "t1" [v1] :: TermA
ta1 = Fun "t1" [a1] :: TermA
t2 = Fun "t2" v2 :: TermA
ta2 = Fun "t2" a2 :: TermA | 904 | annotateTermTests :: TestTree
annotateTermTests = testGroup "Term Annotation Tests" [
testCase "Annotate single Var" $
annotateTermA v1 @?= a1
, testCase "Annotate Function with single Var" $
annotateTermA t1 @?= ta1
, testCase "Annotate Function with multiple Vars" $
annotateTermA t2 @?= ta2
]
where
v1 = Var (Ind 1) :: TermA
a1 = Var (CoInd 1) :: TermA
v2 = map (Var . Ind) [1..10] :: [TermA]
a2 = (map (Var . Ind) [1..9]) ++ [Var (CoInd 10)] :: [TermA]
t1 = Fun "t1" [v1] :: TermA
ta1 = Fun "t1" [a1] :: TermA
t2 = Fun "t2" v2 :: TermA
ta2 = Fun "t2" a2 :: TermA | 904 | annotateTermTests = testGroup "Term Annotation Tests" [
testCase "Annotate single Var" $
annotateTermA v1 @?= a1
, testCase "Annotate Function with single Var" $
annotateTermA t1 @?= ta1
, testCase "Annotate Function with multiple Vars" $
annotateTermA t2 @?= ta2
]
where
v1 = Var (Ind 1) :: TermA
a1 = Var (CoInd 1) :: TermA
v2 = map (Var . Ind) [1..10] :: [TermA]
a2 = (map (Var . Ind) [1..9]) ++ [Var (CoInd 10)] :: [TermA]
t1 = Fun "t1" [v1] :: TermA
ta1 = Fun "t1" [a1] :: TermA
t2 = Fun "t2" v2 :: TermA
ta2 = Fun "t2" a2 :: TermA | 874 | false | true | 4 | 9 | 446 | 275 | 128 | 147 | null | null |
chreekat/snowdrift | Handler/SnowdriftEvent.hs | agpl-3.0 | getEventWikiPageR :: EventWikiPageId -> Handler ()
getEventWikiPageR event_wiki_page_id = do
languages <- getLanguages
runYDB $ do
EventWikiPage{..} <- get404 event_wiki_page_id
WikiPage{..} <- get404 eventWikiPageWikiPage
Project{..} <- get404 wikiPageProject
targets <- select $ from $ \wt -> do
where_ $ wt ^. WikiTargetPage ==. val eventWikiPageWikiPage
return wt
[ wiki_edit_id ] <- fmap unwrapValues $ select $ from $ \we -> do
where_ $ we ^. WikiEditPage ==. val eventWikiPageWikiPage
orderBy [ asc $ we ^. WikiEditTs ]
limit 1
return $ we ^. WikiEditId
let (Entity _ WikiTarget{..}:_) = pickTargetsByLanguage languages targets
lift $ redirect $ WikiEditR projectHandle wikiTargetLanguage wikiTargetTarget wiki_edit_id | 883 | getEventWikiPageR :: EventWikiPageId -> Handler ()
getEventWikiPageR event_wiki_page_id = do
languages <- getLanguages
runYDB $ do
EventWikiPage{..} <- get404 event_wiki_page_id
WikiPage{..} <- get404 eventWikiPageWikiPage
Project{..} <- get404 wikiPageProject
targets <- select $ from $ \wt -> do
where_ $ wt ^. WikiTargetPage ==. val eventWikiPageWikiPage
return wt
[ wiki_edit_id ] <- fmap unwrapValues $ select $ from $ \we -> do
where_ $ we ^. WikiEditPage ==. val eventWikiPageWikiPage
orderBy [ asc $ we ^. WikiEditTs ]
limit 1
return $ we ^. WikiEditId
let (Entity _ WikiTarget{..}:_) = pickTargetsByLanguage languages targets
lift $ redirect $ WikiEditR projectHandle wikiTargetLanguage wikiTargetTarget wiki_edit_id | 883 | getEventWikiPageR event_wiki_page_id = do
languages <- getLanguages
runYDB $ do
EventWikiPage{..} <- get404 event_wiki_page_id
WikiPage{..} <- get404 eventWikiPageWikiPage
Project{..} <- get404 wikiPageProject
targets <- select $ from $ \wt -> do
where_ $ wt ^. WikiTargetPage ==. val eventWikiPageWikiPage
return wt
[ wiki_edit_id ] <- fmap unwrapValues $ select $ from $ \we -> do
where_ $ we ^. WikiEditPage ==. val eventWikiPageWikiPage
orderBy [ asc $ we ^. WikiEditTs ]
limit 1
return $ we ^. WikiEditId
let (Entity _ WikiTarget{..}:_) = pickTargetsByLanguage languages targets
lift $ redirect $ WikiEditR projectHandle wikiTargetLanguage wikiTargetTarget wiki_edit_id | 832 | false | true | 0 | 19 | 258 | 268 | 121 | 147 | null | null |
mightymoose/liquidhaskell | benchmarks/llrbtree-0.1.1/Data/Set/RBTree-ord.hs | bsd-3-clause | el x (Node _ y a b) = case compare x y of
EQ -> append y a b
LT -> case a of
Leaf -> Node R y Leaf b
Node B _ _ _ -> lbalS y (del x a) b
_ -> let zoo = Node R y (del x a) b in zoo
GT -> case b of
Leaf -> Node R y a Leaf
Node B _ _ _ -> rbalS y a (del x b)
_ -> Node R y a (del x b)
{-@ append :: y:a -> l:RBT {v:a | v < y} -> r:RBTN {v:a | y < v} {(bh l)} -> (ARBT2 a l r) @-}
| 527 | del x (Node _ y a b) = case compare x y of
EQ -> append y a b
LT -> case a of
Leaf -> Node R y Leaf b
Node B _ _ _ -> lbalS y (del x a) b
_ -> let zoo = Node R y (del x a) b in zoo
GT -> case b of
Leaf -> Node R y a Leaf
Node B _ _ _ -> rbalS y a (del x b)
_ -> Node R y a (del x b)
{-@ append :: y:a -> l:RBT {v:a | v < y} -> r:RBTN {v:a | y < v} {(bh l)} -> (ARBT2 a l r) @-} | 527 | del x (Node _ y a b) = case compare x y of
EQ -> append y a b
LT -> case a of
Leaf -> Node R y Leaf b
Node B _ _ _ -> lbalS y (del x a) b
_ -> let zoo = Node R y (del x a) b in zoo
GT -> case b of
Leaf -> Node R y a Leaf
Node B _ _ _ -> rbalS y a (del x b)
_ -> Node R y a (del x b)
{-@ append :: y:a -> l:RBT {v:a | v < y} -> r:RBTN {v:a | y < v} {(bh l)} -> (ARBT2 a l r) @-} | 527 | false | false | 0 | 17 | 266 | 214 | 101 | 113 | null | null |
elieux/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | nlHsApp :: LHsExpr id -> LHsExpr id -> LHsExpr id
nlHsApp f x = noLoc (HsApp f x) | 81 | nlHsApp :: LHsExpr id -> LHsExpr id -> LHsExpr id
nlHsApp f x = noLoc (HsApp f x) | 81 | nlHsApp f x = noLoc (HsApp f x) | 31 | false | true | 0 | 8 | 17 | 48 | 21 | 27 | null | null |
kim/amazonka | amazonka-elasticache/gen/Network/AWS/ElastiCache/CreateReplicationGroup.hs | mpl-2.0 | -- | A single-element string list containing an Amazon Resource Name (ARN) that
-- uniquely identifies a Redis RDB snapshot file stored in Amazon S3. The
-- snapshot file will be used to populate the node group. The Amazon S3 object
-- name in the ARN cannot contain any commas.
--
-- Note: This parameter is only valid if the 'Engine' parameter is 'redis'.
--
-- Example of an Amazon S3 ARN: 'arn:aws:s3:::my_bucket/snapshot1.rdb'
crgSnapshotArns :: Lens' CreateReplicationGroup [Text]
crgSnapshotArns = lens _crgSnapshotArns (\s a -> s { _crgSnapshotArns = a }) . _List | 571 | crgSnapshotArns :: Lens' CreateReplicationGroup [Text]
crgSnapshotArns = lens _crgSnapshotArns (\s a -> s { _crgSnapshotArns = a }) . _List | 139 | crgSnapshotArns = lens _crgSnapshotArns (\s a -> s { _crgSnapshotArns = a }) . _List | 84 | true | true | 0 | 10 | 92 | 54 | 33 | 21 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/GeometryShader4.hs | bsd-3-clause | gl_TRIANGLES_ADJACENCY :: GLenum
gl_TRIANGLES_ADJACENCY = 0x000C | 64 | gl_TRIANGLES_ADJACENCY :: GLenum
gl_TRIANGLES_ADJACENCY = 0x000C | 64 | gl_TRIANGLES_ADJACENCY = 0x000C | 31 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
dalaing/type-systems | src/Ast/Type.hs | bsd-3-clause | instantiateTy :: (TyAstBound ki ty, TyAstTransversable ki ty)
=> Type ki ty a
-> Scope () (TyAst ki ty) (TyAstVar a)
-> Type ki ty a
instantiateTy (Type ty) s = Type . instantiate f $ s
where
f _ = ty | 248 | instantiateTy :: (TyAstBound ki ty, TyAstTransversable ki ty)
=> Type ki ty a
-> Scope () (TyAst ki ty) (TyAstVar a)
-> Type ki ty a
instantiateTy (Type ty) s = Type . instantiate f $ s
where
f _ = ty | 248 | instantiateTy (Type ty) s = Type . instantiate f $ s
where
f _ = ty | 73 | false | true | 0 | 10 | 89 | 108 | 52 | 56 | null | null |
tjakway/ghcjvm | compiler/utils/IOEnv.hs | bsd-3-clause | -- | Atomically update the reference. Does not force the evaluation of the
-- new variable contents. For strict update, use 'atomicUpdMutVar''.
atomicUpdMutVar :: IORef a -> (a -> (a, b)) -> IOEnv env b
atomicUpdMutVar var upd = liftIO (atomicModifyIORef var upd) | 265 | atomicUpdMutVar :: IORef a -> (a -> (a, b)) -> IOEnv env b
atomicUpdMutVar var upd = liftIO (atomicModifyIORef var upd) | 119 | atomicUpdMutVar var upd = liftIO (atomicModifyIORef var upd) | 60 | true | true | 0 | 9 | 44 | 58 | 30 | 28 | null | null |
piyush-kurur/yesod | yesod-core/Yesod/Request.hs | mit | -- | Lookup for cookie data.
lookupCookies :: Text -> GHandler s m [Text]
lookupCookies pn = do
rr <- getRequest
return $ lookup' pn $ reqCookies rr | 156 | lookupCookies :: Text -> GHandler s m [Text]
lookupCookies pn = do
rr <- getRequest
return $ lookup' pn $ reqCookies rr | 127 | lookupCookies pn = do
rr <- getRequest
return $ lookup' pn $ reqCookies rr | 82 | true | true | 0 | 9 | 35 | 53 | 25 | 28 | null | null |
abakst/symmetry | checker/src/Symmetry/SymbEx.hs | mit | symBool :: Boolean -> SymbEx Boolean
-------------------------------------------------
symBool b
= SE $ do u <- runSE symtt
return $ case b of
Left _ ->
ASum Nothing (Just u) Nothing
Right _ ->
ASum Nothing Nothing (Just u)
------------------------------------------------- | 387 | symBool :: Boolean -> SymbEx Boolean
symBool b
= SE $ do u <- runSE symtt
return $ case b of
Left _ ->
ASum Nothing (Just u) Nothing
Right _ ->
ASum Nothing Nothing (Just u)
------------------------------------------------- | 337 | symBool b
= SE $ do u <- runSE symtt
return $ case b of
Left _ ->
ASum Nothing (Just u) Nothing
Right _ ->
ASum Nothing Nothing (Just u)
------------------------------------------------- | 300 | true | true | 2 | 14 | 152 | 98 | 44 | 54 | null | null |
AndrasKovacs/trie-vector | Data/TrieVector.hs | mit | map :: forall a b. (a -> b) -> Vector a -> Vector b
map _ s@(Vector 0# _ _ _ ) = unsafeCoerce# s | 106 | map :: forall a b. (a -> b) -> Vector a -> Vector b
map _ s@(Vector 0# _ _ _ ) = unsafeCoerce# s | 105 | map _ s@(Vector 0# _ _ _ ) = unsafeCoerce# s | 53 | false | true | 0 | 8 | 34 | 61 | 31 | 30 | null | null |
SaintDubious/HaskellTracer | src/HaskellTracer/Vector.hs | bsd-3-clause | z :: Vector -> Double
z (Vector _ _ z) = z | 42 | z :: Vector -> Double
z (Vector _ _ z) = z | 42 | z (Vector _ _ z) = z | 20 | false | true | 0 | 6 | 11 | 32 | 15 | 17 | null | null |
kmate/HaRe | old/refactorer/RefacSimplify.hs | bsd-3-clause | createCall p = error ("createCall: " ++ (show p)) | 49 | createCall p = error ("createCall: " ++ (show p)) | 49 | createCall p = error ("createCall: " ++ (show p)) | 49 | false | false | 0 | 9 | 8 | 25 | 12 | 13 | null | null |
snoyberg/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy,
int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy,
word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy,
doubleElemRepDataConTy :: Type
[int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy,
int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy,
word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy,
doubleElemRepDataConTy] = map (mkTyConTy . promoteDataCon)
vecElemDataCons | 568 | int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy,
int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy,
word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy,
doubleElemRepDataConTy :: Type
[int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy,
int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy,
word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy,
doubleElemRepDataConTy] = map (mkTyConTy . promoteDataCon)
vecElemDataCons | 568 | [int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy,
int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy,
word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy,
doubleElemRepDataConTy] = map (mkTyConTy . promoteDataCon)
vecElemDataCons | 322 | false | true | 0 | 7 | 71 | 72 | 50 | 22 | null | null |
m15k/hs-dtd-text | Data/XML/DTD/Parse.hs | bsd-3-clause | renderValue (EntityPERef r) = pERefText r | 41 | renderValue (EntityPERef r) = pERefText r | 41 | renderValue (EntityPERef r) = pERefText r | 41 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
brendanhay/gogol | gogol-serviceconsumermanagement/gen/Network/Google/ServiceConsumerManagement/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'MonitoredResourceDescriptor' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mrdName'
--
-- * 'mrdDisplayName'
--
-- * 'mrdLabels'
--
-- * 'mrdType'
--
-- * 'mrdDescription'
--
-- * 'mrdLaunchStage'
monitoredResourceDescriptor
:: MonitoredResourceDescriptor
monitoredResourceDescriptor =
MonitoredResourceDescriptor'
{ _mrdName = Nothing
, _mrdDisplayName = Nothing
, _mrdLabels = Nothing
, _mrdType = Nothing
, _mrdDescription = Nothing
, _mrdLaunchStage = Nothing
} | 612 | monitoredResourceDescriptor
:: MonitoredResourceDescriptor
monitoredResourceDescriptor =
MonitoredResourceDescriptor'
{ _mrdName = Nothing
, _mrdDisplayName = Nothing
, _mrdLabels = Nothing
, _mrdType = Nothing
, _mrdDescription = Nothing
, _mrdLaunchStage = Nothing
} | 302 | monitoredResourceDescriptor =
MonitoredResourceDescriptor'
{ _mrdName = Nothing
, _mrdDisplayName = Nothing
, _mrdLabels = Nothing
, _mrdType = Nothing
, _mrdDescription = Nothing
, _mrdLaunchStage = Nothing
} | 239 | true | true | 0 | 6 | 118 | 64 | 46 | 18 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F07.hs | bsd-3-clause | ptr_glFinishAsyncSGIX :: FunPtr (Ptr GLuint -> IO GLint)
ptr_glFinishAsyncSGIX = unsafePerformIO $ getCommand "glFinishAsyncSGIX" | 129 | ptr_glFinishAsyncSGIX :: FunPtr (Ptr GLuint -> IO GLint)
ptr_glFinishAsyncSGIX = unsafePerformIO $ getCommand "glFinishAsyncSGIX" | 129 | ptr_glFinishAsyncSGIX = unsafePerformIO $ getCommand "glFinishAsyncSGIX" | 72 | false | true | 0 | 8 | 13 | 34 | 16 | 18 | null | null |
philderbeast/ghcjs | src/Compiler/Info.hs | mit | -- | get the library directory (ghcjs --print-libdir).
getLibDir :: DynFlags -> FilePath
getLibDir = {- (</>"lib") . -} sTopDir . settings | 138 | getLibDir :: DynFlags -> FilePath
getLibDir = {- (</>"lib") . -} sTopDir . settings | 83 | getLibDir = {- (</>"lib") . -} sTopDir . settings | 49 | true | true | 0 | 5 | 21 | 21 | 12 | 9 | null | null |
mjhopkins/StopPayingForFreeMonads | Expressions.hs | mit | --- implement
printExpr :: Print f => Fix f -> String
printExpr = undefined | 76 | printExpr :: Print f => Fix f -> String
printExpr = undefined | 61 | printExpr = undefined | 21 | true | true | 0 | 7 | 14 | 26 | 13 | 13 | null | null |
badarshahzad/Learn-Haskell | week 2 & 3/lab4.hs | mit | head'::[a] -> a
head'(x:s)=x | 28 | head'::[a] -> a
head'(x:s)=x | 28 | head'(x:s)=x | 12 | false | true | 0 | 9 | 3 | 35 | 16 | 19 | null | null |
peterokagey/haskellOEIS | src/Subsets/A272081.hs | apache-2.0 | a272081_list :: [Integer]
a272081_list = concatMap oneIndexed a272034_list | 74 | a272081_list :: [Integer]
a272081_list = concatMap oneIndexed a272034_list | 74 | a272081_list = concatMap oneIndexed a272034_list | 48 | false | true | 0 | 5 | 7 | 19 | 10 | 9 | null | null |
juretta/course | src/L02/List.hs | bsd-3-clause | c :: List (List Int)
c = a :| b :| Nil | 38 | c :: List (List Int)
c = a :| b :| Nil | 38 | c = a :| b :| Nil | 17 | false | true | 3 | 7 | 11 | 33 | 15 | 18 | null | null |
NMouad21/HaskellSamples | CommonWords.hs | mit | nCommonWords n s = take n . qSort' . compress . qSort . words $ s | 65 | nCommonWords n s = take n . qSort' . compress . qSort . words $ s | 65 | nCommonWords n s = take n . qSort' . compress . qSort . words $ s | 65 | false | false | 0 | 10 | 15 | 34 | 16 | 18 | null | null |
ml9951/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprLCmd :: OutputableBndr id => LHsCmd id -> SDoc
pprLCmd (L _ c) = pprCmd c | 76 | pprLCmd :: OutputableBndr id => LHsCmd id -> SDoc
pprLCmd (L _ c) = pprCmd c | 76 | pprLCmd (L _ c) = pprCmd c | 26 | false | true | 0 | 7 | 15 | 39 | 18 | 21 | null | null |
solidsnack/JSONb | Text/JSONb/Schema.hs | bsd-3-clause | collate (c0, Obj p0) ((c1, Obj p1):t)
| match p0 p1 = (c0 `plus` c1, Obj $ merge p0 p1):t
| otherwise = (c0, Obj p0):(c1, Obj p1):t | 165 | collate (c0, Obj p0) ((c1, Obj p1):t)
| match p0 p1 = (c0 `plus` c1, Obj $ merge p0 p1):t
| otherwise = (c0, Obj p0):(c1, Obj p1):t | 165 | collate (c0, Obj p0) ((c1, Obj p1):t)
| match p0 p1 = (c0 `plus` c1, Obj $ merge p0 p1):t
| otherwise = (c0, Obj p0):(c1, Obj p1):t | 165 | false | false | 1 | 9 | 61 | 106 | 55 | 51 | null | null |
mrakgr/futhark | src/Futhark/Optimise/Simplifier/Rules.hs | bsd-3-clause | simplifyConvOp _ _ (ConvOp op se)
| (from, to) <- convTypes op, from == to =
Just $ SubExp se | 97 | simplifyConvOp _ _ (ConvOp op se)
| (from, to) <- convTypes op, from == to =
Just $ SubExp se | 97 | simplifyConvOp _ _ (ConvOp op se)
| (from, to) <- convTypes op, from == to =
Just $ SubExp se | 97 | false | false | 0 | 9 | 23 | 55 | 26 | 29 | null | null |
rrnewton/stack | src/System/Process/Read.hs | bsd-3-clause | findExecutable eo name = liftIO $ do
m <- readIORef $ eoExeCache eo
epath <- case Map.lookup name m of
Just epath -> return epath
Nothing -> do
let loop [] = return $ Left $ ExecutableNotFound name (eoPath eo)
loop (dir:dirs) = do
let fp0 = dir FP.</> name
fps0
| null (eoExeExtension eo) = [fp0]
-- Support `stack exec foo.exe` on Windows
| otherwise = [fp0 ++ eoExeExtension eo, fp0]
testFPs [] = loop dirs
testFPs (fp:fps) = do
exists <- doesFileExist fp
if exists
then do
fp' <- makeAbsolute fp >>= parseAbsFile
return $ return fp'
else testFPs fps
testFPs fps0
epath <- loop $ eoPath eo
!() <- atomicModifyIORef (eoExeCache eo) $ \m' ->
(Map.insert name epath m', ())
return epath
return $ either throwM return epath
-- | Load up an EnvOverride from the standard environment | 1,276 | findExecutable eo name = liftIO $ do
m <- readIORef $ eoExeCache eo
epath <- case Map.lookup name m of
Just epath -> return epath
Nothing -> do
let loop [] = return $ Left $ ExecutableNotFound name (eoPath eo)
loop (dir:dirs) = do
let fp0 = dir FP.</> name
fps0
| null (eoExeExtension eo) = [fp0]
-- Support `stack exec foo.exe` on Windows
| otherwise = [fp0 ++ eoExeExtension eo, fp0]
testFPs [] = loop dirs
testFPs (fp:fps) = do
exists <- doesFileExist fp
if exists
then do
fp' <- makeAbsolute fp >>= parseAbsFile
return $ return fp'
else testFPs fps
testFPs fps0
epath <- loop $ eoPath eo
!() <- atomicModifyIORef (eoExeCache eo) $ \m' ->
(Map.insert name epath m', ())
return epath
return $ either throwM return epath
-- | Load up an EnvOverride from the standard environment | 1,276 | findExecutable eo name = liftIO $ do
m <- readIORef $ eoExeCache eo
epath <- case Map.lookup name m of
Just epath -> return epath
Nothing -> do
let loop [] = return $ Left $ ExecutableNotFound name (eoPath eo)
loop (dir:dirs) = do
let fp0 = dir FP.</> name
fps0
| null (eoExeExtension eo) = [fp0]
-- Support `stack exec foo.exe` on Windows
| otherwise = [fp0 ++ eoExeExtension eo, fp0]
testFPs [] = loop dirs
testFPs (fp:fps) = do
exists <- doesFileExist fp
if exists
then do
fp' <- makeAbsolute fp >>= parseAbsFile
return $ return fp'
else testFPs fps
testFPs fps0
epath <- loop $ eoPath eo
!() <- atomicModifyIORef (eoExeCache eo) $ \m' ->
(Map.insert name epath m', ())
return epath
return $ either throwM return epath
-- | Load up an EnvOverride from the standard environment | 1,276 | false | false | 3 | 29 | 637 | 342 | 156 | 186 | null | null |
matthewSorensen/himpress | Himpress/Modes.hs | bsd-3-clause | allModes = concat [textModes,haskellModes,spatialModes,transitionsModes] | 72 | allModes = concat [textModes,haskellModes,spatialModes,transitionsModes] | 72 | allModes = concat [textModes,haskellModes,spatialModes,transitionsModes] | 72 | false | false | 0 | 6 | 3 | 21 | 12 | 9 | null | null |
chadbrewbaker/combinat | Math/Combinat/Numbers/Primes.hs | bsd-3-clause | ow' :: (Num a, Integral b) => (a -> a -> a) -> (a -> a) -> a -> b -> a
pow' _ _ _ 0 = 1
| 88 | pow' :: (Num a, Integral b) => (a -> a -> a) -> (a -> a) -> a -> b -> a
pow' _ _ _ 0 = 1 | 88 | pow' _ _ _ 0 = 1 | 16 | false | true | 0 | 11 | 29 | 74 | 37 | 37 | null | null |
lukexi/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprInstr (OR size src dst) = pprSizeOpOp (sLit "or") size src dst | 67 | pprInstr (OR size src dst) = pprSizeOpOp (sLit "or") size src dst | 67 | pprInstr (OR size src dst) = pprSizeOpOp (sLit "or") size src dst | 67 | false | false | 0 | 7 | 13 | 34 | 16 | 18 | null | null |
nobsun/hs-bcopl | src/Language/BCoPL/DataLevel/ML1.hs | bsd-3-clause | pTrue = string "true" >> return (Bool True) | 45 | pTrue = string "true" >> return (Bool True) | 45 | pTrue = string "true" >> return (Bool True) | 45 | false | false | 1 | 8 | 9 | 25 | 10 | 15 | null | null |
pb-pravin/terareg | src/TeraReg/MatrixMult.hs | agpl-3.0 | qtStrass :: Matrix Double -> Matrix Double
qtStrass m =
let
(h, w) = size m
strass (Leaf q) =
let
s = fmap (subMatrixFromRect m) q
t = fmap tr s
in
strassQuads s t
strass (Node a b c d) =
let
m11 = strass a
m12 = strass b
m21 = strass c
m22 = strass d
in
(m11 ||| m12) === (m21 ||| m22)
-- strass n@(Node a11 a12 a21 a22) =
-- Leaf $ (m11 ||| m12) === (m21 ||| m22)
-- where
-- (Node m11 m12 m21 m22) = fmap strass n
-- strass q = fmap strass q
-- in
--
in
strass $ zorder (Rect 0 0 w h) quadwords | 807 | qtStrass :: Matrix Double -> Matrix Double
qtStrass m =
let
(h, w) = size m
strass (Leaf q) =
let
s = fmap (subMatrixFromRect m) q
t = fmap tr s
in
strassQuads s t
strass (Node a b c d) =
let
m11 = strass a
m12 = strass b
m21 = strass c
m22 = strass d
in
(m11 ||| m12) === (m21 ||| m22)
-- strass n@(Node a11 a12 a21 a22) =
-- Leaf $ (m11 ||| m12) === (m21 ||| m22)
-- where
-- (Node m11 m12 m21 m22) = fmap strass n
-- strass q = fmap strass q
-- in
--
in
strass $ zorder (Rect 0 0 w h) quadwords | 807 | qtStrass m =
let
(h, w) = size m
strass (Leaf q) =
let
s = fmap (subMatrixFromRect m) q
t = fmap tr s
in
strassQuads s t
strass (Node a b c d) =
let
m11 = strass a
m12 = strass b
m21 = strass c
m22 = strass d
in
(m11 ||| m12) === (m21 ||| m22)
-- strass n@(Node a11 a12 a21 a22) =
-- Leaf $ (m11 ||| m12) === (m21 ||| m22)
-- where
-- (Node m11 m12 m21 m22) = fmap strass n
-- strass q = fmap strass q
-- in
--
in
strass $ zorder (Rect 0 0 w h) quadwords | 764 | false | true | 0 | 15 | 427 | 200 | 100 | 100 | null | null |
javgh/metricsd-client | Network/Metricsd/Client.hs | bsd-3-clause | sendCounter :: MetricsdClientHandle -> String -> Integer -> IO ()
sendCounter h name value = sendMetric h $ name ++ ":" ++ show value ++ "|c\n" | 143 | sendCounter :: MetricsdClientHandle -> String -> Integer -> IO ()
sendCounter h name value = sendMetric h $ name ++ ":" ++ show value ++ "|c\n" | 143 | sendCounter h name value = sendMetric h $ name ++ ":" ++ show value ++ "|c\n" | 77 | false | true | 0 | 10 | 25 | 62 | 28 | 34 | null | null |
RaphaelJ/getwebb.org | Util/Extras.hs | gpl-3.0 | getDisplayable :: Hmac -> ImageAttrs -> Route App
getDisplayable hmac@(Hmac hmacTxt) attrs =
case imageAttrsDisplayable attrs of Just _ -> DownloadDisplayableR hmac
Nothing -> DownloadR hmacTxt
-- | Returns the URL to every HTML5 audio files which can be displayed in the
-- browser with thier mime-types. | 362 | getDisplayable :: Hmac -> ImageAttrs -> Route App
getDisplayable hmac@(Hmac hmacTxt) attrs =
case imageAttrsDisplayable attrs of Just _ -> DownloadDisplayableR hmac
Nothing -> DownloadR hmacTxt
-- | Returns the URL to every HTML5 audio files which can be displayed in the
-- browser with thier mime-types. | 362 | getDisplayable hmac@(Hmac hmacTxt) attrs =
case imageAttrsDisplayable attrs of Just _ -> DownloadDisplayableR hmac
Nothing -> DownloadR hmacTxt
-- | Returns the URL to every HTML5 audio files which can be displayed in the
-- browser with thier mime-types. | 312 | false | true | 0 | 8 | 103 | 66 | 32 | 34 | null | null |
rvion/ftgl-haskell | Graphics/Rendering/FTGL.hs | bsd-2-clause | encodeTag :: Char -> Char -> Char -> Char -> CInt
encodeTag a b c d =
(fromIntegral (ord a) `shift` 24)
.|. (fromIntegral (ord b) `shift` 16)
.|. (fromIntegral (ord c) `shift` 8)
.|. (fromIntegral (ord d)) | 226 | encodeTag :: Char -> Char -> Char -> Char -> CInt
encodeTag a b c d =
(fromIntegral (ord a) `shift` 24)
.|. (fromIntegral (ord b) `shift` 16)
.|. (fromIntegral (ord c) `shift` 8)
.|. (fromIntegral (ord d)) | 225 | encodeTag a b c d =
(fromIntegral (ord a) `shift` 24)
.|. (fromIntegral (ord b) `shift` 16)
.|. (fromIntegral (ord c) `shift` 8)
.|. (fromIntegral (ord d)) | 175 | false | true | 3 | 10 | 58 | 126 | 64 | 62 | null | null |
sheyll/b9-vm-image-builder | src/lib/B9/DiskImages.hs | mit | imageDestinationSharedImageName _ = Nothing | 43 | imageDestinationSharedImageName _ = Nothing | 43 | imageDestinationSharedImageName _ = Nothing | 43 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
GaloisInc/saw-script | heapster-saw/src/Verifier/SAW/Heapster/TypeChecker.hs | bsd-3-clause | tcPointerAtomic e = tcError (pos e) "Expected pointer perm" | 59 | tcPointerAtomic e = tcError (pos e) "Expected pointer perm" | 59 | tcPointerAtomic e = tcError (pos e) "Expected pointer perm" | 59 | false | false | 1 | 7 | 8 | 23 | 9 | 14 | null | null |
shlevy/ghc | compiler/cmm/CmmCommonBlockElim.hs | bsd-3-clause | eqMiddleWith eqBid (CmmUnsafeForeignCall t1 r1 a1)
(CmmUnsafeForeignCall t2 r2 a2)
= t1 == t2 && r1 == r2 && and (zipWith (eqExprWith eqBid) a1 a2) | 168 | eqMiddleWith eqBid (CmmUnsafeForeignCall t1 r1 a1)
(CmmUnsafeForeignCall t2 r2 a2)
= t1 == t2 && r1 == r2 && and (zipWith (eqExprWith eqBid) a1 a2) | 168 | eqMiddleWith eqBid (CmmUnsafeForeignCall t1 r1 a1)
(CmmUnsafeForeignCall t2 r2 a2)
= t1 == t2 && r1 == r2 && and (zipWith (eqExprWith eqBid) a1 a2) | 168 | false | false | 2 | 10 | 45 | 73 | 34 | 39 | null | null |
rueshyna/gogol | gogol-adsense/gen/Network/Google/AdSense/Types.hs | mpl-2.0 | -- | View and manage your AdSense data
adSenseScope :: Proxy '["https://www.googleapis.com/auth/adsense"]
adSenseScope = Proxy | 126 | adSenseScope :: Proxy '["https://www.googleapis.com/auth/adsense"]
adSenseScope = Proxy | 87 | adSenseScope = Proxy | 20 | true | true | 0 | 8 | 14 | 26 | 12 | 14 | null | null |
ameingast/categorizer | src/Categorizer/Configuration.hs | bsd-3-clause | addPortFromEnvironment :: Configuration -> IO Configuration
addPortFromEnvironment conf =
safeReadEnv "PORT" >>= \r -> case r of
Nothing -> return conf
Just p -> return conf { _port = p } | 208 | addPortFromEnvironment :: Configuration -> IO Configuration
addPortFromEnvironment conf =
safeReadEnv "PORT" >>= \r -> case r of
Nothing -> return conf
Just p -> return conf { _port = p } | 208 | addPortFromEnvironment conf =
safeReadEnv "PORT" >>= \r -> case r of
Nothing -> return conf
Just p -> return conf { _port = p } | 148 | false | true | 0 | 12 | 51 | 66 | 32 | 34 | null | null |
akhileshs/stack | src/Stack/Constants.hs | bsd-3-clause | -- | Extensions for modules that are preprocessed by common preprocessors.
haskellPreprocessorExts :: [Text]
haskellPreprocessorExts = ["gc", "chs", "hsc", "x", "y", "ly", "cpphs"] | 180 | haskellPreprocessorExts :: [Text]
haskellPreprocessorExts = ["gc", "chs", "hsc", "x", "y", "ly", "cpphs"] | 105 | haskellPreprocessorExts = ["gc", "chs", "hsc", "x", "y", "ly", "cpphs"] | 71 | true | true | 0 | 5 | 22 | 36 | 23 | 13 | null | null |
dmuneras/LambdaMethods | src/GramaticaConcreta.hs | gpl-2.0 | kwtxt = ["D", "E","e", "LN", "Sen", "Cos", "Tan", "Cot", "Sec", "Csc"] | 71 | kwtxt = ["D", "E","e", "LN", "Sen", "Cos", "Tan", "Cot", "Sec", "Csc"] | 71 | kwtxt = ["D", "E","e", "LN", "Sen", "Cos", "Tan", "Cot", "Sec", "Csc"] | 71 | false | false | 1 | 5 | 11 | 39 | 23 | 16 | null | null |
aBhallo/AoC2016 | Day 7/day7part2.hs | mit | convertToBAB _ = error "Input must be ABA" | 42 | convertToBAB _ = error "Input must be ABA" | 42 | convertToBAB _ = error "Input must be ABA" | 42 | false | false | 0 | 5 | 7 | 12 | 5 | 7 | null | null |
rueshyna/gogol | gogol-apps-calendar/gen/Network/Google/Resource/Calendar/ACL/Delete.hs | mpl-2.0 | -- | Creates a value of 'ACLDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'adCalendarId'
--
-- * 'adRuleId'
aclDelete
:: Text -- ^ 'adCalendarId'
-> Text -- ^ 'adRuleId'
-> ACLDelete
aclDelete pAdCalendarId_ pAdRuleId_ =
ACLDelete'
{ _adCalendarId = pAdCalendarId_
, _adRuleId = pAdRuleId_
} | 414 | aclDelete
:: Text -- ^ 'adCalendarId'
-> Text -- ^ 'adRuleId'
-> ACLDelete
aclDelete pAdCalendarId_ pAdRuleId_ =
ACLDelete'
{ _adCalendarId = pAdCalendarId_
, _adRuleId = pAdRuleId_
} | 211 | aclDelete pAdCalendarId_ pAdRuleId_ =
ACLDelete'
{ _adCalendarId = pAdCalendarId_
, _adRuleId = pAdRuleId_
} | 124 | true | true | 0 | 6 | 92 | 47 | 30 | 17 | null | null |
romanb/amazonka | amazonka-sns/gen/Network/AWS/SNS/CreateTopic.hs | mpl-2.0 | -- | The Amazon Resource Name (ARN) assigned to the created topic.
ctrTopicArn :: Lens' CreateTopicResponse (Maybe Text)
ctrTopicArn = lens _ctrTopicArn (\s a -> s { _ctrTopicArn = a }) | 185 | ctrTopicArn :: Lens' CreateTopicResponse (Maybe Text)
ctrTopicArn = lens _ctrTopicArn (\s a -> s { _ctrTopicArn = a }) | 118 | ctrTopicArn = lens _ctrTopicArn (\s a -> s { _ctrTopicArn = a }) | 64 | true | true | 0 | 9 | 30 | 46 | 25 | 21 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/Resources/RDSOptionGroup.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-optiongroup.html#cfn-rds-optiongroup-majorengineversion
rdsogMajorEngineVersion :: Lens' RDSOptionGroup (Val Text)
rdsogMajorEngineVersion = lens _rDSOptionGroupMajorEngineVersion (\s a -> s { _rDSOptionGroupMajorEngineVersion = a }) | 317 | rdsogMajorEngineVersion :: Lens' RDSOptionGroup (Val Text)
rdsogMajorEngineVersion = lens _rDSOptionGroupMajorEngineVersion (\s a -> s { _rDSOptionGroupMajorEngineVersion = a }) | 177 | rdsogMajorEngineVersion = lens _rDSOptionGroupMajorEngineVersion (\s a -> s { _rDSOptionGroupMajorEngineVersion = a }) | 118 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
jkoppel/compstrat | Data/Comp/Multi/Strategic.hs | bsd-3-clause | revAllbuR :: (Monad m, HTraversable f) => GRewriteM m (Term f) -> GRewriteM m (Term f)
revAllbuR f = revAllR (revAllbuR f) >=> f | 128 | revAllbuR :: (Monad m, HTraversable f) => GRewriteM m (Term f) -> GRewriteM m (Term f)
revAllbuR f = revAllR (revAllbuR f) >=> f | 128 | revAllbuR f = revAllR (revAllbuR f) >=> f | 41 | false | true | 0 | 10 | 23 | 73 | 34 | 39 | null | null |
mydaum/cabal | Cabal/Distribution/Simple/Command.hs | bsd-3-clause | boolOpt' :: (b -> Maybe Bool) -> (Bool -> b) -> OptFlags -> OptFlags
-> MkOptDescr (a -> b) (b -> a -> a) a
boolOpt' g s ffT ffF _sf _lf d get set = BoolOpt d ffT ffF (set.s) (g . get) | 196 | boolOpt' :: (b -> Maybe Bool) -> (Bool -> b) -> OptFlags -> OptFlags
-> MkOptDescr (a -> b) (b -> a -> a) a
boolOpt' g s ffT ffF _sf _lf d get set = BoolOpt d ffT ffF (set.s) (g . get) | 196 | boolOpt' g s ffT ffF _sf _lf d get set = BoolOpt d ffT ffF (set.s) (g . get) | 76 | false | true | 0 | 12 | 55 | 111 | 57 | 54 | null | null |
qpliu/esolang | 01_/hs/compiler2/GenLLVM.hs | gpl-3.0 | forwardRefPhi :: ([(Local,Label)] -> ForwardGen StLLVM String ())
-> GenLLVM (Local -> Label -> GenLLVM())
forwardRefPhi usePhi = do
fwdRef <- forwardRef (\ fwds -> usePhi (map (\ (FwdPhi local label) ->
(local,label))
fwds))
return (\ local label -> fwdRef (FwdPhi local label)) | 407 | forwardRefPhi :: ([(Local,Label)] -> ForwardGen StLLVM String ())
-> GenLLVM (Local -> Label -> GenLLVM())
forwardRefPhi usePhi = do
fwdRef <- forwardRef (\ fwds -> usePhi (map (\ (FwdPhi local label) ->
(local,label))
fwds))
return (\ local label -> fwdRef (FwdPhi local label)) | 407 | forwardRefPhi usePhi = do
fwdRef <- forwardRef (\ fwds -> usePhi (map (\ (FwdPhi local label) ->
(local,label))
fwds))
return (\ local label -> fwdRef (FwdPhi local label)) | 286 | false | true | 0 | 17 | 170 | 140 | 72 | 68 | null | null |
guoy34/ampersand | src/Database/Design/Ampersand/Prototype/ProtoUtil.hs | gpl-3.0 | phpIndent :: Int -> String
phpIndent i
| i < 0 = " " --space instead of \n
| otherwise = '\n':replicate i ' ' | 115 | phpIndent :: Int -> String
phpIndent i
| i < 0 = " " --space instead of \n
| otherwise = '\n':replicate i ' ' | 115 | phpIndent i
| i < 0 = " " --space instead of \n
| otherwise = '\n':replicate i ' ' | 88 | false | true | 2 | 8 | 30 | 56 | 24 | 32 | null | null |
junjihashimoto/persistent | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | andDollar = "$and" | 18 | andDollar = "$and" | 18 | andDollar = "$and" | 18 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
berdario/managemytime | src/ManageMyTime/Models.hs | bsd-3-clause | pickSelect _ True Nothing (Just to) = selectList [ItemDay <=. to ] [] | 77 | pickSelect _ True Nothing (Just to) = selectList [ItemDay <=. to ] [] | 77 | pickSelect _ True Nothing (Just to) = selectList [ItemDay <=. to ] [] | 77 | false | false | 0 | 7 | 20 | 35 | 17 | 18 | null | null |
narrative/stack | src/Stack/Types/Config.hs | bsd-3-clause | configMonoidRebuildGhcOptionsName :: Text
configMonoidRebuildGhcOptionsName = "rebuild-ghc-options" | 99 | configMonoidRebuildGhcOptionsName :: Text
configMonoidRebuildGhcOptionsName = "rebuild-ghc-options" | 99 | configMonoidRebuildGhcOptionsName = "rebuild-ghc-options" | 57 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
zyla/rybu | src/Rybu.hs | bsd-3-clause | -- | Compile the given program.
-- Returns either error message or model.
run :: String -> Either String String
run input = do
model <- left syntaxError $ parseModel "" input
output <- left semanticError $ generateDedan model
pure (output ++ "\n") | 253 | run :: String -> Either String String
run input = do
model <- left syntaxError $ parseModel "" input
output <- left semanticError $ generateDedan model
pure (output ++ "\n") | 179 | run input = do
model <- left syntaxError $ parseModel "" input
output <- left semanticError $ generateDedan model
pure (output ++ "\n") | 141 | true | true | 0 | 10 | 48 | 78 | 35 | 43 | null | null |
merijn/SNet2.0 | SNet/Variants.hs | gpl-3.0 | variantsToList :: Variants ps n -> (forall p . Pattern p -> r) -> [r]
variantsToList Empty _ = [] | 106 | variantsToList :: Variants ps n -> (forall p . Pattern p -> r) -> [r]
variantsToList Empty _ = [] | 106 | variantsToList Empty _ = [] | 36 | false | true | 0 | 10 | 28 | 49 | 25 | 24 | null | null |
dillonhuff/SECD | src/SECD/LambdaCalculus.hs | bsd-3-clause | floatVal = FloatNum | 19 | floatVal = FloatNum | 19 | floatVal = FloatNum | 19 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
forsyde/forsyde-atom | tests/VectorTest.hs | bsd-3-clause | prop_reverse_1 v = V.length v == V.length (V.reverse v)
where types = v :: Vector Int | 87 | prop_reverse_1 v = V.length v == V.length (V.reverse v)
where types = v :: Vector Int | 87 | prop_reverse_1 v = V.length v == V.length (V.reverse v)
where types = v :: Vector Int | 87 | false | false | 3 | 9 | 17 | 54 | 21 | 33 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 4781 = 4780 | 11 | 4781 = 4780 | 11 | 4781 = 4780 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
siddhanathan/ghc | libraries/base/Data/Foldable.hs | bsd-3-clause | foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldlM f z0 xs = foldr f' return xs z0
where f' x k z = f z x >>= k
-- | Map each element of a structure to an action, evaluate these
-- actions from left to right, and ignore the results. For a version
-- that doesn't ignore the results see 'Data.Traversable.traverse'. | 343 | foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldlM f z0 xs = foldr f' return xs z0
where f' x k z = f z x >>= k
-- | Map each element of a structure to an action, evaluate these
-- actions from left to right, and ignore the results. For a version
-- that doesn't ignore the results see 'Data.Traversable.traverse'. | 343 | foldlM f z0 xs = foldr f' return xs z0
where f' x k z = f z x >>= k
-- | Map each element of a structure to an action, evaluate these
-- actions from left to right, and ignore the results. For a version
-- that doesn't ignore the results see 'Data.Traversable.traverse'. | 273 | false | true | 0 | 10 | 78 | 100 | 50 | 50 | null | null |
thomasdziedzic/hs-spotify | src/Spotify/Error.hs | mit | sp_error_message = unsafePerformIO . (peekCString <=< c_sp_error_message) . unwrapError | 87 | sp_error_message = unsafePerformIO . (peekCString <=< c_sp_error_message) . unwrapError | 87 | sp_error_message = unsafePerformIO . (peekCString <=< c_sp_error_message) . unwrapError | 87 | false | false | 1 | 8 | 8 | 25 | 11 | 14 | null | null |
mpickering/ghc-exactprint | tests/examples/ghc710/Move1.hs | bsd-3-clause | definedPNs :: a -> [b]
definedPNs = undefined | 45 | definedPNs :: a -> [b]
definedPNs = undefined | 45 | definedPNs = undefined | 22 | false | true | 0 | 6 | 7 | 18 | 10 | 8 | null | null |
ciderpunx/cv-api | src/Db.hs | gpl-3.0 | createInterest :: CvKey -> Interest -> SqlPersistM (Key Interest)
createInterest cvKey i =
insert $ Interest (Just cvKey) (interestName i) (interestKeywords i) | 163 | createInterest :: CvKey -> Interest -> SqlPersistM (Key Interest)
createInterest cvKey i =
insert $ Interest (Just cvKey) (interestName i) (interestKeywords i) | 163 | createInterest cvKey i =
insert $ Interest (Just cvKey) (interestName i) (interestKeywords i) | 97 | false | true | 0 | 9 | 25 | 62 | 30 | 32 | null | null |
wrengr/bytestring-trie | dev/Bench/TrieFile.hs | bsd-3-clause | main :: IO ()
main = do
[file] <- getArgs
t <- readTrieFromFile file -- >>= evaluate
-- \`sort\`
-- S.putStrLn . S.unlines . T.keys $ t
-- \`wc -l\`
-- putStrLn . show . T.size $ t
{- -- Tests for comparing inferred foldl/foldr vs hand-written version
microbench "List.foldr elems" $ do
vs <- return $! T.elems t
n <- return $! foldr (\v r -> v `seq` (1+) $! r) (0::Int) vs
n `seq` (return () :: IO ())
microbench "Trie.foldr @elems" $ do
t' <- return $! t
n <- return $! F.foldr (\v r -> v `seq` (1+) $! r) (0::Int) t'
n `seq` (return () :: IO ())
microbench "Trie.foldl @elems" $ do
t' <- return $! t
n <- return $! F.foldl (\r v -> v `seq` (1+) $! r) (0::Int) t'
n `seq` (return () :: IO ())
-- -}
-- {- -- verify associativity of folds
putStrLn . show . take 20 . F.foldr (:) [] $ t
putStrLn . show . take 20 . T.foldrWithKey (const (:)) [] $ t
putStrLn . show . take 20 . F.foldl (flip (:)) [] $ t
-- -}
----------------------------------------------------------------
----------------------------------------------------------- fin. | 1,188 | main :: IO ()
main = do
[file] <- getArgs
t <- readTrieFromFile file -- >>= evaluate
-- \`sort\`
-- S.putStrLn . S.unlines . T.keys $ t
-- \`wc -l\`
-- putStrLn . show . T.size $ t
{- -- Tests for comparing inferred foldl/foldr vs hand-written version
microbench "List.foldr elems" $ do
vs <- return $! T.elems t
n <- return $! foldr (\v r -> v `seq` (1+) $! r) (0::Int) vs
n `seq` (return () :: IO ())
microbench "Trie.foldr @elems" $ do
t' <- return $! t
n <- return $! F.foldr (\v r -> v `seq` (1+) $! r) (0::Int) t'
n `seq` (return () :: IO ())
microbench "Trie.foldl @elems" $ do
t' <- return $! t
n <- return $! F.foldl (\r v -> v `seq` (1+) $! r) (0::Int) t'
n `seq` (return () :: IO ())
-- -}
-- {- -- verify associativity of folds
putStrLn . show . take 20 . F.foldr (:) [] $ t
putStrLn . show . take 20 . T.foldrWithKey (const (:)) [] $ t
putStrLn . show . take 20 . F.foldl (flip (:)) [] $ t
-- -}
----------------------------------------------------------------
----------------------------------------------------------- fin. | 1,188 | main = do
[file] <- getArgs
t <- readTrieFromFile file -- >>= evaluate
-- \`sort\`
-- S.putStrLn . S.unlines . T.keys $ t
-- \`wc -l\`
-- putStrLn . show . T.size $ t
{- -- Tests for comparing inferred foldl/foldr vs hand-written version
microbench "List.foldr elems" $ do
vs <- return $! T.elems t
n <- return $! foldr (\v r -> v `seq` (1+) $! r) (0::Int) vs
n `seq` (return () :: IO ())
microbench "Trie.foldr @elems" $ do
t' <- return $! t
n <- return $! F.foldr (\v r -> v `seq` (1+) $! r) (0::Int) t'
n `seq` (return () :: IO ())
microbench "Trie.foldl @elems" $ do
t' <- return $! t
n <- return $! F.foldl (\r v -> v `seq` (1+) $! r) (0::Int) t'
n `seq` (return () :: IO ())
-- -}
-- {- -- verify associativity of folds
putStrLn . show . take 20 . F.foldr (:) [] $ t
putStrLn . show . take 20 . T.foldrWithKey (const (:)) [] $ t
putStrLn . show . take 20 . F.foldl (flip (:)) [] $ t
-- -}
----------------------------------------------------------------
----------------------------------------------------------- fin. | 1,174 | false | true | 0 | 11 | 346 | 157 | 81 | 76 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.