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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
deech/stack | src/Stack/Types/Config.hs | bsd-3-clause | minimalEnvSettings :: EnvSettings
minimalEnvSettings =
EnvSettings
{ esIncludeLocals = False
, esIncludeGhcPackagePath = False
, esStackExe = False
, esLocaleUtf8 = False
} | 196 | minimalEnvSettings :: EnvSettings
minimalEnvSettings =
EnvSettings
{ esIncludeLocals = False
, esIncludeGhcPackagePath = False
, esStackExe = False
, esLocaleUtf8 = False
} | 196 | minimalEnvSettings =
EnvSettings
{ esIncludeLocals = False
, esIncludeGhcPackagePath = False
, esStackExe = False
, esLocaleUtf8 = False
} | 162 | false | true | 0 | 6 | 46 | 37 | 23 | 14 | null | null |
Ragnaroek/orwell | src/Orwell/Analyse.hs | gpl-3.0 | compareNumVal :: (Text, Int) -> (Text, Int) -> Ordering
compareNumVal a b = compare (snd b) (snd a) | 99 | compareNumVal :: (Text, Int) -> (Text, Int) -> Ordering
compareNumVal a b = compare (snd b) (snd a) | 99 | compareNumVal a b = compare (snd b) (snd a) | 43 | false | true | 0 | 7 | 17 | 53 | 28 | 25 | null | null |
dmalikov/multiset | Data/MultiSet.hs | bsd-3-clause | {--------------------------------------------------------------------
Lists
--------------------------------------------------------------------}
-- | /O(t)/. Convert the multiset to a list of elements.
toList :: MultiSet a -> [a]
toList = toAscList | 252 | toList :: MultiSet a -> [a]
toList = toAscList | 46 | toList = toAscList | 18 | true | true | 0 | 8 | 25 | 30 | 14 | 16 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/Runtime/Machine.hs | mit | uprim1 !ustk NEGI !i = do
m <- peekOff ustk i
ustk <- bump ustk
poke ustk (-m)
pure ustk | 96 | uprim1 !ustk NEGI !i = do
m <- peekOff ustk i
ustk <- bump ustk
poke ustk (-m)
pure ustk | 96 | uprim1 !ustk NEGI !i = do
m <- peekOff ustk i
ustk <- bump ustk
poke ustk (-m)
pure ustk | 96 | false | false | 2 | 10 | 27 | 57 | 24 | 33 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | captiously = id | 15 | captiously = id | 15 | captiously = id | 15 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
TomMD/ghc | utils/genprimopcode/Main.hs | bsd-3-clause | ppType (TyApp (TyCon "Addr#") []) = "addrPrimTy" | 54 | ppType (TyApp (TyCon "Addr#") []) = "addrPrimTy" | 54 | ppType (TyApp (TyCon "Addr#") []) = "addrPrimTy" | 54 | false | false | 0 | 9 | 12 | 25 | 12 | 13 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | mkLHsTupleExpr es = noLoc $ ExplicitTuple (map (noLoc . Present) es) Boxed | 75 | mkLHsTupleExpr es = noLoc $ ExplicitTuple (map (noLoc . Present) es) Boxed | 75 | mkLHsTupleExpr es = noLoc $ ExplicitTuple (map (noLoc . Present) es) Boxed | 75 | false | false | 0 | 10 | 12 | 33 | 16 | 17 | null | null |
haskell-distributed/distributed-process-platform | src/Control/Distributed/Process/Platform/ManagedProcess/Client.hs | bsd-3-clause | syncCallChan :: forall s a b . (Addressable s, Serializable a, Serializable b)
=> s -> a -> Process b
syncCallChan server msg = do
r <- syncSafeCallChan server msg
case r of
Left e -> die e
Right r' -> return r'
-- | A safe version of 'syncCallChan', which returns @Left ExitReason@ if the
-- call fails. | 328 | syncCallChan :: forall s a b . (Addressable s, Serializable a, Serializable b)
=> s -> a -> Process b
syncCallChan server msg = do
r <- syncSafeCallChan server msg
case r of
Left e -> die e
Right r' -> return r'
-- | A safe version of 'syncCallChan', which returns @Left ExitReason@ if the
-- call fails. | 328 | syncCallChan server msg = do
r <- syncSafeCallChan server msg
case r of
Left e -> die e
Right r' -> return r'
-- | A safe version of 'syncCallChan', which returns @Left ExitReason@ if the
-- call fails. | 217 | false | true | 0 | 11 | 82 | 105 | 50 | 55 | null | null |
felixsch/xdg | src/System/Environment/XDG/DesktopEntry.hs | gpl-3.0 | typeFromText :: String -> EntryType
typeFromText "Application" = Application | 76 | typeFromText :: String -> EntryType
typeFromText "Application" = Application | 76 | typeFromText "Application" = Application | 40 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
avieth/diplomacy | Diplomacy/Province.hs | bsd-3-clause | adjacency StPetersburg = [BarentsSea, Moscow, Livonia, GulfOfBothnia, Finland, Norway] | 86 | adjacency StPetersburg = [BarentsSea, Moscow, Livonia, GulfOfBothnia, Finland, Norway] | 86 | adjacency StPetersburg = [BarentsSea, Moscow, Livonia, GulfOfBothnia, Finland, Norway] | 86 | false | false | 0 | 5 | 8 | 27 | 16 | 11 | null | null |
ahanikel/raft | src/main/haskell/raft/Net.hs | bsd-3-clause | send :: Socket -> String -> SockAddr -> IO ()
send _ [] _ = return () | 80 | send :: Socket -> String -> SockAddr -> IO ()
send _ [] _ = return () | 80 | send _ [] _ = return () | 34 | false | true | 0 | 9 | 27 | 42 | 20 | 22 | null | null |
AlexeyRaga/eta | compiler/ETA/BasicTypes/Literal.hs | bsd-3-clause | double2IntLit (MachDouble f) = MachInt (truncate f) | 57 | double2IntLit (MachDouble f) = MachInt (truncate f) | 57 | double2IntLit (MachDouble f) = MachInt (truncate f) | 57 | false | false | 0 | 7 | 12 | 24 | 11 | 13 | null | null |
jotrk/xhb-ewmh | src/Graphics/XHB/Ewmh/Error.hs | bsd-2-clause | getNetClientList :: EwmhErrorCtx m => Connection -> m [WINDOW]
getNetClientList c = E.getNetClientList c >>= eitherToError | 122 | getNetClientList :: EwmhErrorCtx m => Connection -> m [WINDOW]
getNetClientList c = E.getNetClientList c >>= eitherToError | 122 | getNetClientList c = E.getNetClientList c >>= eitherToError | 59 | false | true | 0 | 8 | 15 | 40 | 19 | 21 | null | null |
phischu/fragnix | benchmarks/containers/Data.Sequence.hs | bsd-3-clause | -- One of the Digits is a Four.
rigidify (Deep s (Four a b c d) m sf) =
rigidify $ Deep s (Two a b) (node2 c d `consTree` m) sf | 130 | rigidify (Deep s (Four a b c d) m sf) =
rigidify $ Deep s (Two a b) (node2 c d `consTree` m) sf | 98 | rigidify (Deep s (Four a b c d) m sf) =
rigidify $ Deep s (Two a b) (node2 c d `consTree` m) sf | 98 | true | false | 2 | 8 | 34 | 74 | 35 | 39 | null | null |
ekmett/ekg | System/Remote/Label.hs | bsd-3-clause | -- | Set the label to the result of applying the given function to the
-- value.
modify :: (T.Text -> T.Text) -> Label -> IO ()
modify f (C ref) = do
!_ <- atomicModifyIORef ref $ \ i -> let i' = f i in (i', i')
return () | 229 | modify :: (T.Text -> T.Text) -> Label -> IO ()
modify f (C ref) = do
!_ <- atomicModifyIORef ref $ \ i -> let i' = f i in (i', i')
return () | 148 | modify f (C ref) = do
!_ <- atomicModifyIORef ref $ \ i -> let i' = f i in (i', i')
return () | 101 | true | true | 0 | 14 | 58 | 96 | 47 | 49 | null | null |
tjakway/ghcjvm | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | box :: String -- The class involved
-> TyCon -- The tycon involved
-> LHsExpr RdrName -- The argument
-> Type -- The argument type
-> LHsExpr RdrName -- Boxed version of the arg
-- See Note [Deriving and unboxed types] in TcDeriv
box cls_str tycon arg arg_ty = nlHsApp (nlHsVar box_con) arg
where
box_con = assoc_ty_id cls_str tycon boxConTbl arg_ty
--------------------- | 469 | box :: String -- The class involved
-> TyCon -- The tycon involved
-> LHsExpr RdrName -- The argument
-> Type -- The argument type
-> LHsExpr RdrName
box cls_str tycon arg arg_ty = nlHsApp (nlHsVar box_con) arg
where
box_con = assoc_ty_id cls_str tycon boxConTbl arg_ty
--------------------- | 388 | box cls_str tycon arg arg_ty = nlHsApp (nlHsVar box_con) arg
where
box_con = assoc_ty_id cls_str tycon boxConTbl arg_ty
--------------------- | 148 | true | true | 1 | 10 | 159 | 84 | 41 | 43 | null | null |
ekmett/ermine | src/Ermine/Pretty/Type.hs | bsd-2-clause | prettyType (Loc _ r) vs d = prettyType r vs d | 48 | prettyType (Loc _ r) vs d = prettyType r vs d | 48 | prettyType (Loc _ r) vs d = prettyType r vs d | 48 | false | false | 0 | 7 | 13 | 28 | 13 | 15 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-data/Data/Drasil/ExternalLibraries/ODELibraries.hs | bsd-2-clause | aTol = codevar $ implCQD "aTol_oslo" (nounPhrase
"absolute tolerance for ODE solution" "absolute tolerances for ODE solution")
Nothing Real (Label "AbsoluteTolerance") Nothing | 180 | aTol = codevar $ implCQD "aTol_oslo" (nounPhrase
"absolute tolerance for ODE solution" "absolute tolerances for ODE solution")
Nothing Real (Label "AbsoluteTolerance") Nothing | 180 | aTol = codevar $ implCQD "aTol_oslo" (nounPhrase
"absolute tolerance for ODE solution" "absolute tolerances for ODE solution")
Nothing Real (Label "AbsoluteTolerance") Nothing | 180 | false | false | 1 | 8 | 26 | 42 | 18 | 24 | null | null |
brendanhay/gogol | gogol-datafusion/gen/Network/Google/Resource/DataFusion/Projects/Locations/Operations/Cancel.hs | mpl-2.0 | -- | Creates a value of 'ProjectsLocationsOperationsCancel' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'plocXgafv'
--
-- * 'plocUploadProtocol'
--
-- * 'plocAccessToken'
--
-- * 'plocUploadType'
--
-- * 'plocPayload'
--
-- * 'plocName'
--
-- * 'plocCallback'
projectsLocationsOperationsCancel
:: CancelOperationRequest -- ^ 'plocPayload'
-> Text -- ^ 'plocName'
-> ProjectsLocationsOperationsCancel
projectsLocationsOperationsCancel pPlocPayload_ pPlocName_ =
ProjectsLocationsOperationsCancel'
{ _plocXgafv = Nothing
, _plocUploadProtocol = Nothing
, _plocAccessToken = Nothing
, _plocUploadType = Nothing
, _plocPayload = pPlocPayload_
, _plocName = pPlocName_
, _plocCallback = Nothing
} | 826 | projectsLocationsOperationsCancel
:: CancelOperationRequest -- ^ 'plocPayload'
-> Text -- ^ 'plocName'
-> ProjectsLocationsOperationsCancel
projectsLocationsOperationsCancel pPlocPayload_ pPlocName_ =
ProjectsLocationsOperationsCancel'
{ _plocXgafv = Nothing
, _plocUploadProtocol = Nothing
, _plocAccessToken = Nothing
, _plocUploadType = Nothing
, _plocPayload = pPlocPayload_
, _plocName = pPlocName_
, _plocCallback = Nothing
} | 477 | projectsLocationsOperationsCancel pPlocPayload_ pPlocName_ =
ProjectsLocationsOperationsCancel'
{ _plocXgafv = Nothing
, _plocUploadProtocol = Nothing
, _plocAccessToken = Nothing
, _plocUploadType = Nothing
, _plocPayload = pPlocPayload_
, _plocName = pPlocName_
, _plocCallback = Nothing
} | 325 | true | true | 0 | 6 | 150 | 87 | 60 | 27 | null | null |
DavidAlphaFox/ghc | libraries/xhtml/Text/XHtml/Strict/Elements.hs | bsd-3-clause | sup = tag "sup" | 32 | sup = tag "sup" | 32 | sup = tag "sup" | 32 | false | false | 0 | 5 | 20 | 9 | 4 | 5 | null | null |
mortberg/cubicaltt | Resolver.hs | mit | resolveRTele :: [Ident] -> [Resolver CTT.Ter] -> Resolver CTT.Tele
resolveRTele [] _ = return [] | 96 | resolveRTele :: [Ident] -> [Resolver CTT.Ter] -> Resolver CTT.Tele
resolveRTele [] _ = return [] | 96 | resolveRTele [] _ = return [] | 29 | false | true | 0 | 10 | 14 | 52 | 24 | 28 | null | null |
rueshyna/gogol | gogol-sqladmin/gen/Network/Google/Resource/SQL/Instances/Export.hs | mpl-2.0 | -- | Cloud SQL instance ID. This does not include the project ID.
ieInstance :: Lens' InstancesExport Text
ieInstance
= lens _ieInstance (\ s a -> s{_ieInstance = a}) | 168 | ieInstance :: Lens' InstancesExport Text
ieInstance
= lens _ieInstance (\ s a -> s{_ieInstance = a}) | 102 | ieInstance
= lens _ieInstance (\ s a -> s{_ieInstance = a}) | 61 | true | true | 1 | 9 | 30 | 46 | 22 | 24 | null | null |
lynnard/cocos2d-hs | src/Graphics/UI/Cocos2d/Sprite.hs | bsd-3-clause | castSpriteToNonconst :: SpriteConst -> Sprite
castSpriteToNonconst (SpriteConst ptr') = Sprite $ HoppyF.castPtr ptr' | 116 | castSpriteToNonconst :: SpriteConst -> Sprite
castSpriteToNonconst (SpriteConst ptr') = Sprite $ HoppyF.castPtr ptr' | 116 | castSpriteToNonconst (SpriteConst ptr') = Sprite $ HoppyF.castPtr ptr' | 70 | false | true | 0 | 7 | 12 | 37 | 17 | 20 | null | null |
yyotti/99Haskell | src/main/Lists.hs | mit | myButLast (_:xs) = myButLast xs | 31 | myButLast (_:xs) = myButLast xs | 31 | myButLast (_:xs) = myButLast xs | 31 | false | false | 0 | 7 | 4 | 19 | 9 | 10 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_TEXTURE30_ARB :: GLenum
gl_TEXTURE30_ARB = 0x84DE | 52 | gl_TEXTURE30_ARB :: GLenum
gl_TEXTURE30_ARB = 0x84DE | 52 | gl_TEXTURE30_ARB = 0x84DE | 25 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
AndreasPK/stack | src/Stack/Build/ConstructPlan.hs | bsd-3-clause | combineSourceInstalled :: PackageSource
-> (InstallLocation, Installed)
-> PackageInfo
combineSourceInstalled ps (location, installed) =
assert (piiVersion ps == installedVersion installed) $
assert (piiLocation ps == location) $
case location of
-- Always trust something in the snapshot
Snap -> PIOnlyInstalled location installed
Local -> PIBoth ps installed | 442 | combineSourceInstalled :: PackageSource
-> (InstallLocation, Installed)
-> PackageInfo
combineSourceInstalled ps (location, installed) =
assert (piiVersion ps == installedVersion installed) $
assert (piiLocation ps == location) $
case location of
-- Always trust something in the snapshot
Snap -> PIOnlyInstalled location installed
Local -> PIBoth ps installed | 442 | combineSourceInstalled ps (location, installed) =
assert (piiVersion ps == installedVersion installed) $
assert (piiLocation ps == location) $
case location of
-- Always trust something in the snapshot
Snap -> PIOnlyInstalled location installed
Local -> PIBoth ps installed | 309 | false | true | 2 | 10 | 127 | 101 | 50 | 51 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2021/M03/D29/Solution.hs | mit | counter ((f1, l1):f2:fs) =
counts f1 l1 ++ connector f1 (fst f2) ++ counter (f2:fs) | 86 | counter ((f1, l1):f2:fs) =
counts f1 l1 ++ connector f1 (fst f2) ++ counter (f2:fs) | 86 | counter ((f1, l1):f2:fs) =
counts f1 l1 ++ connector f1 (fst f2) ++ counter (f2:fs) | 86 | false | false | 0 | 9 | 17 | 60 | 30 | 30 | null | null |
grnet/snf-ganeti | test/hs/Test/Ganeti/Objects.hs | bsd-2-clause | -- | Check that filter predicate serialisation is idempotent.
prop_FilterPredicate_serialisation :: FilterPredicate -> Property
prop_FilterPredicate_serialisation = testSerialisation | 182 | prop_FilterPredicate_serialisation :: FilterPredicate -> Property
prop_FilterPredicate_serialisation = testSerialisation | 120 | prop_FilterPredicate_serialisation = testSerialisation | 54 | true | true | 0 | 5 | 16 | 16 | 9 | 7 | null | null |
osa1/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | constIsType (Fl _) = False | 26 | constIsType (Fl _) = False | 26 | constIsType (Fl _) = False | 26 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
Noeda/adeonbot | terminal-emulator/src/Terminal/Screen.hs | mit | thawScreen :: ScreenState -> ST s (ScreenStateMut s)
thawScreen (ScreenState cells) =
ScreenStateMut <$> MA.thaw cells | 120 | thawScreen :: ScreenState -> ST s (ScreenStateMut s)
thawScreen (ScreenState cells) =
ScreenStateMut <$> MA.thaw cells | 120 | thawScreen (ScreenState cells) =
ScreenStateMut <$> MA.thaw cells | 67 | false | true | 2 | 9 | 17 | 49 | 22 | 27 | null | null |
peti/funcmp | FMP/Turtle.hs | gpl-3.0 | fork :: Turtle -> Turtle -> Turtle
fork = TFork | 98 | fork :: Turtle -> Turtle -> Turtle
fork = TFork | 98 | fork = TFork | 38 | false | true | 0 | 6 | 60 | 19 | 10 | 9 | null | null |
rainbowbismuth/go-analyze | src/Go/Lexer.hs | gpl-3.0 | isOctalDigit :: Char -> Bool
isOctalDigit = C.isOctDigit | 56 | isOctalDigit :: Char -> Bool
isOctalDigit = C.isOctDigit | 56 | isOctalDigit = C.isOctDigit | 27 | false | true | 0 | 5 | 7 | 17 | 9 | 8 | null | null |
hectorhon/autotrace2 | src/TimeSeriesData/Expressions.hs | bsd-3-clause | eval (TknEquals TknInvalid _) = return TknInvalid | 53 | eval (TknEquals TknInvalid _) = return TknInvalid | 53 | eval (TknEquals TknInvalid _) = return TknInvalid | 53 | false | false | 0 | 7 | 10 | 20 | 9 | 11 | null | null |
gonimo/gonimo-back | src/Gonimo/CodeGen/TypeBridges.hs | agpl-3.0 | -- There is currently no Generic instance for PureScript's Data.Date,
-- so just use the JSON string in the frontend:
utcTimeBridge :: BridgePart
utcTimeBridge = do
typeName ^== "UTCTime"
return psGonimoDate | 213 | utcTimeBridge :: BridgePart
utcTimeBridge = do
typeName ^== "UTCTime"
return psGonimoDate | 95 | utcTimeBridge = do
typeName ^== "UTCTime"
return psGonimoDate | 67 | true | true | 0 | 8 | 36 | 33 | 14 | 19 | null | null |
rleshchinskiy/vector | Data/Vector/Primitive.hs | bsd-3-clause | filterM = G.filterM | 19 | filterM = G.filterM | 19 | filterM = G.filterM | 19 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/base/Data/ByteString/Lazy.hs | bsd-3-clause | -- | /O(n)/ Append two ByteStrings
append :: ByteString -> ByteString -> ByteString
append (LPS []) (LPS ys) = LPS ys | 117 | append :: ByteString -> ByteString -> ByteString
append (LPS []) (LPS ys) = LPS ys | 82 | append (LPS []) (LPS ys) = LPS ys | 33 | true | true | 0 | 11 | 20 | 47 | 22 | 25 | null | null |
beni55/cartel | lib/Cartel/Ast.hs | bsd-3-clause | -- | Sets Haskell 2010 as the @default-language@.
--
-- Currently not documented in Cabal, see
--
-- <https://github.com/haskell/cabal/issues/1894>
haskell2010 :: HasBuildInfo a => a
haskell2010 = buildInfo $ DefaultLanguage Haskell2010 | 236 | haskell2010 :: HasBuildInfo a => a
haskell2010 = buildInfo $ DefaultLanguage Haskell2010 | 88 | haskell2010 = buildInfo $ DefaultLanguage Haskell2010 | 53 | true | true | 0 | 6 | 30 | 30 | 17 | 13 | null | null |
awgn/cgrep | src/CGrep/Strategy/BoyerMoore.hs | gpl-2.0 | splitLines :: Text8 -> [(Text8,Offset)]
splitLines xs = zip ls off
where ls = C.lines xs
off = scanl (\o l -> 1 + o + C.length l) 0 ls
| 150 | splitLines :: Text8 -> [(Text8,Offset)]
splitLines xs = zip ls off
where ls = C.lines xs
off = scanl (\o l -> 1 + o + C.length l) 0 ls
| 150 | splitLines xs = zip ls off
where ls = C.lines xs
off = scanl (\o l -> 1 + o + C.length l) 0 ls
| 110 | false | true | 1 | 10 | 45 | 80 | 41 | 39 | null | null |
bgwines/horse-control | src/Horse/Utils.hs | bsd-3-clause | fromEitherMaybeDefault (Right _) (Just y) = y | 45 | fromEitherMaybeDefault (Right _) (Just y) = y | 45 | fromEitherMaybeDefault (Right _) (Just y) = y | 45 | false | false | 1 | 6 | 6 | 26 | 11 | 15 | null | null |
siddhanathan/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | foldDataConArgs :: FFoldType a -> DataCon -> [a]
-- Fold over the arguments of the datacon
foldDataConArgs ft con
= map foldArg (dataConOrigArgTys con)
where
foldArg
= case getTyVar_maybe (last (tyConAppArgs (dataConOrigResTy con))) of
Just tv -> functorLikeTraverse tv ft
Nothing -> const (ft_triv ft)
-- If we are deriving Foldable for a GADT, there is a chance that the last
-- type variable in the data type isn't actually a type variable at all.
-- (for example, this can happen if the last type variable is refined to
-- be a concrete type such as Int). If the last type variable is refined
-- to be a specific type, then getTyVar_maybe will return Nothing.
-- See Note [DeriveFoldable with ExistentialQuantification]
--
-- The kind checks have ensured the last type parameter is of kind *.
-- Make a HsLam using a fresh variable from a State monad | 927 | foldDataConArgs :: FFoldType a -> DataCon -> [a]
foldDataConArgs ft con
= map foldArg (dataConOrigArgTys con)
where
foldArg
= case getTyVar_maybe (last (tyConAppArgs (dataConOrigResTy con))) of
Just tv -> functorLikeTraverse tv ft
Nothing -> const (ft_triv ft)
-- If we are deriving Foldable for a GADT, there is a chance that the last
-- type variable in the data type isn't actually a type variable at all.
-- (for example, this can happen if the last type variable is refined to
-- be a concrete type such as Int). If the last type variable is refined
-- to be a specific type, then getTyVar_maybe will return Nothing.
-- See Note [DeriveFoldable with ExistentialQuantification]
--
-- The kind checks have ensured the last type parameter is of kind *.
-- Make a HsLam using a fresh variable from a State monad | 885 | foldDataConArgs ft con
= map foldArg (dataConOrigArgTys con)
where
foldArg
= case getTyVar_maybe (last (tyConAppArgs (dataConOrigResTy con))) of
Just tv -> functorLikeTraverse tv ft
Nothing -> const (ft_triv ft)
-- If we are deriving Foldable for a GADT, there is a chance that the last
-- type variable in the data type isn't actually a type variable at all.
-- (for example, this can happen if the last type variable is refined to
-- be a concrete type such as Int). If the last type variable is refined
-- to be a specific type, then getTyVar_maybe will return Nothing.
-- See Note [DeriveFoldable with ExistentialQuantification]
--
-- The kind checks have ensured the last type parameter is of kind *.
-- Make a HsLam using a fresh variable from a State monad | 836 | true | true | 1 | 12 | 220 | 122 | 60 | 62 | null | null |
yairchu/peakachu | src/FRP/Peakachu/Backend/File.hs | bsd-3-clause | strictReadFile :: FilePath -> IO String
strictReadFile filename = do
file <- openFile filename ReadMode
contents <- fix $ \rest -> do
mc <- maybeIO isEOFError $ hGetChar file
case mc of
Nothing -> return ""
Just c -> fmap (c :) rest
hClose file
return contents | 316 | strictReadFile :: FilePath -> IO String
strictReadFile filename = do
file <- openFile filename ReadMode
contents <- fix $ \rest -> do
mc <- maybeIO isEOFError $ hGetChar file
case mc of
Nothing -> return ""
Just c -> fmap (c :) rest
hClose file
return contents | 316 | strictReadFile filename = do
file <- openFile filename ReadMode
contents <- fix $ \rest -> do
mc <- maybeIO isEOFError $ hGetChar file
case mc of
Nothing -> return ""
Just c -> fmap (c :) rest
hClose file
return contents | 276 | false | true | 0 | 16 | 102 | 112 | 50 | 62 | null | null |
maciej-wichrowski/HsCharts | demo/Main.hs | bsd-3-clause | -----------------------------------------------------------------------------
lineChart :: Picture
lineChart =
pictures [ color bgColor $ plotChartBackground xAxis yAxis
, color gridColor $ plotGrid xAxis yAxis (0, 0.125)
, plotAxes xAxis yAxis
, plotAxisScales xAxis yAxis (2, 0.5)
, line 1 pointColor
, line 1.5 pointColor'
, line 3 pointColor''
]
where xAxis = autoScaleAxis Linear chartW xs
yAxis = fixedScaleAxis Linear chartH 0 1
xs = [-6,-5.75..6]
ys = [sigmoid x | x <- xs]
pts x = zip xs (map ((+(0.5 - sigmoid 0 / x)) . (/x)) ys)
line x c = color c $ plotLineChart xAxis yAxis (pts x)
sigmoid x = 1.0 / (1 + exp (-x))
----------------------------------------------------------------------------- | 928 | lineChart :: Picture
lineChart =
pictures [ color bgColor $ plotChartBackground xAxis yAxis
, color gridColor $ plotGrid xAxis yAxis (0, 0.125)
, plotAxes xAxis yAxis
, plotAxisScales xAxis yAxis (2, 0.5)
, line 1 pointColor
, line 1.5 pointColor'
, line 3 pointColor''
]
where xAxis = autoScaleAxis Linear chartW xs
yAxis = fixedScaleAxis Linear chartH 0 1
xs = [-6,-5.75..6]
ys = [sigmoid x | x <- xs]
pts x = zip xs (map ((+(0.5 - sigmoid 0 / x)) . (/x)) ys)
line x c = color c $ plotLineChart xAxis yAxis (pts x)
sigmoid x = 1.0 / (1 + exp (-x))
----------------------------------------------------------------------------- | 836 | lineChart =
pictures [ color bgColor $ plotChartBackground xAxis yAxis
, color gridColor $ plotGrid xAxis yAxis (0, 0.125)
, plotAxes xAxis yAxis
, plotAxisScales xAxis yAxis (2, 0.5)
, line 1 pointColor
, line 1.5 pointColor'
, line 3 pointColor''
]
where xAxis = autoScaleAxis Linear chartW xs
yAxis = fixedScaleAxis Linear chartH 0 1
xs = [-6,-5.75..6]
ys = [sigmoid x | x <- xs]
pts x = zip xs (map ((+(0.5 - sigmoid 0 / x)) . (/x)) ys)
line x c = color c $ plotLineChart xAxis yAxis (pts x)
sigmoid x = 1.0 / (1 + exp (-x))
----------------------------------------------------------------------------- | 815 | true | true | 6 | 16 | 330 | 274 | 142 | 132 | null | null |
erikd/yesod | yesod-static/Yesod/EmbeddedStatic.hs | mit | embedStaticContent :: Yesod site
=> (site -> EmbeddedStatic) -- ^ How to retrieve the embedded static subsite from your site
-> (Route EmbeddedStatic -> Route site) -- ^ how to convert an embedded static route
-> (BL.ByteString -> Either a BL.ByteString) -- ^ javascript minifier
-> AddStaticContent site
embedStaticContent = staticContentHelper | 423 | embedStaticContent :: Yesod site
=> (site -> EmbeddedStatic) -- ^ How to retrieve the embedded static subsite from your site
-> (Route EmbeddedStatic -> Route site) -- ^ how to convert an embedded static route
-> (BL.ByteString -> Either a BL.ByteString) -- ^ javascript minifier
-> AddStaticContent site
embedStaticContent = staticContentHelper | 423 | embedStaticContent = staticContentHelper | 40 | false | true | 0 | 13 | 128 | 78 | 38 | 40 | null | null |
cryptica/slapnet | src/Solver/Simplifier.hs | gpl-3.0 | checkCutPositive :: SBMap Transition -> SimpleCut -> SBool
checkCutPositive m (c0, cs) =
checkTransNegative m c0 &&& bAnd (map (checkTransPositive m) cs) | 161 | checkCutPositive :: SBMap Transition -> SimpleCut -> SBool
checkCutPositive m (c0, cs) =
checkTransNegative m c0 &&& bAnd (map (checkTransPositive m) cs) | 161 | checkCutPositive m (c0, cs) =
checkTransNegative m c0 &&& bAnd (map (checkTransPositive m) cs) | 102 | false | true | 0 | 10 | 29 | 59 | 29 | 30 | null | null |
nomeata/ghc | compiler/cmm/MkGraph.hs | bsd-3-clause | mkForeignJumpExtra :: DynFlags -> Convention -> CmmExpr -> [CmmActual]
-> UpdFrameOffset -> (ByteOff, [(CmmExpr, ByteOff)])
-> CmmAGraph
mkForeignJumpExtra dflags conv e actuals updfr_off extra_stack =
lastWithArgsAndExtraStack dflags Jump Old conv actuals updfr_off extra_stack $
toCall e Nothing updfr_off 0 | 347 | mkForeignJumpExtra :: DynFlags -> Convention -> CmmExpr -> [CmmActual]
-> UpdFrameOffset -> (ByteOff, [(CmmExpr, ByteOff)])
-> CmmAGraph
mkForeignJumpExtra dflags conv e actuals updfr_off extra_stack =
lastWithArgsAndExtraStack dflags Jump Old conv actuals updfr_off extra_stack $
toCall e Nothing updfr_off 0 | 347 | mkForeignJumpExtra dflags conv e actuals updfr_off extra_stack =
lastWithArgsAndExtraStack dflags Jump Old conv actuals updfr_off extra_stack $
toCall e Nothing updfr_off 0 | 178 | false | true | 0 | 13 | 76 | 94 | 49 | 45 | null | null |
horia141/bachelor-thesis | dev/SeqAsm/Utils.hs | mit | digitToBase2 "h" 'a' = Right "1010" | 35 | digitToBase2 "h" 'a' = Right "1010" | 35 | digitToBase2 "h" 'a' = Right "1010" | 35 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
trezona-lecomte/quizster | src/Api.hs | mit | -- Allow the injecting of Config while still returning Handler:
readerToHandler :: Config -> AppM :~> Handler
readerToHandler config = Nat $ \x -> runReaderT x config | 166 | readerToHandler :: Config -> AppM :~> Handler
readerToHandler config = Nat $ \x -> runReaderT x config | 102 | readerToHandler config = Nat $ \x -> runReaderT x config | 56 | true | true | 0 | 7 | 26 | 37 | 19 | 18 | null | null |
ksaveljev/hake-2 | src/Client/Console.hs | bsd-3-clause | messageModeF :: XCommandT
messageModeF =
XCommandT "Console.messageModeF" (do
globals.gChatTeam .= False
globals.gCls.csKeyDest .= Constants.keyMessage
) | 165 | messageModeF :: XCommandT
messageModeF =
XCommandT "Console.messageModeF" (do
globals.gChatTeam .= False
globals.gCls.csKeyDest .= Constants.keyMessage
) | 165 | messageModeF =
XCommandT "Console.messageModeF" (do
globals.gChatTeam .= False
globals.gCls.csKeyDest .= Constants.keyMessage
) | 139 | false | true | 0 | 11 | 26 | 41 | 20 | 21 | null | null |
comonoidial/ALFIN | Alfin/CoreLowering.hs | mit | simplifyTE (LetRec f r as t x e) = LetRec f r as t (simplifyTE x) (simplifyTE e) | 80 | simplifyTE (LetRec f r as t x e) = LetRec f r as t (simplifyTE x) (simplifyTE e) | 80 | simplifyTE (LetRec f r as t x e) = LetRec f r as t (simplifyTE x) (simplifyTE e) | 80 | false | false | 0 | 7 | 17 | 50 | 24 | 26 | null | null |
fimad/scalpel | scalpel/src/Text/HTML/Scalpel/Internal/Scrape/URL.hs | apache-2.0 | -- | A decoder that will always decode using `ISO-8859-1`.
iso88591Decoder :: TagSoup.StringLike str => Decoder str
iso88591Decoder = TagSoup.castString . Text.decodeLatin1 . LBS.toStrict . HTTP.responseBody | 208 | iso88591Decoder :: TagSoup.StringLike str => Decoder str
iso88591Decoder = TagSoup.castString . Text.decodeLatin1 . LBS.toStrict . HTTP.responseBody | 149 | iso88591Decoder = TagSoup.castString . Text.decodeLatin1 . LBS.toStrict . HTTP.responseBody | 91 | true | true | 1 | 8 | 26 | 51 | 23 | 28 | null | null |
jwiegley/ghc-release | compiler/main/DriverPipeline.hs | gpl-3.0 | hscPostBackendPhase :: DynFlags -> HscSource -> HscTarget -> Phase
hscPostBackendPhase _ HsBootFile _ = StopLn | 114 | hscPostBackendPhase :: DynFlags -> HscSource -> HscTarget -> Phase
hscPostBackendPhase _ HsBootFile _ = StopLn | 114 | hscPostBackendPhase _ HsBootFile _ = StopLn | 47 | false | true | 0 | 7 | 18 | 30 | 15 | 15 | null | null |
ComputationWithBoundedResources/tct-core | src/Tct/Core/Data/Declaration.hs | bsd-3-clause | -- | Returns the description of a 'Declaration'.
declHelp :: Declaration c -> [String]
declHelp (Decl _ h _ _) = h | 115 | declHelp :: Declaration c -> [String]
declHelp (Decl _ h _ _) = h | 66 | declHelp (Decl _ h _ _) = h | 28 | true | true | 0 | 7 | 22 | 37 | 19 | 18 | null | null |
39aldo39/klfc | src/Xkb/XCompose.hs | gpl-3.0 | printCustomDeadKey _ = [] | 25 | printCustomDeadKey _ = [] | 25 | printCustomDeadKey _ = [] | 25 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
lancelet/approxier | src/lib/Shapes/Cylinder.hs | apache-2.0 | ----------------------------------------------------------------------------------------------------
-- PRIVATE CYLINDER FUNCTIONS
cylinderToHyperboloid :: Cylinder -> Hyperboloid
cylinderToHyperboloid c =
let r = cylinderRadius c
zmin = cylinderZMin c
zmax = cylinderZMax c
p1 = p3 r 0 zmin
p2 = p3 r 0 zmax
phimax = cylinderPhiMax c
in Hyperboloid { hyperboloidPoint1 = p1
, hyperboloidPoint2 = p2
, hyperboloidPhiMax = phimax } | 520 | cylinderToHyperboloid :: Cylinder -> Hyperboloid
cylinderToHyperboloid c =
let r = cylinderRadius c
zmin = cylinderZMin c
zmax = cylinderZMax c
p1 = p3 r 0 zmin
p2 = p3 r 0 zmax
phimax = cylinderPhiMax c
in Hyperboloid { hyperboloidPoint1 = p1
, hyperboloidPoint2 = p2
, hyperboloidPhiMax = phimax } | 388 | cylinderToHyperboloid c =
let r = cylinderRadius c
zmin = cylinderZMin c
zmax = cylinderZMax c
p1 = p3 r 0 zmin
p2 = p3 r 0 zmax
phimax = cylinderPhiMax c
in Hyperboloid { hyperboloidPoint1 = p1
, hyperboloidPoint2 = p2
, hyperboloidPhiMax = phimax } | 339 | true | true | 0 | 9 | 146 | 102 | 54 | 48 | null | null |
markus1189/SmartCheck | paper/Paper.hs | bsd-3-clause | subConstr :: SubVal -> String
subConstr (SubVal a) = constr a | 61 | subConstr :: SubVal -> String
subConstr (SubVal a) = constr a | 61 | subConstr (SubVal a) = constr a | 31 | false | true | 0 | 9 | 10 | 32 | 14 | 18 | null | null |
joelburget/react-haskell | src/React/DOM.hs | mit | form_ :: [AttrOrHandler sig] -> ReactNode sig -> ReactNode sig
form_ = domParent "form" | 87 | form_ :: [AttrOrHandler sig] -> ReactNode sig -> ReactNode sig
form_ = domParent "form" | 87 | form_ = domParent "form" | 24 | false | true | 0 | 8 | 13 | 40 | 17 | 23 | null | null |
abailly/subhask | src/SubHask/Compatibility/Base.hs | bsd-3-clause | dummy1 = undefined :: Identity a | 32 | dummy1 = undefined :: Identity a | 32 | dummy1 = undefined :: Identity a | 32 | false | false | 0 | 5 | 5 | 12 | 6 | 6 | null | null |
fibsifan/pandoc | src/Text/Pandoc/Readers/Markdown.hs | gpl-2.0 | -- | Read markdown from an input string and return a pair of a Pandoc document
-- and a list of warnings.
readMarkdownWithWarnings :: ReaderOptions -- ^ Reader options
-> String -- ^ String to parse (assuming @'\n'@ line endings)
-> Either PandocError (Pandoc, [String])
readMarkdownWithWarnings opts s =
(readWithWarnings parseMarkdown) def{ stateOptions = opts } (s ++ "\n\n") | 439 | readMarkdownWithWarnings :: ReaderOptions -- ^ Reader options
-> String -- ^ String to parse (assuming @'\n'@ line endings)
-> Either PandocError (Pandoc, [String])
readMarkdownWithWarnings opts s =
(readWithWarnings parseMarkdown) def{ stateOptions = opts } (s ++ "\n\n") | 333 | readMarkdownWithWarnings opts s =
(readWithWarnings parseMarkdown) def{ stateOptions = opts } (s ++ "\n\n") | 111 | true | true | 0 | 10 | 119 | 72 | 39 | 33 | null | null |
exercism/xhaskell | exercises/practice/custom-set/.meta/examples/success-standard/src/CustomSet.hs | mit | difference :: Ord a => CustomSet a -> CustomSet a -> CustomSet a
difference = F.foldl' (flip delete) | 100 | difference :: Ord a => CustomSet a -> CustomSet a -> CustomSet a
difference = F.foldl' (flip delete) | 100 | difference = F.foldl' (flip delete) | 35 | false | true | 0 | 8 | 17 | 46 | 21 | 25 | null | null |
mimi1vx/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkSpacefulness6 = verifyTree checkSpacefulness "a=foo$(lol); echo $a" | 77 | prop_checkSpacefulness6 = verifyTree checkSpacefulness "a=foo$(lol); echo $a" | 77 | prop_checkSpacefulness6 = verifyTree checkSpacefulness "a=foo$(lol); echo $a" | 77 | false | false | 0 | 5 | 6 | 11 | 5 | 6 | null | null |
AgustinCB/hgen | examples/Sudoku.hs | gpl-2.0 | fitnessSudoku :: Fitness Solution
fitnessSudoku solution =
(fromIntegral $ sum $ map fitnessRow solution) +
(fromIntegral $ sum $ map fitnessRow (transpose solution)) +
(fromIntegral $ sum $ map fitnessRow (transposeByBox solution)) | 292 | fitnessSudoku :: Fitness Solution
fitnessSudoku solution =
(fromIntegral $ sum $ map fitnessRow solution) +
(fromIntegral $ sum $ map fitnessRow (transpose solution)) +
(fromIntegral $ sum $ map fitnessRow (transposeByBox solution)) | 292 | fitnessSudoku solution =
(fromIntegral $ sum $ map fitnessRow solution) +
(fromIntegral $ sum $ map fitnessRow (transpose solution)) +
(fromIntegral $ sum $ map fitnessRow (transposeByBox solution)) | 258 | false | true | 0 | 11 | 91 | 85 | 42 | 43 | null | null |
m-alvarez/jhc | src/Stats.hs | mit | printStat greets (Stat s) = do
let fs = createForest 0 $ sort [(splitUp (-1) $ fromAtom (unsafeIntToAtom x),y) | (x,y) <- IB.toList s]
mapM_ putStrLn $ ( draw . fmap p ) (Node (greets,0) fs) where
p (x,0) = x
p (x,n) = x ++ ": " ++ show n | 263 | printStat greets (Stat s) = do
let fs = createForest 0 $ sort [(splitUp (-1) $ fromAtom (unsafeIntToAtom x),y) | (x,y) <- IB.toList s]
mapM_ putStrLn $ ( draw . fmap p ) (Node (greets,0) fs) where
p (x,0) = x
p (x,n) = x ++ ": " ++ show n | 263 | printStat greets (Stat s) = do
let fs = createForest 0 $ sort [(splitUp (-1) $ fromAtom (unsafeIntToAtom x),y) | (x,y) <- IB.toList s]
mapM_ putStrLn $ ( draw . fmap p ) (Node (greets,0) fs) where
p (x,0) = x
p (x,n) = x ++ ": " ++ show n | 263 | false | false | 0 | 17 | 75 | 163 | 82 | 81 | null | null |
facebookincubator/duckling | Duckling/Time/TR/Rules.hs | bsd-3-clause | ruleThisPartofday :: Rule
ruleThisPartofday = Rule
{ name = "this <part-of-day>"
, pattern =
[ regex "bu"
, Predicate isAPartOfDay
]
, prod = \case
(_:Token Time td:_) -> Token Time . partOfDay <$> intersect today td
_ -> Nothing
} | 263 | ruleThisPartofday :: Rule
ruleThisPartofday = Rule
{ name = "this <part-of-day>"
, pattern =
[ regex "bu"
, Predicate isAPartOfDay
]
, prod = \case
(_:Token Time td:_) -> Token Time . partOfDay <$> intersect today td
_ -> Nothing
} | 263 | ruleThisPartofday = Rule
{ name = "this <part-of-day>"
, pattern =
[ regex "bu"
, Predicate isAPartOfDay
]
, prod = \case
(_:Token Time td:_) -> Token Time . partOfDay <$> intersect today td
_ -> Nothing
} | 237 | false | true | 0 | 14 | 72 | 93 | 48 | 45 | null | null |
fphh/crete | Main.hs | bsd-3-clause | routedGetHandle url =
Index.routed url >>= routedOk . toResponse | 66 | routedGetHandle url =
Index.routed url >>= routedOk . toResponse | 66 | routedGetHandle url =
Index.routed url >>= routedOk . toResponse | 66 | false | false | 2 | 5 | 10 | 24 | 11 | 13 | null | null |
bmillwood/pointfree | Plugin/Pl/Rules.hs | mit | foldlE = Quote $ Var Pref "foldl" | 37 | foldlE = Quote $ Var Pref "foldl" | 37 | foldlE = Quote $ Var Pref "foldl" | 37 | false | false | 0 | 6 | 10 | 15 | 7 | 8 | null | null |
Ian-Stewart-Binks/courseography | hs/Response/Calendar.hs | gpl-3.0 | -- | Gives the appropriate starting and ending dates for courses in the Winter.
getDatesWinter :: Double -> (Day, Day)
getDatesWinter 0.0 = (firstMondayWinter, addDays 1 lastMondayWinter) | 187 | getDatesWinter :: Double -> (Day, Day)
getDatesWinter 0.0 = (firstMondayWinter, addDays 1 lastMondayWinter) | 107 | getDatesWinter 0.0 = (firstMondayWinter, addDays 1 lastMondayWinter) | 68 | true | true | 0 | 6 | 26 | 36 | 20 | 16 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Data.hs | bsd-3-clause | deleteTask :: TaskID -> Arduino ()
deleteTask tid = Arduino $ primitive $ DeleteTask tid | 88 | deleteTask :: TaskID -> Arduino ()
deleteTask tid = Arduino $ primitive $ DeleteTask tid | 88 | deleteTask tid = Arduino $ primitive $ DeleteTask tid | 53 | false | true | 0 | 7 | 14 | 34 | 16 | 18 | null | null |
brendanhay/amqp-bark | bark/src/Main.hs | bsd-3-clause | sourceStdin :: (MonadResource m, MonadIO m)
=> Options
-> Unbounded B.ByteString
-> m ()
sourceStdin Options{..} output =
sourceHandle stdin optReadBytes $$ sinkBuffer output | 214 | sourceStdin :: (MonadResource m, MonadIO m)
=> Options
-> Unbounded B.ByteString
-> m ()
sourceStdin Options{..} output =
sourceHandle stdin optReadBytes $$ sinkBuffer output | 214 | sourceStdin Options{..} output =
sourceHandle stdin optReadBytes $$ sinkBuffer output | 89 | false | true | 0 | 9 | 63 | 67 | 32 | 35 | null | null |
miguelpagano/equ | TestSuite/Tests/Proof.hs | gpl-3.0 | fhole0 :: Focus
fhole0 = toFocus $ preExprHole holeInfo0 | 56 | fhole0 :: Focus
fhole0 = toFocus $ preExprHole holeInfo0 | 56 | fhole0 = toFocus $ preExprHole holeInfo0 | 40 | false | true | 0 | 6 | 8 | 18 | 9 | 9 | null | null |
mitchellwrosen/dohaskell | src/Model/Resource/Internal.hs | bsd-3-clause | shortDescResourceType MetaResource = "meta-resource" | 57 | shortDescResourceType MetaResource = "meta-resource" | 57 | shortDescResourceType MetaResource = "meta-resource" | 57 | false | false | 0 | 5 | 8 | 9 | 4 | 5 | null | null |
ucsd-progsys/csv-table | src/Data/CSV/Table/Ops.hs | mit | orient :: Order -> Ordering -> Ordering
orient Dsc LT = GT | 58 | orient :: Order -> Ordering -> Ordering
orient Dsc LT = GT | 58 | orient Dsc LT = GT | 18 | false | true | 0 | 6 | 11 | 24 | 12 | 12 | null | null |
acowley/ghc | compiler/utils/Outputable.hs | bsd-3-clause | -- E.g. "three arguments"
-- | Converts a strictly positive integer into a number of times:
--
-- > speakNTimes 1 = text "once"
-- > speakNTimes 2 = text "twice"
-- > speakNTimes 4 = text "4 times"
speakNTimes :: Int {- >=1 -} -> SDoc
speakNTimes t | t == 1 = ptext (sLit "once")
| t == 2 = ptext (sLit "twice")
| otherwise = speakN t <+> ptext (sLit "times") | 397 | speakNTimes :: Int {- >=1 -} -> SDoc
speakNTimes t | t == 1 = ptext (sLit "once")
| t == 2 = ptext (sLit "twice")
| otherwise = speakN t <+> ptext (sLit "times") | 198 | speakNTimes t | t == 1 = ptext (sLit "once")
| t == 2 = ptext (sLit "twice")
| otherwise = speakN t <+> ptext (sLit "times") | 161 | true | true | 0 | 9 | 111 | 91 | 45 | 46 | null | null |
Enamex/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | lookupCtxtName :: Name -> Ctxt a -> [(Name, a)]
lookupCtxtName n ctxt = case Map.lookup (nsroot n) ctxt of
Just xs -> filterNS (Map.toList xs)
Nothing -> []
where
filterNS [] = []
filterNS ((found, v) : xs)
| nsmatch n found = (found, v) : filterNS xs
| otherwise = filterNS xs
nsmatch (NS n ns) (NS p ps) = ns `isPrefixOf` ps
nsmatch (NS _ _) _ = False
nsmatch looking found = True | 510 | lookupCtxtName :: Name -> Ctxt a -> [(Name, a)]
lookupCtxtName n ctxt = case Map.lookup (nsroot n) ctxt of
Just xs -> filterNS (Map.toList xs)
Nothing -> []
where
filterNS [] = []
filterNS ((found, v) : xs)
| nsmatch n found = (found, v) : filterNS xs
| otherwise = filterNS xs
nsmatch (NS n ns) (NS p ps) = ns `isPrefixOf` ps
nsmatch (NS _ _) _ = False
nsmatch looking found = True | 510 | lookupCtxtName n ctxt = case Map.lookup (nsroot n) ctxt of
Just xs -> filterNS (Map.toList xs)
Nothing -> []
where
filterNS [] = []
filterNS ((found, v) : xs)
| nsmatch n found = (found, v) : filterNS xs
| otherwise = filterNS xs
nsmatch (NS n ns) (NS p ps) = ns `isPrefixOf` ps
nsmatch (NS _ _) _ = False
nsmatch looking found = True | 462 | false | true | 4 | 11 | 203 | 224 | 107 | 117 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | usually = id | 12 | usually = id | 12 | usually = id | 12 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
mrshannon/trees | src/Input/Keyboard/GLUT.hs | gpl-2.0 | changeAsciiKeyState '(' ns k = k { key9 = ns } | 46 | changeAsciiKeyState '(' ns k = k { key9 = ns } | 46 | changeAsciiKeyState '(' ns k = k { key9 = ns } | 46 | false | false | 0 | 6 | 10 | 21 | 11 | 10 | null | null |
enolan/Idris-dev | src/Idris/Delaborate.hs | bsd-3-clause | pprintTerm :: IState -> PTerm -> Doc OutputAnnotation
pprintTerm ist = pprintTerm' ist [] | 89 | pprintTerm :: IState -> PTerm -> Doc OutputAnnotation
pprintTerm ist = pprintTerm' ist [] | 89 | pprintTerm ist = pprintTerm' ist [] | 35 | false | true | 0 | 7 | 13 | 35 | 16 | 19 | null | null |
tidalcycles/Tidal | bin/params-header.hs | gpl-3.0 | drumN "mc" = 78 | 15 | drumN "mc" = 78 | 15 | drumN "mc" = 78 | 15 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
siddhanathan/ghc | compiler/prelude/THNames.hs | bsd-3-clause | ruleBndrQTyConName = libTc (fsLit "RuleBndrQ") ruleBndrQTyConKey | 74 | ruleBndrQTyConName = libTc (fsLit "RuleBndrQ") ruleBndrQTyConKey | 74 | ruleBndrQTyConName = libTc (fsLit "RuleBndrQ") ruleBndrQTyConKey | 74 | false | false | 0 | 7 | 15 | 17 | 8 | 9 | null | null |
zhy0216/haskell-learning | yosog/devel.hs | mit | loop :: IO ()
loop = do
threadDelay 100000
e <- doesFileExist "yesod-devel/devel-terminate"
if e then terminateDevel else loop | 132 | loop :: IO ()
loop = do
threadDelay 100000
e <- doesFileExist "yesod-devel/devel-terminate"
if e then terminateDevel else loop | 132 | loop = do
threadDelay 100000
e <- doesFileExist "yesod-devel/devel-terminate"
if e then terminateDevel else loop | 118 | false | true | 0 | 8 | 24 | 49 | 21 | 28 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/types/TyCon.hs | bsd-3-clause | okParent tc_name (AssocFamilyTyCon cls) = tc_name `elem` map tyConName (classATs cls) | 90 | okParent tc_name (AssocFamilyTyCon cls) = tc_name `elem` map tyConName (classATs cls) | 90 | okParent tc_name (AssocFamilyTyCon cls) = tc_name `elem` map tyConName (classATs cls) | 90 | false | false | 0 | 8 | 15 | 34 | 17 | 17 | null | null |
sgillespie/ghc | compiler/utils/Outputable.hs | bsd-3-clause | withPprStyleDoc :: DynFlags -> PprStyle -> SDoc -> Doc
withPprStyleDoc dflags sty d = runSDoc d (initSDocContext dflags sty) | 124 | withPprStyleDoc :: DynFlags -> PprStyle -> SDoc -> Doc
withPprStyleDoc dflags sty d = runSDoc d (initSDocContext dflags sty) | 124 | withPprStyleDoc dflags sty d = runSDoc d (initSDocContext dflags sty) | 69 | false | true | 0 | 7 | 18 | 43 | 21 | 22 | null | null |
robbinch/tinc | src/Util.hs | mit | getDirectoryContents :: FilePath -> IO [FilePath]
getDirectoryContents dir = filter (`notElem` [".", ".."]) <$> Directory.getDirectoryContents dir | 146 | getDirectoryContents :: FilePath -> IO [FilePath]
getDirectoryContents dir = filter (`notElem` [".", ".."]) <$> Directory.getDirectoryContents dir | 146 | getDirectoryContents dir = filter (`notElem` [".", ".."]) <$> Directory.getDirectoryContents dir | 96 | false | true | 0 | 8 | 15 | 52 | 27 | 25 | null | null |
jgeskens/oemfoe-haskell | Evaluator.hs | mit | ev vars [TDouble left, TDivision, TDouble right] = (TDouble $ left / right, vars) | 81 | ev vars [TDouble left, TDivision, TDouble right] = (TDouble $ left / right, vars) | 81 | ev vars [TDouble left, TDivision, TDouble right] = (TDouble $ left / right, vars) | 81 | false | false | 0 | 7 | 13 | 40 | 21 | 19 | null | null |
justinethier/husk-scheme | hs-src/Language/Scheme/Core.hs | mit | -- |A helper function for the special form /(vector-set!)/
updateVector :: LispVal -> LispVal -> LispVal -> IOThrowsError LispVal
updateVector (Vector vec) (Number idx) obj = return $ Vector $ vec // [(fromInteger idx, obj)] | 224 | updateVector :: LispVal -> LispVal -> LispVal -> IOThrowsError LispVal
updateVector (Vector vec) (Number idx) obj = return $ Vector $ vec // [(fromInteger idx, obj)] | 165 | updateVector (Vector vec) (Number idx) obj = return $ Vector $ vec // [(fromInteger idx, obj)] | 94 | true | true | 0 | 8 | 34 | 70 | 36 | 34 | null | null |
alvisespano/Lw | extras/hml-prototype/PPrint.hs | gpl-3.0 | rational :: Rational -> Doc
rational r = text (show r) | 59 | rational :: Rational -> Doc
rational r = text (show r) | 59 | rational r = text (show r) | 31 | false | true | 0 | 7 | 15 | 27 | 13 | 14 | null | null |
aaronlevin/haskell-shopify | src/Network/API/Shopify/Request.hs | mit | readProductsReq :: StoreName -> Request
readProductsReq storeName = defaultRequest { method = methodGet
, host = encodeUtf8 $ shopifyHost storeName
, path = encodeUtf8 . pack $ "/admin/products.json"
, secure = True
, port = 443
} | 395 | readProductsReq :: StoreName -> Request
readProductsReq storeName = defaultRequest { method = methodGet
, host = encodeUtf8 $ shopifyHost storeName
, path = encodeUtf8 . pack $ "/admin/products.json"
, secure = True
, port = 443
} | 395 | readProductsReq storeName = defaultRequest { method = methodGet
, host = encodeUtf8 $ shopifyHost storeName
, path = encodeUtf8 . pack $ "/admin/products.json"
, secure = True
, port = 443
} | 355 | false | true | 0 | 8 | 201 | 65 | 37 | 28 | null | null |
mindriot101/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | resetCaption :: LP ()
resetCaption = updateState $ \st -> st{ stateCaption = Nothing } | 86 | resetCaption :: LP ()
resetCaption = updateState $ \st -> st{ stateCaption = Nothing } | 86 | resetCaption = updateState $ \st -> st{ stateCaption = Nothing } | 64 | false | true | 0 | 8 | 14 | 33 | 18 | 15 | null | null |
xavierpinho/CAM | src/Parser.hs | unlicense | funp = do
reserved "fun"
x <- identifier
reservedOp "."
y <- expr
return $ F.Fun x y | 94 | funp = do
reserved "fun"
x <- identifier
reservedOp "."
y <- expr
return $ F.Fun x y | 94 | funp = do
reserved "fun"
x <- identifier
reservedOp "."
y <- expr
return $ F.Fun x y | 94 | false | false | 0 | 9 | 27 | 46 | 19 | 27 | null | null |
paul-rouse/persistent | persistent-sqlite/Database/Persist/Sqlite.hs | mit | insertSql' :: EntityDef -> [PersistValue] -> InsertSqlResult
insertSql' ent vals =
case getEntityId ent of
EntityIdNaturalKey _ ->
ISRManyKeys sql vals
where sql = T.concat
[ "INSERT INTO "
, escapeE $ getEntityDBName ent
, "("
, T.intercalate "," $ map (escapeF . fieldDB) cols
, ") VALUES("
, T.intercalate "," (map (const "?") cols)
, ")"
]
EntityIdField fd ->
ISRInsertGet ins sel
where
sel = T.concat
[ "SELECT "
, escapeF $ fieldDB fd
, " FROM "
, escapeE $ getEntityDBName ent
, " WHERE _ROWID_=last_insert_rowid()"
]
ins = T.concat
[ "INSERT INTO "
, escapeE $ getEntityDBName ent
, if null cols
then " VALUES(null)"
else T.concat
[ "("
, T.intercalate "," $ map (escapeF . fieldDB) $ cols
, ") VALUES("
, T.intercalate "," (map (const "?") cols)
, ")"
]
]
where
notGenerated =
isNothing . fieldGenerated
cols =
filter notGenerated $ getEntityFields ent | 1,523 | insertSql' :: EntityDef -> [PersistValue] -> InsertSqlResult
insertSql' ent vals =
case getEntityId ent of
EntityIdNaturalKey _ ->
ISRManyKeys sql vals
where sql = T.concat
[ "INSERT INTO "
, escapeE $ getEntityDBName ent
, "("
, T.intercalate "," $ map (escapeF . fieldDB) cols
, ") VALUES("
, T.intercalate "," (map (const "?") cols)
, ")"
]
EntityIdField fd ->
ISRInsertGet ins sel
where
sel = T.concat
[ "SELECT "
, escapeF $ fieldDB fd
, " FROM "
, escapeE $ getEntityDBName ent
, " WHERE _ROWID_=last_insert_rowid()"
]
ins = T.concat
[ "INSERT INTO "
, escapeE $ getEntityDBName ent
, if null cols
then " VALUES(null)"
else T.concat
[ "("
, T.intercalate "," $ map (escapeF . fieldDB) $ cols
, ") VALUES("
, T.intercalate "," (map (const "?") cols)
, ")"
]
]
where
notGenerated =
isNothing . fieldGenerated
cols =
filter notGenerated $ getEntityFields ent | 1,523 | insertSql' ent vals =
case getEntityId ent of
EntityIdNaturalKey _ ->
ISRManyKeys sql vals
where sql = T.concat
[ "INSERT INTO "
, escapeE $ getEntityDBName ent
, "("
, T.intercalate "," $ map (escapeF . fieldDB) cols
, ") VALUES("
, T.intercalate "," (map (const "?") cols)
, ")"
]
EntityIdField fd ->
ISRInsertGet ins sel
where
sel = T.concat
[ "SELECT "
, escapeF $ fieldDB fd
, " FROM "
, escapeE $ getEntityDBName ent
, " WHERE _ROWID_=last_insert_rowid()"
]
ins = T.concat
[ "INSERT INTO "
, escapeE $ getEntityDBName ent
, if null cols
then " VALUES(null)"
else T.concat
[ "("
, T.intercalate "," $ map (escapeF . fieldDB) $ cols
, ") VALUES("
, T.intercalate "," (map (const "?") cols)
, ")"
]
]
where
notGenerated =
isNothing . fieldGenerated
cols =
filter notGenerated $ getEntityFields ent | 1,462 | false | true | 0 | 19 | 811 | 313 | 160 | 153 | null | null |
rfranek/duckling | Duckling/Numeral/PL/Rules.hs | bsd-3-clause | ruleTwelve :: Rule
ruleTwelve = Rule
{ name = "twelve"
, pattern =
[ regex "dwunast(u|oma)|dwana(\x015b|s)cie"
]
, prod = \_ -> integer 12
} | 156 | ruleTwelve :: Rule
ruleTwelve = Rule
{ name = "twelve"
, pattern =
[ regex "dwunast(u|oma)|dwana(\x015b|s)cie"
]
, prod = \_ -> integer 12
} | 156 | ruleTwelve = Rule
{ name = "twelve"
, pattern =
[ regex "dwunast(u|oma)|dwana(\x015b|s)cie"
]
, prod = \_ -> integer 12
} | 137 | false | true | 0 | 9 | 40 | 49 | 27 | 22 | null | null |
nh2/shake | Development/Shake/Derived.hs | bsd-3-clause | -- | Execute a system command. This function will raise an error if the exit code is non-zero.
-- Before running 'system'' make sure you 'need' any required files.
system' :: FilePath -> [String] -> Action ()
system' path args = do
let path2 = toNative path
let cmd = unwords $ path2 : args
v <- getVerbosity
putLoud cmd
res <- (if v >= Loud then quietly else id) $ traced (takeBaseName path) $ rawSystem path2 args
checkExitCode cmd res
-- | /Deprecated:/ Please use 'command' or 'cmd' instead, with 'Cwd'.
-- This function will be removed in a future version.
--
-- Execute a system command with a specified current working directory (first argument).
-- This function will raise an error if the exit code is non-zero.
-- Before running 'systemCwd' make sure you 'need' any required files.
--
-- @
-- 'systemCwd' \"\/usr\/MyDirectory\" \"pwd\" []
-- @ | 889 | system' :: FilePath -> [String] -> Action ()
system' path args = do
let path2 = toNative path
let cmd = unwords $ path2 : args
v <- getVerbosity
putLoud cmd
res <- (if v >= Loud then quietly else id) $ traced (takeBaseName path) $ rawSystem path2 args
checkExitCode cmd res
-- | /Deprecated:/ Please use 'command' or 'cmd' instead, with 'Cwd'.
-- This function will be removed in a future version.
--
-- Execute a system command with a specified current working directory (first argument).
-- This function will raise an error if the exit code is non-zero.
-- Before running 'systemCwd' make sure you 'need' any required files.
--
-- @
-- 'systemCwd' \"\/usr\/MyDirectory\" \"pwd\" []
-- @ | 723 | system' path args = do
let path2 = toNative path
let cmd = unwords $ path2 : args
v <- getVerbosity
putLoud cmd
res <- (if v >= Loud then quietly else id) $ traced (takeBaseName path) $ rawSystem path2 args
checkExitCode cmd res
-- | /Deprecated:/ Please use 'command' or 'cmd' instead, with 'Cwd'.
-- This function will be removed in a future version.
--
-- Execute a system command with a specified current working directory (first argument).
-- This function will raise an error if the exit code is non-zero.
-- Before running 'systemCwd' make sure you 'need' any required files.
--
-- @
-- 'systemCwd' \"\/usr\/MyDirectory\" \"pwd\" []
-- @ | 678 | true | true | 0 | 12 | 185 | 138 | 71 | 67 | null | null |
bruno-cadorette/Baeta-Compiler | src/ModuleSystem.hs | gpl-3.0 | ensureGraphNodeValid _ = Nothing | 32 | ensureGraphNodeValid _ = Nothing | 32 | ensureGraphNodeValid _ = Nothing | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Min-/fourseq | src/utils/FilterLength.hs | bsd-3-clause | main = do
intro
(n, inpath, outpath) <- argToVar . take 3 <$> getArgs
filterFastq n <$> importFastq inpath >>= outputFastq outpath | 138 | main = do
intro
(n, inpath, outpath) <- argToVar . take 3 <$> getArgs
filterFastq n <$> importFastq inpath >>= outputFastq outpath | 138 | main = do
intro
(n, inpath, outpath) <- argToVar . take 3 <$> getArgs
filterFastq n <$> importFastq inpath >>= outputFastq outpath | 138 | false | false | 0 | 10 | 29 | 56 | 26 | 30 | null | null |
nathanic/hive-hs | src/Hive/Game/Piece.hs | gpl-3.0 | pieceSpecies :: Piece -> Species
pieceSpecies (Piece (_:s:_)) =
case s of
'A' -> Ant
'B' -> Beetle
'G' -> Grasshopper
'L' -> Ladybug
'M' -> Mosquito
'P' -> Pillbug
'Q' -> QueenBee
'S' -> Spider
_ -> error "pieceFromName: invalid species"
-- -- | the list of all possible pieces.
-- allPieces :: [Piece]
-- allPiece
-- = map piece
-- [ "bA1","bA2","bA3"
-- , "bB1","bB2"
-- , "bG1","bG2","bG3"
-- , "bL"
-- , "bM"
-- , "bP"
-- , "bQ"
-- , "bS1","bS2"
-- , "wA1","wA2","wA3"
-- , "wB1","wB2"
-- , "wG1","wG2","wG3"
-- , "wL"
-- , "wM"
-- , "wP"
-- , "wQ"
-- , "wS1","wS2"
-- ]
-- naming them all is just convenient for the repl
-- allows succinct Show instance for Piece | 973 | pieceSpecies :: Piece -> Species
pieceSpecies (Piece (_:s:_)) =
case s of
'A' -> Ant
'B' -> Beetle
'G' -> Grasshopper
'L' -> Ladybug
'M' -> Mosquito
'P' -> Pillbug
'Q' -> QueenBee
'S' -> Spider
_ -> error "pieceFromName: invalid species"
-- -- | the list of all possible pieces.
-- allPieces :: [Piece]
-- allPiece
-- = map piece
-- [ "bA1","bA2","bA3"
-- , "bB1","bB2"
-- , "bG1","bG2","bG3"
-- , "bL"
-- , "bM"
-- , "bP"
-- , "bQ"
-- , "bS1","bS2"
-- , "wA1","wA2","wA3"
-- , "wB1","wB2"
-- , "wG1","wG2","wG3"
-- , "wL"
-- , "wM"
-- , "wP"
-- , "wQ"
-- , "wS1","wS2"
-- ]
-- naming them all is just convenient for the repl
-- allows succinct Show instance for Piece | 973 | pieceSpecies (Piece (_:s:_)) =
case s of
'A' -> Ant
'B' -> Beetle
'G' -> Grasshopper
'L' -> Ladybug
'M' -> Mosquito
'P' -> Pillbug
'Q' -> QueenBee
'S' -> Spider
_ -> error "pieceFromName: invalid species"
-- -- | the list of all possible pieces.
-- allPieces :: [Piece]
-- allPiece
-- = map piece
-- [ "bA1","bA2","bA3"
-- , "bB1","bB2"
-- , "bG1","bG2","bG3"
-- , "bL"
-- , "bM"
-- , "bP"
-- , "bQ"
-- , "bS1","bS2"
-- , "wA1","wA2","wA3"
-- , "wB1","wB2"
-- , "wG1","wG2","wG3"
-- , "wL"
-- , "wM"
-- , "wP"
-- , "wQ"
-- , "wS1","wS2"
-- ]
-- naming them all is just convenient for the repl
-- allows succinct Show instance for Piece | 940 | false | true | 0 | 10 | 432 | 119 | 71 | 48 | null | null |
kim/amazonka | amazonka-swf/gen/Network/AWS/SWF/Types.hs | mpl-2.0 | wecaneaTaskList :: Lens' WorkflowExecutionContinuedAsNewEventAttributes TaskList
wecaneaTaskList = lens _wecaneaTaskList (\s a -> s { _wecaneaTaskList = a }) | 157 | wecaneaTaskList :: Lens' WorkflowExecutionContinuedAsNewEventAttributes TaskList
wecaneaTaskList = lens _wecaneaTaskList (\s a -> s { _wecaneaTaskList = a }) | 157 | wecaneaTaskList = lens _wecaneaTaskList (\s a -> s { _wecaneaTaskList = a }) | 76 | false | true | 0 | 9 | 17 | 39 | 21 | 18 | null | null |
josefs/MiniDSL | Feldspar/Reify.hs | bsd-3-clause | uninteresting _ = False | 34 | uninteresting _ = False | 34 | uninteresting _ = False | 34 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
olsner/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | addTickLCmdStmts :: [LStmt Id (LHsCmd Id)] -> TM [LStmt Id (LHsCmd Id)]
addTickLCmdStmts stmts = do
(stmts, _) <- addTickLCmdStmts' stmts (return ())
return stmts | 166 | addTickLCmdStmts :: [LStmt Id (LHsCmd Id)] -> TM [LStmt Id (LHsCmd Id)]
addTickLCmdStmts stmts = do
(stmts, _) <- addTickLCmdStmts' stmts (return ())
return stmts | 166 | addTickLCmdStmts stmts = do
(stmts, _) <- addTickLCmdStmts' stmts (return ())
return stmts | 94 | false | true | 0 | 11 | 28 | 81 | 39 | 42 | null | null |
plow-technologies/shakespeare-dynamic | ghcjs-shakespeare-dynamic/src/Shakespeare/Ophelia/Parser/VDOM/Live.hs | mit | parseLitExpr :: String -> Exp
parseLitExpr str = fromResult (VarE $ mkName str) $ LitE <$> parseString parseHLit (Columns 0 0) str | 130 | parseLitExpr :: String -> Exp
parseLitExpr str = fromResult (VarE $ mkName str) $ LitE <$> parseString parseHLit (Columns 0 0) str | 130 | parseLitExpr str = fromResult (VarE $ mkName str) $ LitE <$> parseString parseHLit (Columns 0 0) str | 100 | false | true | 0 | 9 | 21 | 59 | 27 | 32 | null | null |
Fuuzetsu/haddock | haddock-library/src/Documentation/Haddock/Markup.hs | bsd-2-clause | markup :: DocMarkupH mod id a -> DocH mod id -> a
markup m DocEmpty = markupEmpty m | 102 | markup :: DocMarkupH mod id a -> DocH mod id -> a
markup m DocEmpty = markupEmpty m | 102 | markup m DocEmpty = markupEmpty m | 52 | false | true | 0 | 7 | 36 | 39 | 18 | 21 | null | null |
isomorphism/csound-expression | src/Csound/Control/Instr.hs | bsd-3-clause | retrig :: (Arg a, Sigs b) => (a -> SE b) -> Evt a -> b
retrig f = retrigs f . fmap return | 89 | retrig :: (Arg a, Sigs b) => (a -> SE b) -> Evt a -> b
retrig f = retrigs f . fmap return | 89 | retrig f = retrigs f . fmap return | 34 | false | true | 0 | 9 | 23 | 60 | 29 | 31 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.