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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Fuuzetsu/hcore | src/Core/Parser.hs | bsd-3-clause | lexCore (c:cs)
| isWhiteSpace c = lexCore cs
| digit c = let numTok = c : takeWhile digit cs
rest = dropWhile digit cs
in numTok : lexCore rest
| letter c = let varTok = c : takeWhile isIdChar cs
rest = dropWhile isIdChar cs
in varTok : lexCore rest | 321 | lexCore (c:cs)
| isWhiteSpace c = lexCore cs
| digit c = let numTok = c : takeWhile digit cs
rest = dropWhile digit cs
in numTok : lexCore rest
| letter c = let varTok = c : takeWhile isIdChar cs
rest = dropWhile isIdChar cs
in varTok : lexCore rest | 321 | lexCore (c:cs)
| isWhiteSpace c = lexCore cs
| digit c = let numTok = c : takeWhile digit cs
rest = dropWhile digit cs
in numTok : lexCore rest
| letter c = let varTok = c : takeWhile isIdChar cs
rest = dropWhile isIdChar cs
in varTok : lexCore rest | 321 | false | false | 2 | 10 | 123 | 122 | 56 | 66 | null | null |
bitemyapp/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | hvMigrationCompleted :: String
hvMigrationCompleted = "completed" | 65 | hvMigrationCompleted :: String
hvMigrationCompleted = "completed" | 65 | hvMigrationCompleted = "completed" | 34 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
unknownloner/calccomp | Asm/InstrSize.hs | mit | instrSize LDI _ = 2 | 20 | instrSize LDI _ = 2 | 20 | instrSize LDI _ = 2 | 20 | false | false | 0 | 4 | 5 | 13 | 5 | 8 | null | null |
nilnullzip/lambda-untyped | src/Parse.hs | mit | parseTerm ('L':x:'.':e) | (isLower x) =
let (exp, r) = parseApply Empty e in (Lambda x exp, r) | 98 | parseTerm ('L':x:'.':e) | (isLower x) =
let (exp, r) = parseApply Empty e in (Lambda x exp, r) | 98 | parseTerm ('L':x:'.':e) | (isLower x) =
let (exp, r) = parseApply Empty e in (Lambda x exp, r) | 98 | false | false | 0 | 10 | 21 | 70 | 34 | 36 | null | null |
philipturnbull/quenelle | test/TestMatch.hs | gpl-2.0 | assertVars dbg rulestr exprstr expectedBindings matches =
TestCase $ assertEqual (dbg ++ "=>" ++ rulestr ++ " -> " ++ exprstr) (sort expectedBindings) (sort $ allMatchBindings matches) | 188 | assertVars dbg rulestr exprstr expectedBindings matches =
TestCase $ assertEqual (dbg ++ "=>" ++ rulestr ++ " -> " ++ exprstr) (sort expectedBindings) (sort $ allMatchBindings matches) | 188 | assertVars dbg rulestr exprstr expectedBindings matches =
TestCase $ assertEqual (dbg ++ "=>" ++ rulestr ++ " -> " ++ exprstr) (sort expectedBindings) (sort $ allMatchBindings matches) | 188 | false | false | 2 | 10 | 30 | 67 | 31 | 36 | null | null |
rueshyna/gogol | gogol-dataproc/gen/Network/Google/Dataproc/Types/Product.hs | mpl-2.0 | jlAddtional :: Lens' JobLabels (HashMap Text Text)
jlAddtional
= lens _jlAddtional (\ s a -> s{_jlAddtional = a}) .
_Coerce | 131 | jlAddtional :: Lens' JobLabels (HashMap Text Text)
jlAddtional
= lens _jlAddtional (\ s a -> s{_jlAddtional = a}) .
_Coerce | 131 | jlAddtional
= lens _jlAddtional (\ s a -> s{_jlAddtional = a}) .
_Coerce | 80 | false | true | 0 | 10 | 27 | 53 | 27 | 26 | null | null |
rahulmutt/ghcvm | compiler/Eta/SimplCore/CSE.hs | bsd-3-clause | cseBind env (Rec pairs)
= (env2, Rec pairs')
where
(bs,es) = unzip pairs
(env1, bs') = addRecBinders env bs
(env2, pairs') = mapAccumL cseRhs env1 (bs' `zip` es) | 177 | cseBind env (Rec pairs)
= (env2, Rec pairs')
where
(bs,es) = unzip pairs
(env1, bs') = addRecBinders env bs
(env2, pairs') = mapAccumL cseRhs env1 (bs' `zip` es) | 177 | cseBind env (Rec pairs)
= (env2, Rec pairs')
where
(bs,es) = unzip pairs
(env1, bs') = addRecBinders env bs
(env2, pairs') = mapAccumL cseRhs env1 (bs' `zip` es) | 177 | false | false | 0 | 7 | 43 | 89 | 47 | 42 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | unfocusedly = id | 16 | unfocusedly = id | 16 | unfocusedly = id | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
TomMD/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprStmtContext ListComp = ptext (sLit "list comprehension") | 66 | pprStmtContext ListComp = ptext (sLit "list comprehension") | 66 | pprStmtContext ListComp = ptext (sLit "list comprehension") | 66 | false | false | 1 | 7 | 13 | 21 | 8 | 13 | null | null |
RobinKrom/interactive-brokers | library/API/IB/Parse.hs | bsd-3-clause | parseDoubleField :: Parser Double
parseDoubleField = parseField double | 70 | parseDoubleField :: Parser Double
parseDoubleField = parseField double | 70 | parseDoubleField = parseField double | 36 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
apyrgio/ganeti | src/Ganeti/Utils/Monad.hs | bsd-2-clause | -- |See 'Data.List.unfoldr'. This is a monad-friendly version of that.
unfoldrM :: (Monad m) => (a -> m (Maybe (b,a))) -> a -> m [b]
unfoldrM = unfoldrM' | 154 | unfoldrM :: (Monad m) => (a -> m (Maybe (b,a))) -> a -> m [b]
unfoldrM = unfoldrM' | 82 | unfoldrM = unfoldrM' | 20 | true | true | 0 | 12 | 28 | 57 | 31 | 26 | null | null |
lspitzner/brittany | source/library/Language/Haskell/Brittany/Internal/Utils.hs | agpl-3.0 | annsDoc :: ExactPrint.Types.Anns -> PP.Doc
annsDoc =
printTreeWithCustom 100 customLayouterNoAnnsF . fmap (ShowIsId . show) | 125 | annsDoc :: ExactPrint.Types.Anns -> PP.Doc
annsDoc =
printTreeWithCustom 100 customLayouterNoAnnsF . fmap (ShowIsId . show) | 125 | annsDoc =
printTreeWithCustom 100 customLayouterNoAnnsF . fmap (ShowIsId . show) | 82 | false | true | 0 | 8 | 16 | 46 | 21 | 25 | null | null |
valderman/selda | selda/src/Database/Selda/Unsafe.hs | mit | -- | Create a column referring to a name of your choice.
-- Use this to refer to variables not exposed by Selda.
rawName :: SqlType a => ColName -> Col s a
rawName = One . Col | 177 | rawName :: SqlType a => ColName -> Col s a
rawName = One . Col | 62 | rawName = One . Col | 19 | true | true | 0 | 7 | 39 | 33 | 17 | 16 | null | null |
narurien/ganeti-ceph | src/Ganeti/HTools/Cluster.hs | gpl-2.0 | -- | Given a list of commands, prefix them with @gnt-instance@ and
-- also beautify the display a little.
formatCmds :: [JobSet] -> String
formatCmds =
unlines .
concatMap (\(jsn, js) -> concatMap (formatJob jsn (length js))
(zip [1..] js)) .
zip [1..] | 285 | formatCmds :: [JobSet] -> String
formatCmds =
unlines .
concatMap (\(jsn, js) -> concatMap (formatJob jsn (length js))
(zip [1..] js)) .
zip [1..] | 179 | formatCmds =
unlines .
concatMap (\(jsn, js) -> concatMap (formatJob jsn (length js))
(zip [1..] js)) .
zip [1..] | 146 | true | true | 2 | 11 | 75 | 90 | 45 | 45 | null | null |
mzini/termlib | Termlib/ContextSensitive.hs | gpl-3.0 | empty :: ReplacementMap
empty = Map.empty | 41 | empty :: ReplacementMap
empty = Map.empty | 41 | empty = Map.empty | 17 | false | true | 0 | 6 | 5 | 20 | 8 | 12 | null | null |
haasn/haskell-vte | Gtk2HsSetup.hs | lgpl-2.1 | getPkgConfigPackages :: Verbosity -> LocalBuildInfo -> PackageDescription -> IO [PackageId]
getPkgConfigPackages verbosity lbi pkg =
sequence
[ do version <- pkgconfig ["--modversion", display pkgname]
case simpleParse version of
Nothing -> die "parsing output of pkg-config --modversion failed"
Just v -> return (PackageIdentifier pkgname v)
| Dependency pkgname _ <- concatMap pkgconfigDepends (allBuildInfo pkg) ]
where
pkgconfig = rawSystemProgramStdoutConf verbosity
pkgConfigProgram (withPrograms lbi)
------------------------------------------------------------------------------
-- Dependency calculation amongst .chs files.
------------------------------------------------------------------------------
-- Given all files of the package, find those that end in .chs and extract the
-- .chs files they depend upon. Then return the PackageDescription with these
-- files rearranged so that they are built in a sequence that files that are
-- needed by other files are built first. | 1,055 | getPkgConfigPackages :: Verbosity -> LocalBuildInfo -> PackageDescription -> IO [PackageId]
getPkgConfigPackages verbosity lbi pkg =
sequence
[ do version <- pkgconfig ["--modversion", display pkgname]
case simpleParse version of
Nothing -> die "parsing output of pkg-config --modversion failed"
Just v -> return (PackageIdentifier pkgname v)
| Dependency pkgname _ <- concatMap pkgconfigDepends (allBuildInfo pkg) ]
where
pkgconfig = rawSystemProgramStdoutConf verbosity
pkgConfigProgram (withPrograms lbi)
------------------------------------------------------------------------------
-- Dependency calculation amongst .chs files.
------------------------------------------------------------------------------
-- Given all files of the package, find those that end in .chs and extract the
-- .chs files they depend upon. Then return the PackageDescription with these
-- files rearranged so that they are built in a sequence that files that are
-- needed by other files are built first. | 1,055 | getPkgConfigPackages verbosity lbi pkg =
sequence
[ do version <- pkgconfig ["--modversion", display pkgname]
case simpleParse version of
Nothing -> die "parsing output of pkg-config --modversion failed"
Just v -> return (PackageIdentifier pkgname v)
| Dependency pkgname _ <- concatMap pkgconfigDepends (allBuildInfo pkg) ]
where
pkgconfig = rawSystemProgramStdoutConf verbosity
pkgConfigProgram (withPrograms lbi)
------------------------------------------------------------------------------
-- Dependency calculation amongst .chs files.
------------------------------------------------------------------------------
-- Given all files of the package, find those that end in .chs and extract the
-- .chs files they depend upon. Then return the PackageDescription with these
-- files rearranged so that they are built in a sequence that files that are
-- needed by other files are built first. | 963 | false | true | 0 | 14 | 188 | 152 | 75 | 77 | null | null |
lukexi/ghc-7.8-arm64 | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | bsd-3-clause | -- | Error functions
panic :: String -> a
panic s = Outputable.panic $ "LlvmCodeGen.CodeGen." ++ s | 98 | panic :: String -> a
panic s = Outputable.panic $ "LlvmCodeGen.CodeGen." ++ s | 77 | panic s = Outputable.panic $ "LlvmCodeGen.CodeGen." ++ s | 56 | true | true | 0 | 7 | 16 | 35 | 16 | 19 | null | null |
Garygunn94/DFS | ClientProxy/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/autogen/Paths_ClientProxy.hs | bsd-3-clause | getSysconfDir = catchIO (getEnv "ClientProxy_sysconfdir") (\_ -> return sysconfdir) | 83 | getSysconfDir = catchIO (getEnv "ClientProxy_sysconfdir") (\_ -> return sysconfdir) | 83 | getSysconfDir = catchIO (getEnv "ClientProxy_sysconfdir") (\_ -> return sysconfdir) | 83 | false | false | 0 | 8 | 8 | 28 | 14 | 14 | null | null |
nomeata/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | genCCall _ (CmmPrim MO_Memset _) _
[CmmHinted dst _,
CmmHinted (CmmLit (CmmInt c _)) _,
CmmHinted (CmmLit (CmmInt n _)) _,
CmmHinted (CmmLit (CmmInt align _)) _]
| n <= maxInlineSizeThreshold && align .&. 3 == 0 = do
code_dst <- getAnyReg dst
dst_r <- getNewRegNat size
return $ code_dst dst_r `appOL` go dst_r n
where
(size, val) = case align .&. 3 of
2 -> (II16, c2)
0 -> (II32, c4)
_ -> (II8, c)
c2 = c `shiftL` 8 .|. c
c4 = c2 `shiftL` 16 .|. c2
sizeBytes = fromIntegral (sizeInBytes size)
go :: Reg -> Integer -> OrdList Instr
go dst i
-- TODO: Add movabs instruction and support 64-bit sets.
| i >= sizeBytes = -- This might be smaller than the below sizes
unitOL (MOV size (OpImm (ImmInteger val)) (OpAddr dst_addr)) `appOL`
go dst (i - sizeBytes)
| i >= 4 = -- Will never happen on 32-bit
unitOL (MOV II32 (OpImm (ImmInteger c4)) (OpAddr dst_addr)) `appOL`
go dst (i - 4)
| i >= 2 =
unitOL (MOV II16 (OpImm (ImmInteger c2)) (OpAddr dst_addr)) `appOL`
go dst (i - 2)
| i >= 1 =
unitOL (MOV II8 (OpImm (ImmInteger c)) (OpAddr dst_addr)) `appOL`
go dst (i - 1)
| otherwise = nilOL
where
dst_addr = AddrBaseIndex (EABaseReg dst) EAIndexNone
(ImmInteger (n - i)) | 1,463 | genCCall _ (CmmPrim MO_Memset _) _
[CmmHinted dst _,
CmmHinted (CmmLit (CmmInt c _)) _,
CmmHinted (CmmLit (CmmInt n _)) _,
CmmHinted (CmmLit (CmmInt align _)) _]
| n <= maxInlineSizeThreshold && align .&. 3 == 0 = do
code_dst <- getAnyReg dst
dst_r <- getNewRegNat size
return $ code_dst dst_r `appOL` go dst_r n
where
(size, val) = case align .&. 3 of
2 -> (II16, c2)
0 -> (II32, c4)
_ -> (II8, c)
c2 = c `shiftL` 8 .|. c
c4 = c2 `shiftL` 16 .|. c2
sizeBytes = fromIntegral (sizeInBytes size)
go :: Reg -> Integer -> OrdList Instr
go dst i
-- TODO: Add movabs instruction and support 64-bit sets.
| i >= sizeBytes = -- This might be smaller than the below sizes
unitOL (MOV size (OpImm (ImmInteger val)) (OpAddr dst_addr)) `appOL`
go dst (i - sizeBytes)
| i >= 4 = -- Will never happen on 32-bit
unitOL (MOV II32 (OpImm (ImmInteger c4)) (OpAddr dst_addr)) `appOL`
go dst (i - 4)
| i >= 2 =
unitOL (MOV II16 (OpImm (ImmInteger c2)) (OpAddr dst_addr)) `appOL`
go dst (i - 2)
| i >= 1 =
unitOL (MOV II8 (OpImm (ImmInteger c)) (OpAddr dst_addr)) `appOL`
go dst (i - 1)
| otherwise = nilOL
where
dst_addr = AddrBaseIndex (EABaseReg dst) EAIndexNone
(ImmInteger (n - i)) | 1,463 | genCCall _ (CmmPrim MO_Memset _) _
[CmmHinted dst _,
CmmHinted (CmmLit (CmmInt c _)) _,
CmmHinted (CmmLit (CmmInt n _)) _,
CmmHinted (CmmLit (CmmInt align _)) _]
| n <= maxInlineSizeThreshold && align .&. 3 == 0 = do
code_dst <- getAnyReg dst
dst_r <- getNewRegNat size
return $ code_dst dst_r `appOL` go dst_r n
where
(size, val) = case align .&. 3 of
2 -> (II16, c2)
0 -> (II32, c4)
_ -> (II8, c)
c2 = c `shiftL` 8 .|. c
c4 = c2 `shiftL` 16 .|. c2
sizeBytes = fromIntegral (sizeInBytes size)
go :: Reg -> Integer -> OrdList Instr
go dst i
-- TODO: Add movabs instruction and support 64-bit sets.
| i >= sizeBytes = -- This might be smaller than the below sizes
unitOL (MOV size (OpImm (ImmInteger val)) (OpAddr dst_addr)) `appOL`
go dst (i - sizeBytes)
| i >= 4 = -- Will never happen on 32-bit
unitOL (MOV II32 (OpImm (ImmInteger c4)) (OpAddr dst_addr)) `appOL`
go dst (i - 4)
| i >= 2 =
unitOL (MOV II16 (OpImm (ImmInteger c2)) (OpAddr dst_addr)) `appOL`
go dst (i - 2)
| i >= 1 =
unitOL (MOV II8 (OpImm (ImmInteger c)) (OpAddr dst_addr)) `appOL`
go dst (i - 1)
| otherwise = nilOL
where
dst_addr = AddrBaseIndex (EABaseReg dst) EAIndexNone
(ImmInteger (n - i)) | 1,463 | false | false | 19 | 19 | 518 | 606 | 310 | 296 | null | null |
mattias-lundell/timber-llvm | src/Syntax2Core.hs | bsd-3-clause | s2cE env (EReq (Just x) (Stmts[SExp e]))= do (_,e) <- s2cEi env e
return (Core.EReq (Core.EVar x) e) | 145 | s2cE env (EReq (Just x) (Stmts[SExp e]))= do (_,e) <- s2cEi env e
return (Core.EReq (Core.EVar x) e) | 145 | s2cE env (EReq (Just x) (Stmts[SExp e]))= do (_,e) <- s2cEi env e
return (Core.EReq (Core.EVar x) e) | 145 | false | false | 0 | 12 | 62 | 79 | 38 | 41 | null | null |
anton-k/sharc-timbre | src/Sharc/Instruments/TrumpetMutedC.hs | bsd-3-clause | note0 :: Note
note0 = Note
(Pitch 184.997 42 "f#3")
1
(Range
(NoteRange
(NoteRangeAmplitude 4439.92 24 3.71)
(NoteRangeHarmonicFreq 1 184.99))
(NoteRange
(NoteRangeAmplitude 184.99 1 957.0)
(NoteRangeHarmonicFreq 53 9804.84)))
[Harmonic 1 1.8 957.0
,Harmonic 2 (-1.535) 251.84
,Harmonic 3 1.844 109.39
,Harmonic 4 (-0.652) 76.03
,Harmonic 5 2.749 59.2
,Harmonic 6 (-0.429) 26.26
,Harmonic 7 (-2.127) 11.98
,Harmonic 8 2.033 24.5
,Harmonic 9 (-9.1e-2) 50.7
,Harmonic 10 1.693 81.82
,Harmonic 11 (-1.296) 40.77
,Harmonic 12 0.984 54.52
,Harmonic 13 (-2.752) 4.98
,Harmonic 14 (-1.636) 23.75
,Harmonic 15 1.182 31.27
,Harmonic 16 (-2.06) 68.32
,Harmonic 17 0.501 78.04
,Harmonic 18 (-2.939) 81.61
,Harmonic 19 1.6e-2 65.69
,Harmonic 20 (-3.074) 54.92
,Harmonic 21 0.177 43.22
,Harmonic 22 (-3.023) 25.46
,Harmonic 23 0.636 12.62
,Harmonic 24 0.484 3.71
,Harmonic 25 (-2.96) 23.33
,Harmonic 26 0.239 119.16
,Harmonic 27 2.961 112.84
,Harmonic 28 (-1.535) 305.58
,Harmonic 29 0.972 61.86
,Harmonic 30 (-2.545) 12.23
,Harmonic 31 (-2.449) 19.96
,Harmonic 32 (-2.6e-2) 60.02
,Harmonic 33 (-2.396) 88.98
,Harmonic 34 0.413 151.76
,Harmonic 35 (-2.907) 180.26
,Harmonic 36 (-0.65) 204.16
,Harmonic 37 1.324 6.33
,Harmonic 38 0.343 122.62
,Harmonic 39 (-3.009) 65.07
,Harmonic 40 (-0.241) 137.75
,Harmonic 41 3.088 99.69
,Harmonic 42 (-0.444) 87.68
,Harmonic 43 2.883 65.46
,Harmonic 44 (-9.7e-2) 50.49
,Harmonic 45 3.024 54.69
,Harmonic 46 (-0.644) 49.46
,Harmonic 47 2.594 28.42
,Harmonic 48 (-0.891) 24.35
,Harmonic 49 0.977 21.82
,Harmonic 50 (-2.016) 61.42
,Harmonic 51 (-0.461) 24.74
,Harmonic 52 (-2.662) 20.34
,Harmonic 53 (-5.0e-3) 26.04] | 1,925 | note0 :: Note
note0 = Note
(Pitch 184.997 42 "f#3")
1
(Range
(NoteRange
(NoteRangeAmplitude 4439.92 24 3.71)
(NoteRangeHarmonicFreq 1 184.99))
(NoteRange
(NoteRangeAmplitude 184.99 1 957.0)
(NoteRangeHarmonicFreq 53 9804.84)))
[Harmonic 1 1.8 957.0
,Harmonic 2 (-1.535) 251.84
,Harmonic 3 1.844 109.39
,Harmonic 4 (-0.652) 76.03
,Harmonic 5 2.749 59.2
,Harmonic 6 (-0.429) 26.26
,Harmonic 7 (-2.127) 11.98
,Harmonic 8 2.033 24.5
,Harmonic 9 (-9.1e-2) 50.7
,Harmonic 10 1.693 81.82
,Harmonic 11 (-1.296) 40.77
,Harmonic 12 0.984 54.52
,Harmonic 13 (-2.752) 4.98
,Harmonic 14 (-1.636) 23.75
,Harmonic 15 1.182 31.27
,Harmonic 16 (-2.06) 68.32
,Harmonic 17 0.501 78.04
,Harmonic 18 (-2.939) 81.61
,Harmonic 19 1.6e-2 65.69
,Harmonic 20 (-3.074) 54.92
,Harmonic 21 0.177 43.22
,Harmonic 22 (-3.023) 25.46
,Harmonic 23 0.636 12.62
,Harmonic 24 0.484 3.71
,Harmonic 25 (-2.96) 23.33
,Harmonic 26 0.239 119.16
,Harmonic 27 2.961 112.84
,Harmonic 28 (-1.535) 305.58
,Harmonic 29 0.972 61.86
,Harmonic 30 (-2.545) 12.23
,Harmonic 31 (-2.449) 19.96
,Harmonic 32 (-2.6e-2) 60.02
,Harmonic 33 (-2.396) 88.98
,Harmonic 34 0.413 151.76
,Harmonic 35 (-2.907) 180.26
,Harmonic 36 (-0.65) 204.16
,Harmonic 37 1.324 6.33
,Harmonic 38 0.343 122.62
,Harmonic 39 (-3.009) 65.07
,Harmonic 40 (-0.241) 137.75
,Harmonic 41 3.088 99.69
,Harmonic 42 (-0.444) 87.68
,Harmonic 43 2.883 65.46
,Harmonic 44 (-9.7e-2) 50.49
,Harmonic 45 3.024 54.69
,Harmonic 46 (-0.644) 49.46
,Harmonic 47 2.594 28.42
,Harmonic 48 (-0.891) 24.35
,Harmonic 49 0.977 21.82
,Harmonic 50 (-2.016) 61.42
,Harmonic 51 (-0.461) 24.74
,Harmonic 52 (-2.662) 20.34
,Harmonic 53 (-5.0e-3) 26.04] | 1,925 | note0 = Note
(Pitch 184.997 42 "f#3")
1
(Range
(NoteRange
(NoteRangeAmplitude 4439.92 24 3.71)
(NoteRangeHarmonicFreq 1 184.99))
(NoteRange
(NoteRangeAmplitude 184.99 1 957.0)
(NoteRangeHarmonicFreq 53 9804.84)))
[Harmonic 1 1.8 957.0
,Harmonic 2 (-1.535) 251.84
,Harmonic 3 1.844 109.39
,Harmonic 4 (-0.652) 76.03
,Harmonic 5 2.749 59.2
,Harmonic 6 (-0.429) 26.26
,Harmonic 7 (-2.127) 11.98
,Harmonic 8 2.033 24.5
,Harmonic 9 (-9.1e-2) 50.7
,Harmonic 10 1.693 81.82
,Harmonic 11 (-1.296) 40.77
,Harmonic 12 0.984 54.52
,Harmonic 13 (-2.752) 4.98
,Harmonic 14 (-1.636) 23.75
,Harmonic 15 1.182 31.27
,Harmonic 16 (-2.06) 68.32
,Harmonic 17 0.501 78.04
,Harmonic 18 (-2.939) 81.61
,Harmonic 19 1.6e-2 65.69
,Harmonic 20 (-3.074) 54.92
,Harmonic 21 0.177 43.22
,Harmonic 22 (-3.023) 25.46
,Harmonic 23 0.636 12.62
,Harmonic 24 0.484 3.71
,Harmonic 25 (-2.96) 23.33
,Harmonic 26 0.239 119.16
,Harmonic 27 2.961 112.84
,Harmonic 28 (-1.535) 305.58
,Harmonic 29 0.972 61.86
,Harmonic 30 (-2.545) 12.23
,Harmonic 31 (-2.449) 19.96
,Harmonic 32 (-2.6e-2) 60.02
,Harmonic 33 (-2.396) 88.98
,Harmonic 34 0.413 151.76
,Harmonic 35 (-2.907) 180.26
,Harmonic 36 (-0.65) 204.16
,Harmonic 37 1.324 6.33
,Harmonic 38 0.343 122.62
,Harmonic 39 (-3.009) 65.07
,Harmonic 40 (-0.241) 137.75
,Harmonic 41 3.088 99.69
,Harmonic 42 (-0.444) 87.68
,Harmonic 43 2.883 65.46
,Harmonic 44 (-9.7e-2) 50.49
,Harmonic 45 3.024 54.69
,Harmonic 46 (-0.644) 49.46
,Harmonic 47 2.594 28.42
,Harmonic 48 (-0.891) 24.35
,Harmonic 49 0.977 21.82
,Harmonic 50 (-2.016) 61.42
,Harmonic 51 (-0.461) 24.74
,Harmonic 52 (-2.662) 20.34
,Harmonic 53 (-5.0e-3) 26.04] | 1,911 | false | true | 0 | 10 | 527 | 779 | 401 | 378 | null | null |
dmjio/hadron | examples/WordCountAuto.hs | bsd-3-clause | mapper' = intoCSV def =$= C.concatMap f
where
f ln = concatMap (map (\w -> ([w], 1 :: Int)) . B.words) ln | 115 | mapper' = intoCSV def =$= C.concatMap f
where
f ln = concatMap (map (\w -> ([w], 1 :: Int)) . B.words) ln | 115 | mapper' = intoCSV def =$= C.concatMap f
where
f ln = concatMap (map (\w -> ([w], 1 :: Int)) . B.words) ln | 115 | false | false | 1 | 12 | 31 | 74 | 36 | 38 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpOutOfLine NewAlignedPinnedByteArrayOp_Char = True | 55 | primOpOutOfLine NewAlignedPinnedByteArrayOp_Char = True | 55 | primOpOutOfLine NewAlignedPinnedByteArrayOp_Char = True | 55 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
olsner/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | emitPrimOp _ res WriteOffAddrOp_Word64 args = doWriteOffAddrOp Nothing b64 res args | 98 | emitPrimOp _ res WriteOffAddrOp_Word64 args = doWriteOffAddrOp Nothing b64 res args | 98 | emitPrimOp _ res WriteOffAddrOp_Word64 args = doWriteOffAddrOp Nothing b64 res args | 98 | false | false | 1 | 5 | 25 | 28 | 11 | 17 | null | null |
chpatrick/language-glsl | Language/GLSL/Parser.hs | bsd-3-clause | structDeclaratorList :: P [StructDeclarator]
structDeclaratorList = structDeclarator `sepBy` comma | 98 | structDeclaratorList :: P [StructDeclarator]
structDeclaratorList = structDeclarator `sepBy` comma | 98 | structDeclaratorList = structDeclarator `sepBy` comma | 53 | false | true | 0 | 6 | 8 | 23 | 13 | 10 | null | null |
nikki-and-the-robots/nikki | src/Game/Scene.hs | lgpl-3.0 | touchesDeadlyHandler _ = Nothing | 32 | touchesDeadlyHandler _ = Nothing | 32 | touchesDeadlyHandler _ = Nothing | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
houshuang/frame | src/Data/Frame/HFrame.hs | mit | alignCols :: [(k, Block)] -> [(k, Block)]
alignCols xs = zip a (alignVecs b)
where (a, b) = unzip xs | 102 | alignCols :: [(k, Block)] -> [(k, Block)]
alignCols xs = zip a (alignVecs b)
where (a, b) = unzip xs | 102 | alignCols xs = zip a (alignVecs b)
where (a, b) = unzip xs | 60 | false | true | 0 | 7 | 21 | 64 | 35 | 29 | null | null |
nevrenato/HetsAlloy | OWL2/Parse.hs | gpl-2.0 | symbPairs :: GenParser Char st [(IRI, Maybe IRI)]
symbPairs = uriPair >>= \ u -> do
commaP `followedWith` uriP
us <- symbPairs
return $ u : us
<|> return [u] | 171 | symbPairs :: GenParser Char st [(IRI, Maybe IRI)]
symbPairs = uriPair >>= \ u -> do
commaP `followedWith` uriP
us <- symbPairs
return $ u : us
<|> return [u] | 171 | symbPairs = uriPair >>= \ u -> do
commaP `followedWith` uriP
us <- symbPairs
return $ u : us
<|> return [u] | 121 | false | true | 6 | 9 | 43 | 84 | 42 | 42 | null | null |
guoguo12/haskell-ptable | ptable.hs | apache-2.0 | name "Ga" = "Gallium" | 21 | name "Ga" = "Gallium" | 21 | name "Ga" = "Gallium" | 21 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
snoyberg/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | eqCanRewriteFR (Given, ReprEq) (_, ReprEq) = True | 55 | eqCanRewriteFR (Given, ReprEq) (_, ReprEq) = True | 55 | eqCanRewriteFR (Given, ReprEq) (_, ReprEq) = True | 55 | false | false | 1 | 6 | 12 | 26 | 13 | 13 | null | null |
satnam6502/haskell-kubernetes | Kubernetes/Connection.hs | apache-2.0 | loadConfig :: IO (String, String)
loadConfig
= do homeDir <- getEnv "HOME"
Just (config::Object) <- Yaml.decodeFile (homeDir ++ "/.kube/config")
let maybeCurrentContext = Data.HashMap.Strict.lookup "current-context" config
when (isNothing maybeCurrentContext) $ error "Failed to find current context"
let Just (String currentContextText) = maybeCurrentContext
currentContext = unpack currentContextText
eitherConfig2::Either ParseException KubeConfig.KubeConfig <- Yaml.decodeFileEither (homeDir ++ "/.kube/config")
let Right config2 = eitherConfig2
let maybeMasterIP = KubeConfig.lookupMasterIP currentContext config2
when (isNothing maybeMasterIP) $ error ("Failed to find master IP for context " ++ currentContext)
let Just masterIP = maybeMasterIP
maybeToken = KubeConfig.lookupBearerToken currentContext config2
when (isNothing maybeToken) $ error ("No bearer token found for context " ++ currentContext)
let Just token = maybeToken
return (masterIP, token) | 1,076 | loadConfig :: IO (String, String)
loadConfig
= do homeDir <- getEnv "HOME"
Just (config::Object) <- Yaml.decodeFile (homeDir ++ "/.kube/config")
let maybeCurrentContext = Data.HashMap.Strict.lookup "current-context" config
when (isNothing maybeCurrentContext) $ error "Failed to find current context"
let Just (String currentContextText) = maybeCurrentContext
currentContext = unpack currentContextText
eitherConfig2::Either ParseException KubeConfig.KubeConfig <- Yaml.decodeFileEither (homeDir ++ "/.kube/config")
let Right config2 = eitherConfig2
let maybeMasterIP = KubeConfig.lookupMasterIP currentContext config2
when (isNothing maybeMasterIP) $ error ("Failed to find master IP for context " ++ currentContext)
let Just masterIP = maybeMasterIP
maybeToken = KubeConfig.lookupBearerToken currentContext config2
when (isNothing maybeToken) $ error ("No bearer token found for context " ++ currentContext)
let Just token = maybeToken
return (masterIP, token) | 1,076 | loadConfig
= do homeDir <- getEnv "HOME"
Just (config::Object) <- Yaml.decodeFile (homeDir ++ "/.kube/config")
let maybeCurrentContext = Data.HashMap.Strict.lookup "current-context" config
when (isNothing maybeCurrentContext) $ error "Failed to find current context"
let Just (String currentContextText) = maybeCurrentContext
currentContext = unpack currentContextText
eitherConfig2::Either ParseException KubeConfig.KubeConfig <- Yaml.decodeFileEither (homeDir ++ "/.kube/config")
let Right config2 = eitherConfig2
let maybeMasterIP = KubeConfig.lookupMasterIP currentContext config2
when (isNothing maybeMasterIP) $ error ("Failed to find master IP for context " ++ currentContext)
let Just masterIP = maybeMasterIP
maybeToken = KubeConfig.lookupBearerToken currentContext config2
when (isNothing maybeToken) $ error ("No bearer token found for context " ++ currentContext)
let Just token = maybeToken
return (masterIP, token) | 1,042 | false | true | 0 | 12 | 224 | 286 | 130 | 156 | null | null |
kfish/hogg | Codec/Container/Ogg/Page.hs | bsd-3-clause | buildSegtab numsegs accum incplt (x:xs) =
buildSegtab (numsegs+length(tab)) (accum ++ tab) incplt xs
where
(q,r) = quotRem (fromIntegral $ L.length x) 255
tab = buildTab q r xs incplt | 197 | buildSegtab numsegs accum incplt (x:xs) =
buildSegtab (numsegs+length(tab)) (accum ++ tab) incplt xs
where
(q,r) = quotRem (fromIntegral $ L.length x) 255
tab = buildTab q r xs incplt | 197 | buildSegtab numsegs accum incplt (x:xs) =
buildSegtab (numsegs+length(tab)) (accum ++ tab) incplt xs
where
(q,r) = quotRem (fromIntegral $ L.length x) 255
tab = buildTab q r xs incplt | 197 | false | false | 1 | 9 | 42 | 96 | 49 | 47 | null | null |
ekmett/wl-pprint-extras | src/Text/PrettyPrint/Free/Internal.hs | bsd-2-clause | -- | The document @aboveBreak x y@ concatenates document @x@ and @y@ with
-- a @linebreak@ in between. (infixr 5)
aboveBreak :: Doc a e -> Doc a e -> Doc a e
aboveBreak x y = x <> linebreak <> y | 201 | aboveBreak :: Doc a e -> Doc a e -> Doc a e
aboveBreak x y = x <> linebreak <> y | 87 | aboveBreak x y = x <> linebreak <> y | 43 | true | true | 0 | 7 | 48 | 49 | 24 | 25 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/PublicDelegatedPrefixes/Insert.hs | mpl-2.0 | -- | Name of the region of this request.
pdpiRegion :: Lens' PublicDelegatedPrefixesInsert Text
pdpiRegion
= lens _pdpiRegion (\ s a -> s{_pdpiRegion = a}) | 157 | pdpiRegion :: Lens' PublicDelegatedPrefixesInsert Text
pdpiRegion
= lens _pdpiRegion (\ s a -> s{_pdpiRegion = a}) | 116 | pdpiRegion
= lens _pdpiRegion (\ s a -> s{_pdpiRegion = a}) | 61 | true | true | 1 | 9 | 26 | 46 | 22 | 24 | null | null |
ekmett/ermine | src/Ermine/Syntax/Digest.hs | bsd-2-clause | digestBinary :: Binary b => Ctx -> b -> Ctx
digestBinary c = digest c . runPut . put | 84 | digestBinary :: Binary b => Ctx -> b -> Ctx
digestBinary c = digest c . runPut . put | 84 | digestBinary c = digest c . runPut . put | 40 | false | true | 2 | 9 | 18 | 48 | 20 | 28 | null | null |
haskell-web-intro/secdev | examples/common/app/SavedState.hs | mit | setYuge :: Int -> ReaderT MyStore (ExceptT ServantErr IO) Text
setYuge requestedUs = do
yugeStore <- ask
pronunciation <$> lift (hoist atomically (tryIncreasingYuge requestedUs yugeStore)) | 192 | setYuge :: Int -> ReaderT MyStore (ExceptT ServantErr IO) Text
setYuge requestedUs = do
yugeStore <- ask
pronunciation <$> lift (hoist atomically (tryIncreasingYuge requestedUs yugeStore)) | 192 | setYuge requestedUs = do
yugeStore <- ask
pronunciation <$> lift (hoist atomically (tryIncreasingYuge requestedUs yugeStore)) | 129 | false | true | 0 | 12 | 28 | 66 | 31 | 35 | null | null |
pittsburgh-haskell/haskell-intro-session | src/Tutorial.hs | bsd-3-clause | -- | a person
alice :: Person
alice = P { firstName = "Alice", parents = [bob, carol], age = 12 } | 97 | alice :: Person
alice = P { firstName = "Alice", parents = [bob, carol], age = 12 } | 83 | alice = P { firstName = "Alice", parents = [bob, carol], age = 12 } | 67 | true | true | 0 | 8 | 21 | 48 | 26 | 22 | null | null |
nastya13/MyBreakfast | dist/build/autogen/Paths_MyBreakfast.hs | gpl-3.0 | datadir = "/home/anastasia/.cabal/share/x86_64-linux-ghc-7.8.3/MyBreakfast-0.1.0.0" | 86 | datadir = "/home/anastasia/.cabal/share/x86_64-linux-ghc-7.8.3/MyBreakfast-0.1.0.0" | 86 | datadir = "/home/anastasia/.cabal/share/x86_64-linux-ghc-7.8.3/MyBreakfast-0.1.0.0" | 86 | false | false | 0 | 4 | 5 | 6 | 3 | 3 | null | null |
christiaanb/clash-tryout | src/CLaSH/Driver/TestbenchGen.hs | bsd-3-clause | flattenLets e = [e] | 34 | flattenLets e = [e] | 34 | flattenLets e = [e] | 34 | false | false | 0 | 5 | 18 | 12 | 6 | 6 | null | null |
cyruscousins/HarmLang | src/HarmLang/InitialBasis.hs | mit | interpretNamedInterval "second" = Interval 2 | 44 | interpretNamedInterval "second" = Interval 2 | 44 | interpretNamedInterval "second" = Interval 2 | 44 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
harendra-kumar/unicode-transforms | Data/Unicode/Internal/NormalizeStream.hs | bsd-3-clause | writeReorderBuffer marr di (One c) = do
n <- unsafeWrite marr di c
return (di + n) | 90 | writeReorderBuffer marr di (One c) = do
n <- unsafeWrite marr di c
return (di + n) | 90 | writeReorderBuffer marr di (One c) = do
n <- unsafeWrite marr di c
return (di + n) | 90 | false | false | 0 | 9 | 24 | 46 | 21 | 25 | null | null |
Fermat/FCR | src/Fcr/Parser.hs | gpl-3.0 | parseModule :: String -> String -> Either P.ParseError Module
parseModule srcName cnts =
runIndent $ runParserT gModule () srcName cnts | 136 | parseModule :: String -> String -> Either P.ParseError Module
parseModule srcName cnts =
runIndent $ runParserT gModule () srcName cnts | 136 | parseModule srcName cnts =
runIndent $ runParserT gModule () srcName cnts | 74 | false | true | 0 | 8 | 20 | 46 | 22 | 24 | null | null |
BartAdv/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reifyApp ist t [n, tt', t']
| t == reflm "LetTacTy" = do n' <- reifyTTName n
tt'' <- reifyTT tt'
t'' <- reifyTT t'
return $ LetTacTy n' (delab ist tt'') (delab ist t'') | 310 | reifyApp ist t [n, tt', t']
| t == reflm "LetTacTy" = do n' <- reifyTTName n
tt'' <- reifyTT tt'
t'' <- reifyTT t'
return $ LetTacTy n' (delab ist tt'') (delab ist t'') | 310 | reifyApp ist t [n, tt', t']
| t == reflm "LetTacTy" = do n' <- reifyTTName n
tt'' <- reifyTT tt'
t'' <- reifyTT t'
return $ LetTacTy n' (delab ist tt'') (delab ist t'') | 310 | false | false | 0 | 11 | 176 | 95 | 43 | 52 | null | null |
SKA-ScienceDataProcessor/RC | MS2/lib/DSL_Gridder/gcf/GCF.hs | apache-2.0 | mgrid :: Double -> Double -> Int -> [Double]
mgrid lo hi n =
let
diff = (hi - lo) / P.fromIntegral (n - 1)
(half, r) = n `divMod` 2
mid = if r > 0 then [(hi + lo) / 2.0] else []
in P.take half (P.iterate (+ diff) lo) P.++ mid P.++ P.reverse (P.take half (P.iterate (\v -> v - diff) hi)) | 302 | mgrid :: Double -> Double -> Int -> [Double]
mgrid lo hi n =
let
diff = (hi - lo) / P.fromIntegral (n - 1)
(half, r) = n `divMod` 2
mid = if r > 0 then [(hi + lo) / 2.0] else []
in P.take half (P.iterate (+ diff) lo) P.++ mid P.++ P.reverse (P.take half (P.iterate (\v -> v - diff) hi)) | 302 | mgrid lo hi n =
let
diff = (hi - lo) / P.fromIntegral (n - 1)
(half, r) = n `divMod` 2
mid = if r > 0 then [(hi + lo) / 2.0] else []
in P.take half (P.iterate (+ diff) lo) P.++ mid P.++ P.reverse (P.take half (P.iterate (\v -> v - diff) hi)) | 257 | false | true | 0 | 13 | 80 | 194 | 101 | 93 | null | null |
vincenthz/cryptonite | Crypto/MAC/KMAC.hs | bsd-3-clause | cshakeUpdate :: (HashSHAKE a, ByteArrayAccess ba)
=> H.Context a -> ba -> H.Context a
cshakeUpdate = H.hashUpdate | 126 | cshakeUpdate :: (HashSHAKE a, ByteArrayAccess ba)
=> H.Context a -> ba -> H.Context a
cshakeUpdate = H.hashUpdate | 126 | cshakeUpdate = H.hashUpdate | 27 | false | true | 0 | 9 | 29 | 46 | 23 | 23 | null | null |
vigoo/stack | src/Stack/Types/Config.hs | bsd-3-clause | snapshotsDir :: (MonadReader env m, HasConfig env, HasGHCVariant env, MonadThrow m) => m (Path Abs Dir)
snapshotsDir = do
config <- asks getConfig
platform <- platformVariantRelDir
return $ configStackRoot config </> $(mkRelDir "snapshots") </> platform
-- | Installation root for dependencies | 306 | snapshotsDir :: (MonadReader env m, HasConfig env, HasGHCVariant env, MonadThrow m) => m (Path Abs Dir)
snapshotsDir = do
config <- asks getConfig
platform <- platformVariantRelDir
return $ configStackRoot config </> $(mkRelDir "snapshots") </> platform
-- | Installation root for dependencies | 306 | snapshotsDir = do
config <- asks getConfig
platform <- platformVariantRelDir
return $ configStackRoot config </> $(mkRelDir "snapshots") </> platform
-- | Installation root for dependencies | 202 | false | true | 0 | 11 | 53 | 94 | 45 | 49 | null | null |
mcschroeder/ghc | compiler/basicTypes/DataCon.hs | bsd-3-clause | dataConRepStrictness :: DataCon -> [StrictnessMark]
-- ^ Give the demands on the arguments of a
-- Core constructor application (Con dc args)
dataConRepStrictness dc = case dcRep dc of
NoDataConRep -> [NotMarkedStrict | _ <- dataConRepArgTys dc]
DCR { dcr_stricts = strs } -> strs | 336 | dataConRepStrictness :: DataCon -> [StrictnessMark]
dataConRepStrictness dc = case dcRep dc of
NoDataConRep -> [NotMarkedStrict | _ <- dataConRepArgTys dc]
DCR { dcr_stricts = strs } -> strs | 246 | dataConRepStrictness dc = case dcRep dc of
NoDataConRep -> [NotMarkedStrict | _ <- dataConRepArgTys dc]
DCR { dcr_stricts = strs } -> strs | 194 | true | true | 0 | 11 | 100 | 65 | 34 | 31 | null | null |
snowmantw/Frag | src/AFRPUtilities.hs | gpl-2.0 | -- Sample a signal at regular intervals.
sample :: Time -> SF a (Event a)
sample p_ev = identity &&& repeatedly p_ev () >>^ \(a, e) -> e `tag` a | 144 | sample :: Time -> SF a (Event a)
sample p_ev = identity &&& repeatedly p_ev () >>^ \(a, e) -> e `tag` a | 103 | sample p_ev = identity &&& repeatedly p_ev () >>^ \(a, e) -> e `tag` a | 70 | true | true | 2 | 9 | 29 | 68 | 34 | 34 | null | null |
csabahruska/q3demo | src/Q3Demo/Graphics/GLBackend.hs | bsd-3-clause | compilePrimitive' (TriangleStripI v) = GLTriangleStripI (fromIntegral $ V.length v) <$> uploadVectorElement v | 109 | compilePrimitive' (TriangleStripI v) = GLTriangleStripI (fromIntegral $ V.length v) <$> uploadVectorElement v | 109 | compilePrimitive' (TriangleStripI v) = GLTriangleStripI (fromIntegral $ V.length v) <$> uploadVectorElement v | 109 | false | false | 0 | 10 | 11 | 37 | 17 | 20 | null | null |
jhnesk/project-euler | test/UnitTests.hs | unlicense | tests = TestList [
TestCase (assertEqual "Test 1a" 23 (P1.solution 10)),
TestCase (assertEqual "Test 1b" 233168 (P1.solution 1000))
] | 145 | tests = TestList [
TestCase (assertEqual "Test 1a" 23 (P1.solution 10)),
TestCase (assertEqual "Test 1b" 233168 (P1.solution 1000))
] | 145 | tests = TestList [
TestCase (assertEqual "Test 1a" 23 (P1.solution 10)),
TestCase (assertEqual "Test 1b" 233168 (P1.solution 1000))
] | 145 | false | false | 0 | 12 | 30 | 57 | 28 | 29 | null | null |
tlaitinen/yesod-dsl | YesodDsl/Generator/Esqueleto.hs | bsd-2-clause | hsFieldRef ml (SqlField (Var vn (Right e) mf) fn) = do
return $ makeJust ml $ vn ++ projectField mf ++ entityName e ++ (upperFirst fn) | 138 | hsFieldRef ml (SqlField (Var vn (Right e) mf) fn) = do
return $ makeJust ml $ vn ++ projectField mf ++ entityName e ++ (upperFirst fn) | 138 | hsFieldRef ml (SqlField (Var vn (Right e) mf) fn) = do
return $ makeJust ml $ vn ++ projectField mf ++ entityName e ++ (upperFirst fn) | 138 | false | false | 0 | 12 | 29 | 73 | 34 | 39 | null | null |
SamirTalwar/advent-of-code | 2021/AOC_12_2.hs | mit | isSmall :: Cave -> Bool
isSmall (Small _) = True | 48 | isSmall :: Cave -> Bool
isSmall (Small _) = True | 48 | isSmall (Small _) = True | 24 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
Bugfry/exercises | exercism/haskell/space-age/src/SpaceAge.hs | mit | ageOn :: Planet -> Double -> Double
ageOn planet seconds = seconds / (secondsInYear * yearRelativeToEarth planet)
where secondsInYear = 60 * 60 * 24 * 365.25 | 159 | ageOn :: Planet -> Double -> Double
ageOn planet seconds = seconds / (secondsInYear * yearRelativeToEarth planet)
where secondsInYear = 60 * 60 * 24 * 365.25 | 159 | ageOn planet seconds = seconds / (secondsInYear * yearRelativeToEarth planet)
where secondsInYear = 60 * 60 * 24 * 365.25 | 123 | false | true | 0 | 8 | 28 | 58 | 29 | 29 | null | null |
lulf/wishsys | Model.hs | mit | createShortName :: Text -> Text
createShortName = T.toLower . T.concat . (T.splitOn " ") | 88 | createShortName :: Text -> Text
createShortName = T.toLower . T.concat . (T.splitOn " ") | 88 | createShortName = T.toLower . T.concat . (T.splitOn " ") | 56 | false | true | 0 | 8 | 13 | 35 | 18 | 17 | null | null |
ndmitchell/ghcid | src/Ghcid.hs | bsd-3-clause | prettyOutput :: String -> Int -> [Load] -> [EvalResult] -> [String]
prettyOutput currTime loadedCount [] evals =
(allGoodMessage ++ " (" ++ show loadedCount ++ " module" ++ ['s' | loadedCount /= 1] ++ ", at " ++ currTime ++ ")")
: concatMap printEval evals | 268 | prettyOutput :: String -> Int -> [Load] -> [EvalResult] -> [String]
prettyOutput currTime loadedCount [] evals =
(allGoodMessage ++ " (" ++ show loadedCount ++ " module" ++ ['s' | loadedCount /= 1] ++ ", at " ++ currTime ++ ")")
: concatMap printEval evals | 268 | prettyOutput currTime loadedCount [] evals =
(allGoodMessage ++ " (" ++ show loadedCount ++ " module" ++ ['s' | loadedCount /= 1] ++ ", at " ++ currTime ++ ")")
: concatMap printEval evals | 200 | false | true | 0 | 13 | 56 | 101 | 52 | 49 | null | null |
JeanJoskin/JsLib | src/Language/JsLib/Parser/Parser.hs | bsd-3-clause | pCallExpressionPost :: JsParser (Expression -> Expression)
pCallExpressionPost = flip (.) <$> pCECall <*> option id pCallExpressionPost <|>
flip (.) <$> pCEIndex <*> option id pCallExpressionPost <|>
flip (.) <$> pCEDot <*> option id pCallExpressionPost | 301 | pCallExpressionPost :: JsParser (Expression -> Expression)
pCallExpressionPost = flip (.) <$> pCECall <*> option id pCallExpressionPost <|>
flip (.) <$> pCEIndex <*> option id pCallExpressionPost <|>
flip (.) <$> pCEDot <*> option id pCallExpressionPost | 301 | pCallExpressionPost = flip (.) <$> pCECall <*> option id pCallExpressionPost <|>
flip (.) <$> pCEIndex <*> option id pCallExpressionPost <|>
flip (.) <$> pCEDot <*> option id pCallExpressionPost | 242 | false | true | 0 | 13 | 81 | 83 | 42 | 41 | null | null |
bergmark/hlint | data/Default.hs | bsd-3-clause | error = a >= 'A' && a <= 'Z' ==> isAsciiUpper a | 47 | error = a >= 'A' && a <= 'Z' ==> isAsciiUpper a | 47 | error = a >= 'A' && a <= 'Z' ==> isAsciiUpper a | 47 | false | false | 0 | 8 | 11 | 25 | 12 | 13 | null | null |
michaelbeaumont/hatic | hatic.hs | bsd-3-clause | setMatch = "^s ([a-zA-Z0-9_]*) ([a-zA-Z0-9_]*)" :: B.ByteString | 63 | setMatch = "^s ([a-zA-Z0-9_]*) ([a-zA-Z0-9_]*)" :: B.ByteString | 63 | setMatch = "^s ([a-zA-Z0-9_]*) ([a-zA-Z0-9_]*)" :: B.ByteString | 63 | false | false | 0 | 5 | 6 | 11 | 6 | 5 | null | null |
ytakano/tsukuyomi | tests/json/json_haskell_atto.hs | bsd-3-clause | parse_members =
do
h <- parse_member
_ <- parse_ws
t <- (Atto.try $ Atto.many' parse_sp_member) <|> return []
return $ JSON_Object $ h:t | 154 | parse_members =
do
h <- parse_member
_ <- parse_ws
t <- (Atto.try $ Atto.many' parse_sp_member) <|> return []
return $ JSON_Object $ h:t | 154 | parse_members =
do
h <- parse_member
_ <- parse_ws
t <- (Atto.try $ Atto.many' parse_sp_member) <|> return []
return $ JSON_Object $ h:t | 154 | false | false | 0 | 12 | 40 | 65 | 30 | 35 | null | null |
Rydgel/flappy-haskell | src/Graphics.hs | mit | renderRepeatedTexture :: SDL.Renderer -> Texture -> CInt -> CInt -> IO ()
renderRepeatedTexture r t@(Texture _ (V2 width height)) ox oy = do
renderTexture r t (P (V2 offset (oy-height)))
renderTexture r t (P (V2 (offset+width) (oy-height)))
where
offset = ox - (ox `div` width) * width - width | 303 | renderRepeatedTexture :: SDL.Renderer -> Texture -> CInt -> CInt -> IO ()
renderRepeatedTexture r t@(Texture _ (V2 width height)) ox oy = do
renderTexture r t (P (V2 offset (oy-height)))
renderTexture r t (P (V2 (offset+width) (oy-height)))
where
offset = ox - (ox `div` width) * width - width | 303 | renderRepeatedTexture r t@(Texture _ (V2 width height)) ox oy = do
renderTexture r t (P (V2 offset (oy-height)))
renderTexture r t (P (V2 (offset+width) (oy-height)))
where
offset = ox - (ox `div` width) * width - width | 229 | false | true | 1 | 13 | 58 | 169 | 82 | 87 | null | null |
castaway/pandoc | src/Text/Pandoc/Writers/Docx.hs | gpl-2.0 | inlineToOpenXML opts (Subscript lst) =
withTextProp (mknode "w:vertAlign" [("w:val","subscript")] ())
$ inlinesToOpenXML opts lst | 133 | inlineToOpenXML opts (Subscript lst) =
withTextProp (mknode "w:vertAlign" [("w:val","subscript")] ())
$ inlinesToOpenXML opts lst | 133 | inlineToOpenXML opts (Subscript lst) =
withTextProp (mknode "w:vertAlign" [("w:val","subscript")] ())
$ inlinesToOpenXML opts lst | 133 | false | false | 2 | 8 | 17 | 55 | 25 | 30 | null | null |
Fuuzetsu/haddock | haddock-library/src/Documentation/Haddock/Markup.hs | bsd-2-clause | markup m (DocParagraph d) = markupParagraph m (markup m d) | 69 | markup m (DocParagraph d) = markupParagraph m (markup m d) | 69 | markup m (DocParagraph d) = markupParagraph m (markup m d) | 69 | false | false | 0 | 7 | 20 | 30 | 14 | 16 | null | null |
ghc-android/ghc | compiler/prelude/TysPrim.hs | bsd-3-clause | {-
************************************************************************
* *
\subsection[TysPrim-synch-var]{The synchronizing variable type}
* *
************************************************************************
-}
mVarPrimTyCon :: TyCon
mVarPrimTyCon = pcPrimTyCon mVarPrimTyConName [Nominal, Representational] PtrRep | 466 | mVarPrimTyCon :: TyCon
mVarPrimTyCon = pcPrimTyCon mVarPrimTyConName [Nominal, Representational] PtrRep | 103 | mVarPrimTyCon = pcPrimTyCon mVarPrimTyConName [Nominal, Representational] PtrRep | 80 | true | true | 0 | 6 | 160 | 25 | 14 | 11 | null | null |
ambiata/mafia | src/Mafia/Git.hs | bsd-3-clause | parseSubmoduleState :: Text -> SubmoduleState
parseSubmoduleState line
| "-" `T.isPrefixOf` line = NeedsInit
| "+" `T.isPrefixOf` line = OutOfSync
| otherwise = Ready | 186 | parseSubmoduleState :: Text -> SubmoduleState
parseSubmoduleState line
| "-" `T.isPrefixOf` line = NeedsInit
| "+" `T.isPrefixOf` line = OutOfSync
| otherwise = Ready | 186 | parseSubmoduleState line
| "-" `T.isPrefixOf` line = NeedsInit
| "+" `T.isPrefixOf` line = OutOfSync
| otherwise = Ready | 140 | false | true | 1 | 8 | 42 | 59 | 30 | 29 | null | null |
brendanhay/gogol | gogol-container/gen/Network/Google/Resource/Container/Projects/Locations/Clusters/Create.hs | mpl-2.0 | -- | The parent (project and location) where the cluster will be created.
-- Specified in the format \`projects\/*\/locations\/*\`.
plccParent :: Lens' ProjectsLocationsClustersCreate Text
plccParent
= lens _plccParent (\ s a -> s{_plccParent = a}) | 250 | plccParent :: Lens' ProjectsLocationsClustersCreate Text
plccParent
= lens _plccParent (\ s a -> s{_plccParent = a}) | 118 | plccParent
= lens _plccParent (\ s a -> s{_plccParent = a}) | 61 | true | true | 0 | 9 | 36 | 43 | 23 | 20 | null | null |
input-output-hk/pos-haskell-prototype | util/src/Pos/Util/Log/Structured.hs | mit | logErrorSX = logMessageSX Error | 33 | logErrorSX = logMessageSX Error | 33 | logErrorSX = logMessageSX Error | 33 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
ARCCN/hcprobe | src/HCProbe/EDSL/Handlers.hs | bsd-3-clause | modifyIORef' :: IORef a -> (a -> a) -> IO ()
modifyIORef' ref f = do
x <- readIORef ref
let x' = f x
x' `seq` writeIORef ref x'
#endif | 146 | modifyIORef' :: IORef a -> (a -> a) -> IO ()
modifyIORef' ref f = do
x <- readIORef ref
let x' = f x
x' `seq` writeIORef ref x'
#endif | 146 | modifyIORef' ref f = do
x <- readIORef ref
let x' = f x
x' `seq` writeIORef ref x'
#endif | 101 | false | true | 0 | 11 | 42 | 81 | 37 | 44 | null | null |
mstksg/hledger | hledger-lib/Hledger/Read/Common.hs | gpl-3.0 | getAccountAliases :: MonadState Journal m => m [AccountAlias]
getAccountAliases = fmap jparsealiases get | 104 | getAccountAliases :: MonadState Journal m => m [AccountAlias]
getAccountAliases = fmap jparsealiases get | 104 | getAccountAliases = fmap jparsealiases get | 42 | false | true | 0 | 7 | 12 | 31 | 15 | 16 | null | null |
rethab/tagger | src/Tagger/IncompletionFinder.hs | bsd-3-clause | -- | Read ID3 Tags and set them on the Songs and Albums of an Artist,
-- | filter those with incomplete Tags.
getIncomplete :: [Artist] -> IO [Artist]
getIncomplete as = mapM tagArt as >>= return . filter incomp | 211 | getIncomplete :: [Artist] -> IO [Artist]
getIncomplete as = mapM tagArt as >>= return . filter incomp | 101 | getIncomplete as = mapM tagArt as >>= return . filter incomp | 60 | true | true | 0 | 7 | 39 | 48 | 24 | 24 | null | null |
ddssff/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | tildeEscape :: LP Char
tildeEscape = try $ do
string "^^"
c <- satisfy (\x -> x >= '\0' && x <= '\128')
d <- if isLowerHex c
then option "" $ count 1 (satisfy isLowerHex)
else return ""
if null d
then case ord c of
x | x >= 64 && x <= 127 -> return $ chr (x - 64)
| otherwise -> return $ chr (x + 64)
else return $ chr $ read ('0':'x':c:d) | 411 | tildeEscape :: LP Char
tildeEscape = try $ do
string "^^"
c <- satisfy (\x -> x >= '\0' && x <= '\128')
d <- if isLowerHex c
then option "" $ count 1 (satisfy isLowerHex)
else return ""
if null d
then case ord c of
x | x >= 64 && x <= 127 -> return $ chr (x - 64)
| otherwise -> return $ chr (x + 64)
else return $ chr $ read ('0':'x':c:d) | 411 | tildeEscape = try $ do
string "^^"
c <- satisfy (\x -> x >= '\0' && x <= '\128')
d <- if isLowerHex c
then option "" $ count 1 (satisfy isLowerHex)
else return ""
if null d
then case ord c of
x | x >= 64 && x <= 127 -> return $ chr (x - 64)
| otherwise -> return $ chr (x + 64)
else return $ chr $ read ('0':'x':c:d) | 388 | false | true | 0 | 17 | 150 | 201 | 96 | 105 | null | null |
frerich/pandoc | src/Text/Pandoc/Writers/ConTeXt.hs | gpl-2.0 | fromBcp47 ("ar":"MA":_) = "ar-ma" | 35 | fromBcp47 ("ar":"MA":_) = "ar-ma" | 35 | fromBcp47 ("ar":"MA":_) = "ar-ma" | 35 | false | false | 0 | 8 | 5 | 20 | 10 | 10 | null | null |
haskell-streaming/streaming | src/Streaming/Prelude.hs | bsd-3-clause | {- | Merge two streams, ordering them by applying the given function to
each element before comparing.
The return values of both streams are returned.
-}
mergeOn :: (Monad m, Ord b)
=> (a -> b)
-> Stream (Of a) m r
-> Stream (Of a) m s
-> Stream (Of a) m (r, s)
mergeOn f = mergeBy (comparing f) | 310 | mergeOn :: (Monad m, Ord b)
=> (a -> b)
-> Stream (Of a) m r
-> Stream (Of a) m s
-> Stream (Of a) m (r, s)
mergeOn f = mergeBy (comparing f) | 149 | mergeOn f = mergeBy (comparing f) | 33 | true | true | 0 | 12 | 75 | 104 | 52 | 52 | null | null |
abstools/abs-haskell-formal | benchmarks/3_primality_test_parallel/progs/1000.hs | bsd-3-clause | main :: IO ()
main = printHeap =<< run 1000000 main_ (head the_end) | 67 | main :: IO ()
main = printHeap =<< run 1000000 main_ (head the_end) | 67 | main = printHeap =<< run 1000000 main_ (head the_end) | 53 | false | true | 2 | 7 | 12 | 35 | 16 | 19 | null | null |
rahulmutt/ghcvm | compiler/Eta/CodeGen/Expr.hs | bsd-3-clause | cgCase (StgApp v []) binder altType@(PrimAlt _) alts
| isUnLiftedType (idType v)
|| repsCompatible
= do
unless repsCompatible $
panic "cgCase: reps do not match, perhaps a dodgy unsafeCoerce?"
vInfo <- getCgIdInfo v
binderLoc <- newIdLoc nvBinder
emitAssign binderLoc (idInfoLoadCode vInfo)
bindArgs [(nvBinder, binderLoc)]
cgAlts nvBinder altType alts
where repsCompatible = vRep == idPrimRep binder
-- TODO: Allow integer conversions?
nvBinder = NonVoid binder
vRep = idPrimRep v | 557 | cgCase (StgApp v []) binder altType@(PrimAlt _) alts
| isUnLiftedType (idType v)
|| repsCompatible
= do
unless repsCompatible $
panic "cgCase: reps do not match, perhaps a dodgy unsafeCoerce?"
vInfo <- getCgIdInfo v
binderLoc <- newIdLoc nvBinder
emitAssign binderLoc (idInfoLoadCode vInfo)
bindArgs [(nvBinder, binderLoc)]
cgAlts nvBinder altType alts
where repsCompatible = vRep == idPrimRep binder
-- TODO: Allow integer conversions?
nvBinder = NonVoid binder
vRep = idPrimRep v | 557 | cgCase (StgApp v []) binder altType@(PrimAlt _) alts
| isUnLiftedType (idType v)
|| repsCompatible
= do
unless repsCompatible $
panic "cgCase: reps do not match, perhaps a dodgy unsafeCoerce?"
vInfo <- getCgIdInfo v
binderLoc <- newIdLoc nvBinder
emitAssign binderLoc (idInfoLoadCode vInfo)
bindArgs [(nvBinder, binderLoc)]
cgAlts nvBinder altType alts
where repsCompatible = vRep == idPrimRep binder
-- TODO: Allow integer conversions?
nvBinder = NonVoid binder
vRep = idPrimRep v | 557 | false | false | 2 | 11 | 143 | 157 | 72 | 85 | null | null |
kellino/TypeSystems | typedArith/Pretty.hs | mit | parensIf :: Bool -> Doc -> Doc
parensIf True = parens | 53 | parensIf :: Bool -> Doc -> Doc
parensIf True = parens | 53 | parensIf True = parens | 22 | false | true | 0 | 6 | 10 | 22 | 11 | 11 | null | null |
dysinger/amazonka | amazonka-route53-domains/gen/Network/AWS/Route53Domains/TransferDomain.hs | mpl-2.0 | -- | Provides detailed contact information.
--
-- Type: Complex
--
-- Children: 'FirstName', 'MiddleName', 'LastName', 'ContactType', 'OrganizationName', 'AddressLine1', 'AddressLine2', 'City', 'State', 'CountryCode', 'ZipCode', 'PhoneNumber', 'Email', 'Fax', 'ExtraParams'
--
-- Required: Yes
tdTechContact :: Lens' TransferDomain ContactDetail
tdTechContact = lens _tdTechContact (\s a -> s { _tdTechContact = a }) | 416 | tdTechContact :: Lens' TransferDomain ContactDetail
tdTechContact = lens _tdTechContact (\s a -> s { _tdTechContact = a }) | 122 | tdTechContact = lens _tdTechContact (\s a -> s { _tdTechContact = a }) | 70 | true | true | 1 | 9 | 49 | 52 | 28 | 24 | null | null |
wavewave/loopdiagram | src/HEP/Physics/LoopCalculation/Box.hs | bsd-3-clause | matchFSLinesWorker :: ((Int,Dir),(Int,Dir))
-> Handle
-> Comb (MatchF, MatchF) (MatchS, MatchS)
-> Maybe (Comb (MatchF, MatchF) (MatchS, MatchS))
matchFSLinesWorker ((i,iof),(j,ios)) (Handle (k1,d1)) c@(Comb (f1,f2) (s1,s2)) =
case getSF k1 of
S -> if | j == 1 ->
case s1 of
Left s@(SL (v1,v2) d ()) ->
let ms' = if matchVertexSLineDir (ios,d1) s then Just (SL (v1,v2) d k1) else Nothing
in maybe Nothing (\s'->Just (Comb (f1,f2) (Right s',s2))) ms'
Right s@(SL (v1,v2) d k) ->
if matchVertexSLineDir (ios,d1) s && k == k1 then Just c else Nothing
| j == 2 ->
case s2 of
Left s@(SL (v1,v2) d ()) ->
let ms' = if matchVertexSLineDir (ios,d1) s then Just (SL (v1,v2) d k1) else Nothing
in maybe Nothing (\s'->Just (Comb (f1,f2) (s1,Right s'))) ms'
Right s@(SL (v1,v2) d k) ->
if matchVertexSLineDir (ios,d1) s && k == k1 then Just c else Nothing
| otherwise -> (error "error in matchFSLines")
F -> if | i == 1 ->
case f1 of
Left f@(FL (v1,v2) d ()) -> do
k' <- getFermionKind iof d k1
f' <- if matchVertexFLineDir (iof,d1) f
then return (FL (v1,v2) d k')
else Nothing
return (Comb (Right f',f2) (s1,s2))
Right f@(FL (v1,v2) d k) -> do
k' <- getFermionKind iof d k1
if matchVertexFLineDir (iof,d1) f && k == k'
then return c
else Nothing
| i == 2 ->
case f2 of
Left f@(FL (v1,v2) d ()) -> do
k' <- getFermionKind iof d k1
f' <- if matchVertexFLineDir (iof,d1) f
then return (FL (v1,v2) d k')
else Nothing
return (Comb (f1,Right f') (s1,s2))
Right f@(FL (v1,v2) d k) -> do
k' <- getFermionKind iof d k1
if matchVertexFLineDir (iof,d1) f && k == k'
then return c
else Nothing
| otherwise -> (error "error in matchFSLines") | 2,412 | matchFSLinesWorker :: ((Int,Dir),(Int,Dir))
-> Handle
-> Comb (MatchF, MatchF) (MatchS, MatchS)
-> Maybe (Comb (MatchF, MatchF) (MatchS, MatchS))
matchFSLinesWorker ((i,iof),(j,ios)) (Handle (k1,d1)) c@(Comb (f1,f2) (s1,s2)) =
case getSF k1 of
S -> if | j == 1 ->
case s1 of
Left s@(SL (v1,v2) d ()) ->
let ms' = if matchVertexSLineDir (ios,d1) s then Just (SL (v1,v2) d k1) else Nothing
in maybe Nothing (\s'->Just (Comb (f1,f2) (Right s',s2))) ms'
Right s@(SL (v1,v2) d k) ->
if matchVertexSLineDir (ios,d1) s && k == k1 then Just c else Nothing
| j == 2 ->
case s2 of
Left s@(SL (v1,v2) d ()) ->
let ms' = if matchVertexSLineDir (ios,d1) s then Just (SL (v1,v2) d k1) else Nothing
in maybe Nothing (\s'->Just (Comb (f1,f2) (s1,Right s'))) ms'
Right s@(SL (v1,v2) d k) ->
if matchVertexSLineDir (ios,d1) s && k == k1 then Just c else Nothing
| otherwise -> (error "error in matchFSLines")
F -> if | i == 1 ->
case f1 of
Left f@(FL (v1,v2) d ()) -> do
k' <- getFermionKind iof d k1
f' <- if matchVertexFLineDir (iof,d1) f
then return (FL (v1,v2) d k')
else Nothing
return (Comb (Right f',f2) (s1,s2))
Right f@(FL (v1,v2) d k) -> do
k' <- getFermionKind iof d k1
if matchVertexFLineDir (iof,d1) f && k == k'
then return c
else Nothing
| i == 2 ->
case f2 of
Left f@(FL (v1,v2) d ()) -> do
k' <- getFermionKind iof d k1
f' <- if matchVertexFLineDir (iof,d1) f
then return (FL (v1,v2) d k')
else Nothing
return (Comb (f1,Right f') (s1,s2))
Right f@(FL (v1,v2) d k) -> do
k' <- getFermionKind iof d k1
if matchVertexFLineDir (iof,d1) f && k == k'
then return c
else Nothing
| otherwise -> (error "error in matchFSLines") | 2,412 | matchFSLinesWorker ((i,iof),(j,ios)) (Handle (k1,d1)) c@(Comb (f1,f2) (s1,s2)) =
case getSF k1 of
S -> if | j == 1 ->
case s1 of
Left s@(SL (v1,v2) d ()) ->
let ms' = if matchVertexSLineDir (ios,d1) s then Just (SL (v1,v2) d k1) else Nothing
in maybe Nothing (\s'->Just (Comb (f1,f2) (Right s',s2))) ms'
Right s@(SL (v1,v2) d k) ->
if matchVertexSLineDir (ios,d1) s && k == k1 then Just c else Nothing
| j == 2 ->
case s2 of
Left s@(SL (v1,v2) d ()) ->
let ms' = if matchVertexSLineDir (ios,d1) s then Just (SL (v1,v2) d k1) else Nothing
in maybe Nothing (\s'->Just (Comb (f1,f2) (s1,Right s'))) ms'
Right s@(SL (v1,v2) d k) ->
if matchVertexSLineDir (ios,d1) s && k == k1 then Just c else Nothing
| otherwise -> (error "error in matchFSLines")
F -> if | i == 1 ->
case f1 of
Left f@(FL (v1,v2) d ()) -> do
k' <- getFermionKind iof d k1
f' <- if matchVertexFLineDir (iof,d1) f
then return (FL (v1,v2) d k')
else Nothing
return (Comb (Right f',f2) (s1,s2))
Right f@(FL (v1,v2) d k) -> do
k' <- getFermionKind iof d k1
if matchVertexFLineDir (iof,d1) f && k == k'
then return c
else Nothing
| i == 2 ->
case f2 of
Left f@(FL (v1,v2) d ()) -> do
k' <- getFermionKind iof d k1
f' <- if matchVertexFLineDir (iof,d1) f
then return (FL (v1,v2) d k')
else Nothing
return (Comb (f1,Right f') (s1,s2))
Right f@(FL (v1,v2) d k) -> do
k' <- getFermionKind iof d k1
if matchVertexFLineDir (iof,d1) f && k == k'
then return c
else Nothing
| otherwise -> (error "error in matchFSLines") | 2,207 | false | true | 0 | 22 | 1,090 | 1,000 | 526 | 474 | null | null |
JanGe/irc-dcc | src/Network/IRC/DCC/Client/FileTransfer.hs | mit | -- | Accept a DCC file offer for a partially downloaded file
resumeFile :: DccSend
-> DccAccept
-> (PortNumber -> IO ())
-- ^ Callback when socket is ready
-> (FileOffset -> IO ())
-- ^ Callback when a chunk of data was transferred
-> ReaderT (Maybe PortNumber) IO ()
resumeFile offer accept
| accept `matchesSend` offer =
download (ResumeFrom pos) offer
| otherwise = fail "You mixed the DCC and Reverse DCC workflow when calling 'resumeFile'."
where
pos = acceptedPosition accept | 571 | resumeFile :: DccSend
-> DccAccept
-> (PortNumber -> IO ())
-- ^ Callback when socket is ready
-> (FileOffset -> IO ())
-- ^ Callback when a chunk of data was transferred
-> ReaderT (Maybe PortNumber) IO ()
resumeFile offer accept
| accept `matchesSend` offer =
download (ResumeFrom pos) offer
| otherwise = fail "You mixed the DCC and Reverse DCC workflow when calling 'resumeFile'."
where
pos = acceptedPosition accept | 510 | resumeFile offer accept
| accept `matchesSend` offer =
download (ResumeFrom pos) offer
| otherwise = fail "You mixed the DCC and Reverse DCC workflow when calling 'resumeFile'."
where
pos = acceptedPosition accept | 237 | true | true | 0 | 12 | 171 | 120 | 59 | 61 | null | null |
vadimjprokopev/Thesis | Haskell/Derivative/Derivative.hs | mit | simplify (Log a)
| E == simplify a = Const 1
| otherwise = Log (simplify a) | 79 | simplify (Log a)
| E == simplify a = Const 1
| otherwise = Log (simplify a) | 79 | simplify (Log a)
| E == simplify a = Const 1
| otherwise = Log (simplify a) | 79 | false | false | 1 | 9 | 20 | 47 | 21 | 26 | null | null |
gnn/Hets | GUI/GtkUtils.hs | gpl-2.0 | fileOpenDialog :: FilePath -- ^ Defaultname for file
-> [(String, [String])] -- ^ Filter (name, pattern list)
-> Maybe (FilePath -> IO ()) -- ^ Action on open
-> IO (Maybe FilePath)
fileOpenDialog = fileDialog FileChooserActionOpen | 276 | fileOpenDialog :: FilePath -- ^ Defaultname for file
-> [(String, [String])] -- ^ Filter (name, pattern list)
-> Maybe (FilePath -> IO ()) -- ^ Action on open
-> IO (Maybe FilePath)
fileOpenDialog = fileDialog FileChooserActionOpen | 276 | fileOpenDialog = fileDialog FileChooserActionOpen | 49 | false | true | 0 | 12 | 80 | 65 | 35 | 30 | null | null |
AlexanderPankiv/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | {-
************************************************************************
* *
\subsection{Local Names}
* *
************************************************************************
This *local* name is used by the interactive stuff
-}
itName :: Unique -> SrcSpan -> Name
itName uniq loc = mkInternalName uniq (mkOccNameFS varName (fsLit "it")) loc | 488 | itName :: Unique -> SrcSpan -> Name
itName uniq loc = mkInternalName uniq (mkOccNameFS varName (fsLit "it")) loc | 112 | itName uniq loc = mkInternalName uniq (mkOccNameFS varName (fsLit "it")) loc | 76 | true | true | 0 | 9 | 176 | 50 | 24 | 26 | null | null |
umairsd/course-haskell-cis194 | hw06/Fibonacci.hs | mit | fib n = fib (n-1) + fib (n-2) | 29 | fib n = fib (n-1) + fib (n-2) | 29 | fib n = fib (n-1) + fib (n-2) | 29 | false | false | 0 | 8 | 7 | 33 | 16 | 17 | null | null |
alexisVallet/hnn | src/HNN/Tensor/Internal.hs | bsd-3-clause | tconcat :: forall n m a . (KnownNat n, KnownNat m, KnownNat (n + m), MT.TensorDataType a)
=> Tensor '[n] a -> Tensor '[m] a -> Tensor '[n + m] a
tconcat t1 t2 = unsafePerformIO $ do
let t1sz = fromIntegral $ natVal (Proxy :: Proxy n)
t2sz = fromIntegral $ natVal (Proxy :: Proxy m)
out <- MT.emptyTensor
mt1 <- unsafeThaw t1
mt2 <- unsafeThaw t2
MT.withDevicePtr mt1 $ \t1ptr -> do
MT.withDevicePtr mt2 $ \t2ptr -> do
MT.withDevicePtr out $ \outptr -> do
CUDA.copyArray t1sz t1ptr outptr
CUDA.copyArray t2sz t2ptr
(CUDA.DevicePtr
$ plusPtr
(CUDA.useDevicePtr outptr)
(sizeOf (undefined :: a) * fromIntegral t1sz))
unsafeFreeze out | 724 | tconcat :: forall n m a . (KnownNat n, KnownNat m, KnownNat (n + m), MT.TensorDataType a)
=> Tensor '[n] a -> Tensor '[m] a -> Tensor '[n + m] a
tconcat t1 t2 = unsafePerformIO $ do
let t1sz = fromIntegral $ natVal (Proxy :: Proxy n)
t2sz = fromIntegral $ natVal (Proxy :: Proxy m)
out <- MT.emptyTensor
mt1 <- unsafeThaw t1
mt2 <- unsafeThaw t2
MT.withDevicePtr mt1 $ \t1ptr -> do
MT.withDevicePtr mt2 $ \t2ptr -> do
MT.withDevicePtr out $ \outptr -> do
CUDA.copyArray t1sz t1ptr outptr
CUDA.copyArray t2sz t2ptr
(CUDA.DevicePtr
$ plusPtr
(CUDA.useDevicePtr outptr)
(sizeOf (undefined :: a) * fromIntegral t1sz))
unsafeFreeze out | 724 | tconcat t1 t2 = unsafePerformIO $ do
let t1sz = fromIntegral $ natVal (Proxy :: Proxy n)
t2sz = fromIntegral $ natVal (Proxy :: Proxy m)
out <- MT.emptyTensor
mt1 <- unsafeThaw t1
mt2 <- unsafeThaw t2
MT.withDevicePtr mt1 $ \t1ptr -> do
MT.withDevicePtr mt2 $ \t2ptr -> do
MT.withDevicePtr out $ \outptr -> do
CUDA.copyArray t1sz t1ptr outptr
CUDA.copyArray t2sz t2ptr
(CUDA.DevicePtr
$ plusPtr
(CUDA.useDevicePtr outptr)
(sizeOf (undefined :: a) * fromIntegral t1sz))
unsafeFreeze out | 572 | false | true | 0 | 27 | 200 | 302 | 147 | 155 | null | null |
esmolanka/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | ubxparens :: LaTeX -> LaTeX
ubxparens h = text "(#" <> h <> text "#)" | 69 | ubxparens :: LaTeX -> LaTeX
ubxparens h = text "(#" <> h <> text "#)" | 69 | ubxparens h = text "(#" <> h <> text "#)" | 41 | false | true | 0 | 7 | 14 | 32 | 15 | 17 | null | null |
manyoo/ghcjs | src/Gen2/Compactor.hs | mit | identsS f (IfStat e s1 s2) = IfStat <$> identsE f e <*> identsS f s1 <*> identsS f s2 | 97 | identsS f (IfStat e s1 s2) = IfStat <$> identsE f e <*> identsS f s1 <*> identsS f s2 | 97 | identsS f (IfStat e s1 s2) = IfStat <$> identsE f e <*> identsS f s1 <*> identsS f s2 | 97 | false | false | 0 | 8 | 31 | 48 | 22 | 26 | null | null |
uemurax/carettah | FormatPangoMarkup.hs | gpl-2.0 | formatPangoMarkupWhite :: String -> String -> String
formatPangoMarkupWhite lang text =
"<span foreground=\"white\">" ++
(unlines . fmap (concat . fmap tagTokShape) . highlightAs lang) text ++
"</span>" | 210 | formatPangoMarkupWhite :: String -> String -> String
formatPangoMarkupWhite lang text =
"<span foreground=\"white\">" ++
(unlines . fmap (concat . fmap tagTokShape) . highlightAs lang) text ++
"</span>" | 210 | formatPangoMarkupWhite lang text =
"<span foreground=\"white\">" ++
(unlines . fmap (concat . fmap tagTokShape) . highlightAs lang) text ++
"</span>" | 157 | false | true | 0 | 14 | 34 | 62 | 30 | 32 | null | null |
ekmett/ixset | src/Data/IxSet.hs | bsd-3-clause | -- | A reversed groupBy
rGroupBy :: (Typeable k, Typeable t) => IxSet t -> [(k, [t])]
rGroupBy = reverse . groupBy | 114 | rGroupBy :: (Typeable k, Typeable t) => IxSet t -> [(k, [t])]
rGroupBy = reverse . groupBy | 90 | rGroupBy = reverse . groupBy | 28 | true | true | 0 | 9 | 21 | 50 | 28 | 22 | null | null |
rubilnikas/haskell2 | src/Model/Move.hs | bsd-3-clause | reverseP O = X | 14 | reverseP O = X | 14 | reverseP O = X | 14 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ivanperez-keera/SoOSiM-ui | src/View/InitIconsInfoArea.hs | bsd-3-clause | -- | The string column
_STRING_COLUMN :: ColumnId (Pixbuf, String) String
_STRING_COLUMN = makeColumnIdString 1 | 111 | _STRING_COLUMN :: ColumnId (Pixbuf, String) String
_STRING_COLUMN = makeColumnIdString 1 | 88 | _STRING_COLUMN = makeColumnIdString 1 | 37 | true | true | 0 | 6 | 14 | 26 | 14 | 12 | null | null |
zalora/replicator | src/Replicator/Command.hs | mit | run :: [Task] -> Command
run tasks conf sections = do
zero <- if flags_timeline then seconds else return 0
_ <- map' (\s -> run' Context{sec = s, ..} tasks) sections
when flags_timeline $ quack zero "Done."
where
complex = length tasks > 1
map' = if flags_parallel then Parallel.mapM else mapM
run' _ [] = return ()
run' ctx (t:tt) = do
ctx' <- t ctx;
run' ctx' tt | 436 | run :: [Task] -> Command
run tasks conf sections = do
zero <- if flags_timeline then seconds else return 0
_ <- map' (\s -> run' Context{sec = s, ..} tasks) sections
when flags_timeline $ quack zero "Done."
where
complex = length tasks > 1
map' = if flags_parallel then Parallel.mapM else mapM
run' _ [] = return ()
run' ctx (t:tt) = do
ctx' <- t ctx;
run' ctx' tt | 436 | run tasks conf sections = do
zero <- if flags_timeline then seconds else return 0
_ <- map' (\s -> run' Context{sec = s, ..} tasks) sections
when flags_timeline $ quack zero "Done."
where
complex = length tasks > 1
map' = if flags_parallel then Parallel.mapM else mapM
run' _ [] = return ()
run' ctx (t:tt) = do
ctx' <- t ctx;
run' ctx' tt | 411 | false | true | 0 | 13 | 142 | 182 | 89 | 93 | null | null |
nbrunt/JSHOP | res/hjs-0.2.1/src/HJS/Parser/Prim.hs | mit | commaSep p = p `sepBy` (do { rOp ","; whiteSpace }) | 51 | commaSep p = p `sepBy` (do { rOp ","; whiteSpace }) | 51 | commaSep p = p `sepBy` (do { rOp ","; whiteSpace }) | 51 | false | false | 0 | 9 | 10 | 30 | 16 | 14 | null | null |
ndmitchell/guihaskell | gtkconsole/Main.hs | bsd-3-clause | ppendText :: TextView -> String -> IO ()
appendText txtOut s = do
buf <- textViewGetBuffer txtOut
end <- textBufferGetEndIter buf
textBufferInsert buf end s
| 173 | appendText :: TextView -> String -> IO ()
appendText txtOut s = do
buf <- textViewGetBuffer txtOut
end <- textBufferGetEndIter buf
textBufferInsert buf end s | 172 | appendText txtOut s = do
buf <- textViewGetBuffer txtOut
end <- textBufferGetEndIter buf
textBufferInsert buf end s | 130 | false | true | 0 | 8 | 41 | 59 | 26 | 33 | null | null |
mzini/qlogic | Qlogic/IntSat.hs | gpl-3.0 | [p] `mEqu` [q] = return $ p <-> q | 48 | [p] `mEqu` [q] = return $ p <-> q | 48 | [p] `mEqu` [q] = return $ p <-> q | 48 | false | false | 0 | 6 | 23 | 28 | 15 | 13 | null | null |
necrobious/iso3166 | src/Data/ISO3166/Parse.hs | bsd-3-clause | parseAlpha2 :: Text -> Maybe Country
parseAlpha2 input = Map.lookup input idx_a2 | 80 | parseAlpha2 :: Text -> Maybe Country
parseAlpha2 input = Map.lookup input idx_a2 | 80 | parseAlpha2 input = Map.lookup input idx_a2 | 43 | false | true | 0 | 7 | 11 | 33 | 14 | 19 | null | null |
egison/egison | hs-src/Language/Egison/IExpr.hs | mit | extractIndex DF{} = undefined | 35 | extractIndex DF{} = undefined | 35 | extractIndex DF{} = undefined | 35 | false | false | 0 | 6 | 9 | 13 | 6 | 7 | null | null |
jbracker/supermonad-plugin | examples/applicative/ll1-parser/MainSuperapplicative.hs | bsd-3-clause | qual :: Parser Char Token
equal = symbol '=' *> pure TEqual
| 60 | equal :: Parser Char Token
equal = symbol '=' *> pure TEqual | 60 | equal = symbol '=' *> pure TEqual | 33 | false | true | 1 | 6 | 12 | 29 | 12 | 17 | null | null |
facebookincubator/duckling | Duckling/Rules/IS.hs | bsd-3-clause | defaultRules :: Seal Dimension -> [Rule]
defaultRules = langRules | 65 | defaultRules :: Seal Dimension -> [Rule]
defaultRules = langRules | 65 | defaultRules = langRules | 24 | false | true | 0 | 6 | 8 | 21 | 11 | 10 | null | null |
xnning/fcore | lib/typeCheck/TypeCheck.hs | bsd-2-clause | checkExpr (L loc (Dot e x (Just (args, _)))) =
do (t, _) <- checkExpr e
case deThunkOnce t of
JType (JClass _) -> checkExpr (L loc $ JMethod (NonStatic e) x args undefined)
RecordType _ -> checkExpr (L loc $ App (L loc $ RecordProj e x) tuple)
And _ _ -> checkExpr (L loc $ App (L loc $ RecordProj e x) tuple)
_ -> throwError (NotMember x t `withExpr` e) -- TODO: should be x's loc
where tuple = Tuple args `withLocs` args
-- JNew, JMethod, and JField | 519 | checkExpr (L loc (Dot e x (Just (args, _)))) =
do (t, _) <- checkExpr e
case deThunkOnce t of
JType (JClass _) -> checkExpr (L loc $ JMethod (NonStatic e) x args undefined)
RecordType _ -> checkExpr (L loc $ App (L loc $ RecordProj e x) tuple)
And _ _ -> checkExpr (L loc $ App (L loc $ RecordProj e x) tuple)
_ -> throwError (NotMember x t `withExpr` e) -- TODO: should be x's loc
where tuple = Tuple args `withLocs` args
-- JNew, JMethod, and JField | 519 | checkExpr (L loc (Dot e x (Just (args, _)))) =
do (t, _) <- checkExpr e
case deThunkOnce t of
JType (JClass _) -> checkExpr (L loc $ JMethod (NonStatic e) x args undefined)
RecordType _ -> checkExpr (L loc $ App (L loc $ RecordProj e x) tuple)
And _ _ -> checkExpr (L loc $ App (L loc $ RecordProj e x) tuple)
_ -> throwError (NotMember x t `withExpr` e) -- TODO: should be x's loc
where tuple = Tuple args `withLocs` args
-- JNew, JMethod, and JField | 519 | false | false | 0 | 16 | 158 | 236 | 114 | 122 | null | null |
nuttycom/haskoin | Network/Haskoin/Script/Evaluator.hs | unlicense | nullDummyEnforcer :: ProgramTransition ()
nullDummyEnforcer = do
flgs <- ask
topStack <- ( getStack >>= headOrError )
if ( NULLDUMMY `elem` flgs ) && ( not . null $ topStack )
then programError $ "Non-null dummy stack in multi-sig"
else return ()
where
headOrError s = if null s
then programError "Empty stack where dummy op should be."
else return ( head s )
--------------------------------------------------------------------------------
-- | Based on the IfStack, returns whether the script is within an
-- evaluating if-branch. | 593 | nullDummyEnforcer :: ProgramTransition ()
nullDummyEnforcer = do
flgs <- ask
topStack <- ( getStack >>= headOrError )
if ( NULLDUMMY `elem` flgs ) && ( not . null $ topStack )
then programError $ "Non-null dummy stack in multi-sig"
else return ()
where
headOrError s = if null s
then programError "Empty stack where dummy op should be."
else return ( head s )
--------------------------------------------------------------------------------
-- | Based on the IfStack, returns whether the script is within an
-- evaluating if-branch. | 593 | nullDummyEnforcer = do
flgs <- ask
topStack <- ( getStack >>= headOrError )
if ( NULLDUMMY `elem` flgs ) && ( not . null $ topStack )
then programError $ "Non-null dummy stack in multi-sig"
else return ()
where
headOrError s = if null s
then programError "Empty stack where dummy op should be."
else return ( head s )
--------------------------------------------------------------------------------
-- | Based on the IfStack, returns whether the script is within an
-- evaluating if-branch. | 551 | false | true | 1 | 11 | 141 | 121 | 61 | 60 | null | null |
jstolarek/ghc | includes/CodeGen.Platform.hs | bsd-3-clause | callerSaves (VanillaReg 7 _) = True | 36 | callerSaves (VanillaReg 7 _) = True | 36 | callerSaves (VanillaReg 7 _) = True | 36 | false | false | 0 | 7 | 6 | 17 | 8 | 9 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.