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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
paulrzcz/takusen-oracle
|
Database/Oracle/OCIFunctions.hs
|
bsd-3-clause
|
tSession :: ErrorHandle -> ConnHandle -> IO SessHandle
getSession err conn = liftM castPtr (getHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX oci_ATTR_SESSION)
| 162
|
getSession :: ErrorHandle -> ConnHandle -> IO SessHandle
getSession err conn = liftM castPtr (getHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX oci_ATTR_SESSION)
| 161
|
getSession err conn = liftM castPtr (getHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX oci_ATTR_SESSION)
| 104
| false
| true
| 0
| 9
| 22
| 54
| 25
| 29
| null | null |
rubik/stack-hpc-coveralls
|
src/SHC/Coverage.hs
|
isc
|
readCoverageData :: Config -> String -> IO TestSuiteCoverageData
readCoverageData conf suite = do
let tixPath = hpcDir conf </> suite </> getTixFileName suite
mTix <- readTix tixPath
case mTix of
Nothing -> putStrLn ("Couldn't find the file " ++ tixPath) >>
exitFailure
Just (Tix tixs) -> do
coverageData <- mapM getCoverageData tixs
let filteredCoverageData = filter sourceDirFilter coverageData
return $ M.fromList $ map toFirstAndRest filteredCoverageData
where getCoverageData tixModule@(TixModule modName _ _ tixs) = do
let pkgKey = takeWhile (/= '/') modName
stackProj =
fromMaybe (error $ "readCoverageData/filePath/stackProj: couldn't find " ++ pkgKey) $
find ((== pkgKey) . stackProjectKey) (stackProjects conf)
mix@(Mix origFp _ _ _ _) <- readMix [fromMaybe (stackProjectMixDir stackProj) (mixDir conf)] (Right tixModule)
let fp = normalise $ maybe id (</>) (stackProjectPath stackProj) origFp
source <- BS.readFile fp
return (fp, source, mix, tixs)
sourceDirFilter = not . matchAny excludeDirPatterns . fst4
excludeDirPatterns = [] -- XXX: for now
| 1,366
|
readCoverageData :: Config -> String -> IO TestSuiteCoverageData
readCoverageData conf suite = do
let tixPath = hpcDir conf </> suite </> getTixFileName suite
mTix <- readTix tixPath
case mTix of
Nothing -> putStrLn ("Couldn't find the file " ++ tixPath) >>
exitFailure
Just (Tix tixs) -> do
coverageData <- mapM getCoverageData tixs
let filteredCoverageData = filter sourceDirFilter coverageData
return $ M.fromList $ map toFirstAndRest filteredCoverageData
where getCoverageData tixModule@(TixModule modName _ _ tixs) = do
let pkgKey = takeWhile (/= '/') modName
stackProj =
fromMaybe (error $ "readCoverageData/filePath/stackProj: couldn't find " ++ pkgKey) $
find ((== pkgKey) . stackProjectKey) (stackProjects conf)
mix@(Mix origFp _ _ _ _) <- readMix [fromMaybe (stackProjectMixDir stackProj) (mixDir conf)] (Right tixModule)
let fp = normalise $ maybe id (</>) (stackProjectPath stackProj) origFp
source <- BS.readFile fp
return (fp, source, mix, tixs)
sourceDirFilter = not . matchAny excludeDirPatterns . fst4
excludeDirPatterns = [] -- XXX: for now
| 1,366
|
readCoverageData conf suite = do
let tixPath = hpcDir conf </> suite </> getTixFileName suite
mTix <- readTix tixPath
case mTix of
Nothing -> putStrLn ("Couldn't find the file " ++ tixPath) >>
exitFailure
Just (Tix tixs) -> do
coverageData <- mapM getCoverageData tixs
let filteredCoverageData = filter sourceDirFilter coverageData
return $ M.fromList $ map toFirstAndRest filteredCoverageData
where getCoverageData tixModule@(TixModule modName _ _ tixs) = do
let pkgKey = takeWhile (/= '/') modName
stackProj =
fromMaybe (error $ "readCoverageData/filePath/stackProj: couldn't find " ++ pkgKey) $
find ((== pkgKey) . stackProjectKey) (stackProjects conf)
mix@(Mix origFp _ _ _ _) <- readMix [fromMaybe (stackProjectMixDir stackProj) (mixDir conf)] (Right tixModule)
let fp = normalise $ maybe id (</>) (stackProjectPath stackProj) origFp
source <- BS.readFile fp
return (fp, source, mix, tixs)
sourceDirFilter = not . matchAny excludeDirPatterns . fst4
excludeDirPatterns = [] -- XXX: for now
| 1,301
| false
| true
| 0
| 22
| 457
| 379
| 183
| 196
| null | null |
IanConnolly/aws-sdk-fork
|
AWS/EC2/Instance.hs
|
bsd-3-clause
|
reservationSink :: MonadThrow m
=> Consumer Event m Reservation
reservationSink =
Reservation
<$> getT "reservationId"
<*> getT "ownerId"
<*> groupSetSink
<*> instanceSetSink
<*> getT "requesterId"
| 225
|
reservationSink :: MonadThrow m
=> Consumer Event m Reservation
reservationSink =
Reservation
<$> getT "reservationId"
<*> getT "ownerId"
<*> groupSetSink
<*> instanceSetSink
<*> getT "requesterId"
| 225
|
reservationSink =
Reservation
<$> getT "reservationId"
<*> getT "ownerId"
<*> groupSetSink
<*> instanceSetSink
<*> getT "requesterId"
| 157
| false
| true
| 14
| 7
| 52
| 73
| 34
| 39
| null | null |
svenssonjoel/EmbArBB
|
Intel/ArBB/Backend/ArBB.hs
|
bsd-3-clause
|
finish :: ArBBBackend ()
finish = liftVM $ VM.finish_
| 59
|
finish :: ArBBBackend ()
finish = liftVM $ VM.finish_
| 54
|
finish = liftVM $ VM.finish_
| 29
| false
| true
| 2
| 7
| 14
| 29
| 12
| 17
| null | null |
mit-plv/riscv-semantics
|
src/Spec/ExecuteCSR.hs
|
bsd-3-clause
|
execute (Csrrsi rd zimm csr12) = do
checkPermissions (zimm /= 0) csr12
val <- getCSR (lookupCSR csr12)
when (zimm /= 0) (setCSR (lookupCSR csr12) (val .|. ((fromIntegral:: MachineInt -> t) zimm)))
setRegister rd val
| 223
|
execute (Csrrsi rd zimm csr12) = do
checkPermissions (zimm /= 0) csr12
val <- getCSR (lookupCSR csr12)
when (zimm /= 0) (setCSR (lookupCSR csr12) (val .|. ((fromIntegral:: MachineInt -> t) zimm)))
setRegister rd val
| 223
|
execute (Csrrsi rd zimm csr12) = do
checkPermissions (zimm /= 0) csr12
val <- getCSR (lookupCSR csr12)
when (zimm /= 0) (setCSR (lookupCSR csr12) (val .|. ((fromIntegral:: MachineInt -> t) zimm)))
setRegister rd val
| 223
| false
| false
| 0
| 15
| 41
| 110
| 53
| 57
| null | null |
tjakway/ghcjvm
|
utils/genprimopcode/Syntax.hs
|
bsd-3-clause
|
sane_ty _ _
= False
| 22
|
sane_ty _ _
= False
| 22
|
sane_ty _ _
= False
| 22
| false
| false
| 1
| 5
| 7
| 12
| 5
| 7
| null | null |
kawamuray/ganeti
|
src/Ganeti/OpParams.hs
|
gpl-2.0
|
pDiskChgAmount :: Field
pDiskChgAmount =
withDoc "Disk amount to add or grow to" .
renameField "DiskChgAmount" $ simpleField "amount" [t| NonNegative Int |]
| 160
|
pDiskChgAmount :: Field
pDiskChgAmount =
withDoc "Disk amount to add or grow to" .
renameField "DiskChgAmount" $ simpleField "amount" [t| NonNegative Int |]
| 160
|
pDiskChgAmount =
withDoc "Disk amount to add or grow to" .
renameField "DiskChgAmount" $ simpleField "amount" [t| NonNegative Int |]
| 136
| false
| true
| 0
| 7
| 26
| 34
| 18
| 16
| null | null |
michalkonecny/aern
|
aern-order/src/Numeric/AERN/RefinementOrder/RoundedBasis.hs
|
bsd-3-clause
|
propRoundedBasisJoinMonotone ::
(Eq t, RoundedBasis t, PartialComparison t) =>
t ->
(PartialCompareEffortIndicator t,
PartialJoinEffortIndicator t) ->
LEPair t ->
LEPair t ->
Bool
propRoundedBasisJoinMonotone _ (effortComp, effortInOut)
(LEPair (e1Lower,e1))
(LEPair (e2Lower,e2)) =
case (maybeRLower, maybeR) of
(Just rLower, Just r) ->
case pLeqEff effortComp rLower r of
Just b -> b
Nothing -> True
(_, _) -> True
where
maybeRLower = partialJoinOutEff effortInOut e1Lower e2Lower
maybeR = partialJoinInEff effortInOut e1 e2
| 655
|
propRoundedBasisJoinMonotone ::
(Eq t, RoundedBasis t, PartialComparison t) =>
t ->
(PartialCompareEffortIndicator t,
PartialJoinEffortIndicator t) ->
LEPair t ->
LEPair t ->
Bool
propRoundedBasisJoinMonotone _ (effortComp, effortInOut)
(LEPair (e1Lower,e1))
(LEPair (e2Lower,e2)) =
case (maybeRLower, maybeR) of
(Just rLower, Just r) ->
case pLeqEff effortComp rLower r of
Just b -> b
Nothing -> True
(_, _) -> True
where
maybeRLower = partialJoinOutEff effortInOut e1Lower e2Lower
maybeR = partialJoinInEff effortInOut e1 e2
| 655
|
propRoundedBasisJoinMonotone _ (effortComp, effortInOut)
(LEPair (e1Lower,e1))
(LEPair (e2Lower,e2)) =
case (maybeRLower, maybeR) of
(Just rLower, Just r) ->
case pLeqEff effortComp rLower r of
Just b -> b
Nothing -> True
(_, _) -> True
where
maybeRLower = partialJoinOutEff effortInOut e1Lower e2Lower
maybeR = partialJoinInEff effortInOut e1 e2
| 441
| false
| true
| 1
| 14
| 199
| 202
| 102
| 100
| null | null |
moonKimura/vector-0.10.9.1
|
Data/Vector/Generic/New.hs
|
bsd-3-clause
|
create p = New p
| 16
|
create p = New p
| 16
|
create p = New p
| 16
| false
| false
| 1
| 5
| 4
| 16
| 5
| 11
| null | null |
haskellGardener/yusic
|
src/Yusic.hs
|
mit
|
toKeyGuide (F:G:C :[]) = Just KG_F_EsSus2
| 61
|
toKeyGuide (F:G:C :[]) = Just KG_F_EsSus2
| 61
|
toKeyGuide (F:G:C :[]) = Just KG_F_EsSus2
| 61
| false
| false
| 0
| 10
| 25
| 29
| 14
| 15
| null | null |
qrilka/xlsx
|
src/Codec/Xlsx/Types/StyleSheet.hs
|
mit
|
-- #,##0 ;[Red](#,##0)
stdNumberFormatId NfThousands2DecimalNegativeParens = 39
| 79
|
stdNumberFormatId NfThousands2DecimalNegativeParens = 39
| 56
|
stdNumberFormatId NfThousands2DecimalNegativeParens = 39
| 56
| true
| false
| 0
| 5
| 6
| 10
| 5
| 5
| null | null |
Leonidas-from-XIV/7langs7weeks
|
haskell/day3.hs
|
apache-2.0
|
myMaze = Maze [[Exits 1 [(0,1)], Exits 2 [(1,1), (0,2)], Exits 3 []],
[Exits 4 [], Exits 5 [(1,2)], Exits 6 [(2,2)]],
[Exits 6 [], Exits 8 [], Exits 9 []]]
| 193
|
myMaze = Maze [[Exits 1 [(0,1)], Exits 2 [(1,1), (0,2)], Exits 3 []],
[Exits 4 [], Exits 5 [(1,2)], Exits 6 [(2,2)]],
[Exits 6 [], Exits 8 [], Exits 9 []]]
| 193
|
myMaze = Maze [[Exits 1 [(0,1)], Exits 2 [(1,1), (0,2)], Exits 3 []],
[Exits 4 [], Exits 5 [(1,2)], Exits 6 [(2,2)]],
[Exits 6 [], Exits 8 [], Exits 9 []]]
| 193
| false
| false
| 0
| 10
| 68
| 145
| 81
| 64
| null | null |
GaloisInc/sk-dev-platform
|
libs/SCD/src/SCD/M4/Dependencies.hs
|
bsd-3-clause
|
ppOriginLayerModule :: Origin -> Doc
ppOriginLayerModule (InDefinition _ m) = pp m
| 82
|
ppOriginLayerModule :: Origin -> Doc
ppOriginLayerModule (InDefinition _ m) = pp m
| 82
|
ppOriginLayerModule (InDefinition _ m) = pp m
| 45
| false
| true
| 0
| 7
| 11
| 29
| 14
| 15
| null | null |
wavewave/hoodle-core
|
src/Hoodle/GUI/Menu.hs
|
gpl-3.0
|
color2Int ColorOrange = 8
| 29
|
color2Int ColorOrange = 8
| 29
|
color2Int ColorOrange = 8
| 29
| false
| false
| 0
| 5
| 7
| 9
| 4
| 5
| null | null |
tom-szczarkowski/matasano-crypto-puzzles-solutions
|
set4/MAC.hs
|
mit
|
validKeyedMAC digest key (msg, mac) =
keyedMAC digest key msg == mac
| 71
|
validKeyedMAC digest key (msg, mac) =
keyedMAC digest key msg == mac
| 71
|
validKeyedMAC digest key (msg, mac) =
keyedMAC digest key msg == mac
| 71
| false
| false
| 0
| 6
| 14
| 30
| 15
| 15
| null | null |
nevrenato/HetsAlloy
|
Common/ProverTools.hs
|
gpl-2.0
|
check4jarFile :: String -- ^ environment Variable
-> String -- ^ jar file name
-> IO (Bool, FilePath)
check4jarFile = check4jarFileWithDefault ""
| 149
|
check4jarFile :: String -- ^ environment Variable
-> String -- ^ jar file name
-> IO (Bool, FilePath)
check4jarFile = check4jarFileWithDefault ""
| 149
|
check4jarFile = check4jarFileWithDefault ""
| 43
| false
| true
| 0
| 9
| 25
| 35
| 18
| 17
| null | null |
zsol/visual-graphrewrite
|
GraphRewrite/Internal/Rewrite.hs
|
bsd-3-clause
|
match rs g e (SApp y ys) _
= case rewriteStep' rs e g of
(SApp x xs, bs) -> matches rs g (x:xs) (y:ys) bs
_ -> (g, Nothing)
-- | Fine pattern matching. Returns the rewrite steps needed to match the expression against the pattern.
| 300
|
match rs g e (SApp y ys) _
= case rewriteStep' rs e g of
(SApp x xs, bs) -> matches rs g (x:xs) (y:ys) bs
_ -> (g, Nothing)
-- | Fine pattern matching. Returns the rewrite steps needed to match the expression against the pattern.
| 300
|
match rs g e (SApp y ys) _
= case rewriteStep' rs e g of
(SApp x xs, bs) -> matches rs g (x:xs) (y:ys) bs
_ -> (g, Nothing)
-- | Fine pattern matching. Returns the rewrite steps needed to match the expression against the pattern.
| 300
| false
| false
| 0
| 10
| 117
| 96
| 47
| 49
| null | null |
fibsifan/pandoc
|
src/Text/Pandoc/Readers/HTML.hs
|
gpl-2.0
|
pBody :: TagParser Blocks
pBody = pInTags "body" block
| 54
|
pBody :: TagParser Blocks
pBody = pInTags "body" block
| 54
|
pBody = pInTags "body" block
| 28
| false
| true
| 0
| 6
| 8
| 26
| 10
| 16
| null | null |
mightymoose/liquidhaskell
|
tests/pos/zipper.hs
|
bsd-3-clause
|
{-@ focusDown :: UStack a -> UStack a @-}
focusDown :: Stack a -> Stack a
focusDown = reverseStack . focusUp . reverseStack
| 123
|
focusDown :: Stack a -> Stack a
focusDown = reverseStack . focusUp . reverseStack
| 81
|
focusDown = reverseStack . focusUp . reverseStack
| 49
| true
| true
| 0
| 7
| 22
| 36
| 16
| 20
| null | null |
konn/konnfav
|
Utils.hs
|
bsd-2-clause
|
(=$) :: Monad m => E.Enumeratee ao ai m b -> E.Iteratee ai m b -> E.Iteratee ao m b
(=$) = (E.joinI .) . (E.$$)
| 111
|
(=$) :: Monad m => E.Enumeratee ao ai m b -> E.Iteratee ai m b -> E.Iteratee ao m b
(=$) = (E.joinI .) . (E.$$)
| 111
|
(=$) = (E.joinI .) . (E.$$)
| 27
| false
| true
| 1
| 10
| 25
| 80
| 40
| 40
| null | null |
mightymoose/liquidhaskell
|
benchmarks/llrbtree-0.1.1/Data/Set/BUSplay.hs
|
bsd-3-clause
|
(Node l1 x1 r1) === (Node l2 x2 r2) = x1 == x2 && l1 === l2 && r1 === r2
| 72
|
(Node l1 x1 r1) === (Node l2 x2 r2) = x1 == x2 && l1 === l2 && r1 === r2
| 72
|
(Node l1 x1 r1) === (Node l2 x2 r2) = x1 == x2 && l1 === l2 && r1 === r2
| 72
| false
| false
| 0
| 9
| 20
| 52
| 25
| 27
| null | null |
mstksg/hledger
|
hledger-lib/Hledger/Utils/String.hs
|
gpl-3.0
|
-- | Clip a multi-line string to the specified width and height from the top left.
cliptopleft :: Int -> Int -> String -> String
cliptopleft w h = intercalate "\n" . take h . map (take w) . lines
| 195
|
cliptopleft :: Int -> Int -> String -> String
cliptopleft w h = intercalate "\n" . take h . map (take w) . lines
| 112
|
cliptopleft w h = intercalate "\n" . take h . map (take w) . lines
| 66
| true
| true
| 0
| 9
| 39
| 61
| 28
| 33
| null | null |
bitemyapp/ganeti
|
src/Ganeti/Query/Instance.hs
|
bsd-2-clause
|
-- | Returns a field that retrieves a given NIC's network name.
getIndexedNicNetworkNameField :: Int -> FieldGetter Instance Runtime
getIndexedNicNetworkNameField index =
FieldConfig (\cfg inst -> rsMaybeUnavail $ do
nicObj <- maybeAt index $ instNics inst
nicNetworkId <- nicNetwork nicObj
return $ getNetworkName cfg nicNetworkId)
| 346
|
getIndexedNicNetworkNameField :: Int -> FieldGetter Instance Runtime
getIndexedNicNetworkNameField index =
FieldConfig (\cfg inst -> rsMaybeUnavail $ do
nicObj <- maybeAt index $ instNics inst
nicNetworkId <- nicNetwork nicObj
return $ getNetworkName cfg nicNetworkId)
| 282
|
getIndexedNicNetworkNameField index =
FieldConfig (\cfg inst -> rsMaybeUnavail $ do
nicObj <- maybeAt index $ instNics inst
nicNetworkId <- nicNetwork nicObj
return $ getNetworkName cfg nicNetworkId)
| 213
| true
| true
| 0
| 13
| 58
| 85
| 38
| 47
| null | null |
46elks/samples
|
haskell/send_sms.hs
|
unlicense
|
prepare_sms :: ByteString -> ByteString -> ByteString -> [(ByteString, ByteString)]
prepare_sms to from message =
[("to", to), ("from", from), ("message", message)]
| 168
|
prepare_sms :: ByteString -> ByteString -> ByteString -> [(ByteString, ByteString)]
prepare_sms to from message =
[("to", to), ("from", from), ("message", message)]
| 168
|
prepare_sms to from message =
[("to", to), ("from", from), ("message", message)]
| 84
| false
| true
| 0
| 9
| 24
| 72
| 40
| 32
| null | null |
ktvoelker/cookie-jar
|
test/HttpOnly.hs
|
gpl-3.0
|
test4 = sessionTest "Remove HttpOnly flag from an HTTP source" $ do
recv t (e True) "x=y; HttpOnly"
send t (e True) "x=y"
noSend t (e False)
recv t (e True) "x=z"
send t (e True) "x=z"
send t (e False) "x=z"
| 219
|
test4 = sessionTest "Remove HttpOnly flag from an HTTP source" $ do
recv t (e True) "x=y; HttpOnly"
send t (e True) "x=y"
noSend t (e False)
recv t (e True) "x=z"
send t (e True) "x=z"
send t (e False) "x=z"
| 219
|
test4 = sessionTest "Remove HttpOnly flag from an HTTP source" $ do
recv t (e True) "x=y; HttpOnly"
send t (e True) "x=y"
noSend t (e False)
recv t (e True) "x=z"
send t (e True) "x=z"
send t (e False) "x=z"
| 219
| false
| false
| 0
| 10
| 53
| 107
| 47
| 60
| null | null |
niswegmann/copilot-language
|
src/Copilot/Language/Operators/Integral.hs
|
bsd-3-clause
|
x ^ (Const y) = foldl' ((P.*)) (Const 1) (replicate (P.fromIntegral y) x)
| 82
|
x ^ (Const y) = foldl' ((P.*)) (Const 1) (replicate (P.fromIntegral y) x)
| 82
|
x ^ (Const y) = foldl' ((P.*)) (Const 1) (replicate (P.fromIntegral y) x)
| 82
| false
| false
| 2
| 10
| 21
| 54
| 27
| 27
| null | null |
spinda/liquidhaskell
|
src/Language/Haskell/Liquid/Desugar710/DsGRHSs.hs
|
bsd-3-clause
|
matchGuards (ParStmt {} : _) _ _ _ = panic "matchGuards ParStmt"
| 66
|
matchGuards (ParStmt {} : _) _ _ _ = panic "matchGuards ParStmt"
| 66
|
matchGuards (ParStmt {} : _) _ _ _ = panic "matchGuards ParStmt"
| 66
| false
| false
| 0
| 8
| 13
| 29
| 14
| 15
| null | null |
abakst/liquidhaskell
|
tests/test.hs
|
bsd-3-clause
|
isTest :: FilePath -> Bool
isTest f = takeExtension f == ".hs"
| 64
|
isTest :: FilePath -> Bool
isTest f = takeExtension f == ".hs"
| 64
|
isTest f = takeExtension f == ".hs"
| 35
| false
| true
| 1
| 7
| 13
| 34
| 14
| 20
| null | null |
tangboyun/diagrams-heatmap
|
src/Diagrams/HeatMap/Dendrogram.hs
|
bsd-3-clause
|
dendrogramPath :: Dendrogram Double -> Path V2 Double
dendrogramPath = mconcat . fst . go []
where
go acc (Leaf x) = (acc, (x, 0))
go acc (Branch d l r) = (path : acc'', pos)
where
(acc', (!xL, !yL)) = go acc l
(acc'', (!xR, !yR)) = go acc' r
path = fromVertices [ p2 (xL, yL)
, p2 (xL, d)
, p2 (xR, d)
, p2 (xR, yR)]
pos = (xL + (xR - xL) / 2, d)
| 511
|
dendrogramPath :: Dendrogram Double -> Path V2 Double
dendrogramPath = mconcat . fst . go []
where
go acc (Leaf x) = (acc, (x, 0))
go acc (Branch d l r) = (path : acc'', pos)
where
(acc', (!xL, !yL)) = go acc l
(acc'', (!xR, !yR)) = go acc' r
path = fromVertices [ p2 (xL, yL)
, p2 (xL, d)
, p2 (xR, d)
, p2 (xR, yR)]
pos = (xL + (xR - xL) / 2, d)
| 511
|
dendrogramPath = mconcat . fst . go []
where
go acc (Leaf x) = (acc, (x, 0))
go acc (Branch d l r) = (path : acc'', pos)
where
(acc', (!xL, !yL)) = go acc l
(acc'', (!xR, !yR)) = go acc' r
path = fromVertices [ p2 (xL, yL)
, p2 (xL, d)
, p2 (xR, d)
, p2 (xR, yR)]
pos = (xL + (xR - xL) / 2, d)
| 457
| false
| true
| 0
| 11
| 243
| 231
| 124
| 107
| null | null |
abooij/cubicaltt
|
Eval.hs
|
mit
|
evals :: Env -> [(Ident,Ter)] -> [(Ident,Val)]
evals env bts = [ (b,eval env t) | (b,t) <- bts ]
| 96
|
evals :: Env -> [(Ident,Ter)] -> [(Ident,Val)]
evals env bts = [ (b,eval env t) | (b,t) <- bts ]
| 96
|
evals env bts = [ (b,eval env t) | (b,t) <- bts ]
| 49
| false
| true
| 0
| 8
| 19
| 70
| 40
| 30
| null | null |
agomezl/MonadBox
|
src/MonadBox/URI.hs
|
mit
|
metadata ∷ String
metadata = baseURI ++ "/metadata/auto"
| 56
|
metadata ∷ String
metadata = baseURI ++ "/metadata/auto"
| 56
|
metadata = baseURI ++ "/metadata/auto"
| 38
| false
| true
| 0
| 5
| 7
| 15
| 8
| 7
| null | null |
Solumin/ScriptNScribe
|
src/UI/BreveUI.hs
|
mit
|
parseTrOp :: Parser BreveEval.Trace
parseTrOp = do
parseSymbol "TrOp"
opS <- choice (map parseSymbol BreveLang.mathOps)
let op = case opS of
"+" -> BreveLang.Add
"*" -> BreveLang.Mult
"-" -> BreveLang.Sub
"/" -> BreveLang.Div
BreveEval.TrOp op <$> parseParens parseTrace <*> parseParens parseTrace
| 361
|
parseTrOp :: Parser BreveEval.Trace
parseTrOp = do
parseSymbol "TrOp"
opS <- choice (map parseSymbol BreveLang.mathOps)
let op = case opS of
"+" -> BreveLang.Add
"*" -> BreveLang.Mult
"-" -> BreveLang.Sub
"/" -> BreveLang.Div
BreveEval.TrOp op <$> parseParens parseTrace <*> parseParens parseTrace
| 361
|
parseTrOp = do
parseSymbol "TrOp"
opS <- choice (map parseSymbol BreveLang.mathOps)
let op = case opS of
"+" -> BreveLang.Add
"*" -> BreveLang.Mult
"-" -> BreveLang.Sub
"/" -> BreveLang.Div
BreveEval.TrOp op <$> parseParens parseTrace <*> parseParens parseTrace
| 325
| false
| true
| 0
| 13
| 104
| 109
| 50
| 59
| null | null |
bitemyapp/ghc
|
compiler/basicTypes/OccName.hs
|
bsd-3-clause
|
pprNameSpaceBrief VarName = char 'v'
| 38
|
pprNameSpaceBrief VarName = char 'v'
| 38
|
pprNameSpaceBrief VarName = char 'v'
| 38
| false
| false
| 0
| 5
| 6
| 12
| 5
| 7
| null | null |
mightymoose/liquidhaskell
|
benchmarks/hmatrix-0.15.0.1/lib/Numeric/LinearAlgebra/Algorithms.hs
|
bsd-3-clause
|
i :: Complex Double
i = 0:+1
| 28
|
i :: Complex Double
i = 0:+1
| 28
|
i = 0:+1
| 8
| false
| true
| 2
| 6
| 6
| 26
| 10
| 16
| null | null |
AlexeyRaga/eta
|
compiler/ETA/Prelude/PrimOp.hs
|
bsd-3-clause
|
tagOf_PrimOp TryPutMVarOp = _ILIT(347)
| 38
|
tagOf_PrimOp TryPutMVarOp = _ILIT(347)
| 38
|
tagOf_PrimOp TryPutMVarOp = _ILIT(347)
| 38
| false
| false
| 0
| 6
| 3
| 16
| 7
| 9
| null | null |
trygvis/hledger
|
hledger/Hledger/Cli/Register.hs
|
gpl-3.0
|
mkitem True p b = (ds, p, b)
where ds = case ptransaction p of Just (Transaction{tdate=da,tdescription=de}) -> Just (da,de)
Nothing -> Just (nulldate,"")
-- | Date-sort and split a list of postings into three spans - postings matched
-- by the given display expression, and the preceding and following postings.
| 354
|
mkitem True p b = (ds, p, b)
where ds = case ptransaction p of Just (Transaction{tdate=da,tdescription=de}) -> Just (da,de)
Nothing -> Just (nulldate,"")
-- | Date-sort and split a list of postings into three spans - postings matched
-- by the given display expression, and the preceding and following postings.
| 354
|
mkitem True p b = (ds, p, b)
where ds = case ptransaction p of Just (Transaction{tdate=da,tdescription=de}) -> Just (da,de)
Nothing -> Just (nulldate,"")
-- | Date-sort and split a list of postings into three spans - postings matched
-- by the given display expression, and the preceding and following postings.
| 354
| false
| false
| 0
| 14
| 93
| 89
| 49
| 40
| null | null |
christiaanb/ghc
|
compiler/deSugar/Check.hs
|
bsd-3-clause
|
-- Always succeeds
might_fail_pat _ = False
| 71
|
might_fail_pat _ = False
| 52
|
might_fail_pat _ = False
| 52
| true
| false
| 0
| 5
| 34
| 10
| 5
| 5
| null | null |
the-real-blackh/hexpat
|
Text/XML/Expat/Internal/IO.hs
|
bsd-3-clause
|
encodingToString UTF16 = "UTF-16"
| 36
|
encodingToString UTF16 = "UTF-16"
| 36
|
encodingToString UTF16 = "UTF-16"
| 36
| false
| false
| 0
| 5
| 6
| 9
| 4
| 5
| null | null |
nazrhom/vcs-clojure
|
src/Patches/Diff3.hs
|
bsd-3-clause
|
lvl10 = Alspn
(Scns C1ConsProof
(recurse (Alspn Scp) .@.
keep (UString "Space") .@.
recurse tmp .@.
An))
| 145
|
lvl10 = Alspn
(Scns C1ConsProof
(recurse (Alspn Scp) .@.
keep (UString "Space") .@.
recurse tmp .@.
An))
| 145
|
lvl10 = Alspn
(Scns C1ConsProof
(recurse (Alspn Scp) .@.
keep (UString "Space") .@.
recurse tmp .@.
An))
| 145
| false
| false
| 0
| 14
| 57
| 53
| 25
| 28
| null | null |
frantisekfarka/ghc-dsi
|
compiler/llvmGen/Llvm/Types.hs
|
bsd-3-clause
|
-- | Test if the given 'LlvmType' is a floating point type
isFloat :: LlvmType -> Bool
isFloat LMFloat = True
| 112
|
isFloat :: LlvmType -> Bool
isFloat LMFloat = True
| 53
|
isFloat LMFloat = True
| 25
| true
| true
| 0
| 5
| 23
| 19
| 10
| 9
| null | null |
DougBurke/swish
|
src/Swish/RDF/Parser/NTriples.hs
|
lgpl-2.1
|
is09 = isDigit
| 14
|
is09 = isDigit
| 14
|
is09 = isDigit
| 14
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
fizruk/replay-free
|
examples/AskForkHalt.hs
|
bsd-3-clause
|
evalWithSaveF' (Continue x) = evalF' x
| 38
|
evalWithSaveF' (Continue x) = evalF' x
| 38
|
evalWithSaveF' (Continue x) = evalF' x
| 38
| false
| false
| 0
| 6
| 5
| 19
| 8
| 11
| null | null |
klapaucius/vector-hashtables
|
src/Data/Vector/Hashtables/Internal.hs
|
bsd-3-clause
|
-- | /O(1)/ in the best case, /O(n)/ in the worst case.
-- Insert key and value in dictionary by key's hash.
-- If entry with given key found value will be replaced.
insert :: (MVector ks k, MVector vs v, PrimMonad m, Hashable k, Eq k)
=> Dictionary (PrimState m) ks k vs v -> k -> v -> m ()
insert DRef{..} key' value' = do
d@Dictionary{..} <- readMutVar getDRef
let
hashCode' = hash key' .&. mask
targetBucket = hashCode' `rem` A.length buckets
go i | i >= 0 = do
hc <- hashCode ! i
if hc == hashCode'
then do
k <- key !~ i
if k == key'
then value <~~ i $ value'
else go =<< next ! i
else go =<< next ! i
| otherwise = addOrResize
addOrResize = do
freeCount <- refs ! getFreeCount
if freeCount > 0
then do
index <- refs ! getFreeList
nxt <- next ! index
refs <~ getFreeList $ nxt
refs <~ getFreeCount $ freeCount - 1
add index targetBucket
else do
count <- refs ! getCount
refs <~ getCount $ count + 1
if count == A.length next
then do
nd <- resize d count hashCode' key' value'
writeMutVar getDRef nd
else add (fromIntegral count) (fromIntegral targetBucket)
add !index !targetBucket = do
hashCode <~ index $ hashCode'
b <- buckets ! targetBucket
next <~ index $ b
key <~~ index $ key'
value <~~ index $ value'
buckets <~ targetBucket $ index
go =<< buckets ! targetBucket
| 1,959
|
insert :: (MVector ks k, MVector vs v, PrimMonad m, Hashable k, Eq k)
=> Dictionary (PrimState m) ks k vs v -> k -> v -> m ()
insert DRef{..} key' value' = do
d@Dictionary{..} <- readMutVar getDRef
let
hashCode' = hash key' .&. mask
targetBucket = hashCode' `rem` A.length buckets
go i | i >= 0 = do
hc <- hashCode ! i
if hc == hashCode'
then do
k <- key !~ i
if k == key'
then value <~~ i $ value'
else go =<< next ! i
else go =<< next ! i
| otherwise = addOrResize
addOrResize = do
freeCount <- refs ! getFreeCount
if freeCount > 0
then do
index <- refs ! getFreeList
nxt <- next ! index
refs <~ getFreeList $ nxt
refs <~ getFreeCount $ freeCount - 1
add index targetBucket
else do
count <- refs ! getCount
refs <~ getCount $ count + 1
if count == A.length next
then do
nd <- resize d count hashCode' key' value'
writeMutVar getDRef nd
else add (fromIntegral count) (fromIntegral targetBucket)
add !index !targetBucket = do
hashCode <~ index $ hashCode'
b <- buckets ! targetBucket
next <~ index $ b
key <~~ index $ key'
value <~~ index $ value'
buckets <~ targetBucket $ index
go =<< buckets ! targetBucket
| 1,793
|
insert DRef{..} key' value' = do
d@Dictionary{..} <- readMutVar getDRef
let
hashCode' = hash key' .&. mask
targetBucket = hashCode' `rem` A.length buckets
go i | i >= 0 = do
hc <- hashCode ! i
if hc == hashCode'
then do
k <- key !~ i
if k == key'
then value <~~ i $ value'
else go =<< next ! i
else go =<< next ! i
| otherwise = addOrResize
addOrResize = do
freeCount <- refs ! getFreeCount
if freeCount > 0
then do
index <- refs ! getFreeList
nxt <- next ! index
refs <~ getFreeList $ nxt
refs <~ getFreeCount $ freeCount - 1
add index targetBucket
else do
count <- refs ! getCount
refs <~ getCount $ count + 1
if count == A.length next
then do
nd <- resize d count hashCode' key' value'
writeMutVar getDRef nd
else add (fromIntegral count) (fromIntegral targetBucket)
add !index !targetBucket = do
hashCode <~ index $ hashCode'
b <- buckets ! targetBucket
next <~ index $ b
key <~~ index $ key'
value <~~ index $ value'
buckets <~ targetBucket $ index
go =<< buckets ! targetBucket
| 1,660
| true
| true
| 0
| 19
| 935
| 517
| 247
| 270
| null | null |
Potregon/while
|
src/Parser/While.hs
|
gpl-3.0
|
goto 80 4 = 18
| 14
|
goto 80 4 = 18
| 14
|
goto 80 4 = 18
| 14
| false
| false
| 1
| 5
| 4
| 14
| 5
| 9
| null | null |
termite2/tsl
|
Frontend/Grammar.hs
|
bsd-3-clause
|
relterm' = withPos $
( erel
<|> estruct False
<|> etern False
<|> eapply False
<|> elit False
<|> ebool False
<|> eterm False
<|> ecase False
<|> econd False)
| 246
|
relterm' = withPos $
( erel
<|> estruct False
<|> etern False
<|> eapply False
<|> elit False
<|> ebool False
<|> eterm False
<|> ecase False
<|> econd False)
| 246
|
relterm' = withPos $
( erel
<|> estruct False
<|> etern False
<|> eapply False
<|> elit False
<|> ebool False
<|> eterm False
<|> ecase False
<|> econd False)
| 246
| false
| false
| 0
| 15
| 117
| 69
| 31
| 38
| null | null |
shlevy/arithmoi
|
Math/NumberTheory/Powers/Fourth.hs
|
mit
|
integerFourthRoot' :: Integral a => a -> a
integerFourthRoot' 0 = 0
| 67
|
integerFourthRoot' :: Integral a => a -> a
integerFourthRoot' 0 = 0
| 67
|
integerFourthRoot' 0 = 0
| 24
| false
| true
| 0
| 6
| 11
| 25
| 12
| 13
| null | null |
ra1u/HaskellPitaya
|
src/System/RedPitaya/Arm.hs
|
lgpl-3.0
|
runArm :: FpgaArm a -> FpgaPtr -> IO a
runArm = runReaderT . unFA
| 66
|
runArm :: FpgaArm a -> FpgaPtr -> IO a
runArm = runReaderT . unFA
| 66
|
runArm = runReaderT . unFA
| 27
| false
| true
| 1
| 8
| 14
| 36
| 15
| 21
| null | null |
ghc-android/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
failIOIdKey = mkPreludeMiscIdUnique 38
| 56
|
failIOIdKey = mkPreludeMiscIdUnique 38
| 56
|
failIOIdKey = mkPreludeMiscIdUnique 38
| 56
| false
| false
| 0
| 5
| 21
| 9
| 4
| 5
| null | null |
atodorov/bdcs
|
src/BDCS/NPM/SemVer.hs
|
lgpl-2.1
|
toText :: SemVer -> T.Text
toText SemVer{..} = let
mainver = [T.pack $ show major, ".",
T.pack $ show minor, ".",
T.pack $ show patch]
prever = if null preRelease then [] else "-":idsToText preRelease
buildver = if null buildMeta then [] else "+":idsToText buildMeta
in
T.concat $ mainver ++ prever ++ buildver
where
idsToText ids = intersperse "." $ map idToText ids
idToText (NumericIdentifier i) = T.pack $ show i
idToText (TextIdentifier t) = t
-- Internal type for parsing partial versions
| 565
|
toText :: SemVer -> T.Text
toText SemVer{..} = let
mainver = [T.pack $ show major, ".",
T.pack $ show minor, ".",
T.pack $ show patch]
prever = if null preRelease then [] else "-":idsToText preRelease
buildver = if null buildMeta then [] else "+":idsToText buildMeta
in
T.concat $ mainver ++ prever ++ buildver
where
idsToText ids = intersperse "." $ map idToText ids
idToText (NumericIdentifier i) = T.pack $ show i
idToText (TextIdentifier t) = t
-- Internal type for parsing partial versions
| 565
|
toText SemVer{..} = let
mainver = [T.pack $ show major, ".",
T.pack $ show minor, ".",
T.pack $ show patch]
prever = if null preRelease then [] else "-":idsToText preRelease
buildver = if null buildMeta then [] else "+":idsToText buildMeta
in
T.concat $ mainver ++ prever ++ buildver
where
idsToText ids = intersperse "." $ map idToText ids
idToText (NumericIdentifier i) = T.pack $ show i
idToText (TextIdentifier t) = t
-- Internal type for parsing partial versions
| 538
| false
| true
| 2
| 11
| 153
| 203
| 102
| 101
| null | null |
pikajude/WordNet-ghc74
|
NLP/WordNet.hs
|
bsd-3-clause
|
emptyStack :: [a]
emptyStack = []
| 33
|
emptyStack :: [a]
emptyStack = []
| 33
|
emptyStack = []
| 15
| false
| true
| 0
| 5
| 5
| 16
| 9
| 7
| null | null |
clockworkdevstudio/Idlewild-Lang
|
DWARF.hs
|
bsd-2-clause
|
dwarfTagEncodingToStringMap =
Map.fromList (map (\t -> (fst t :: Int,snd t)) dwarfTags)
| 89
|
dwarfTagEncodingToStringMap =
Map.fromList (map (\t -> (fst t :: Int,snd t)) dwarfTags)
| 89
|
dwarfTagEncodingToStringMap =
Map.fromList (map (\t -> (fst t :: Int,snd t)) dwarfTags)
| 89
| false
| false
| 0
| 11
| 13
| 42
| 22
| 20
| null | null |
andrew-m-h/libmu-HS
|
src/LibMu/Builder.hs
|
bsd-3-clause
|
putExtractValueS :: Int -> SSAVariable -> Maybe ExceptionClause -> WriterT BlockState Builder SSAVariable
putExtractValueS index opnd exec = do
let operation = ExtractValueS (varType opnd) index opnd exec
assT <- let retT = head $ retType operation in lift $ putTypeDef (show retT) retT
assignee <- lift $ createVariable "v" assT
tell $ BlockState ([Assign [assignee] (ExtractValueS (varType opnd) index opnd exec)], [], Nothing)
return assignee
| 462
|
putExtractValueS :: Int -> SSAVariable -> Maybe ExceptionClause -> WriterT BlockState Builder SSAVariable
putExtractValueS index opnd exec = do
let operation = ExtractValueS (varType opnd) index opnd exec
assT <- let retT = head $ retType operation in lift $ putTypeDef (show retT) retT
assignee <- lift $ createVariable "v" assT
tell $ BlockState ([Assign [assignee] (ExtractValueS (varType opnd) index opnd exec)], [], Nothing)
return assignee
| 462
|
putExtractValueS index opnd exec = do
let operation = ExtractValueS (varType opnd) index opnd exec
assT <- let retT = head $ retType operation in lift $ putTypeDef (show retT) retT
assignee <- lift $ createVariable "v" assT
tell $ BlockState ([Assign [assignee] (ExtractValueS (varType opnd) index opnd exec)], [], Nothing)
return assignee
| 356
| false
| true
| 0
| 15
| 82
| 176
| 83
| 93
| null | null |
nlim/portfolio-quote
|
main/GetQuote.hs
|
mit
|
main :: IO ()
main = do
args <- getArgs
putStrLn $ "Got Args: " ++ (show args)
case args of
a1:as -> do
putStrLn $ "Running QuoteLookup using as input: " ++ a1
r <- runAndParseNew a1
printResult r
putStrLn "Done with QuoteLookup"
[] -> do
putStrLn "Please provide a file of transactions"
| 353
|
main :: IO ()
main = do
args <- getArgs
putStrLn $ "Got Args: " ++ (show args)
case args of
a1:as -> do
putStrLn $ "Running QuoteLookup using as input: " ++ a1
r <- runAndParseNew a1
printResult r
putStrLn "Done with QuoteLookup"
[] -> do
putStrLn "Please provide a file of transactions"
| 351
|
main = do
args <- getArgs
putStrLn $ "Got Args: " ++ (show args)
case args of
a1:as -> do
putStrLn $ "Running QuoteLookup using as input: " ++ a1
r <- runAndParseNew a1
printResult r
putStrLn "Done with QuoteLookup"
[] -> do
putStrLn "Please provide a file of transactions"
| 337
| false
| true
| 0
| 13
| 119
| 104
| 46
| 58
| null | null |
m4lvin/HasCacBDD
|
hs/Data/HasCacBDD.hs
|
gpl-2.0
|
-- | Exclusive Or
xor :: Bdd -> Bdd -> Bdd
xor = withTwoBDDs bdd_Operator_Xor
| 77
|
xor :: Bdd -> Bdd -> Bdd
xor = withTwoBDDs bdd_Operator_Xor
| 59
|
xor = withTwoBDDs bdd_Operator_Xor
| 34
| true
| true
| 0
| 8
| 14
| 29
| 13
| 16
| null | null |
aparent/jcc
|
src/ParseJanus.hs
|
gpl-3.0
|
reservedOp = Token.reservedOp lexer
| 35
|
reservedOp = Token.reservedOp lexer
| 35
|
reservedOp = Token.reservedOp lexer
| 35
| false
| false
| 0
| 6
| 3
| 11
| 5
| 6
| null | null |
FranklinChen/hugs98-plus-Sep2006
|
packages/HaXml/src/Text/XML/HaXml/Parse.hs
|
bsd-3-clause
|
elemOpenTag :: XParser ElemTag
elemOpenTag = do
tok TokAnyOpen
e <- elemtag
tok TokAnyClose
return e
-- | For use with stream parsers - accepts a closing tag, provided it
-- matches the given element name.
| 224
|
elemOpenTag :: XParser ElemTag
elemOpenTag = do
tok TokAnyOpen
e <- elemtag
tok TokAnyClose
return e
-- | For use with stream parsers - accepts a closing tag, provided it
-- matches the given element name.
| 224
|
elemOpenTag = do
tok TokAnyOpen
e <- elemtag
tok TokAnyClose
return e
-- | For use with stream parsers - accepts a closing tag, provided it
-- matches the given element name.
| 193
| false
| true
| 0
| 7
| 54
| 41
| 18
| 23
| null | null |
peterokagey/haskellOEIS
|
src/Helpers/Primes.hs
|
apache-2.0
|
properFactors :: Integer -> [Integer]
properFactors = drop 1 . properDivisors
| 77
|
properFactors :: Integer -> [Integer]
properFactors = drop 1 . properDivisors
| 77
|
properFactors = drop 1 . properDivisors
| 39
| false
| true
| 0
| 6
| 10
| 25
| 13
| 12
| null | null |
christiaanb/Idris-dev
|
src/Idris/ElabTerm.hs
|
bsd-3-clause
|
reflectConstant (PtrType) = Var (reflm "PtrType")
| 49
|
reflectConstant (PtrType) = Var (reflm "PtrType")
| 49
|
reflectConstant (PtrType) = Var (reflm "PtrType")
| 49
| false
| false
| 0
| 7
| 5
| 21
| 10
| 11
| null | null |
theNerd247/ariaRacer
|
arweb/app/HtmlTemplates.hs
|
bsd-3-clause
|
bootstrapJS :: H.AttributeValue
bootstrapJS = "/js/bootstrap.min.js"
| 68
|
bootstrapJS :: H.AttributeValue
bootstrapJS = "/js/bootstrap.min.js"
| 68
|
bootstrapJS = "/js/bootstrap.min.js"
| 36
| false
| true
| 0
| 5
| 5
| 13
| 7
| 6
| null | null |
JacquesCarette/literate-scientific-software
|
code/drasil-printers/Language/Drasil/TeX/Helpers.hs
|
bsd-2-clause
|
hyperConfig :: D
hyperConfig = command "hypersetup" hyperSettings
| 65
|
hyperConfig :: D
hyperConfig = command "hypersetup" hyperSettings
| 65
|
hyperConfig = command "hypersetup" hyperSettings
| 48
| false
| true
| 0
| 6
| 7
| 22
| 9
| 13
| null | null |
diogob/haskell-tools
|
src/HaskellTools/Database.hs
|
bsd-3-clause
|
insertExt :: PackageDescription -> Extension -> T.Text
insertExt p e =
toSQL $
insert "private.extensions" cols values
& onConflict .~ doNothing
where
cols = fromList ["package_name", "extension"]
values = fromList [p2name p, e2extension e]
e2extension = T.pack . display
| 291
|
insertExt :: PackageDescription -> Extension -> T.Text
insertExt p e =
toSQL $
insert "private.extensions" cols values
& onConflict .~ doNothing
where
cols = fromList ["package_name", "extension"]
values = fromList [p2name p, e2extension e]
e2extension = T.pack . display
| 291
|
insertExt p e =
toSQL $
insert "private.extensions" cols values
& onConflict .~ doNothing
where
cols = fromList ["package_name", "extension"]
values = fromList [p2name p, e2extension e]
e2extension = T.pack . display
| 236
| false
| true
| 7
| 9
| 58
| 106
| 49
| 57
| null | null |
Bodigrim/katas
|
src/haskell/B-Church-numbers.hs
|
bsd-2-clause
|
pow :: Number -> Number -> Number
pow x (Nr n) = n (mult x) 1
| 61
|
pow :: Number -> Number -> Number
pow x (Nr n) = n (mult x) 1
| 61
|
pow x (Nr n) = n (mult x) 1
| 27
| false
| true
| 0
| 7
| 15
| 45
| 21
| 24
| null | null |
aBhallo/AoC2016
|
Day 4/day4part1.hs
|
mit
|
tabulate :: String -> Table -> Table
tabulate [] table = table
| 62
|
tabulate :: String -> Table -> Table
tabulate [] table = table
| 62
|
tabulate [] table = table
| 25
| false
| true
| 0
| 6
| 11
| 26
| 13
| 13
| null | null |
k16shikano/hpdft
|
src/PDF/Outlines.hs
|
mit
|
findFirst dict =
case findObjFromDict dict "/First" of
Just (ObjRef x) -> Just x
Nothing -> Nothing
| 109
|
findFirst dict =
case findObjFromDict dict "/First" of
Just (ObjRef x) -> Just x
Nothing -> Nothing
| 109
|
findFirst dict =
case findObjFromDict dict "/First" of
Just (ObjRef x) -> Just x
Nothing -> Nothing
| 109
| false
| false
| 3
| 6
| 26
| 39
| 19
| 20
| null | null |
binesiyu/ifl
|
ifpt-master/Utils.hs
|
mit
|
setToList :: (Ord a) => Set a -> [a]
setToList xs = xs
| 54
|
setToList :: (Ord a) => Set a -> [a]
setToList xs = xs
| 54
|
setToList xs = xs
| 17
| false
| true
| 0
| 7
| 12
| 33
| 17
| 16
| null | null |
merijn/lambda-except
|
PrettyPrint.hs
|
bsd-3-clause
|
operator :: String -> Doc
operator = dullyellow . text
| 54
|
operator :: String -> Doc
operator = dullyellow . text
| 54
|
operator = dullyellow . text
| 28
| false
| true
| 1
| 7
| 9
| 27
| 11
| 16
| null | null |
kumasento/accelerate-cuda
|
Data/Array/Accelerate/CUDA/CodeGen.hs
|
bsd-3-clause
|
codegenPrimConst (PrimPi ty) = codegenPi ty
| 49
|
codegenPrimConst (PrimPi ty) = codegenPi ty
| 49
|
codegenPrimConst (PrimPi ty) = codegenPi ty
| 49
| false
| false
| 0
| 7
| 11
| 18
| 8
| 10
| null | null |
tippenein/scrape_the_truth
|
src/Database.hs
|
mit
|
migrateDb:: IO ()
migrateDb = do
putStrLn "migrating database"
runDb $ runMigration migrateAll
| 98
|
migrateDb:: IO ()
migrateDb = do
putStrLn "migrating database"
runDb $ runMigration migrateAll
| 98
|
migrateDb = do
putStrLn "migrating database"
runDb $ runMigration migrateAll
| 80
| false
| true
| 0
| 8
| 16
| 32
| 14
| 18
| null | null |
1yefuwang1/haskell99problems
|
src/H99/BinaryTrees.hs
|
bsd-3-clause
|
cbalTree 1 = return $ leaf 'x'
| 30
|
cbalTree 1 = return $ leaf 'x'
| 30
|
cbalTree 1 = return $ leaf 'x'
| 30
| false
| false
| 0
| 6
| 6
| 16
| 7
| 9
| null | null |
fpco/cabal
|
Cabal/Distribution/PackageDescription/Configuration.hs
|
bsd-3-clause
|
fromDepMap :: DependencyMap -> [Dependency]
fromDepMap m = [ Dependency p vr | (p,vr) <- toList (unDependencyMap m) ]
| 117
|
fromDepMap :: DependencyMap -> [Dependency]
fromDepMap m = [ Dependency p vr | (p,vr) <- toList (unDependencyMap m) ]
| 117
|
fromDepMap m = [ Dependency p vr | (p,vr) <- toList (unDependencyMap m) ]
| 73
| false
| true
| 0
| 11
| 18
| 58
| 28
| 30
| null | null |
mtlstats/mtlstats
|
src/Mtlstats/Control/NewGame.hs
|
gpl-3.0
|
recordGoalC :: Controller
recordGoalC = Controller
{ drawController = \s -> let
(game, goal) = gameGoal s
in drawPrompt (recordGoalPrompt game goal) s
, handleController = \e -> do
(game, goal) <- gets gameGoal
promptHandler (recordGoalPrompt game goal) e
return True
}
| 295
|
recordGoalC :: Controller
recordGoalC = Controller
{ drawController = \s -> let
(game, goal) = gameGoal s
in drawPrompt (recordGoalPrompt game goal) s
, handleController = \e -> do
(game, goal) <- gets gameGoal
promptHandler (recordGoalPrompt game goal) e
return True
}
| 295
|
recordGoalC = Controller
{ drawController = \s -> let
(game, goal) = gameGoal s
in drawPrompt (recordGoalPrompt game goal) s
, handleController = \e -> do
(game, goal) <- gets gameGoal
promptHandler (recordGoalPrompt game goal) e
return True
}
| 269
| false
| true
| 0
| 13
| 67
| 111
| 55
| 56
| null | null |
goldfirere/singletons
|
singletons-base/tests/compile-and-dump/Singletons/PatternMatching.hs
|
bsd-3-clause
|
test5 :: Proxy Fls -> Proxy False
test5 = id
| 44
|
test5 :: Proxy Fls -> Proxy False
test5 = id
| 44
|
test5 = id
| 10
| false
| true
| 0
| 6
| 9
| 21
| 10
| 11
| null | null |
thedward/haskell-ogdl
|
Text/OGDL/Parsec.hs
|
bsd-3-clause
|
-- // [3] char_break ::= 0x0d | 0x0a
breakChar = oneOf "\x0d\x0a"
| 70
|
breakChar = oneOf "\x0d\x0a"
| 28
|
breakChar = oneOf "\x0d\x0a"
| 28
| true
| false
| 0
| 5
| 16
| 10
| 5
| 5
| null | null |
GaloisInc/ivory-tower-stm32
|
ivory-bsp-stm32/src/Ivory/BSP/STM32/Peripheral/DMA/Peripheral.hs
|
bsd-3-clause
|
showDMAStreamRegs :: DMAStreamRegs -> String
showDMAStreamRegs regs = concat $
[ showReg (dmaStreamCR regs)
, showReg (dmaStreamNDTR regs)
, showReg (dmaStreamPAR regs)
, showReg (dmaStreamM0AR regs)
, showReg (dmaStreamM1AR regs)
, showReg (dmaStreamFCR regs)
]
| 276
|
showDMAStreamRegs :: DMAStreamRegs -> String
showDMAStreamRegs regs = concat $
[ showReg (dmaStreamCR regs)
, showReg (dmaStreamNDTR regs)
, showReg (dmaStreamPAR regs)
, showReg (dmaStreamM0AR regs)
, showReg (dmaStreamM1AR regs)
, showReg (dmaStreamFCR regs)
]
| 276
|
showDMAStreamRegs regs = concat $
[ showReg (dmaStreamCR regs)
, showReg (dmaStreamNDTR regs)
, showReg (dmaStreamPAR regs)
, showReg (dmaStreamM0AR regs)
, showReg (dmaStreamM1AR regs)
, showReg (dmaStreamFCR regs)
]
| 231
| false
| true
| 0
| 9
| 48
| 94
| 47
| 47
| null | null |
authchir/mini-ml
|
test/Spec.hs
|
isc
|
closureTests = [
("let n = 1 * 5 in " ++
"let f = fun x -> fun y -> x + y + n in " ++
"f 1 2",
"let x0 = 1 * 5 in\n" ++
"let x1 = Closure (fun env -> fun x -> " ++
"let x2 = Closure (fun env -> fun y -> " ++
"let x3 = env.0 + y in\n" ++
"let x4 = x3 + env.1 in\n" ++
"x4, [x,env.0]) in\n" ++
"x2, [x0]) in\n" ++
"let x5 = x1 1 in\n" ++
"let x6 = x5 2 in\n" ++
"x6"),
("let x = 5 in let f = fun y -> x + y in f 3",
"let x0 = Closure (fun env -> fun y -> " ++
"let x1 = 5 + y in\n" ++
"x1, []) in\n" ++
"let x2 = x0 3 in\n" ++
"x2"),
("let rec f = fun x -> fun y -> f y x in f 1 2",
"let x0 = Closure (fun env -> fun x -> " ++
"let x1 = Closure (fun env -> fun y -> " ++
"let x2 = env.0 y in\n" ++
"let x3 = x2 env.1 in\n" ++
"x3, [env.self,x]) in\n" ++
"x1, []) in\n" ++
"let x4 = x0 1 in\n" ++
"let x5 = x4 2 in\n" ++
"x5"),
("let x = 5 + 3 in let f = fun y -> x + y in f 3",
"let x0 = 5 + 3 in\n" ++
"let x1 = Closure (fun env -> fun y -> " ++
"let x2 = env.0 + y in\n" ++
"x2, [x0]) in\n" ++
"let x3 = x1 3 in\n" ++
"x3"),
("let rec sum = fun n -> if n = 0 then 0 else n + sum (n - 1) in sum 3",
"let x0 = Closure (fun env -> fun n -> " ++
"let x1 = n = 0 in\n" ++
"let x2 = if x1 then 0 else " ++
"let x3 = n - 1 in\n" ++
"let x4 = env.self x3 in\n" ++
"let x5 = n + x4 in\n" ++
"x5 in\n" ++
"x2, []) in\n" ++
"let x6 = x0 3 in\n" ++
"x6")
]
| 1,657
|
closureTests = [
("let n = 1 * 5 in " ++
"let f = fun x -> fun y -> x + y + n in " ++
"f 1 2",
"let x0 = 1 * 5 in\n" ++
"let x1 = Closure (fun env -> fun x -> " ++
"let x2 = Closure (fun env -> fun y -> " ++
"let x3 = env.0 + y in\n" ++
"let x4 = x3 + env.1 in\n" ++
"x4, [x,env.0]) in\n" ++
"x2, [x0]) in\n" ++
"let x5 = x1 1 in\n" ++
"let x6 = x5 2 in\n" ++
"x6"),
("let x = 5 in let f = fun y -> x + y in f 3",
"let x0 = Closure (fun env -> fun y -> " ++
"let x1 = 5 + y in\n" ++
"x1, []) in\n" ++
"let x2 = x0 3 in\n" ++
"x2"),
("let rec f = fun x -> fun y -> f y x in f 1 2",
"let x0 = Closure (fun env -> fun x -> " ++
"let x1 = Closure (fun env -> fun y -> " ++
"let x2 = env.0 y in\n" ++
"let x3 = x2 env.1 in\n" ++
"x3, [env.self,x]) in\n" ++
"x1, []) in\n" ++
"let x4 = x0 1 in\n" ++
"let x5 = x4 2 in\n" ++
"x5"),
("let x = 5 + 3 in let f = fun y -> x + y in f 3",
"let x0 = 5 + 3 in\n" ++
"let x1 = Closure (fun env -> fun y -> " ++
"let x2 = env.0 + y in\n" ++
"x2, [x0]) in\n" ++
"let x3 = x1 3 in\n" ++
"x3"),
("let rec sum = fun n -> if n = 0 then 0 else n + sum (n - 1) in sum 3",
"let x0 = Closure (fun env -> fun n -> " ++
"let x1 = n = 0 in\n" ++
"let x2 = if x1 then 0 else " ++
"let x3 = n - 1 in\n" ++
"let x4 = env.self x3 in\n" ++
"let x5 = n + x4 in\n" ++
"x5 in\n" ++
"x2, []) in\n" ++
"let x6 = x0 3 in\n" ++
"x6")
]
| 1,657
|
closureTests = [
("let n = 1 * 5 in " ++
"let f = fun x -> fun y -> x + y + n in " ++
"f 1 2",
"let x0 = 1 * 5 in\n" ++
"let x1 = Closure (fun env -> fun x -> " ++
"let x2 = Closure (fun env -> fun y -> " ++
"let x3 = env.0 + y in\n" ++
"let x4 = x3 + env.1 in\n" ++
"x4, [x,env.0]) in\n" ++
"x2, [x0]) in\n" ++
"let x5 = x1 1 in\n" ++
"let x6 = x5 2 in\n" ++
"x6"),
("let x = 5 in let f = fun y -> x + y in f 3",
"let x0 = Closure (fun env -> fun y -> " ++
"let x1 = 5 + y in\n" ++
"x1, []) in\n" ++
"let x2 = x0 3 in\n" ++
"x2"),
("let rec f = fun x -> fun y -> f y x in f 1 2",
"let x0 = Closure (fun env -> fun x -> " ++
"let x1 = Closure (fun env -> fun y -> " ++
"let x2 = env.0 y in\n" ++
"let x3 = x2 env.1 in\n" ++
"x3, [env.self,x]) in\n" ++
"x1, []) in\n" ++
"let x4 = x0 1 in\n" ++
"let x5 = x4 2 in\n" ++
"x5"),
("let x = 5 + 3 in let f = fun y -> x + y in f 3",
"let x0 = 5 + 3 in\n" ++
"let x1 = Closure (fun env -> fun y -> " ++
"let x2 = env.0 + y in\n" ++
"x2, [x0]) in\n" ++
"let x3 = x1 3 in\n" ++
"x3"),
("let rec sum = fun n -> if n = 0 then 0 else n + sum (n - 1) in sum 3",
"let x0 = Closure (fun env -> fun n -> " ++
"let x1 = n = 0 in\n" ++
"let x2 = if x1 then 0 else " ++
"let x3 = n - 1 in\n" ++
"let x4 = env.self x3 in\n" ++
"let x5 = n + x4 in\n" ++
"x5 in\n" ++
"x2, []) in\n" ++
"let x6 = x0 3 in\n" ++
"x6")
]
| 1,657
| false
| false
| 0
| 15
| 693
| 199
| 107
| 92
| null | null |
f1ori/hadcc
|
Udp.hs
|
gpl-3.0
|
sendUdp :: Socket -> String -> Integer -> String -> IO ()
sendUdp sock ip port str = do
host <- inet_addr ip
sendTo sock str (SockAddrInet (fromInteger port) host)
return ()
-- vim: sw=4 expandtab
| 210
|
sendUdp :: Socket -> String -> Integer -> String -> IO ()
sendUdp sock ip port str = do
host <- inet_addr ip
sendTo sock str (SockAddrInet (fromInteger port) host)
return ()
-- vim: sw=4 expandtab
| 210
|
sendUdp sock ip port str = do
host <- inet_addr ip
sendTo sock str (SockAddrInet (fromInteger port) host)
return ()
-- vim: sw=4 expandtab
| 152
| false
| true
| 0
| 12
| 49
| 89
| 40
| 49
| null | null |
kim/amazonka
|
amazonka-ecs/gen/Network/AWS/ECS/Types.hs
|
mpl-2.0
|
-- | The Amazon Resource Name (ARN) of the task.
cTaskArn :: Lens' Container (Maybe Text)
cTaskArn = lens _cTaskArn (\s a -> s { _cTaskArn = a })
| 145
|
cTaskArn :: Lens' Container (Maybe Text)
cTaskArn = lens _cTaskArn (\s a -> s { _cTaskArn = a })
| 96
|
cTaskArn = lens _cTaskArn (\s a -> s { _cTaskArn = a })
| 55
| true
| true
| 0
| 9
| 28
| 46
| 25
| 21
| null | null |
mikeyhc/harkerbot
|
src/Main.hs
|
bsd-3-clause
|
write :: String -> Message -> Bot ()
write s m = do
h <- asks socket
liftIO $ hWrite h s m
| 98
|
write :: String -> Message -> Bot ()
write s m = do
h <- asks socket
liftIO $ hWrite h s m
| 98
|
write s m = do
h <- asks socket
liftIO $ hWrite h s m
| 61
| false
| true
| 0
| 8
| 30
| 53
| 24
| 29
| null | null |
ShellShoccar-jpn/Open-usp-Tukubai
|
COMMANDS.HS/mdate.hs
|
mit
|
filterMode (FMonthPlus f1 sign f2 file) = readF file >>= filterMonthPlus f1 sign f2
| 83
|
filterMode (FMonthPlus f1 sign f2 file) = readF file >>= filterMonthPlus f1 sign f2
| 83
|
filterMode (FMonthPlus f1 sign f2 file) = readF file >>= filterMonthPlus f1 sign f2
| 83
| false
| false
| 0
| 7
| 13
| 35
| 16
| 19
| null | null |
elitak/frag
|
src/Render.hs
|
gpl-2.0
|
renderObjects :: IORef(Camera) -> HashTable String Model ->
Frustum -> BSPMap -> ObsObjState -> IO()
renderObjects camRef mdels frust mp oos
| isRay oos = renderRay oos
| isProjectile oos = renderProjectile oos
| isAICube oos = renderEnemy camRef mdels frust mp oos
| otherwise = return ()
| 323
|
renderObjects :: IORef(Camera) -> HashTable String Model ->
Frustum -> BSPMap -> ObsObjState -> IO()
renderObjects camRef mdels frust mp oos
| isRay oos = renderRay oos
| isProjectile oos = renderProjectile oos
| isAICube oos = renderEnemy camRef mdels frust mp oos
| otherwise = return ()
| 323
|
renderObjects camRef mdels frust mp oos
| isRay oos = renderRay oos
| isProjectile oos = renderProjectile oos
| isAICube oos = renderEnemy camRef mdels frust mp oos
| otherwise = return ()
| 218
| false
| true
| 3
| 11
| 81
| 116
| 54
| 62
| null | null |
mikeizbicki/dominion
|
src/Dominion/Rules.hs
|
bsd-3-clause
|
countNumCards :: PlayerState -> Card -> Int
countNumCards ps c = length $ filter (==c) $ getAllCards ps
| 103
|
countNumCards :: PlayerState -> Card -> Int
countNumCards ps c = length $ filter (==c) $ getAllCards ps
| 103
|
countNumCards ps c = length $ filter (==c) $ getAllCards ps
| 59
| false
| true
| 0
| 8
| 17
| 46
| 22
| 24
| null | null |
skatenerd/what-is-it-really
|
app/Main.hs
|
bsd-3-clause
|
readme = "Your computer represents non-whole numbers imprecisely.\
\ It does this so that it can use a bounded amount of space, and so that\
\ numbers will be easy to add and multiply. This is a tool to show you\
\ how a given number is represented within your computer (and how that differs from what you thought).\
\ The \"float\" route corresponds to a 32-bit representation and the \"double\" route corresponds\
\ to a 64-bit representation"
| 448
|
readme = "Your computer represents non-whole numbers imprecisely.\
\ It does this so that it can use a bounded amount of space, and so that\
\ numbers will be easy to add and multiply. This is a tool to show you\
\ how a given number is represented within your computer (and how that differs from what you thought).\
\ The \"float\" route corresponds to a 32-bit representation and the \"double\" route corresponds\
\ to a 64-bit representation"
| 448
|
readme = "Your computer represents non-whole numbers imprecisely.\
\ It does this so that it can use a bounded amount of space, and so that\
\ numbers will be easy to add and multiply. This is a tool to show you\
\ how a given number is represented within your computer (and how that differs from what you thought).\
\ The \"float\" route corresponds to a 32-bit representation and the \"double\" route corresponds\
\ to a 64-bit representation"
| 448
| false
| false
| 1
| 5
| 80
| 10
| 3
| 7
| null | null |
svalaskevicius/hob
|
test/HobTest/Control.hs
|
gpl-3.0
|
runCtxActions :: Context -> App() -> IO()
runCtxActions ctx actions = do
deferredRunner ctx actions
flushEvents
| 119
|
runCtxActions :: Context -> App() -> IO()
runCtxActions ctx actions = do
deferredRunner ctx actions
flushEvents
| 119
|
runCtxActions ctx actions = do
deferredRunner ctx actions
flushEvents
| 77
| false
| true
| 0
| 8
| 23
| 45
| 20
| 25
| null | null |
flowbox-public/accelerate-cuda
|
Data/Array/Accelerate/CUDA/CodeGen/Constant.hs
|
bsd-3-clause
|
primMaxBound (NonNumBoundedType ty) | NonNumDict <- nonNumDict ty = nonnum ty maxBound
| 94
|
primMaxBound (NonNumBoundedType ty) | NonNumDict <- nonNumDict ty = nonnum ty maxBound
| 94
|
primMaxBound (NonNumBoundedType ty) | NonNumDict <- nonNumDict ty = nonnum ty maxBound
| 94
| false
| false
| 0
| 9
| 19
| 33
| 14
| 19
| null | null |
Yogu/haskell-resolve
|
Resolver.hs
|
gpl-2.0
|
-- Helpers
-- | Converts positive to negative and negative to positive literal.
negatedLiteral :: Literal -> Literal
negatedLiteral (NegativeLiteral name) = PositiveLiteral name
| 178
|
negatedLiteral :: Literal -> Literal
negatedLiteral (NegativeLiteral name) = PositiveLiteral name
| 97
|
negatedLiteral (NegativeLiteral name) = PositiveLiteral name
| 60
| true
| true
| 0
| 7
| 24
| 29
| 15
| 14
| null | null |
uroboros/haskell_design_patterns
|
chapter4/1_folding_over_lists.hs
|
mit
|
{-
+ 2 = 2
+ 3 = 5
+ 5 = 10
+ 7 = 17
17
-}
-- ... using foldM:
doSumStrict' = foldM doPlus
where
doPlus acc x = do
putStrLn $ " + " ++ (show x) ++ " = " ++ (show acc')
return acc'
where acc' = acc + x
| 242
|
doSumStrict' = foldM doPlus
where
doPlus acc x = do
putStrLn $ " + " ++ (show x) ++ " = " ++ (show acc')
return acc'
where acc' = acc + x
| 163
|
doSumStrict' = foldM doPlus
where
doPlus acc x = do
putStrLn $ " + " ++ (show x) ++ " = " ++ (show acc')
return acc'
where acc' = acc + x
| 163
| true
| false
| 0
| 11
| 97
| 72
| 35
| 37
| null | null |
gavilancomun/kakuro-haskell
|
Kakuro.hs
|
apache-2.0
|
draw (Value [x]) = " " ++ show x ++ " "
| 47
|
draw (Value [x]) = " " ++ show x ++ " "
| 47
|
draw (Value [x]) = " " ++ show x ++ " "
| 47
| false
| false
| 0
| 8
| 19
| 29
| 14
| 15
| null | null |
danplubell/hmp3-phoenix
|
src/Style.hs
|
gpl-3.0
|
fgCursCol :: Color -> CColor
fgCursCol c = case c of
RGB 0 0 0 -> CColor (nullA, cblack)
RGB 128 128 128 -> CColor (boldA, cblack)
RGB 139 0 0 -> CColor (nullA, cred)
RGB 255 0 0 -> CColor (boldA, cred)
RGB 0 100 0 -> CColor (nullA, cgreen)
RGB 0 128 0 -> CColor (boldA, cgreen)
RGB 165 42 42 -> CColor (nullA, cyellow)
RGB 255 255 0 -> CColor (boldA, cyellow)
RGB 0 0 139 -> CColor (nullA, cblue)
RGB 0 0 255 -> CColor (boldA, cblue)
RGB 128 0 128 -> CColor (nullA, cmagenta)
RGB 255 0 255 -> CColor (boldA, cmagenta)
RGB 0 139 139 -> CColor (nullA, ccyan)
RGB 0 255 255 -> CColor (boldA, ccyan)
RGB 165 165 165 -> CColor (nullA, cwhite)
RGB 255 255 255 -> CColor (boldA, cwhite)
Default -> CColor (nullA, defaultColor)
Reverse -> CColor (reverseA, defaultColor)
_ -> CColor (nullA, cblack) -- NB
| 983
|
fgCursCol :: Color -> CColor
fgCursCol c = case c of
RGB 0 0 0 -> CColor (nullA, cblack)
RGB 128 128 128 -> CColor (boldA, cblack)
RGB 139 0 0 -> CColor (nullA, cred)
RGB 255 0 0 -> CColor (boldA, cred)
RGB 0 100 0 -> CColor (nullA, cgreen)
RGB 0 128 0 -> CColor (boldA, cgreen)
RGB 165 42 42 -> CColor (nullA, cyellow)
RGB 255 255 0 -> CColor (boldA, cyellow)
RGB 0 0 139 -> CColor (nullA, cblue)
RGB 0 0 255 -> CColor (boldA, cblue)
RGB 128 0 128 -> CColor (nullA, cmagenta)
RGB 255 0 255 -> CColor (boldA, cmagenta)
RGB 0 139 139 -> CColor (nullA, ccyan)
RGB 0 255 255 -> CColor (boldA, ccyan)
RGB 165 165 165 -> CColor (nullA, cwhite)
RGB 255 255 255 -> CColor (boldA, cwhite)
Default -> CColor (nullA, defaultColor)
Reverse -> CColor (reverseA, defaultColor)
_ -> CColor (nullA, cblack) -- NB
| 983
|
fgCursCol c = case c of
RGB 0 0 0 -> CColor (nullA, cblack)
RGB 128 128 128 -> CColor (boldA, cblack)
RGB 139 0 0 -> CColor (nullA, cred)
RGB 255 0 0 -> CColor (boldA, cred)
RGB 0 100 0 -> CColor (nullA, cgreen)
RGB 0 128 0 -> CColor (boldA, cgreen)
RGB 165 42 42 -> CColor (nullA, cyellow)
RGB 255 255 0 -> CColor (boldA, cyellow)
RGB 0 0 139 -> CColor (nullA, cblue)
RGB 0 0 255 -> CColor (boldA, cblue)
RGB 128 0 128 -> CColor (nullA, cmagenta)
RGB 255 0 255 -> CColor (boldA, cmagenta)
RGB 0 139 139 -> CColor (nullA, ccyan)
RGB 0 255 255 -> CColor (boldA, ccyan)
RGB 165 165 165 -> CColor (nullA, cwhite)
RGB 255 255 255 -> CColor (boldA, cwhite)
Default -> CColor (nullA, defaultColor)
Reverse -> CColor (reverseA, defaultColor)
_ -> CColor (nullA, cblack) -- NB
| 954
| false
| true
| 20
| 6
| 341
| 386
| 212
| 174
| null | null |
raichoo/Idris-dev
|
src/IRTS/CodegenJavaScript.hs
|
bsd-3-clause
|
jsSTOREOLD :: CompileInfo ->JS
jsSTOREOLD _ = JSAssign (JSProj jsMYOLDBASE "addr") jsSTACKBASE
| 94
|
jsSTOREOLD :: CompileInfo ->JS
jsSTOREOLD _ = JSAssign (JSProj jsMYOLDBASE "addr") jsSTACKBASE
| 94
|
jsSTOREOLD _ = JSAssign (JSProj jsMYOLDBASE "addr") jsSTACKBASE
| 63
| false
| true
| 0
| 7
| 11
| 31
| 15
| 16
| null | null |
UoYCS-plasma/LazySmallCheck2012
|
suite/performance/Benchmarks/Mux.hs
|
bsd-3-clause
|
num (a:as) = (if a then 1 else 0) + 2 * num as
| 57
|
num (a:as) = (if a then 1 else 0) + 2 * num as
| 57
|
num (a:as) = (if a then 1 else 0) + 2 * num as
| 57
| false
| false
| 0
| 8
| 24
| 39
| 20
| 19
| null | null |
DavidAlphaFox/yesod
|
yesod/Yesod/Default/Config2.hs
|
mit
|
makeYesodLogger :: LoggerSet -> IO Logger
makeYesodLogger loggerSet' = do
(getter, _) <- clockDateCacher
return $! Yesod.Core.Types.Logger loggerSet' getter
| 164
|
makeYesodLogger :: LoggerSet -> IO Logger
makeYesodLogger loggerSet' = do
(getter, _) <- clockDateCacher
return $! Yesod.Core.Types.Logger loggerSet' getter
| 164
|
makeYesodLogger loggerSet' = do
(getter, _) <- clockDateCacher
return $! Yesod.Core.Types.Logger loggerSet' getter
| 122
| false
| true
| 0
| 9
| 26
| 50
| 25
| 25
| null | null |
haroldcarr/learn-haskell-coq-ml-etc
|
haskell/course/2013-11-nicta/src/Course/List.hs
|
unlicense
|
lengthGT4C _ = False
| 20
|
lengthGT4C _ = False
| 20
|
lengthGT4C _ = False
| 20
| false
| false
| 0
| 4
| 3
| 10
| 4
| 6
| null | null |
koengit/turbospec
|
TurboSpec.hs
|
mit
|
eval sub ((p,xs):<=>:b) =
fromDyn (app p [ a | x <- xs, Just a <- [lookup x sub] ])
(undefined :: Bool)
== b
| 130
|
eval sub ((p,xs):<=>:b) =
fromDyn (app p [ a | x <- xs, Just a <- [lookup x sub] ])
(undefined :: Bool)
== b
| 130
|
eval sub ((p,xs):<=>:b) =
fromDyn (app p [ a | x <- xs, Just a <- [lookup x sub] ])
(undefined :: Bool)
== b
| 130
| false
| false
| 0
| 13
| 46
| 77
| 40
| 37
| null | null |
mhlakhani/hlisp
|
src/Environment.hs
|
mit
|
addSymbols :: Environment -> [(Name, LispVal)] -> Environment
addSymbols !env !syms = env'
where
helper !e !(n,v) = addSymbol e n v
!env' = foldl' helper env syms
| 182
|
addSymbols :: Environment -> [(Name, LispVal)] -> Environment
addSymbols !env !syms = env'
where
helper !e !(n,v) = addSymbol e n v
!env' = foldl' helper env syms
| 182
|
addSymbols !env !syms = env'
where
helper !e !(n,v) = addSymbol e n v
!env' = foldl' helper env syms
| 120
| false
| true
| 0
| 8
| 47
| 77
| 37
| 40
| null | null |
abakst/symmetry
|
checker/src/Symmetry/SymbEx.hs
|
mit
|
symCons :: SymbEx a -> SymbEx [a] -> SymbEx [a]
symCons x l
= SE $ do xv <- runSE x
AList _ xv' <- runSE l
return $ case xv' of
Nothing -> AList Nothing (Just xv)
Just xv' -> AList Nothing (Just $ xv `join` xv')
| 293
|
symCons :: SymbEx a -> SymbEx [a] -> SymbEx [a]
symCons x l
= SE $ do xv <- runSE x
AList _ xv' <- runSE l
return $ case xv' of
Nothing -> AList Nothing (Just xv)
Just xv' -> AList Nothing (Just $ xv `join` xv')
| 293
|
symCons x l
= SE $ do xv <- runSE x
AList _ xv' <- runSE l
return $ case xv' of
Nothing -> AList Nothing (Just xv)
Just xv' -> AList Nothing (Just $ xv `join` xv')
| 245
| false
| true
| 2
| 15
| 129
| 129
| 59
| 70
| null | null |
mgsloan/curve
|
Data/Curve/Util.hs
|
bsd-3-clause
|
nest n f x = f (nest (n-1) f x)
| 31
|
nest n f x = f (nest (n-1) f x)
| 31
|
nest n f x = f (nest (n-1) f x)
| 31
| false
| false
| 1
| 9
| 9
| 39
| 16
| 23
| null | null |
bixuanzju/fcore
|
lib/SymbolicEvaluator.hs
|
bsd-2-clause
|
-- big-step interpreter
eval :: Expr () Value -> Value
eval (Var _ x) = x
| 73
|
eval :: Expr () Value -> Value
eval (Var _ x) = x
| 49
|
eval (Var _ x) = x
| 18
| true
| true
| 0
| 7
| 15
| 34
| 17
| 17
| null | null |
fibsifan/pandoc
|
src/Text/Pandoc/Writers/ODT.hs
|
gpl-2.0
|
transformPicMath _ entriesRef (Math t math) = do
entries <- readIORef entriesRef
let dt = if t == InlineMath then DisplayInline else DisplayBlock
case writeMathML dt <$> readTeX math of
Left _ -> return $ Math t math
Right r -> do
let conf = useShortEmptyTags (const False) defaultConfigPP
let mathml = ppcTopElement conf r
epochtime <- floor `fmap` getPOSIXTime
let dirname = "Formula-" ++ show (length entries) ++ "/"
let fname = dirname ++ "content.xml"
let entry = toEntry fname epochtime (fromStringLazy mathml)
modifyIORef entriesRef (entry:)
return $ RawInline (Format "opendocument") $ render Nothing $
inTags False "draw:frame" [("text:anchor-type",
if t == DisplayMath
then "paragraph"
else "as-char")
,("style:vertical-pos", "middle")
,("style:vertical-rel", "text")] $
selfClosingTag "draw:object" [("xlink:href", dirname)
, ("xlink:type", "simple")
, ("xlink:show", "embed")
, ("xlink:actuate", "onLoad")]
| 1,352
|
transformPicMath _ entriesRef (Math t math) = do
entries <- readIORef entriesRef
let dt = if t == InlineMath then DisplayInline else DisplayBlock
case writeMathML dt <$> readTeX math of
Left _ -> return $ Math t math
Right r -> do
let conf = useShortEmptyTags (const False) defaultConfigPP
let mathml = ppcTopElement conf r
epochtime <- floor `fmap` getPOSIXTime
let dirname = "Formula-" ++ show (length entries) ++ "/"
let fname = dirname ++ "content.xml"
let entry = toEntry fname epochtime (fromStringLazy mathml)
modifyIORef entriesRef (entry:)
return $ RawInline (Format "opendocument") $ render Nothing $
inTags False "draw:frame" [("text:anchor-type",
if t == DisplayMath
then "paragraph"
else "as-char")
,("style:vertical-pos", "middle")
,("style:vertical-rel", "text")] $
selfClosingTag "draw:object" [("xlink:href", dirname)
, ("xlink:type", "simple")
, ("xlink:show", "embed")
, ("xlink:actuate", "onLoad")]
| 1,352
|
transformPicMath _ entriesRef (Math t math) = do
entries <- readIORef entriesRef
let dt = if t == InlineMath then DisplayInline else DisplayBlock
case writeMathML dt <$> readTeX math of
Left _ -> return $ Math t math
Right r -> do
let conf = useShortEmptyTags (const False) defaultConfigPP
let mathml = ppcTopElement conf r
epochtime <- floor `fmap` getPOSIXTime
let dirname = "Formula-" ++ show (length entries) ++ "/"
let fname = dirname ++ "content.xml"
let entry = toEntry fname epochtime (fromStringLazy mathml)
modifyIORef entriesRef (entry:)
return $ RawInline (Format "opendocument") $ render Nothing $
inTags False "draw:frame" [("text:anchor-type",
if t == DisplayMath
then "paragraph"
else "as-char")
,("style:vertical-pos", "middle")
,("style:vertical-rel", "text")] $
selfClosingTag "draw:object" [("xlink:href", dirname)
, ("xlink:type", "simple")
, ("xlink:show", "embed")
, ("xlink:actuate", "onLoad")]
| 1,352
| false
| false
| 0
| 19
| 559
| 334
| 168
| 166
| null | null |
nomeata/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
opt_l :: DynFlags -> [String]
opt_l dflags = sOpt_l (settings dflags)
| 85
|
opt_l :: DynFlags -> [String]
opt_l dflags = sOpt_l (settings dflags)
| 85
|
opt_l dflags = sOpt_l (settings dflags)
| 39
| false
| true
| 0
| 7
| 26
| 30
| 15
| 15
| null | null |
mduvall/gitit
|
Network/Gitit/Initialize.hs
|
gpl-2.0
|
createStaticIfMissing :: Config -> IO ()
createStaticIfMissing conf = do
let staticdir = staticDir conf
staticExists <- doesDirectoryExist staticdir
unless staticExists $ do
let cssdir = staticdir </> "css"
createDirectoryIfMissing True cssdir
cssDataDir <- getDataFileName $ "data" </> "static" </> "css"
-- cssFiles <- liftM (filter (\f -> takeExtension f == ".css")) $ getDirectoryContents cssDataDir
forM_ ["custom.css"] $ \f -> do
copyFile (cssDataDir </> f) (cssdir </> f)
logM "gitit" WARNING $ "Created " ++ (cssdir </> f)
{-
let icondir = staticdir </> "img" </> "icons"
createDirectoryIfMissing True icondir
iconDataDir <- getDataFileName $ "data" </> "static" </> "img" </> "icons"
iconFiles <- liftM (filter (\f -> takeExtension f == ".png")) $ getDirectoryContents iconDataDir
forM_ iconFiles $ \f -> do
copyFile (iconDataDir </> f) (icondir </> f)
logM "gitit" WARNING $ "Created " ++ (icondir </> f)
-}
logopath <- getDataFileName $ "data" </> "static" </> "img" </> "logo.png"
createDirectoryIfMissing True $ staticdir </> "img"
copyFile logopath $ staticdir </> "img" </> "logo.png"
logM "gitit" WARNING $ "Created " ++ (staticdir </> "img" </> "logo.png")
{-
let jsdir = staticdir </> "js"
createDirectoryIfMissing True jsdir
jsDataDir <- getDataFileName $ "data" </> "static" </> "js"
javascripts <- liftM (filter (`notElem` [".", ".."])) $ getDirectoryContents jsDataDir
forM_ javascripts $ \f -> do
copyFile (jsDataDir </> f) (jsdir </> f)
logM "gitit" WARNING $ "Created " ++ (jsdir </> f)
-}
| 1,652
|
createStaticIfMissing :: Config -> IO ()
createStaticIfMissing conf = do
let staticdir = staticDir conf
staticExists <- doesDirectoryExist staticdir
unless staticExists $ do
let cssdir = staticdir </> "css"
createDirectoryIfMissing True cssdir
cssDataDir <- getDataFileName $ "data" </> "static" </> "css"
-- cssFiles <- liftM (filter (\f -> takeExtension f == ".css")) $ getDirectoryContents cssDataDir
forM_ ["custom.css"] $ \f -> do
copyFile (cssDataDir </> f) (cssdir </> f)
logM "gitit" WARNING $ "Created " ++ (cssdir </> f)
{-
let icondir = staticdir </> "img" </> "icons"
createDirectoryIfMissing True icondir
iconDataDir <- getDataFileName $ "data" </> "static" </> "img" </> "icons"
iconFiles <- liftM (filter (\f -> takeExtension f == ".png")) $ getDirectoryContents iconDataDir
forM_ iconFiles $ \f -> do
copyFile (iconDataDir </> f) (icondir </> f)
logM "gitit" WARNING $ "Created " ++ (icondir </> f)
-}
logopath <- getDataFileName $ "data" </> "static" </> "img" </> "logo.png"
createDirectoryIfMissing True $ staticdir </> "img"
copyFile logopath $ staticdir </> "img" </> "logo.png"
logM "gitit" WARNING $ "Created " ++ (staticdir </> "img" </> "logo.png")
{-
let jsdir = staticdir </> "js"
createDirectoryIfMissing True jsdir
jsDataDir <- getDataFileName $ "data" </> "static" </> "js"
javascripts <- liftM (filter (`notElem` [".", ".."])) $ getDirectoryContents jsDataDir
forM_ javascripts $ \f -> do
copyFile (jsDataDir </> f) (jsdir </> f)
logM "gitit" WARNING $ "Created " ++ (jsdir </> f)
-}
| 1,652
|
createStaticIfMissing conf = do
let staticdir = staticDir conf
staticExists <- doesDirectoryExist staticdir
unless staticExists $ do
let cssdir = staticdir </> "css"
createDirectoryIfMissing True cssdir
cssDataDir <- getDataFileName $ "data" </> "static" </> "css"
-- cssFiles <- liftM (filter (\f -> takeExtension f == ".css")) $ getDirectoryContents cssDataDir
forM_ ["custom.css"] $ \f -> do
copyFile (cssDataDir </> f) (cssdir </> f)
logM "gitit" WARNING $ "Created " ++ (cssdir </> f)
{-
let icondir = staticdir </> "img" </> "icons"
createDirectoryIfMissing True icondir
iconDataDir <- getDataFileName $ "data" </> "static" </> "img" </> "icons"
iconFiles <- liftM (filter (\f -> takeExtension f == ".png")) $ getDirectoryContents iconDataDir
forM_ iconFiles $ \f -> do
copyFile (iconDataDir </> f) (icondir </> f)
logM "gitit" WARNING $ "Created " ++ (icondir </> f)
-}
logopath <- getDataFileName $ "data" </> "static" </> "img" </> "logo.png"
createDirectoryIfMissing True $ staticdir </> "img"
copyFile logopath $ staticdir </> "img" </> "logo.png"
logM "gitit" WARNING $ "Created " ++ (staticdir </> "img" </> "logo.png")
{-
let jsdir = staticdir </> "js"
createDirectoryIfMissing True jsdir
jsDataDir <- getDataFileName $ "data" </> "static" </> "js"
javascripts <- liftM (filter (`notElem` [".", ".."])) $ getDirectoryContents jsDataDir
forM_ javascripts $ \f -> do
copyFile (jsDataDir </> f) (jsdir </> f)
logM "gitit" WARNING $ "Created " ++ (jsdir </> f)
-}
| 1,611
| false
| true
| 0
| 18
| 365
| 244
| 114
| 130
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.