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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
spechub/Hets | HasCASL/RawSym.hs | gpl-2.0 | statSymbMapItems :: Env -> [SymbMapItems] -> Result RawSymbolMap
statSymbMapItems e sl = do
rs <- mapM ( \ (SymbMapItems kind l _ _)
-> mapM (symbOrMapToRaw e kind) l) sl
foldr ( \ (r1, r2) mm -> do
m <- mm
if Map.member r1 m then do
Result [Diag Error ("... | 592 | statSymbMapItems :: Env -> [SymbMapItems] -> Result RawSymbolMap
statSymbMapItems e sl = do
rs <- mapM ( \ (SymbMapItems kind l _ _)
-> mapM (symbOrMapToRaw e kind) l) sl
foldr ( \ (r1, r2) mm -> do
m <- mm
if Map.member r1 m then do
Result [Diag Error ("... | 592 | statSymbMapItems e sl = do
rs <- mapM ( \ (SymbMapItems kind l _ _)
-> mapM (symbOrMapToRaw e kind) l) sl
foldr ( \ (r1, r2) mm -> do
m <- mm
if Map.member r1 m then do
Result [Diag Error ("duplicate mapping for: " ++
showDoc r1 ... | 527 | false | true | 0 | 25 | 239 | 213 | 102 | 111 | null | null |
rahulmutt/ghcvm | compiler/Eta/BasicTypes/IdInfo.hs | bsd-3-clause | -- Setters
setRuleInfo :: IdInfo -> RuleInfo -> IdInfo
setRuleInfo info sp = sp `seq` info { ruleInfo = sp } | 115 | setRuleInfo :: IdInfo -> RuleInfo -> IdInfo
setRuleInfo info sp = sp `seq` info { ruleInfo = sp } | 103 | setRuleInfo info sp = sp `seq` info { ruleInfo = sp } | 59 | true | true | 0 | 7 | 27 | 39 | 22 | 17 | null | null |
snoyberg/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | translateOp dflags WordAddOp = Just (mo_wordAdd dflags) | 60 | translateOp dflags WordAddOp = Just (mo_wordAdd dflags) | 60 | translateOp dflags WordAddOp = Just (mo_wordAdd dflags) | 60 | false | false | 0 | 7 | 11 | 20 | 9 | 11 | null | null |
kcharter/spdy-base | src/Network/SPDY/Internal/Deserialize.hs | bsd-3-clause | parseTerminationStatus :: Parser TerminationStatus
parseTerminationStatus =
fmap toStatus anyWord32
where toStatus w | w == tsProtocolError = ProtocolError
| w == tsInvalidStream = InvalidStream
| w == tsRefusedStream = RefusedStream
| w == tsUnsuppor... | 843 | parseTerminationStatus :: Parser TerminationStatus
parseTerminationStatus =
fmap toStatus anyWord32
where toStatus w | w == tsProtocolError = ProtocolError
| w == tsInvalidStream = InvalidStream
| w == tsRefusedStream = RefusedStream
| w == tsUnsuppor... | 843 | parseTerminationStatus =
fmap toStatus anyWord32
where toStatus w | w == tsProtocolError = ProtocolError
| w == tsInvalidStream = InvalidStream
| w == tsRefusedStream = RefusedStream
| w == tsUnsupportedVersion = UnsupportedVersion
... | 792 | false | true | 2 | 8 | 319 | 207 | 94 | 113 | null | null |
facebookincubator/duckling | Duckling/Dimensions/Types.hs | bsd-3-clause | toName :: Dimension a -> Text
toName RegexMatch = "regex" | 57 | toName :: Dimension a -> Text
toName RegexMatch = "regex" | 57 | toName RegexMatch = "regex" | 27 | false | true | 0 | 7 | 9 | 27 | 11 | 16 | null | null |
jsavatgy/xroads-game | code/orange-lines.hs | gpl-2.0 | segments = zip points (tail (cycle points)) | 43 | segments = zip points (tail (cycle points)) | 43 | segments = zip points (tail (cycle points)) | 43 | false | false | 0 | 9 | 6 | 23 | 11 | 12 | null | null |
rodrigogribeiro/mptc | src/Language/Haskell/Exts/Annotated/Simplify.hs | bsd-3-clause | sCName :: CName l -> S.CName
sCName (VarName _ n) = S.VarName (sName n) | 71 | sCName :: CName l -> S.CName
sCName (VarName _ n) = S.VarName (sName n) | 71 | sCName (VarName _ n) = S.VarName (sName n) | 42 | false | true | 0 | 7 | 13 | 42 | 20 | 22 | null | null |
jaiyalas/haha | src/BrickUI/OldMyBrick.hs | mit | -- in C.hCenter $ str "> " <+> (selStr $ menuShow i)
customAttr :: A.AttrName
customAttr = L.listSelectedAttr <> "custom" | 122 | customAttr :: A.AttrName
customAttr = L.listSelectedAttr <> "custom" | 68 | customAttr = L.listSelectedAttr <> "custom" | 43 | true | true | 0 | 6 | 20 | 20 | 11 | 9 | null | null |
agrafix/revenue-sample-app | src/Queries.hs | bsd-3-clause | getTotalRevenue :: MonadIO m => SqlPersistT m [Maybe Double]
getTotalRevenue =
liftM (map unValue) $
select $
from $ \(s, i, c) ->
do where_ (s ^. SaleItem ==. i ^. ItemId &&. s ^. SaleCustomer ==. c ^. CustomerId)
return (sum_ $ castNum (s ^. SaleAmount) *. i ^. ItemRevenue) | 299 | getTotalRevenue :: MonadIO m => SqlPersistT m [Maybe Double]
getTotalRevenue =
liftM (map unValue) $
select $
from $ \(s, i, c) ->
do where_ (s ^. SaleItem ==. i ^. ItemId &&. s ^. SaleCustomer ==. c ^. CustomerId)
return (sum_ $ castNum (s ^. SaleAmount) *. i ^. ItemRevenue) | 299 | getTotalRevenue =
liftM (map unValue) $
select $
from $ \(s, i, c) ->
do where_ (s ^. SaleItem ==. i ^. ItemId &&. s ^. SaleCustomer ==. c ^. CustomerId)
return (sum_ $ castNum (s ^. SaleAmount) *. i ^. ItemRevenue) | 238 | false | true | 6 | 17 | 73 | 141 | 67 | 74 | null | null |
vdweegen/UvA-Software_Testing | Lab5/Jordan/Lecture5.hs | gpl-3.0 | extendNode :: Node -> Constraint -> [Node]
extendNode (s,constraints) (r,c,vs) =
[(extend s ((r,c),v),
sortBy length3rd $
prune (r,c,v) constraints) | v <- vs ] | 179 | extendNode :: Node -> Constraint -> [Node]
extendNode (s,constraints) (r,c,vs) =
[(extend s ((r,c),v),
sortBy length3rd $
prune (r,c,v) constraints) | v <- vs ] | 179 | extendNode (s,constraints) (r,c,vs) =
[(extend s ((r,c),v),
sortBy length3rd $
prune (r,c,v) constraints) | v <- vs ] | 136 | false | true | 0 | 10 | 43 | 103 | 56 | 47 | null | null |
martinra/hlinear | test/HLinear/Test/Hook/EchelonTransformation.hs | gpl-3.0 | unitTests :: TestTree
unitTests =
testGroup "Echelon Transformation Unit Tests"
[ testCase "toMatrix trivial" $
let et = EchelonTransformation 2 V.empty :: EchelonTransformation Rational
in toMatrix et @?= M.fromLists
([[1,0], [0,1]] :: [[Rational]])
, testCase "toMatri... | 1,161 | unitTests :: TestTree
unitTests =
testGroup "Echelon Transformation Unit Tests"
[ testCase "toMatrix trivial" $
let et = EchelonTransformation 2 V.empty :: EchelonTransformation Rational
in toMatrix et @?= M.fromLists
([[1,0], [0,1]] :: [[Rational]])
, testCase "toMatri... | 1,161 | unitTests =
testGroup "Echelon Transformation Unit Tests"
[ testCase "toMatrix trivial" $
let et = EchelonTransformation 2 V.empty :: EchelonTransformation Rational
in toMatrix et @?= M.fromLists
([[1,0], [0,1]] :: [[Rational]])
, testCase "toMatrix diagonal" $
le... | 1,139 | false | true | 0 | 17 | 406 | 374 | 198 | 176 | null | null |
mwotton/Hubris-Haskell | Language/Ruby/Foo.hs | mit | could_be_called :: Int -> Int
could_be_called x = 3 * x | 55 | could_be_called :: Int -> Int
could_be_called x = 3 * x | 55 | could_be_called x = 3 * x | 25 | false | true | 1 | 7 | 10 | 29 | 12 | 17 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/OpsWorksCMServerEngineAttribute.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworkscm-server-engineattribute.html#cfn-opsworkscm-server-engineattribute-name
owcmseaName :: Lens' OpsWorksCMServerEngineAttribute (Maybe (Val Text))
owcmseaName = lens _opsWorksCMServerEngineAttributeName (\s a -> s { _opsWorksCMServ... | 348 | owcmseaName :: Lens' OpsWorksCMServerEngineAttribute (Maybe (Val Text))
owcmseaName = lens _opsWorksCMServerEngineAttributeName (\s a -> s { _opsWorksCMServerEngineAttributeName = a }) | 184 | owcmseaName = lens _opsWorksCMServerEngineAttributeName (\s a -> s { _opsWorksCMServerEngineAttributeName = a }) | 112 | true | true | 0 | 9 | 22 | 52 | 28 | 24 | null | null |
bb010g/aura | aura/exec/Aura/Commands/A.hs | gpl-3.0 | renderAurPkgInfo :: Settings -> AurInfo -> Text
renderAurPkgInfo ss ai = dtot . colourCheck ss $ entrify ss fields entries
where fields = infoFields . langOf $ ss
entries = [ magenta "aur"
, annotate bold . pretty $ aurNameOf ai
, pretty $ aurVersionOf ai
... | 970 | renderAurPkgInfo :: Settings -> AurInfo -> Text
renderAurPkgInfo ss ai = dtot . colourCheck ss $ entrify ss fields entries
where fields = infoFields . langOf $ ss
entries = [ magenta "aur"
, annotate bold . pretty $ aurNameOf ai
, pretty $ aurVersionOf ai
... | 970 | renderAurPkgInfo ss ai = dtot . colourCheck ss $ entrify ss fields entries
where fields = infoFields . langOf $ ss
entries = [ magenta "aur"
, annotate bold . pretty $ aurNameOf ai
, pretty $ aurVersionOf ai
, outOfDateMsg (dateObsoleteOf ai) $... | 922 | false | true | 1 | 11 | 388 | 278 | 135 | 143 | null | null |
facebookincubator/duckling | Duckling/Time/EL/Corpus.hs | bsd-3-clause | context :: Context
context = testContext {locale = makeLocale EL Nothing} | 73 | context :: Context
context = testContext {locale = makeLocale EL Nothing} | 73 | context = testContext {locale = makeLocale EL Nothing} | 54 | false | true | 0 | 7 | 10 | 24 | 13 | 11 | null | null |
TomMD/ghc | compiler/basicTypes/Var.hs | bsd-3-clause | -- | 'mustHaveLocalBinding' returns @True@ of 'Id's and 'TyVar's
-- that must have a binding in this module. The converse
-- is not quite right: there are some global 'Id's that must have
-- bindings, such as record selectors. But that doesn't matter,
-- because it's only used for assertions
mustHaveLocalBinding ... | 379 | mustHaveLocalBinding :: Var -> Bool
mustHaveLocalBinding var = isLocalVar var | 84 | mustHaveLocalBinding var = isLocalVar var | 41 | true | true | 0 | 5 | 68 | 26 | 15 | 11 | null | null |
keithodulaigh/Hets | Comorphisms/HolLight2Isabelle.hs | gpl-2.0 | notIgnore :: [String]
notIgnore = ["+", "-", "*"] | 49 | notIgnore :: [String]
notIgnore = ["+", "-", "*"] | 49 | notIgnore = ["+", "-", "*"] | 27 | false | true | 0 | 7 | 7 | 30 | 15 | 15 | null | null |
ajdunlap/yesod-markdown | Yesod/Markdown.hs | bsd-3-clause | maybeMarkdownField :: FormFieldSettings -> FormletField sub y (Maybe Markdown)
maybeMarkdownField = optionalFieldHelper markdownFieldProfile | 140 | maybeMarkdownField :: FormFieldSettings -> FormletField sub y (Maybe Markdown)
maybeMarkdownField = optionalFieldHelper markdownFieldProfile | 140 | maybeMarkdownField = optionalFieldHelper markdownFieldProfile | 61 | false | true | 0 | 8 | 12 | 31 | 15 | 16 | null | null |
JanGe/xdcc | src/DCC.hs | mit | connectionType env@Env {..} (SendReverseServer path' ip size' token) =
Passive ip localPort . offerSocketReverse <$> publicIP'
where
offerSocketReverse pIP p = runDccIO env $
sendCtcp remoteNick $ SendReverseClient path' pIP p size' token
publicIP' = note ("Passive connections are only supported i... | 526 | connectionType env@Env {..} (SendReverseServer path' ip size' token) =
Passive ip localPort . offerSocketReverse <$> publicIP'
where
offerSocketReverse pIP p = runDccIO env $
sendCtcp remoteNick $ SendReverseClient path' pIP p size' token
publicIP' = note ("Passive connections are only supported i... | 526 | connectionType env@Env {..} (SendReverseServer path' ip size' token) =
Passive ip localPort . offerSocketReverse <$> publicIP'
where
offerSocketReverse pIP p = runDccIO env $
sendCtcp remoteNick $ SendReverseClient path' pIP p size' token
publicIP' = note ("Passive connections are only supported i... | 526 | false | false | 4 | 8 | 106 | 118 | 51 | 67 | null | null |
j-mueller/hldb | webapp/VirtualHom/Svg.hs | bsd-3-clause | -- | The @mathematical@ attribute.
mathematical :: AttrTag
mathematical = makeAttribute "mathematical" | 102 | mathematical :: AttrTag
mathematical = makeAttribute "mathematical" | 67 | mathematical = makeAttribute "mathematical" | 43 | true | true | 0 | 5 | 11 | 15 | 8 | 7 | null | null |
madmann91/Ape | src/Ape/Env.hs | lgpl-3.0 | genVariable :: Env a -> String -> String
genVariable e = genVariableWith (isInEnv e) | 84 | genVariable :: Env a -> String -> String
genVariable e = genVariableWith (isInEnv e) | 84 | genVariable e = genVariableWith (isInEnv e) | 43 | false | true | 0 | 7 | 13 | 34 | 16 | 18 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT41.hs | gpl-3.0 | qfac (S x) acc = qfac x (S x * acc) | 35 | qfac (S x) acc = qfac x (S x * acc) | 35 | qfac (S x) acc = qfac x (S x * acc) | 35 | false | false | 0 | 8 | 10 | 32 | 15 | 17 | null | null |
zchn/hi-ckev-in-servant | hi-ckev-in-servant-server/src/HiCkevInServant/Server/Logging.hs | bsd-3-clause | -- | Take a bunch of logs with severity and print them to stdout with timestamps.
withLogging
:: (MonadMask m, MonadIO m, Pretty msg)
=> Severity -> LogM msg m a -> m a
withLogging severityThreshold body =
withFDHandler defaultBatchingOptions stdout 0.4 80 $
\stdoutHandler ->
runLoggingT
(withTimest... | 381 | withLogging
:: (MonadMask m, MonadIO m, Pretty msg)
=> Severity -> LogM msg m a -> m a
withLogging severityThreshold body =
withFDHandler defaultBatchingOptions stdout 0.4 80 $
\stdoutHandler ->
runLoggingT
(withTimestamps body)
(printLogs severityThreshold stdoutHandler) | 299 | withLogging severityThreshold body =
withFDHandler defaultBatchingOptions stdout 0.4 80 $
\stdoutHandler ->
runLoggingT
(withTimestamps body)
(printLogs severityThreshold stdoutHandler) | 208 | true | true | 0 | 9 | 78 | 96 | 47 | 49 | null | null |
slackcals/xmonad-configs | xmonad/xmonad.hs | gpl-3.0 | -- Map workspaces
myWorkspaces = [ "1:main", "2:extra_terminals", "3:browser", "4",
"5:mail","6:mail","7","8","9:float"
] | 153 | myWorkspaces = [ "1:main", "2:extra_terminals", "3:browser", "4",
"5:mail","6:mail","7","8","9:float"
] | 135 | myWorkspaces = [ "1:main", "2:extra_terminals", "3:browser", "4",
"5:mail","6:mail","7","8","9:float"
] | 135 | true | false | 1 | 5 | 43 | 37 | 22 | 15 | null | null |
OmnipotentEntity/fluidsim | src/main.hs | bsd-3-clause | initialize :: IO ()
initialize =
do
_ <- SDL.init SDL.initFlagEverything
sdlWindow <- withCString "Test" $ \title ->
SDL.createWindow title SDL.windowPosCentered SDL.windowPosCentered (mkCInt 640) (mkCInt 480) SDL.windowFlagOpenGL
_ <- SDL.createRenderer sdlWindow (mkCInt (-1)) SDL.rendererFlagAccel... | 340 | initialize :: IO ()
initialize =
do
_ <- SDL.init SDL.initFlagEverything
sdlWindow <- withCString "Test" $ \title ->
SDL.createWindow title SDL.windowPosCentered SDL.windowPosCentered (mkCInt 640) (mkCInt 480) SDL.windowFlagOpenGL
_ <- SDL.createRenderer sdlWindow (mkCInt (-1)) SDL.rendererFlagAccel... | 340 | initialize =
do
_ <- SDL.init SDL.initFlagEverything
sdlWindow <- withCString "Test" $ \title ->
SDL.createWindow title SDL.windowPosCentered SDL.windowPosCentered (mkCInt 640) (mkCInt 480) SDL.windowFlagOpenGL
_ <- SDL.createRenderer sdlWindow (mkCInt (-1)) SDL.rendererFlagAccelerated
return () | 320 | false | true | 0 | 12 | 59 | 119 | 56 | 63 | null | null |
trskop/cabal | Cabal/Distribution/Simple/GHC.hs | bsd-3-clause | -- | Filter the "-threaded" flag when profiling as it does not
-- work with ghc-6.8 and older.
hackThreadedFlag :: Verbosity -> Compiler -> Bool -> BuildInfo -> IO BuildInfo
hackThreadedFlag verbosity comp prof bi
| not mustFilterThreaded = return bi
| otherwise = do
warn verbosity $ "The ghc fla... | 906 | hackThreadedFlag :: Verbosity -> Compiler -> Bool -> BuildInfo -> IO BuildInfo
hackThreadedFlag verbosity comp prof bi
| not mustFilterThreaded = return bi
| otherwise = do
warn verbosity $ "The ghc flag '-threaded' is not compatible with "
++ "profiling in ghc-6.8 and older. It w... | 809 | hackThreadedFlag verbosity comp prof bi
| not mustFilterThreaded = return bi
| otherwise = do
warn verbosity $ "The ghc flag '-threaded' is not compatible with "
++ "profiling in ghc-6.8 and older. It will be disabled."
return bi { options = filterHcOptions (/= "-threaded") (o... | 730 | true | true | 2 | 12 | 237 | 203 | 105 | 98 | null | null |
deadfoxygrandpa/Elm | compiler/Build/File.hs | bsd-3-clause | update :: String -> M.ModuleInterface -> Bool -> Build ()
update name inter wasUpdated =
do modify (Map.insert name (wasUpdated, inter))
tell (Last . Just $ name) | 169 | update :: String -> M.ModuleInterface -> Bool -> Build ()
update name inter wasUpdated =
do modify (Map.insert name (wasUpdated, inter))
tell (Last . Just $ name) | 169 | update name inter wasUpdated =
do modify (Map.insert name (wasUpdated, inter))
tell (Last . Just $ name) | 111 | false | true | 0 | 10 | 33 | 76 | 37 | 39 | null | null |
UCSD-PL/nano-js | Language/Nano/ESC/Types.hs | bsd-3-clause | ppObligation (l, p) = text "for" <+> pp l <+> dcolon <+> pp p | 61 | ppObligation (l, p) = text "for" <+> pp l <+> dcolon <+> pp p | 61 | ppObligation (l, p) = text "for" <+> pp l <+> dcolon <+> pp p | 61 | false | false | 4 | 6 | 13 | 39 | 17 | 22 | null | null |
berdario/jira2sheet | src/Jira2Sheet/Crypto.hs | bsd-3-clause | liftCrypto :: (Exception e, MonadCrypto m, MonadError SomeException m) => Either e a -> m a
liftCrypto = either (throwError . SomeException) pure | 145 | liftCrypto :: (Exception e, MonadCrypto m, MonadError SomeException m) => Either e a -> m a
liftCrypto = either (throwError . SomeException) pure | 145 | liftCrypto = either (throwError . SomeException) pure | 53 | false | true | 0 | 8 | 22 | 64 | 30 | 34 | null | null |
ajnsit/vyom | src/Vyom/Data/TypeRep.hs | mit | serialiseTypeRep :: TypeRep a -> ExprU
serialiseTypeRep rep = Node "TypeRep"
[Leaf (C8.unpack (S.serialise (SomeTypeRep rep)))] | 129 | serialiseTypeRep :: TypeRep a -> ExprU
serialiseTypeRep rep = Node "TypeRep"
[Leaf (C8.unpack (S.serialise (SomeTypeRep rep)))] | 129 | serialiseTypeRep rep = Node "TypeRep"
[Leaf (C8.unpack (S.serialise (SomeTypeRep rep)))] | 90 | false | true | 0 | 12 | 17 | 55 | 26 | 29 | null | null |
sdiehl/ghc | libraries/base/GHC/Show.hs | bsd-3-clause | showLitChar '\DEL' s = showString "\\DEL" s | 52 | showLitChar '\DEL' s = showString "\\DEL" s | 52 | showLitChar '\DEL' s = showString "\\DEL" s | 52 | false | false | 1 | 5 | 15 | 18 | 7 | 11 | null | null |
mcschroeder/ghc | compiler/main/DynFlags.hs | bsd-3-clause | setOutputDir f = setObjectDir f . setHiDir f . setStubDir f . setDumpDir f | 75 | setOutputDir f = setObjectDir f . setHiDir f . setStubDir f . setDumpDir f | 75 | setOutputDir f = setObjectDir f . setHiDir f . setStubDir f . setDumpDir f | 75 | false | false | 0 | 8 | 14 | 33 | 14 | 19 | null | null |
jhstanton/Binder | src/Binder/Commands.hs | bsd-3-clause | runIf True m = m | 17 | runIf True m = m | 17 | runIf True m = m | 17 | false | false | 0 | 5 | 5 | 11 | 5 | 6 | null | null |
guoguo12/haskell-ptable | ptable.hs | apache-2.0 | gnum "Pa" = -1 | 14 | gnum "Pa" = -1 | 14 | gnum "Pa" = -1 | 14 | false | false | 0 | 5 | 3 | 12 | 5 | 7 | null | null |
pbrisbin/renters-reality | Handler/Review.hs | bsd-2-clause | postEditR :: ReviewId -> Handler RepHtml
postEditR = getEditR | 61 | postEditR :: ReviewId -> Handler RepHtml
postEditR = getEditR | 61 | postEditR = getEditR | 20 | false | true | 0 | 6 | 8 | 18 | 9 | 9 | null | null |
nomeata/cryptonite | Crypto/PubKey/ECC/Prim.hs | bsd-3-clause | divmod :: Integer -> Integer -> Integer -> Maybe Integer
divmod y x m = do
i <- inverse (x `mod` m) m
return $ y * i `mod` m | 132 | divmod :: Integer -> Integer -> Integer -> Maybe Integer
divmod y x m = do
i <- inverse (x `mod` m) m
return $ y * i `mod` m | 132 | divmod y x m = do
i <- inverse (x `mod` m) m
return $ y * i `mod` m | 75 | false | true | 0 | 10 | 37 | 76 | 37 | 39 | null | null |
carlohamalainen/cli-yesod-blog-1.4 | Application.hs | bsd-2-clause | getAppSettings :: IO AppSettings
getAppSettings = loadAppSettings [configSettingsYml] [] useEnv | 95 | getAppSettings :: IO AppSettings
getAppSettings = loadAppSettings [configSettingsYml] [] useEnv | 95 | getAppSettings = loadAppSettings [configSettingsYml] [] useEnv | 62 | false | true | 0 | 6 | 9 | 32 | 14 | 18 | null | null |
ChrisCoffey/rwh | src/RW/Chap3.hs | bsd-3-clause | -- I suspect this is wrong once we pass through 90 degrees
findBend :: Point -> Point -> Point -> Direction
findBend a b c =
case vProd a b c of
x
| x == 0 -> DStraight
| x < 0 -> DRight
| x > 0 -> DLeft
where
vProd (x,y) (x', y') (x'', y'') =
(x' - x)*(y'' - y) - (y' - y)*(x''... | 325 | findBend :: Point -> Point -> Point -> Direction
findBend a b c =
case vProd a b c of
x
| x == 0 -> DStraight
| x < 0 -> DRight
| x > 0 -> DLeft
where
vProd (x,y) (x', y') (x'', y'') =
(x' - x)*(y'' - y) - (y' - y)*(x'' - x) | 266 | findBend a b c =
case vProd a b c of
x
| x == 0 -> DStraight
| x < 0 -> DRight
| x > 0 -> DLeft
where
vProd (x,y) (x', y') (x'', y'') =
(x' - x)*(y'' - y) - (y' - y)*(x'' - x) | 217 | true | true | 3 | 9 | 111 | 152 | 79 | 73 | null | null |
mainland/dph | dph-prim-par/Data/Array/Parallel/Unlifted/Distributed/Primitive/Operators.hs | bsd-3-clause | - Mapping --------------------------------------------------------------------
-- | Map a function across all elements of a distributed value.
-- The worker function also gets the current thread index.
imapD' :: (DT a, DT b)
=> W.What -> Gang -> (Int -> a -> b) -> Dist a -> Dist b
imapD' what gang f !d
=... | 510 | imapD' :: (DT a, DT b)
=> W.What -> Gang -> (Int -> a -> b) -> Dist a -> Dist b
imapD' what gang f !d
= runDistST (W.CMap what) gang
$ do i <- myIndex
x <- myD d
let result = f i x
deepSeqD result (return ())
return result
| 305 | imapD' what gang f !d
= runDistST (W.CMap what) gang
$ do i <- myIndex
x <- myD d
let result = f i x
deepSeqD result (return ())
return result
| 215 | true | true | 3 | 12 | 162 | 159 | 73 | 86 | null | null |
Tener/HaNS | src/Hans/Device/Tap.hs | bsd-3-clause | tapReceiveLoop :: Fd -> EthernetHandle -> IO ()
tapReceiveLoop fd eh = forever (k =<< tapReceive fd)
where k pkt = queueEthernet eh pkt
-- | Recieve an ethernet frame from a tap device. | 189 | tapReceiveLoop :: Fd -> EthernetHandle -> IO ()
tapReceiveLoop fd eh = forever (k =<< tapReceive fd)
where k pkt = queueEthernet eh pkt
-- | Recieve an ethernet frame from a tap device. | 189 | tapReceiveLoop fd eh = forever (k =<< tapReceive fd)
where k pkt = queueEthernet eh pkt
-- | Recieve an ethernet frame from a tap device. | 141 | false | true | 1 | 9 | 37 | 66 | 29 | 37 | null | null |
dorchard/gram_lang | frontend/src/Language/Granule/Checker/Checker.hs | bsd-3-clause | checkExpr defs gam pol _ ty@(FunTy sig tau) (Val s _ (Abs _ p t e)) = do
-- If an explicit signature on the lambda was given, then check
-- it confirms with the type being checked here
(tau', subst1) <- case t of
Nothing -> return (tau, [])
Just t' -> do
(eqT, unifiedType, subst) <- equalTypes s si... | 1,822 | checkExpr defs gam pol _ ty@(FunTy sig tau) (Val s _ (Abs _ p t e)) = do
-- If an explicit signature on the lambda was given, then check
-- it confirms with the type being checked here
(tau', subst1) <- case t of
Nothing -> return (tau, [])
Just t' -> do
(eqT, unifiedType, subst) <- equalTypes s si... | 1,822 | checkExpr defs gam pol _ ty@(FunTy sig tau) (Val s _ (Abs _ p t e)) = do
-- If an explicit signature on the lambda was given, then check
-- it confirms with the type being checked here
(tau', subst1) <- case t of
Nothing -> return (tau, [])
Just t' -> do
(eqT, unifiedType, subst) <- equalTypes s si... | 1,822 | false | false | 0 | 20 | 453 | 447 | 229 | 218 | null | null |
DevJac/haskell-project-euler | src/Problem24.hs | mit | factorial :: (Integral n) => n -> n
factorial n = product [2..n] | 64 | factorial :: (Integral n) => n -> n
factorial n = product [2..n] | 64 | factorial n = product [2..n] | 28 | false | true | 0 | 8 | 12 | 40 | 19 | 21 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/ShallowDeepPlugin/AbsThenPass.hs | bsd-3-clause | absThenExpr :: CoreExpr -> BindM CoreExpr
absThenExpr e = do
thenId <- thNameToId bindThenNameTH
fmapId <- thNameToId fmapNameTH
absId <- thNameToId absNameTH
case e of
Var v -> return $ Var v
Lit l -> return $ Lit l
Type ty -> return $ Type ty
Coercion co -> return $ Coercion co
-- Look fo... | 1,642 | absThenExpr :: CoreExpr -> BindM CoreExpr
absThenExpr e = do
thenId <- thNameToId bindThenNameTH
fmapId <- thNameToId fmapNameTH
absId <- thNameToId absNameTH
case e of
Var v -> return $ Var v
Lit l -> return $ Lit l
Type ty -> return $ Type ty
Coercion co -> return $ Coercion co
-- Look fo... | 1,642 | absThenExpr e = do
thenId <- thNameToId bindThenNameTH
fmapId <- thNameToId fmapNameTH
absId <- thNameToId absNameTH
case e of
Var v -> return $ Var v
Lit l -> return $ Lit l
Type ty -> return $ Type ty
Coercion co -> return $ Coercion co
-- Look for expressions of the form:
-- forall (... | 1,600 | false | true | 0 | 26 | 591 | 657 | 298 | 359 | null | null |
bqv/hebi | plugin/haskell/Message.hs | mpl-2.0 | irc_join :: Writeable a => a -> Message
irc_join chan = Message Nothing Join ( Short (text chan) End ) | 102 | irc_join :: Writeable a => a -> Message
irc_join chan = Message Nothing Join ( Short (text chan) End ) | 102 | irc_join chan = Message Nothing Join ( Short (text chan) End ) | 62 | false | true | 0 | 9 | 19 | 46 | 22 | 24 | null | null |
vTurbine/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | nlTuplePat :: [LPat id] -> Boxity -> LPat id
nlTuplePat pats box = noLoc (TuplePat pats box []) | 95 | nlTuplePat :: [LPat id] -> Boxity -> LPat id
nlTuplePat pats box = noLoc (TuplePat pats box []) | 95 | nlTuplePat pats box = noLoc (TuplePat pats box []) | 50 | false | true | 0 | 8 | 17 | 48 | 23 | 25 | null | null |
gorkinovich/Haskell | Checkers/src/Console/Util.hs | mit | dropTokenEx text 0 = text | 25 | dropTokenEx text 0 = text | 25 | dropTokenEx text 0 = text | 25 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
christiaanb/cabal | Cabal/Distribution/Simple/PackageIndex.hs | bsd-3-clause | -- | Get all the packages from the index.
--
-- They are grouped by source package id (package name and version).
--
allPackagesBySourcePackageId :: PackageInstalled a => PackageIndex a -> [(PackageId, [a])]
allPackagesBySourcePackageId (PackageIndex _ pnames) =
[ (packageId ipkg, ipkgs)
| pvers <- Map.elems pnames... | 360 | allPackagesBySourcePackageId :: PackageInstalled a => PackageIndex a -> [(PackageId, [a])]
allPackagesBySourcePackageId (PackageIndex _ pnames) =
[ (packageId ipkg, ipkgs)
| pvers <- Map.elems pnames
, ipkgs@(ipkg:_) <- Map.elems pvers ] | 243 | allPackagesBySourcePackageId (PackageIndex _ pnames) =
[ (packageId ipkg, ipkgs)
| pvers <- Map.elems pnames
, ipkgs@(ipkg:_) <- Map.elems pvers ] | 152 | true | true | 0 | 10 | 58 | 100 | 54 | 46 | null | null |
gcross/habit-of-fate | sources/library/HabitOfFate/Data/Habit.hs | agpl-3.0 | updateHabitDeadline ∷ Habit → LocalTime → Habit
updateHabitDeadline habit today =
case habit ^. frequency_ of
Repeated days_to_keep deadline repeated | today >= deadline →
habit & frequency_ .~ Repeated days_to_keep (nextDeadline repeated today deadline) repeated
_ → habit | 289 | updateHabitDeadline ∷ Habit → LocalTime → Habit
updateHabitDeadline habit today =
case habit ^. frequency_ of
Repeated days_to_keep deadline repeated | today >= deadline →
habit & frequency_ .~ Repeated days_to_keep (nextDeadline repeated today deadline) repeated
_ → habit | 289 | updateHabitDeadline habit today =
case habit ^. frequency_ of
Repeated days_to_keep deadline repeated | today >= deadline →
habit & frequency_ .~ Repeated days_to_keep (nextDeadline repeated today deadline) repeated
_ → habit | 241 | false | true | 2 | 8 | 54 | 87 | 41 | 46 | null | null |
brendanhay/gogol | gogol-containeranalysis/gen/Network/Google/ContainerAnalysis/Types/Product.hs | mpl-2.0 | -- | The affected resource.
ftbdResource :: Lens' FixableTotalByDigest (Maybe Resource)
ftbdResource
= lens _ftbdResource (\ s a -> s{_ftbdResource = a}) | 155 | ftbdResource :: Lens' FixableTotalByDigest (Maybe Resource)
ftbdResource
= lens _ftbdResource (\ s a -> s{_ftbdResource = a}) | 127 | ftbdResource
= lens _ftbdResource (\ s a -> s{_ftbdResource = a}) | 67 | true | true | 0 | 9 | 23 | 48 | 25 | 23 | null | null |
teuffy/interactive-brokers | executable/IB.hs | bsd-3-clause | ibContract :: String -> String -> IBContract
--ibContract sf s = future sf s Nothing GLOBEX "USD"
ibContract sf s
| elem sf ["CL","NG"] = future sf s Nothing NYMEX "USD"
| elem sf ["ES","NQ"] = future sf s Nothing GLOBEX "USD"
| otherwise = future sf s Nothing GLOBEX "USD" | 281 | ibContract :: String -> String -> IBContract
ibContract sf s
| elem sf ["CL","NG"] = future sf s Nothing NYMEX "USD"
| elem sf ["ES","NQ"] = future sf s Nothing GLOBEX "USD"
| otherwise = future sf s Nothing GLOBEX "USD" | 228 | ibContract sf s
| elem sf ["CL","NG"] = future sf s Nothing NYMEX "USD"
| elem sf ["ES","NQ"] = future sf s Nothing GLOBEX "USD"
| otherwise = future sf s Nothing GLOBEX "USD" | 183 | true | true | 1 | 9 | 58 | 112 | 52 | 60 | null | null |
tomjaguarpaw/postgresql-simple | src/Database/PostgreSQL/Simple/Errors.hs | bsd-3-clause | constraintViolationE :: SqlError -> Maybe (SqlError, ConstraintViolation)
constraintViolationE e = fmap ((,) e) $ constraintViolation e | 135 | constraintViolationE :: SqlError -> Maybe (SqlError, ConstraintViolation)
constraintViolationE e = fmap ((,) e) $ constraintViolation e | 135 | constraintViolationE e = fmap ((,) e) $ constraintViolation e | 61 | false | true | 0 | 9 | 15 | 46 | 23 | 23 | null | null |
sol/v8 | test/Language/JavaScript/V8Spec.hs | mit | fakeLoader :: FakeLoader -> SourceLoader
fakeLoader m name = maybe noSource return (M.lookup name m_)
where
m_ = execState m M.empty
noSource = throwIO (ErrorCall $ "no source for " ++ show name) | 205 | fakeLoader :: FakeLoader -> SourceLoader
fakeLoader m name = maybe noSource return (M.lookup name m_)
where
m_ = execState m M.empty
noSource = throwIO (ErrorCall $ "no source for " ++ show name) | 205 | fakeLoader m name = maybe noSource return (M.lookup name m_)
where
m_ = execState m M.empty
noSource = throwIO (ErrorCall $ "no source for " ++ show name) | 164 | false | true | 2 | 8 | 42 | 87 | 37 | 50 | null | null |
Erdwolf/autotool-bonn | src/Hilbert/Match.hs | gpl-2.0 | matches [] = return emptyFM | 27 | matches [] = return emptyFM | 27 | matches [] = return emptyFM | 27 | false | false | 1 | 5 | 4 | 17 | 6 | 11 | null | null |
alanz/cloud-haskell-play | src/simplesupervisor.hs | unlicense | -- ---------------------------------------------------------------------
-- Note: this TH stuff has to be before anything that refers to it
exitIgnore :: Process ()
exitIgnore = liftIO $ throwIO ChildInitIgnore | 211 | exitIgnore :: Process ()
exitIgnore = liftIO $ throwIO ChildInitIgnore | 70 | exitIgnore = liftIO $ throwIO ChildInitIgnore | 45 | true | true | 0 | 6 | 26 | 25 | 13 | 12 | null | null |
qbyt/lolscheme | src/Lolscheme/Evaluator.hs | mit | closePort _ = return $ Bool False | 33 | closePort _ = return $ Bool False | 33 | closePort _ = return $ Bool False | 33 | false | false | 2 | 5 | 6 | 18 | 7 | 11 | null | null |
myShoggoth/shakespeare | Text/Hamlet/Parse.hs | mit | selectors :: (String, [String]) -> [String]
selectors (_, s) = s | 64 | selectors :: (String, [String]) -> [String]
selectors (_, s) = s | 64 | selectors (_, s) = s | 20 | false | true | 0 | 7 | 10 | 36 | 21 | 15 | null | null |
holmisen/hrunner | src/Subst.hs | gpl-3.0 | html '\'' = "´" | 21 | html '\'' = "´" | 21 | html '\'' = "´" | 21 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
nuttycom/haskoin | Network/Haskoin/Crypto/Base58.hs | unlicense | decodeBase58I :: BS.ByteString -> Maybe Integer
decodeBase58I s = case go of
Just (r,[]) -> Just r
_ -> Nothing
where
c = b58' . fromIntegral . ord
p = isJust . c
f = fromIntegral . fromJust . c
go = listToMaybe $ readInt 58 p f (B8.unpack s)
-- | Encode a bytestring to a base 58 ... | 335 | decodeBase58I :: BS.ByteString -> Maybe Integer
decodeBase58I s = case go of
Just (r,[]) -> Just r
_ -> Nothing
where
c = b58' . fromIntegral . ord
p = isJust . c
f = fromIntegral . fromJust . c
go = listToMaybe $ readInt 58 p f (B8.unpack s)
-- | Encode a bytestring to a base 58 ... | 335 | decodeBase58I s = case go of
Just (r,[]) -> Just r
_ -> Nothing
where
c = b58' . fromIntegral . ord
p = isJust . c
f = fromIntegral . fromJust . c
go = listToMaybe $ readInt 58 p f (B8.unpack s)
-- | Encode a bytestring to a base 58 representation. | 287 | false | true | 3 | 10 | 98 | 127 | 60 | 67 | null | null |
AlexanderPankiv/ghc | compiler/basicTypes/VarEnv.hs | bsd-3-clause | lookupWithDefaultVarEnv = lookupWithDefaultUFM | 46 | lookupWithDefaultVarEnv = lookupWithDefaultUFM | 46 | lookupWithDefaultVarEnv = lookupWithDefaultUFM | 46 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
rueshyna/gogol | gogol-dataflow/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Create.hs | mpl-2.0 | -- | Deprecated. This field is now in the Job message.
pjcReplaceJobId :: Lens' ProjectsJobsCreate (Maybe Text)
pjcReplaceJobId
= lens _pjcReplaceJobId
(\ s a -> s{_pjcReplaceJobId = a}) | 194 | pjcReplaceJobId :: Lens' ProjectsJobsCreate (Maybe Text)
pjcReplaceJobId
= lens _pjcReplaceJobId
(\ s a -> s{_pjcReplaceJobId = a}) | 139 | pjcReplaceJobId
= lens _pjcReplaceJobId
(\ s a -> s{_pjcReplaceJobId = a}) | 82 | true | true | 0 | 9 | 35 | 48 | 25 | 23 | null | null |
tonyday567/chart-svg | src/Data/Colour.hs | bsd-3-clause | lab2xyz_ :: Array '[3] Double -> Array '[3] Double
lab2xyz_ lab =
dot sum (*) m1' ((** 3.0) <$> dot sum (*) m2' lab) | 118 | lab2xyz_ :: Array '[3] Double -> Array '[3] Double
lab2xyz_ lab =
dot sum (*) m1' ((** 3.0) <$> dot sum (*) m2' lab) | 118 | lab2xyz_ lab =
dot sum (*) m1' ((** 3.0) <$> dot sum (*) m2' lab) | 67 | false | true | 0 | 8 | 25 | 72 | 38 | 34 | null | null |
olsner/ghc | compiler/utils/Outputable.hs | bsd-3-clause | showPpr :: Outputable a => DynFlags -> a -> String
showPpr dflags thing = showSDoc dflags (ppr thing) | 101 | showPpr :: Outputable a => DynFlags -> a -> String
showPpr dflags thing = showSDoc dflags (ppr thing) | 101 | showPpr dflags thing = showSDoc dflags (ppr thing) | 50 | false | true | 0 | 7 | 17 | 42 | 20 | 22 | null | null |
iu-parfunc/criterion | Criterion/Report.hs | bsd-2-clause | vector2 name1 name2 v1 v2 = MuList $ zipWith val (G.toList v1) (G.toList v2)
where val i j = mkStrContext $ \nym ->
case undefined of
_| nym == name1 -> MuVariable i
| nym == name2 -> MuVariable j
| otherwise -> MuNothing
--... | 831 | vector2 name1 name2 v1 v2 = MuList $ zipWith val (G.toList v1) (G.toList v2)
where val i j = mkStrContext $ \nym ->
case undefined of
_| nym == name1 -> MuVariable i
| nym == name2 -> MuVariable j
| otherwise -> MuNothing
--... | 831 | vector2 name1 name2 v1 v2 = MuList $ zipWith val (G.toList v1) (G.toList v2)
where val i j = mkStrContext $ \nym ->
case undefined of
_| nym == name1 -> MuVariable i
| nym == name2 -> MuVariable j
| otherwise -> MuNothing
--... | 831 | false | false | 1 | 13 | 229 | 131 | 63 | 68 | null | null |
AlbinTheander/oden | test/Oden/Backend/GoBackendSpec.hs | mit | literalExpr :: AST.Literal -> AST.Expression
literalExpr = AST.Expression . AST.Operand . AST.Literal | 101 | literalExpr :: AST.Literal -> AST.Expression
literalExpr = AST.Expression . AST.Operand . AST.Literal | 101 | literalExpr = AST.Expression . AST.Operand . AST.Literal | 56 | false | true | 0 | 7 | 11 | 33 | 17 | 16 | null | null |
jasonzoladz/persistent | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | -- | Point to a nested field to query. This field is not an array type.
-- This level of nesting is not the final level.
-- Use '->.' or '&>.' to point to the final level.
(&~>.) :: forall val nes nes1. PersistEntity nes1 => EntityField val nes1 -> NestedField nes1 nes -> NestedField val nes
(&~>.) = MidNestFlds | 314 | (&~>.) :: forall val nes nes1. PersistEntity nes1 => EntityField val nes1 -> NestedField nes1 nes -> NestedField val nes
(&~>.) = MidNestFlds | 142 | (&~>.) = MidNestFlds | 21 | true | true | 0 | 9 | 60 | 55 | 31 | 24 | null | null |
VictorDenisov/cluedo | src/Test/AllTests.hs | gpl-2.0 | testIsUnique_hasSimilar :: Assertion
testIsUnique_hasSimilar =
False @=? (Utils.isUnique ["A", "B", "B"]) | 109 | testIsUnique_hasSimilar :: Assertion
testIsUnique_hasSimilar =
False @=? (Utils.isUnique ["A", "B", "B"]) | 109 | testIsUnique_hasSimilar =
False @=? (Utils.isUnique ["A", "B", "B"]) | 72 | false | true | 0 | 8 | 14 | 32 | 18 | 14 | null | null |
mannersio/manners | cli/src/Runner.hs | mit | performMethod "post" url options body = serialiseResponse <$> W.postWith options url body | 89 | performMethod "post" url options body = serialiseResponse <$> W.postWith options url body | 89 | performMethod "post" url options body = serialiseResponse <$> W.postWith options url body | 89 | false | false | 0 | 7 | 11 | 28 | 13 | 15 | null | null |
bredelings/BAli-Phy | haskell/Data/Either.hs | gpl-2.0 | either f g (Left l) = f l | 26 | either f g (Left l) = f l | 26 | either f g (Left l) = f l | 26 | false | false | 0 | 7 | 8 | 22 | 10 | 12 | null | null |
mainland/nikola | examples/common/GUI/Commands.hs | bsd-3-clause | glutKeyToKey (GLUT.SpecialKey GLUT.KeyNumLock) = SpecialKey KeyNumLock | 81 | glutKeyToKey (GLUT.SpecialKey GLUT.KeyNumLock) = SpecialKey KeyNumLock | 81 | glutKeyToKey (GLUT.SpecialKey GLUT.KeyNumLock) = SpecialKey KeyNumLock | 81 | false | false | 0 | 8 | 16 | 22 | 10 | 12 | null | null |
AndrewRademacher/stack | src/Stack/PackageDump.hs | bsd-3-clause | addProfiling :: MonadIO m
=> InstalledCache
-> Conduit (DumpPackage a b) m (DumpPackage Bool b)
addProfiling (InstalledCache ref) =
CL.mapM go
where
go dp = liftIO $ do
InstalledCacheInner m <- readIORef ref
let gid = dpGhcPkgId dp
p <- case Map.lookup gid m o... | 1,081 | addProfiling :: MonadIO m
=> InstalledCache
-> Conduit (DumpPackage a b) m (DumpPackage Bool b)
addProfiling (InstalledCache ref) =
CL.mapM go
where
go dp = liftIO $ do
InstalledCacheInner m <- readIORef ref
let gid = dpGhcPkgId dp
p <- case Map.lookup gid m o... | 1,081 | addProfiling (InstalledCache ref) =
CL.mapM go
where
go dp = liftIO $ do
InstalledCacheInner m <- readIORef ref
let gid = dpGhcPkgId dp
p <- case Map.lookup gid m of
Just installed -> return (installedCacheProfiling installed)
Nothing | null (dpLibraries dp) -> ... | 959 | false | true | 3 | 25 | 495 | 328 | 146 | 182 | null | null |
lifengsun/haskell-exercise | scheme/04/errorcheck.hs | gpl-3.0 | showError :: LispError -> String
showError (UnboundVar message varname) = concat [message, ": ", varname] | 105 | showError :: LispError -> String
showError (UnboundVar message varname) = concat [message, ": ", varname] | 105 | showError (UnboundVar message varname) = concat [message, ": ", varname] | 72 | false | true | 0 | 7 | 14 | 38 | 20 | 18 | null | null |
GaloisInc/halvm-ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | emptyImportAvails :: ImportAvails
emptyImportAvails = ImportAvails { imp_mods = emptyModuleEnv,
imp_dep_mods = emptyUFM,
imp_dep_pkgs = [],
imp_trust_pkgs = [],
... | 468 | emptyImportAvails :: ImportAvails
emptyImportAvails = ImportAvails { imp_mods = emptyModuleEnv,
imp_dep_mods = emptyUFM,
imp_dep_pkgs = [],
imp_trust_pkgs = [],
... | 468 | emptyImportAvails = ImportAvails { imp_mods = emptyModuleEnv,
imp_dep_mods = emptyUFM,
imp_dep_pkgs = [],
imp_trust_pkgs = [],
imp_trust_own_pkg = False,
... | 434 | false | true | 0 | 8 | 275 | 70 | 40 | 30 | null | null |
kd226/Raytrace | src/SceneBuilder.hs | bsd-3-clause | -- | Sample view with camera at (0,0,0), looking in (0,0,1) direction,
-- oriented along y and with field of view equal 110
sampleView = View (Vec3 0.0 0.0 0.0) 0.01 (mkNormal (Vec3 0.0 (-0.0) 0.5))
(mkNormal (Vec3 0.0 1.0 0.0)) (11.0/9.0 * pi/2) | 266 | sampleView = View (Vec3 0.0 0.0 0.0) 0.01 (mkNormal (Vec3 0.0 (-0.0) 0.5))
(mkNormal (Vec3 0.0 1.0 0.0)) (11.0/9.0 * pi/2) | 140 | sampleView = View (Vec3 0.0 0.0 0.0) 0.01 (mkNormal (Vec3 0.0 (-0.0) 0.5))
(mkNormal (Vec3 0.0 1.0 0.0)) (11.0/9.0 * pi/2) | 140 | true | false | 0 | 11 | 63 | 81 | 42 | 39 | null | null |
pparkkin/eta | compiler/ETA/Utils/UnVarGraph.hs | bsd-3-clause | unionUnVarGraph :: UnVarGraph -> UnVarGraph -> UnVarGraph
{-
Premature optimisation, it seems.
unionUnVarGraph (UnVarGraph [CBPG s1 s2]) (UnVarGraph [CG s3, CG s4])
| s1 == s3 && s2 == s4
= pprTrace "unionUnVarGraph fired" empty $
completeGraph (s1 `unionUnVarSet` s2)
unionUnVarGraph (UnVarGraph [CBPG s1 ... | 626 | unionUnVarGraph :: UnVarGraph -> UnVarGraph -> UnVarGraph
unionUnVarGraph (UnVarGraph g1) (UnVarGraph g2)
= -- pprTrace "unionUnVarGraph" (ppr (length g1, length g2)) $
UnVarGraph (g1 `unionBags` g2) | 209 | unionUnVarGraph (UnVarGraph g1) (UnVarGraph g2)
= -- pprTrace "unionUnVarGraph" (ppr (length g1, length g2)) $
UnVarGraph (g1 `unionBags` g2) | 151 | true | true | 0 | 7 | 125 | 50 | 27 | 23 | null | null |
andorp/grin | grin/src/Grin/TypeEnv.hs | bsd-3-clause | simpleSubType (T_Location ls1) (T_Location ls2) =
(Set.fromList ls1) `Set.isSubsetOf` (Set.fromList ls2) | 106 | simpleSubType (T_Location ls1) (T_Location ls2) =
(Set.fromList ls1) `Set.isSubsetOf` (Set.fromList ls2) | 106 | simpleSubType (T_Location ls1) (T_Location ls2) =
(Set.fromList ls1) `Set.isSubsetOf` (Set.fromList ls2) | 106 | false | false | 1 | 9 | 12 | 55 | 25 | 30 | null | null |
zymbolic-creations/learningHaskell | ringOfDeath/RingOfDeath.hs | gpl-3.0 | findSoleSurvivor _ n
| n < 1 = error "The number of people to skip must be positive!" | 89 | findSoleSurvivor _ n
| n < 1 = error "The number of people to skip must be positive!" | 89 | findSoleSurvivor _ n
| n < 1 = error "The number of people to skip must be positive!" | 89 | false | false | 0 | 8 | 21 | 24 | 10 | 14 | null | null |
CulpaBS/wbBach | src/Futhark/Representation/AST/Attributes/Aliases.hs | bsd-3-clause | expAliases (DoLoop ctxmerge valmerge _ loopbody) =
map (`HS.difference` merge_names) $ bodyAliases loopbody
where merge_names = HS.fromList $
map (paramName . fst) $ ctxmerge ++ valmerge | 212 | expAliases (DoLoop ctxmerge valmerge _ loopbody) =
map (`HS.difference` merge_names) $ bodyAliases loopbody
where merge_names = HS.fromList $
map (paramName . fst) $ ctxmerge ++ valmerge | 212 | expAliases (DoLoop ctxmerge valmerge _ loopbody) =
map (`HS.difference` merge_names) $ bodyAliases loopbody
where merge_names = HS.fromList $
map (paramName . fst) $ ctxmerge ++ valmerge | 212 | false | false | 0 | 10 | 51 | 71 | 36 | 35 | null | null |
jsavatgy/hatupist | code/resultColorTheme.hs | gpl-2.0 | paintText x y text = do
fntDscr <- liftIO (fontDescriptionFromString "Sans 8")
layout <- createLayout (text)
liftIO (layoutSetFontDescription layout (Just fntDscr))
moveTo x y
setSourceRGB 0 0 0
showLayout layout | 224 | paintText x y text = do
fntDscr <- liftIO (fontDescriptionFromString "Sans 8")
layout <- createLayout (text)
liftIO (layoutSetFontDescription layout (Just fntDscr))
moveTo x y
setSourceRGB 0 0 0
showLayout layout | 224 | paintText x y text = do
fntDscr <- liftIO (fontDescriptionFromString "Sans 8")
layout <- createLayout (text)
liftIO (layoutSetFontDescription layout (Just fntDscr))
moveTo x y
setSourceRGB 0 0 0
showLayout layout | 224 | false | false | 0 | 11 | 41 | 86 | 37 | 49 | null | null |
eliben/code-for-blog | 2017/haskell-parsers/exprparser.hs | unlicense | sumexpr :: Parser Int
sumexpr = do t <- term
do symbol "+"
se <- sumexpr
return (t + se)
<|> return t | 160 | sumexpr :: Parser Int
sumexpr = do t <- term
do symbol "+"
se <- sumexpr
return (t + se)
<|> return t | 160 | sumexpr = do t <- term
do symbol "+"
se <- sumexpr
return (t + se)
<|> return t | 138 | false | true | 0 | 12 | 81 | 57 | 25 | 32 | null | null |
GRACeFUL-project/GRACe | examples/SmallExample.hs | bsd-3-clause | example :: GCM ()
example = do
let budget = 10000
-- Instantiate components
r <- rain 20
pmp <- pump 2
(inf, out, ovf, cap) <- storage 4
(floodFlow, isFlooded) <- floodingOfSquare
-- Create an action
(pumpAction, pumpCost) <- incre... | 1,127 | example :: GCM ()
example = do
let budget = 10000
-- Instantiate components
r <- rain 20
pmp <- pump 2
(inf, out, ovf, cap) <- storage 4
(floodFlow, isFlooded) <- floodingOfSquare
-- Create an action
(pumpAction, pumpCost) <- incre... | 1,127 | example = do
let budget = 10000
-- Instantiate components
r <- rain 20
pmp <- pump 2
(inf, out, ovf, cap) <- storage 4
(floodFlow, isFlooded) <- floodingOfSquare
-- Create an action
(pumpAction, pumpCost) <- increaseCap (capacity p... | 1,109 | false | true | 9 | 10 | 364 | 333 | 150 | 183 | null | null |
rleshchinskiy/vector | Data/Vector/Generic/Mutable.hs | bsd-3-clause | vmunstreamMax s n
= do
v <- INTERNAL_CHECK(checkLength) "munstreamMax" n
$ unsafeNew n
let {-# INLINE_INNER copy #-}
copy i (Chunk n f) =
INTERNAL_CHECK(checkSlice) "munstreamMax.copy" i n (length v) $ do
f (basicUnsafeSlice i n v)
return (i+n)
... | 471 | vmunstreamMax s n
= do
v <- INTERNAL_CHECK(checkLength) "munstreamMax" n
$ unsafeNew n
let {-# INLINE_INNER copy #-}
copy i (Chunk n f) =
INTERNAL_CHECK(checkSlice) "munstreamMax.copy" i n (length v) $ do
f (basicUnsafeSlice i n v)
return (i+n)
... | 471 | vmunstreamMax s n
= do
v <- INTERNAL_CHECK(checkLength) "munstreamMax" n
$ unsafeNew n
let {-# INLINE_INNER copy #-}
copy i (Chunk n f) =
INTERNAL_CHECK(checkSlice) "munstreamMax.copy" i n (length v) $ do
f (basicUnsafeSlice i n v)
return (i+n)
... | 471 | false | false | 1 | 16 | 158 | 172 | 78 | 94 | null | null |
saep/neil | src/Text/Latex/TexSoup.hs | bsd-3-clause | universeCommands (x:rest) = case x of
Curly xs -> fs xs
Square xs -> fs xs
MathExpr xs -> fs xs
CodeExpr xs -> fs xs
Environ s xs -> fs xs
x -> fs []
where
fs xs = universeCommands xs ++ universeCommands rest | 244 | universeCommands (x:rest) = case x of
Curly xs -> fs xs
Square xs -> fs xs
MathExpr xs -> fs xs
CodeExpr xs -> fs xs
Environ s xs -> fs xs
x -> fs []
where
fs xs = universeCommands xs ++ universeCommands rest | 244 | universeCommands (x:rest) = case x of
Curly xs -> fs xs
Square xs -> fs xs
MathExpr xs -> fs xs
CodeExpr xs -> fs xs
Environ s xs -> fs xs
x -> fs []
where
fs xs = universeCommands xs ++ universeCommands rest | 244 | false | false | 1 | 9 | 80 | 118 | 50 | 68 | null | null |
kawu/dawg | src/Data/DAWG/HashMap.hs | bsd-2-clause | fromJust :: Maybe a -> a
fromJust (Just x) = x | 48 | fromJust :: Maybe a -> a
fromJust (Just x) = x | 48 | fromJust (Just x) = x | 23 | false | true | 0 | 6 | 12 | 31 | 14 | 17 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | "li" `closes` "li" = True | 25 | "li" `closes` "li" = True | 25 | "li" `closes` "li" = True | 25 | false | false | 0 | 5 | 4 | 14 | 7 | 7 | null | null |
meiersi/blaze-builder | Blaze/ByteString/Builder/Internal.hs | bsd-3-clause | toByteStringIO :: (S.ByteString -> IO ()) -> Builder -> IO ()
toByteStringIO = toByteStringIOWith defaultBufferSize | 115 | toByteStringIO :: (S.ByteString -> IO ()) -> Builder -> IO ()
toByteStringIO = toByteStringIOWith defaultBufferSize | 115 | toByteStringIO = toByteStringIOWith defaultBufferSize | 53 | false | true | 0 | 9 | 14 | 41 | 20 | 21 | null | null |
FPBrno/dht-dks | src/Data/DHT/DKS/Internal.hs | bsd-3-clause | dksLookup :: OnResult Encoding -> DksHandle -> DhtKey -> IO ()
dksLookup callback handle = _sendOp handle . LookupOp callback | 125 | dksLookup :: OnResult Encoding -> DksHandle -> DhtKey -> IO ()
dksLookup callback handle = _sendOp handle . LookupOp callback | 125 | dksLookup callback handle = _sendOp handle . LookupOp callback | 62 | false | true | 0 | 9 | 19 | 46 | 21 | 25 | null | null |
keithodulaigh/Hets | CspCASLProver/Consts.hs | gpl-2.0 | -- | Type for CspCASLProver's PreAlphabet
preAlphabetType :: Typ
preAlphabetType = Type {typeId = preAlphabetS,
typeSort = [],
typeArgs = []} | 189 | preAlphabetType :: Typ
preAlphabetType = Type {typeId = preAlphabetS,
typeSort = [],
typeArgs = []} | 147 | preAlphabetType = Type {typeId = preAlphabetS,
typeSort = [],
typeArgs = []} | 124 | true | true | 0 | 7 | 68 | 36 | 22 | 14 | null | null |
vdweegen/UvA-Software_Testing | Lab6/Jordan/Lecture6.hs | gpl-3.0 | encode :: Integer -> Integer -> Integer -> Integer
encode p k m = let
p' = p-1
e = head [ x | x <- [k..], gcd x p' == 1 ]
in
exM m e p | 145 | encode :: Integer -> Integer -> Integer -> Integer
encode p k m = let
p' = p-1
e = head [ x | x <- [k..], gcd x p' == 1 ]
in
exM m e p | 145 | encode p k m = let
p' = p-1
e = head [ x | x <- [k..], gcd x p' == 1 ]
in
exM m e p | 94 | false | true | 0 | 13 | 48 | 87 | 43 | 44 | null | null |
CloudI/CloudI | src/api/haskell/external/binary-0.8.7.0/src/Data/Binary/Builder.hs | mit | -- | Write a Int64 in big endian format
putInt64be :: Int64 -> Builder
putInt64be = B.int64BE | 93 | putInt64be :: Int64 -> Builder
putInt64be = B.int64BE | 53 | putInt64be = B.int64BE | 22 | true | true | 0 | 7 | 16 | 25 | 11 | 14 | null | null |
alexander-at-github/eta | compiler/ETA/Types/TyCon.hs | bsd-3-clause | isFamilyTyCon _ = False | 64 | isFamilyTyCon _ = False | 64 | isFamilyTyCon _ = False | 64 | false | false | 0 | 5 | 44 | 9 | 4 | 5 | null | null |
sukwon0709/z3-haskell | src/Z3/Monad.hs | bsd-3-clause | -- | Create a predicate that checks that the bit-wise signed multiplication of
-- /t1/ and /t2/ does not underflow.
--
-- Reference: <http://research.microsoft.com/en-us/um/redmond/projects/z3/group__capi.html#ga501ccc01d737aad3ede5699741717fda>
mkBvmulNoUnderflow :: MonadZ3 z3 => AST -> AST -> z3 AST
mkBvmulNoUnderflo... | 356 | mkBvmulNoUnderflow :: MonadZ3 z3 => AST -> AST -> z3 AST
mkBvmulNoUnderflow = liftFun2 Base.mkBvmulNoUnderflow | 110 | mkBvmulNoUnderflow = liftFun2 Base.mkBvmulNoUnderflow | 53 | true | true | 0 | 8 | 38 | 38 | 20 | 18 | null | null |
intolerable/league-of-legends | src/League/Types/Region.hs | bsd-3-clause | shortRegion KR = "kr" | 21 | shortRegion KR = "kr" | 21 | shortRegion KR = "kr" | 21 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
gridaphobe/target | examples/XMonad/Properties.hs | mit | prop_greedyView_local (x :: T) (n :: NonNegative Int) = i `tagMember` x ==>
workspaces x == workspaces (greedyView i x)
where
workspaces a = sortBy (\s t -> tag s `compare` tag t) $
workspace (current a)
: map workspace (visible a) ++ hi... | 378 | prop_greedyView_local (x :: T) (n :: NonNegative Int) = i `tagMember` x ==>
workspaces x == workspaces (greedyView i x)
where
workspaces a = sortBy (\s t -> tag s `compare` tag t) $
workspace (current a)
: map workspace (visible a) ++ hi... | 378 | prop_greedyView_local (x :: T) (n :: NonNegative Int) = i `tagMember` x ==>
workspaces x == workspaces (greedyView i x)
where
workspaces a = sortBy (\s t -> tag s `compare` tag t) $
workspace (current a)
: map workspace (visible a) ++ hi... | 378 | false | false | 1 | 12 | 140 | 139 | 67 | 72 | null | null |
graydon/metrics | src/Data/Metrics/Snapshot.hs | mit | -- | Calculate the 99.9th percentile of a "Snapshot"
get999thPercentile :: Snapshot -> Double
get999thPercentile = quantile p999Q | 129 | get999thPercentile :: Snapshot -> Double
get999thPercentile = quantile p999Q | 76 | get999thPercentile = quantile p999Q | 35 | true | true | 0 | 5 | 17 | 19 | 10 | 9 | null | null |
samcal/rasa | rasa-ext-vim/src/Rasa/Ext/Vim.hs | gpl-3.0 | normal [Keypress '-' []] = runApp prevBuf | 41 | normal [Keypress '-' []] = runApp prevBuf | 41 | normal [Keypress '-' []] = runApp prevBuf | 41 | false | false | 0 | 8 | 6 | 22 | 10 | 12 | null | null |
three/codeworld | codeworld-prediction/src/CodeWorld/Prediction/Trivial.hs | apache-2.0 | stepTo :: StepFun s -> Timestamp -> TState s -> TState s
stepTo step target (now, s)
= (target, step (target - now) s) | 122 | stepTo :: StepFun s -> Timestamp -> TState s -> TState s
stepTo step target (now, s)
= (target, step (target - now) s) | 122 | stepTo step target (now, s)
= (target, step (target - now) s) | 65 | false | true | 0 | 8 | 27 | 63 | 32 | 31 | null | null |
emilaxelsson/ag-graph | examples/LeavesBelow.hs | bsd-3-clause | iLeaf i = In (Leaf i) | 21 | iLeaf i = In (Leaf i) | 21 | iLeaf i = In (Leaf i) | 21 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
brandur/redis-haskell | src/Database/Redis/Command.hs | bsd-3-clause | sdiffstore :: (MonadIO m, MonadFailure RedisError m)
=> Server -> RedisKey -> [RedisKey] -> m RedisValue
sdiffstore r dest ks = command r $ multiBulk r "SDIFFSTORE" ([dest] ++ ks) | 191 | sdiffstore :: (MonadIO m, MonadFailure RedisError m)
=> Server -> RedisKey -> [RedisKey] -> m RedisValue
sdiffstore r dest ks = command r $ multiBulk r "SDIFFSTORE" ([dest] ++ ks) | 191 | sdiffstore r dest ks = command r $ multiBulk r "SDIFFSTORE" ([dest] ++ ks) | 74 | false | true | 0 | 9 | 41 | 77 | 39 | 38 | null | null |
notcome/ImplFP | src/Language/Core/Parser.hs | mit | braces p = P.char '{' *> p <* P.char '}' | 40 | braces p = P.char '{' *> p <* P.char '}' | 40 | braces p = P.char '{' *> p <* P.char '}' | 40 | false | false | 0 | 8 | 9 | 27 | 12 | 15 | null | null |
lgeorget/ogma | server/src/Ogma/Server.hs | mit | ogmaIdentityHandler :: ConnectionPool
-> IdentityId
-> Handler (Entity User)
ogmaIdentityHandler pool id = do
userMaybe <- liftIO $ runSqlPool (getUserByIdentity id) pool
case userMaybe of Just val -> return val
Nothing -> throwError (err500 { errB... | 343 | ogmaIdentityHandler :: ConnectionPool
-> IdentityId
-> Handler (Entity User)
ogmaIdentityHandler pool id = do
userMaybe <- liftIO $ runSqlPool (getUserByIdentity id) pool
case userMaybe of Just val -> return val
Nothing -> throwError (err500 { errB... | 343 | ogmaIdentityHandler pool id = do
userMaybe <- liftIO $ runSqlPool (getUserByIdentity id) pool
case userMaybe of Just val -> return val
Nothing -> throwError (err500 { errBody = "Orphan token" }) | 226 | false | true | 0 | 13 | 111 | 94 | 45 | 49 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.