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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_476 (146#) = happyShift action_499 | 41 | action_476 (146#) = happyShift action_499 | 41 | action_476 (146#) = happyShift action_499 | 41 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
JamesSullivan1/Mpp | src/MppSemanticAnalyzer.hs | mit | wf_case :: (String,[String],M_stmt,Pos) -> String -> Sym_Table -> E Bool
wf_case (c,as,s,pos) n t = case sym_lookup n t of
Ok (S_TypI cs) -> case sym_lookup c t of
Ok (S_ConI (_,_,ps,u)) -> case tmpInsert ps as (sym_blockscope_up t) of
Ok t' ->
if allOkay [a,b,x] then Ok True
... | 1,147 | wf_case :: (String,[String],M_stmt,Pos) -> String -> Sym_Table -> E Bool
wf_case (c,as,s,pos) n t = case sym_lookup n t of
Ok (S_TypI cs) -> case sym_lookup c t of
Ok (S_ConI (_,_,ps,u)) -> case tmpInsert ps as (sym_blockscope_up t) of
Ok t' ->
if allOkay [a,b,x] then Ok True
... | 1,147 | wf_case (c,as,s,pos) n t = case sym_lookup n t of
Ok (S_TypI cs) -> case sym_lookup c t of
Ok (S_ConI (_,_,ps,u)) -> case tmpInsert ps as (sym_blockscope_up t) of
Ok t' ->
if allOkay [a,b,x] then Ok True
else Except $ firstErr [a,b,x]
where
... | 1,074 | false | true | 0 | 21 | 496 | 506 | 257 | 249 | null | null |
lostbean/sledge | src/Texture/ODF.hs | gpl-3.0 | addPointsWithConst :: U.Vector Quaternion -> Double -> Maybe Rad -> ODF -> ODF
addPointsWithConst qs k customWidth odf@ODF{..} = odf { odfIntensity = is }
where is = addManyKernelsWithConst width k odfTree qs odfIntensity
width = fromMaybe odfKernelWidth customWidth | 279 | addPointsWithConst :: U.Vector Quaternion -> Double -> Maybe Rad -> ODF -> ODF
addPointsWithConst qs k customWidth odf@ODF{..} = odf { odfIntensity = is }
where is = addManyKernelsWithConst width k odfTree qs odfIntensity
width = fromMaybe odfKernelWidth customWidth | 279 | addPointsWithConst qs k customWidth odf@ODF{..} = odf { odfIntensity = is }
where is = addManyKernelsWithConst width k odfTree qs odfIntensity
width = fromMaybe odfKernelWidth customWidth | 200 | false | true | 1 | 8 | 51 | 90 | 45 | 45 | null | null |
justinethier/husk-scheme | hs-src/Language/Scheme/Numerical.hs | mit | numFloor [(Float n)] = return $ Float $ fromInteger $ floor n | 61 | numFloor [(Float n)] = return $ Float $ fromInteger $ floor n | 61 | numFloor [(Float n)] = return $ Float $ fromInteger $ floor n | 61 | false | false | 0 | 8 | 11 | 33 | 16 | 17 | null | null |
brendanhay/gogol | gogol-bigquery/gen/Network/Google/BigQuery/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'Entry' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ePredictedLabel'
--
-- * 'eItemCount'
entry
:: Entry
entry = Entry' {_ePredictedLabel = Nothing, _eItemCount = Nothing} | 289 | entry
:: Entry
entry = Entry' {_ePredictedLabel = Nothing, _eItemCount = Nothing} | 85 | entry = Entry' {_ePredictedLabel = Nothing, _eItemCount = Nothing} | 66 | true | true | 1 | 7 | 53 | 36 | 22 | 14 | null | null |
roberth/uu-helium | test/typeerrors/Examples/BgExplicitVarBind.hs | gpl-3.0 | f :: Bool
f = True | 18 | f :: Bool
f = True | 18 | f = True | 8 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
arekfu/project_euler | p0060/p0060.hs | mit | isectMany :: (Ord a) => [[a]] -> [a]
isectMany [x] = x | 54 | isectMany :: (Ord a) => [[a]] -> [a]
isectMany [x] = x | 54 | isectMany [x] = x | 17 | false | true | 0 | 9 | 11 | 45 | 23 | 22 | null | null |
rootzlevel/sansa | src/Data/Units.hs | bsd-2-clause | gibi :: unit -> GiBi :@ unit
gibi = (GiBi :@) | 45 | gibi :: unit -> GiBi :@ unit
gibi = (GiBi :@) | 45 | gibi = (GiBi :@) | 16 | false | true | 0 | 8 | 10 | 30 | 14 | 16 | null | null |
NicolasDP/hs-memory | Data/Memory/Encoding/Base32.hs | bsd-3-clause | -- | Transform a number of bytes pointed by.@src in the base32 binary representation in @dst
--
-- destination memory need to be of correct size, otherwise it will lead
-- to really bad things.
toBase32 :: Ptr Word8 -- ^ input
-> Ptr Word8 -- ^ output
-> Int -- ^ input len
-> IO ()
toBa... | 1,582 | toBase32 :: Ptr Word8 -- ^ input
-> Ptr Word8 -- ^ output
-> Int -- ^ input len
-> IO ()
toBase32 dst src len = loop 0 0
where
eqChar :: Word8
eqChar = 0x3d
peekOrZero :: Int -> IO Word8
peekOrZero i
| i >= len = return 0
| otherwise = peekByteOff src... | 1,388 | toBase32 dst src len = loop 0 0
where
eqChar :: Word8
eqChar = 0x3d
peekOrZero :: Int -> IO Word8
peekOrZero i
| i >= len = return 0
| otherwise = peekByteOff src i
pokeOrPadding :: Int -- for the test
-> Int -- src index
-> Word8 -- the value... | 1,266 | true | true | 33 | 10 | 637 | 518 | 280 | 238 | null | null |
ribag/ganeti-experiments | src/Ganeti/JQueue.hs | gpl-2.0 | -- | Compute a job's priority.
calcJobPriority :: QueuedJob -> Int
calcJobPriority QueuedJob { qjOps = ops } =
helper . map qoPriority $ filter (not . opStatusFinalized . qoStatus) ops
where helper [] = C.opPrioDefault
helper ps = minimum ps
-- | Log but ignore an 'IOError'. | 292 | calcJobPriority :: QueuedJob -> Int
calcJobPriority QueuedJob { qjOps = ops } =
helper . map qoPriority $ filter (not . opStatusFinalized . qoStatus) ops
where helper [] = C.opPrioDefault
helper ps = minimum ps
-- | Log but ignore an 'IOError'. | 261 | calcJobPriority QueuedJob { qjOps = ops } =
helper . map qoPriority $ filter (not . opStatusFinalized . qoStatus) ops
where helper [] = C.opPrioDefault
helper ps = minimum ps
-- | Log but ignore an 'IOError'. | 225 | true | true | 0 | 9 | 64 | 81 | 41 | 40 | null | null |
chreekat/snowdrift | Model/User.hs | agpl-3.0 | userViewWikiEditsDB :: UserId -> WikiPageId -> DB ()
userViewWikiEditsDB user_id wiki_page_id = unviewedWikiEdits >>= viewWikiEdits
where
unviewedWikiEdits :: DB [WikiEditId]
unviewedWikiEdits = fmap (map unValue) $
select $
from $ \we -> do
where_ $
we ^. WikiEditPage ==. ... | 546 | userViewWikiEditsDB :: UserId -> WikiPageId -> DB ()
userViewWikiEditsDB user_id wiki_page_id = unviewedWikiEdits >>= viewWikiEdits
where
unviewedWikiEdits :: DB [WikiEditId]
unviewedWikiEdits = fmap (map unValue) $
select $
from $ \we -> do
where_ $
we ^. WikiEditPage ==. ... | 546 | userViewWikiEditsDB user_id wiki_page_id = unviewedWikiEdits >>= viewWikiEdits
where
unviewedWikiEdits :: DB [WikiEditId]
unviewedWikiEdits = fmap (map unValue) $
select $
from $ \we -> do
where_ $
we ^. WikiEditPage ==. val wiki_page_id &&.
we ^. WikiEditId `no... | 493 | false | true | 0 | 14 | 139 | 161 | 80 | 81 | null | null |
athanclark/lh-bug | deps/unordered-containers/tests/HashMapProperties.hs | bsd-3-clause | pNeq :: [(Key, Int)] -> [(Key, Int)] -> Bool
pNeq xs = (M.fromList xs /=) `eq` (HM.fromList xs /=) | 98 | pNeq :: [(Key, Int)] -> [(Key, Int)] -> Bool
pNeq xs = (M.fromList xs /=) `eq` (HM.fromList xs /=) | 98 | pNeq xs = (M.fromList xs /=) `eq` (HM.fromList xs /=) | 53 | false | true | 0 | 8 | 18 | 64 | 37 | 27 | null | null |
ddssff/lens | src/Data/Data/Lens.hs | bsd-3-clause | -- $setup
-- >>> :set -XNoOverloadedStrings
-- >>> import Control.Lens
-------------------------------------------------------------------------------
-- Generic Traversal
-------------------------------------------------------------------------------
-- | A generic applicative transformation that maps over the immed... | 566 | gtraverse :: (Applicative f, Data a) => (forall d. Data d => d -> f d) -> a -> f a
gtraverse f = gfoldl (\x y -> x <*> f y) pure | 128 | gtraverse f = gfoldl (\x y -> x <*> f y) pure | 45 | true | true | 0 | 11 | 79 | 95 | 53 | 42 | null | null |
salamansar/GA-cube | src/BitStringIndRunner.hs | mit | processGAInd :: Individual i => Int -> Int -> Int -> (Int -> i) -> (Int, Maybe i)
processGAInd popSize maxLocale maxFit factoryFunc =
let (cnt, pop) = processGAPop popSize maxLocale maxFit factoryFunc
in (cnt, find (maxFitnesseReached maxFit) pop) | 256 | processGAInd :: Individual i => Int -> Int -> Int -> (Int -> i) -> (Int, Maybe i)
processGAInd popSize maxLocale maxFit factoryFunc =
let (cnt, pop) = processGAPop popSize maxLocale maxFit factoryFunc
in (cnt, find (maxFitnesseReached maxFit) pop) | 256 | processGAInd popSize maxLocale maxFit factoryFunc =
let (cnt, pop) = processGAPop popSize maxLocale maxFit factoryFunc
in (cnt, find (maxFitnesseReached maxFit) pop) | 174 | false | true | 0 | 11 | 47 | 103 | 52 | 51 | null | null |
kalashnikov/haskell_script | euler.hs | mit | factor 1 = [] | 13 | factor 1 = [] | 13 | factor 1 = [] | 13 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
jasonzoladz/persistent | persistent/Database/Persist.hs | mit | limitOffsetOrder :: PersistEntity val => [SelectOpt val] -> (Int, Int, [SelectOpt val])
limitOffsetOrder opts =
foldr go (0, 0, []) opts
where
go (LimitTo l) (_, b, c) = (l, b ,c)
go (OffsetBy o) (a, _, c) = (a, o, c)
go x (a, b, c) = (a, b, x : c) | 266 | limitOffsetOrder :: PersistEntity val => [SelectOpt val] -> (Int, Int, [SelectOpt val])
limitOffsetOrder opts =
foldr go (0, 0, []) opts
where
go (LimitTo l) (_, b, c) = (l, b ,c)
go (OffsetBy o) (a, _, c) = (a, o, c)
go x (a, b, c) = (a, b, x : c) | 266 | limitOffsetOrder opts =
foldr go (0, 0, []) opts
where
go (LimitTo l) (_, b, c) = (l, b ,c)
go (OffsetBy o) (a, _, c) = (a, o, c)
go x (a, b, c) = (a, b, x : c) | 178 | false | true | 0 | 9 | 70 | 167 | 94 | 73 | null | null |
sheganinans/plugins-auto | System/Plugins/Auto/LiftName.hs | bsd-3-clause | liftNameFlavour (NameU i) = [| case $( lift i ) of
I# i' -> NameU i' |] | 116 | liftNameFlavour (NameU i) = [| case $( lift i ) of
I# i' -> NameU i' |] | 116 | liftNameFlavour (NameU i) = [| case $( lift i ) of
I# i' -> NameU i' |] | 116 | false | false | 0 | 7 | 61 | 18 | 10 | 8 | null | null |
jedahu/hike | src/Hike/Data/Result.hs | bsd-3-clause | state
:: (Functor f)
=> (ResultState -> f ResultState) -> Result a -> f (Result a)
state f (Result s a) = fmap (\s' -> Result s' a) (f s) | 145 | state
:: (Functor f)
=> (ResultState -> f ResultState) -> Result a -> f (Result a)
state f (Result s a) = fmap (\s' -> Result s' a) (f s) | 145 | state f (Result s a) = fmap (\s' -> Result s' a) (f s) | 54 | false | true | 0 | 10 | 37 | 93 | 44 | 49 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/RegionTargetHTTPSProxies/Insert.hs | mpl-2.0 | -- | Creates a value of 'RegionTargetHTTPSProxiesInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rthpiRequestId'
--
-- * 'rthpiProject'
--
-- * 'rthpiPayload'
--
-- * 'rthpiRegion'
regionTargetHTTPSProxiesInsert
:: Text --... | 708 | regionTargetHTTPSProxiesInsert
:: Text -- ^ 'rthpiProject'
-> TargetHTTPSProxy -- ^ 'rthpiPayload'
-> Text -- ^ 'rthpiRegion'
-> RegionTargetHTTPSProxiesInsert
regionTargetHTTPSProxiesInsert pRthpiProject_ pRthpiPayload_ pRthpiRegion_ =
RegionTargetHTTPSProxiesInsert'
{ _rthpiRequestId = Nothing
... | 433 | regionTargetHTTPSProxiesInsert pRthpiProject_ pRthpiPayload_ pRthpiRegion_ =
RegionTargetHTTPSProxiesInsert'
{ _rthpiRequestId = Nothing
, _rthpiProject = pRthpiProject_
, _rthpiPayload = pRthpiPayload_
, _rthpiRegion = pRthpiRegion_
} | 257 | true | true | 0 | 9 | 124 | 79 | 48 | 31 | null | null |
thoughtpolice/binary-serialise-cbor | bench/Real/Load.hs | bsd-3-clause | boolField :: String -> (b -> Bool) -> (Bool -> b -> b) -> FieldDescr b
boolField name get set = liftField get set (FieldDescr name showF readF)
where
showF = text . show
readF line str _
| str == "True" = ParseOk [] True
| str == "False" = ParseOk [] False
| lstr == "true" = ParseOk [cas... | 601 | boolField :: String -> (b -> Bool) -> (Bool -> b -> b) -> FieldDescr b
boolField name get set = liftField get set (FieldDescr name showF readF)
where
showF = text . show
readF line str _
| str == "True" = ParseOk [] True
| str == "False" = ParseOk [] False
| lstr == "true" = ParseOk [cas... | 601 | boolField name get set = liftField get set (FieldDescr name showF readF)
where
showF = text . show
readF line str _
| str == "True" = ParseOk [] True
| str == "False" = ParseOk [] False
| lstr == "true" = ParseOk [caseWarning] True
| lstr == "false" = ParseOk [caseWarning] False
... | 530 | false | true | 10 | 10 | 181 | 213 | 105 | 108 | null | null |
edgarklerks/dotfiles | .xmonad/xmonad.hs | bsd-2-clause | main = do
-- system("setxkbmap -layout us")
xconfig <- xmobar defaults
xmonad $ ewmh xconfig
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs
--fi
-- No need to modify this.... | 323 | main = do
-- system("setxkbmap -layout us")
xconfig <- xmobar defaults
xmonad $ ewmh xconfig
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs
--fi
-- No need to modify this.... | 323 | main = do
-- system("setxkbmap -layout us")
xconfig <- xmobar defaults
xmonad $ ewmh xconfig
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs
--fi
-- No need to modify this.... | 323 | false | false | 1 | 9 | 61 | 37 | 18 | 19 | null | null |
r-peck/Rome | src/Lib.hs | mit | listParser :: Opts.Parser RomeCommand
listParser = List <$> listPayloadParser | 77 | listParser :: Opts.Parser RomeCommand
listParser = List <$> listPayloadParser | 77 | listParser = List <$> listPayloadParser | 39 | false | true | 0 | 6 | 8 | 20 | 10 | 10 | null | null |
snoyberg/ghc | compiler/typecheck/TcEvidence.hs | bsd-3-clause | mkWpFun WpHole (WpCast co2) t1 _ = WpCast (mkTcFunCo Representational (mkTcRepReflCo t1) co2) | 100 | mkWpFun WpHole (WpCast co2) t1 _ = WpCast (mkTcFunCo Representational (mkTcRepReflCo t1) co2) | 100 | mkWpFun WpHole (WpCast co2) t1 _ = WpCast (mkTcFunCo Representational (mkTcRepReflCo t1) co2) | 100 | false | false | 0 | 9 | 19 | 40 | 19 | 21 | null | null |
tpsinnem/Idris-dev | src/Idris/Core/Elaborate.hs | bsd-3-clause | getLog :: Elab' aux String
getLog = do ES p logs _ <- get
return $! logs
-- The primitives, from ProofState | 120 | getLog :: Elab' aux String
getLog = do ES p logs _ <- get
return $! logs
-- The primitives, from ProofState | 120 | getLog = do ES p logs _ <- get
return $! logs
-- The primitives, from ProofState | 93 | false | true | 0 | 8 | 34 | 44 | 19 | 25 | null | null |
mcschroeder/ghc | compiler/basicTypes/DataCon.hs | bsd-3-clause | isSrcUnpacked _ = False | 23 | isSrcUnpacked _ = False | 23 | isSrcUnpacked _ = False | 23 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
bitemyapp/hakaru | Examples/HMMDeriv.hs | bsd-3-clause | reifyOp :: (Mochastic repr, Lambda repr, Integrate repr) =>
repr Int -> repr Int ->
repr (Int -> LinearOperator Int) -> repr Table
reifyOp domainSize rangeSize m =
vector domainSize (\i ->
vector rangeSize (\j ->
app (app m i) (lam (\j' -> if_ (equal j j') 1 0)))) | 289 | reifyOp :: (Mochastic repr, Lambda repr, Integrate repr) =>
repr Int -> repr Int ->
repr (Int -> LinearOperator Int) -> repr Table
reifyOp domainSize rangeSize m =
vector domainSize (\i ->
vector rangeSize (\j ->
app (app m i) (lam (\j' -> if_ (equal j j') 1 0)))) | 289 | reifyOp domainSize rangeSize m =
vector domainSize (\i ->
vector rangeSize (\j ->
app (app m i) (lam (\j' -> if_ (equal j j') 1 0)))) | 140 | false | true | 0 | 18 | 73 | 141 | 70 | 71 | null | null |
kim/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/Types.hs | mpl-2.0 | -- | The MD5 digest of the key that you used to encrypt your input file, or that
-- you want Elastic Transcoder to use to encrypt your output file. Elastic
-- Transcoder uses the key digest as a checksum to make sure your key was not
-- corrupted in transit. The key MD5 must be base64-encoded, and it must be
-- exactly... | 457 | eKeyMd5 :: Lens' Encryption (Maybe Text)
eKeyMd5 = lens _eKeyMd5 (\s a -> s { _eKeyMd5 = a }) | 93 | eKeyMd5 = lens _eKeyMd5 (\s a -> s { _eKeyMd5 = a }) | 52 | true | true | 0 | 9 | 87 | 50 | 29 | 21 | null | null |
ezyang/ghc | compiler/iface/ToIface.hs | bsd-3-clause | ----------------
toIfaceTyCon :: TyCon -> IfaceTyCon
toIfaceTyCon tc
= IfaceTyCon tc_name info
where
tc_name = tyConName tc
info = IfaceTyConInfo promoted sort
promoted | isPromotedDataCon tc = IsPromoted
| otherwise = IsNotPromoted
tupleSort :: TyCon -> Maybe IfaceTyConS... | 1,058 | toIfaceTyCon :: TyCon -> IfaceTyCon
toIfaceTyCon tc
= IfaceTyCon tc_name info
where
tc_name = tyConName tc
info = IfaceTyConInfo promoted sort
promoted | isPromotedDataCon tc = IsPromoted
| otherwise = IsNotPromoted
tupleSort :: TyCon -> Maybe IfaceTyConSort
tupleSort... | 1,041 | toIfaceTyCon tc
= IfaceTyCon tc_name info
where
tc_name = tyConName tc
info = IfaceTyConInfo promoted sort
promoted | isPromotedDataCon tc = IsPromoted
| otherwise = IsNotPromoted
tupleSort :: TyCon -> Maybe IfaceTyConSort
tupleSort tc' =
case tyConTuple_maybe... | 1,005 | true | true | 1 | 13 | 389 | 288 | 131 | 157 | null | null |
scott-fleischman/greek-grammar | haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs | mit | decomposeChar '\x1FEC' = "\x03A1\x0314" | 39 | decomposeChar '\x1FEC' = "\x03A1\x0314" | 39 | decomposeChar '\x1FEC' = "\x03A1\x0314" | 39 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
rueshyna/gogol | gogol-monitoring/gen/Network/Google/Resource/Monitoring/Projects/MonitoredResourceDescriptors/List.hs | mpl-2.0 | -- | A positive number that is the maximum number of results to return.
pmrdlPageSize :: Lens' ProjectsMonitoredResourceDescriptorsList (Maybe Int32)
pmrdlPageSize
= lens _pmrdlPageSize
(\ s a -> s{_pmrdlPageSize = a})
. mapping _Coerce | 250 | pmrdlPageSize :: Lens' ProjectsMonitoredResourceDescriptorsList (Maybe Int32)
pmrdlPageSize
= lens _pmrdlPageSize
(\ s a -> s{_pmrdlPageSize = a})
. mapping _Coerce | 178 | pmrdlPageSize
= lens _pmrdlPageSize
(\ s a -> s{_pmrdlPageSize = a})
. mapping _Coerce | 100 | true | true | 2 | 8 | 47 | 60 | 28 | 32 | null | null |
ganeti-github-testing/ganeti-test-1 | test/hs/Test/Ganeti/HTools/Cluster.hs | bsd-2-clause | -- | Checks if a node is "big" enough.
isNodeBig :: Int -> Node.Node -> Bool
isNodeBig size node = Node.availDisk node > size * Types.unitDsk
&& Node.availMem node > size * Types.unitMem
&& Node.availCpu node > size * Types.unitCpu | 275 | isNodeBig :: Int -> Node.Node -> Bool
isNodeBig size node = Node.availDisk node > size * Types.unitDsk
&& Node.availMem node > size * Types.unitMem
&& Node.availCpu node > size * Types.unitCpu | 236 | isNodeBig size node = Node.availDisk node > size * Types.unitDsk
&& Node.availMem node > size * Types.unitMem
&& Node.availCpu node > size * Types.unitCpu | 198 | true | true | 0 | 14 | 83 | 80 | 39 | 41 | null | null |
bgamari/linear | src/Linear/V.hs | bsd-3-clause | fromVector :: forall n a. Dim n => Vector a -> Maybe (V n a)
fromVector v
| V.length v == reflectDim (Proxy :: Proxy n) = Just (V v)
| otherwise = Nothing | 192 | fromVector :: forall n a. Dim n => Vector a -> Maybe (V n a)
fromVector v
| V.length v == reflectDim (Proxy :: Proxy n) = Just (V v)
| otherwise = Nothing | 192 | fromVector v
| V.length v == reflectDim (Proxy :: Proxy n) = Just (V v)
| otherwise = Nothing | 131 | false | true | 1 | 11 | 71 | 89 | 42 | 47 | null | null |
broma0/nysql | src/hs/Database/NySQL/TH.hs | bsd-3-clause | replaceQs :: String -> String
replaceQs s = subRegex paramRegex s "?" | 69 | replaceQs :: String -> String
replaceQs s = subRegex paramRegex s "?" | 69 | replaceQs s = subRegex paramRegex s "?" | 39 | false | true | 0 | 7 | 11 | 32 | 13 | 19 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Core.hs | gpl-3.0 | in46 :: Pattern Double
in46 = cF 0 "46" | 39 | in46 :: Pattern Double
in46 = cF 0 "46" | 39 | in46 = cF 0 "46" | 16 | false | true | 0 | 6 | 8 | 26 | 10 | 16 | null | null |
athanclark/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | mapPTermFC f g (PRunElab fc tm ns) = PRunElab (f fc) (mapPTermFC f g tm) ns | 75 | mapPTermFC f g (PRunElab fc tm ns) = PRunElab (f fc) (mapPTermFC f g tm) ns | 75 | mapPTermFC f g (PRunElab fc tm ns) = PRunElab (f fc) (mapPTermFC f g tm) ns | 75 | false | false | 0 | 7 | 15 | 49 | 22 | 27 | null | null |
agocorona/RefSerialize | Data/RefSerialize/Parser.hs | bsd-3-clause | sepBy1,sepBy :: STR a -> STR sep -> STR [a]
sepBy p sep = sepBy1 p sep <|> return [] | 95 | sepBy1,sepBy :: STR a -> STR sep -> STR [a]
sepBy p sep = sepBy1 p sep <|> return [] | 94 | sepBy p sep = sepBy1 p sep <|> return [] | 48 | false | true | 5 | 9 | 30 | 64 | 28 | 36 | null | null |
chengzh2008/hpffp | src/ch24-Parser/polymorphicParser.hs | bsd-3-clause | main :: IO ()
main = do
-- parseOnly from Attoparsec
print $ parseOnly parseFraction badFraction
print $ parseOnly parseFraction shouldWork
print $ parseOnly parseFraction shouldAlsoWork
print $ parseOnly parseFraction alsoBad
-- parseString from Trifect
print $ parseString parseFraction mempty badFracti... | 485 | main :: IO ()
main = do
-- parseOnly from Attoparsec
print $ parseOnly parseFraction badFraction
print $ parseOnly parseFraction shouldWork
print $ parseOnly parseFraction shouldAlsoWork
print $ parseOnly parseFraction alsoBad
-- parseString from Trifect
print $ parseString parseFraction mempty badFracti... | 485 | main = do
-- parseOnly from Attoparsec
print $ parseOnly parseFraction badFraction
print $ parseOnly parseFraction shouldWork
print $ parseOnly parseFraction shouldAlsoWork
print $ parseOnly parseFraction alsoBad
-- parseString from Trifect
print $ parseString parseFraction mempty badFraction
print $ p... | 471 | false | true | 0 | 8 | 79 | 122 | 54 | 68 | null | null |
brendanhay/gogol | gogol-adexchangebuyer2/gen/Network/Google/AdExchangeBuyer2/Types/Product.hs | mpl-2.0 | -- | The unique numerical ID of the client user that has accepted an
-- invitation. The value of this field is ignored in an update operation.
cuUserId :: Lens' ClientUser (Maybe Int64)
cuUserId
= lens _cuUserId (\ s a -> s{_cuUserId = a}) .
mapping _Coerce | 265 | cuUserId :: Lens' ClientUser (Maybe Int64)
cuUserId
= lens _cuUserId (\ s a -> s{_cuUserId = a}) .
mapping _Coerce | 122 | cuUserId
= lens _cuUserId (\ s a -> s{_cuUserId = a}) .
mapping _Coerce | 79 | true | true | 2 | 9 | 54 | 63 | 29 | 34 | null | null |
0xfaded/websockets | tests/haskell/Network/WebSockets/Socket/Tests.hs | bsd-3-clause | sendReceive :: forall p. (ExampleRequest p, TextProtocol p) => p -> Assertion
sendReceive proto = do
serverThread <- forkIO $ retry $ runServer "0.0.0.0" 42940 server
waitSome
texts <- map unArbitraryUtf8 <$> sample
texts' <- retry $ webSocketsClient 42940 proto $ client' texts
waitSome
killThr... | 1,346 | sendReceive :: forall p. (ExampleRequest p, TextProtocol p) => p -> Assertion
sendReceive proto = do
serverThread <- forkIO $ retry $ runServer "0.0.0.0" 42940 server
waitSome
texts <- map unArbitraryUtf8 <$> sample
texts' <- retry $ webSocketsClient 42940 proto $ client' texts
waitSome
killThr... | 1,346 | sendReceive proto = do
serverThread <- forkIO $ retry $ runServer "0.0.0.0" 42940 server
waitSome
texts <- map unArbitraryUtf8 <$> sample
texts' <- retry $ webSocketsClient 42940 proto $ client' texts
waitSome
killThread serverThread
texts @=? texts'
where
waitSome = threadDelay $ 200... | 1,268 | false | true | 0 | 11 | 352 | 325 | 160 | 165 | null | null |
joshuaunderwood7/beeHive | FileMan.hs | gpl-3.0 | readFileToBuffer :: String -> (String -> b) -> IO b
readFileToBuffer filename inputFunc = do
input <- readFile filename
return $ inputFunc input | 169 | readFileToBuffer :: String -> (String -> b) -> IO b
readFileToBuffer filename inputFunc = do
input <- readFile filename
return $ inputFunc input | 169 | readFileToBuffer filename inputFunc = do
input <- readFile filename
return $ inputFunc input | 117 | false | true | 0 | 8 | 47 | 54 | 25 | 29 | null | null |
themoritz/cabal | Cabal/Distribution/Simple/LHC.hs | bsd-3-clause | stripExe :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> IO ()
stripExe verbosity lbi name path = when (stripExes lbi) $
case lookupProgram stripProgram (withPrograms lbi) of
Just strip -> runProgram verbosity strip args
Nothing -> unless (buildOS == Windows) $
-- Don't bother w... | 922 | stripExe :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> IO ()
stripExe verbosity lbi name path = when (stripExes lbi) $
case lookupProgram stripProgram (withPrograms lbi) of
Just strip -> runProgram verbosity strip args
Nothing -> unless (buildOS == Windows) $
-- Don't bother w... | 922 | stripExe verbosity lbi name path = when (stripExes lbi) $
case lookupProgram stripProgram (withPrograms lbi) of
Just strip -> runProgram verbosity strip args
Nothing -> unless (buildOS == Windows) $
-- Don't bother warning on windows, we don't expect them to
-- have the ... | 849 | false | true | 8 | 10 | 315 | 153 | 80 | 73 | null | null |
ocus/TinyASM_Haskell | library/TinyASM/VM.hs | bsd-3-clause | executeByteCode bc@(BC4 0x14 address1 address2 address3) (sp, mem, scr) = Just (Just (if (mem !! address2) == (mem !! address3) then (mem !! address1) else (nextPointer sp bc)), mem, scr) | 188 | executeByteCode bc@(BC4 0x14 address1 address2 address3) (sp, mem, scr) = Just (Just (if (mem !! address2) == (mem !! address3) then (mem !! address1) else (nextPointer sp bc)), mem, scr) | 188 | executeByteCode bc@(BC4 0x14 address1 address2 address3) (sp, mem, scr) = Just (Just (if (mem !! address2) == (mem !! address3) then (mem !! address1) else (nextPointer sp bc)), mem, scr) | 188 | false | false | 0 | 12 | 30 | 94 | 52 | 42 | null | null |
adituv/qbscript | src/Compiler/QbScript/CodeGen.hs | bsd-3-clause | putQbArrayType QbTVector2 = putWord32BE 0x00010500 | 56 | putQbArrayType QbTVector2 = putWord32BE 0x00010500 | 56 | putQbArrayType QbTVector2 = putWord32BE 0x00010500 | 56 | false | false | 0 | 5 | 10 | 12 | 5 | 7 | null | null |
boojinks/cis194-solutions | src/HW01/solution.hs | bsd-3-clause | -- Exercise 4
validate :: Integer -> Bool
validate = (== 0) . (`mod` 10) . sumDigits . doubleEveryOther . toDigits | 115 | validate :: Integer -> Bool
validate = (== 0) . (`mod` 10) . sumDigits . doubleEveryOther . toDigits | 100 | validate = (== 0) . (`mod` 10) . sumDigits . doubleEveryOther . toDigits | 72 | true | true | 0 | 9 | 21 | 42 | 25 | 17 | null | null |
ulricha/dsh | src/Database/DSH/Tests/CombinatorTests.hs | bsd-3-clause | prop_all_zero :: (BackendVector b, VectorLang v) => [Integer] -> DSHProperty (v TExpr TExpr) b
prop_all_zero = makePropEq (Q.all (Q.== 0)) (all (== 0)) | 151 | prop_all_zero :: (BackendVector b, VectorLang v) => [Integer] -> DSHProperty (v TExpr TExpr) b
prop_all_zero = makePropEq (Q.all (Q.== 0)) (all (== 0)) | 151 | prop_all_zero = makePropEq (Q.all (Q.== 0)) (all (== 0)) | 56 | false | true | 0 | 10 | 22 | 80 | 41 | 39 | null | null |
abramhindle/haskell-sand-game | Sand4.hs | lgpl-3.0 | roomIter r@(Room room) = do
(_ : newroom ) <- helper (emptyLine : room)
return (Room newroom)
where
helper (bottom:[]) = do
(b,t) <- processRow bottom emptyLine
return (b:[])
helper (bottom:top:xs) = do
(b,t) <- processRow bottom... | 411 | roomIter r@(Room room) = do
(_ : newroom ) <- helper (emptyLine : room)
return (Room newroom)
where
helper (bottom:[]) = do
(b,t) <- processRow bottom emptyLine
return (b:[])
helper (bottom:top:xs) = do
(b,t) <- processRow bottom... | 411 | roomIter r@(Room room) = do
(_ : newroom ) <- helper (emptyLine : room)
return (Room newroom)
where
helper (bottom:[]) = do
(b,t) <- processRow bottom emptyLine
return (b:[])
helper (bottom:top:xs) = do
(b,t) <- processRow bottom... | 411 | false | false | 1 | 11 | 189 | 182 | 85 | 97 | null | null |
EEviston/distro_api | src/ServiceLib.hs | bsd-3-clause | -- | The port number of the mongoDB database that devnostics-rest uses to store and access data
mongoDbPort :: IO Integer
mongoDbPort = defEnv "MONGODB_PORT" read 27017 False | 174 | mongoDbPort :: IO Integer
mongoDbPort = defEnv "MONGODB_PORT" read 27017 False | 78 | mongoDbPort = defEnv "MONGODB_PORT" read 27017 False | 52 | true | true | 0 | 5 | 27 | 24 | 12 | 12 | null | null |
andorp/hs-bluesnap | src/Bluesnap/API/Request.hs | gpl-3.0 | elementToXMLShopper_currency :: Xsd.XsdString -> [Content ()]
elementToXMLShopper_currency = schemaTypeToXML "shopper-currency" | 127 | elementToXMLShopper_currency :: Xsd.XsdString -> [Content ()]
elementToXMLShopper_currency = schemaTypeToXML "shopper-currency" | 127 | elementToXMLShopper_currency = schemaTypeToXML "shopper-currency" | 65 | false | true | 0 | 8 | 9 | 28 | 14 | 14 | null | null |
nevrenato/Hets_Fork | HasCASL/ClassAna.hs | gpl-2.0 | lesserVariance :: Variance -> Variance -> Bool
lesserVariance v1 v2 = case v1 of
InVar -> True
_ -> case v2 of
NonVar -> True
_ -> v1 == v2
-- | revert variance | 183 | lesserVariance :: Variance -> Variance -> Bool
lesserVariance v1 v2 = case v1 of
InVar -> True
_ -> case v2 of
NonVar -> True
_ -> v1 == v2
-- | revert variance | 183 | lesserVariance v1 v2 = case v1 of
InVar -> True
_ -> case v2 of
NonVar -> True
_ -> v1 == v2
-- | revert variance | 136 | false | true | 0 | 11 | 56 | 61 | 31 | 30 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs | lgpl-2.1 | -- marshalling 2
{-
-- | A @wxRect@ object.
type WxRectObject a = Ptr (CWxRectObject a)
type TWxRectObject a = CWxRectObject a
data CWxRectObject a = CWxRectObject
-}
{-
withWxRectRef :: String -> Rect -> (Ptr (TWxRect r) -> IO a) -> IO a
withWxRectRef msg r f
= withWxRectPtr r $ \p -> withValidPtr msg p f
-}
w... | 477 | withWxRectPtr :: Rect -> (Ptr (TWxRect r) -> IO a) -> IO a
withWxRectPtr r f
= bracket (withCRect r wxRect_Create)
(wxRect_Delete)
f | 158 | withWxRectPtr r f
= bracket (withCRect r wxRect_Create)
(wxRect_Delete)
f | 99 | true | true | 0 | 11 | 115 | 67 | 34 | 33 | null | null |
pasberth/LeatherScript-prototype | Language/LeatherScript/LeatherShield.hs | mit | paramTy (AST.Ascribe _ t) e = forceMkType t e | 45 | paramTy (AST.Ascribe _ t) e = forceMkType t e | 45 | paramTy (AST.Ascribe _ t) e = forceMkType t e | 45 | false | false | 0 | 8 | 8 | 26 | 12 | 14 | null | null |
prsteele/mdp | src/Algorithms/MDP/Examples/Ex_3_1.hs | mit | -- | The transition matrix
transition :: Control -> State -> State -> Double
transition U1 A A = 3 / 4 | 102 | transition :: Control -> State -> State -> Double
transition U1 A A = 3 / 4 | 75 | transition U1 A A = 3 / 4 | 25 | true | true | 0 | 7 | 21 | 35 | 18 | 17 | null | null |
ababkin/qmuli | examples/cognito-lambda/src/Main.hs | mit | main :: IO ()
main = withConfig config
where
config :: ConfigProgram ()
config = do
cognito <- customResource "cognitoProvider"
Cognito.providerLambda def
contactsTable <- ddbTable "contacts" (DdbAttrDef "Id" S) def
genericLambda "scanContacts" (scanContacts contactsTabl... | 771 | main :: IO ()
main = withConfig config
where
config :: ConfigProgram ()
config = do
cognito <- customResource "cognitoProvider"
Cognito.providerLambda def
contactsTable <- ddbTable "contacts" (DdbAttrDef "Id" S) def
genericLambda "scanContacts" (scanContacts contactsTabl... | 771 | main = withConfig config
where
config :: ConfigProgram ()
config = do
cognito <- customResource "cognitoProvider"
Cognito.providerLambda def
contactsTable <- ddbTable "contacts" (DdbAttrDef "Id" S) def
genericLambda "scanContacts" (scanContacts contactsTable) def
g... | 757 | false | true | 0 | 11 | 172 | 176 | 77 | 99 | null | null |
spechub/Hets | CSL/Fold.hs | gpl-2.0 | -- | The identity transformation
idRecord :: Record CMD EXPRESSION
idRecord =
Record { foldAss = \ v _ _ -> v
, foldCmd = \ v _ _ -> v
, foldSequence = const
, foldCond = const
, foldRepeat = \ v _ _ -> v
, foldVar = const
, foldOp = \ v _ _ _ _ -> ... | 486 | idRecord :: Record CMD EXPRESSION
idRecord =
Record { foldAss = \ v _ _ -> v
, foldCmd = \ v _ _ -> v
, foldSequence = const
, foldCond = const
, foldRepeat = \ v _ _ -> v
, foldVar = const
, foldOp = \ v _ _ _ _ -> v
, foldList = \ v _ _... | 453 | idRecord =
Record { foldAss = \ v _ _ -> v
, foldCmd = \ v _ _ -> v
, foldSequence = const
, foldCond = const
, foldRepeat = \ v _ _ -> v
, foldVar = const
, foldOp = \ v _ _ _ _ -> v
, foldList = \ v _ _ -> v
, foldInterval = ... | 419 | true | true | 0 | 7 | 226 | 163 | 97 | 66 | null | null |
zudov/purescript-inspection | src/Inspection/API/Types.hs | bsd-3-clause | liftGithubMAuth :: AuthToken -> GithubM a -> Inspector a
liftGithubMAuth auth m = do
Environment{..} <- ask
lift $ withExceptT GithubError
$ runGithubM envGithubCacheRef envManager (toGithubAuth auth) m | 213 | liftGithubMAuth :: AuthToken -> GithubM a -> Inspector a
liftGithubMAuth auth m = do
Environment{..} <- ask
lift $ withExceptT GithubError
$ runGithubM envGithubCacheRef envManager (toGithubAuth auth) m | 213 | liftGithubMAuth auth m = do
Environment{..} <- ask
lift $ withExceptT GithubError
$ runGithubM envGithubCacheRef envManager (toGithubAuth auth) m | 156 | false | true | 0 | 10 | 38 | 72 | 33 | 39 | null | null |
ndmitchell/extra | src/System/IO/Extra.hs | bsd-3-clause | writeFileUTF8 :: FilePath -> String -> IO ()
writeFileUTF8 = writeFileEncoding utf8 | 83 | writeFileUTF8 :: FilePath -> String -> IO ()
writeFileUTF8 = writeFileEncoding utf8 | 83 | writeFileUTF8 = writeFileEncoding utf8 | 38 | false | true | 0 | 9 | 11 | 32 | 14 | 18 | null | null |
bttr/psqueues | tests/Data/PSQ/Class/Util.hs | bsd-3-clause | arbitraryInt :: Gen Int
arbitraryInt = arbitrary | 48 | arbitraryInt :: Gen Int
arbitraryInt = arbitrary | 48 | arbitraryInt = arbitrary | 24 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
dmjio/aeson | src/Data/Aeson/TH.hs | bsd-3-clause | dispatchFunByType :: JSONClass
-> JSONFun
-> Name
-> TyVarMap
-> Bool -- True if we are using the function argument that works
-- on lists (e.g., [a] -> Value). False is we are using
-- the functi... | 707 | dispatchFunByType :: JSONClass
-> JSONFun
-> Name
-> TyVarMap
-> Bool -- True if we are using the function argument that works
-- on lists (e.g., [a] -> Value). False is we are using
-- the functi... | 707 | dispatchFunByType _ jf _ tvMap list (VarT tyName) =
varE $ case M.lookup tyName tvMap of
Just (tfjExp, tfjlExp) -> if list then tfjlExp else tfjExp
Nothing -> jsonFunValOrListName list jf Arity0 | 245 | false | true | 0 | 11 | 321 | 112 | 58 | 54 | null | null |
Heather/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | showDeclImp o (PClauses _ _ n cs) = text "pat" <+> text (showCG n) <+> text "\t" <+>
indent 2 (vsep (map (showCImp o) cs)) | 162 | showDeclImp o (PClauses _ _ n cs) = text "pat" <+> text (showCG n) <+> text "\t" <+>
indent 2 (vsep (map (showCImp o) cs)) | 162 | showDeclImp o (PClauses _ _ n cs) = text "pat" <+> text (showCG n) <+> text "\t" <+>
indent 2 (vsep (map (showCImp o) cs)) | 162 | false | false | 0 | 12 | 64 | 75 | 35 | 40 | null | null |
liwanwei/pandoc | src/Text/Pandoc/Parsing.hs | gpl-2.0 | many1Till :: Stream s m t
=> ParserT s st m a
-> ParserT s st m end
-> ParserT s st m [a]
many1Till p end = do
first <- p
rest <- manyTill p end
return (first:rest)
-- | A more general form of @notFollowedBy@. This one allows any
-- type of parser to be specifi... | 397 | many1Till :: Stream s m t
=> ParserT s st m a
-> ParserT s st m end
-> ParserT s st m [a]
many1Till p end = do
first <- p
rest <- manyTill p end
return (first:rest)
-- | A more general form of @notFollowedBy@. This one allows any
-- type of parser to be specifi... | 397 | many1Till p end = do
first <- p
rest <- manyTill p end
return (first:rest)
-- | A more general form of @notFollowedBy@. This one allows any
-- type of parser to be specified, and succeeds only if that parser fails.
-- It does not consume any input. | 277 | false | true | 0 | 9 | 130 | 100 | 48 | 52 | null | null |
ulrikrasmussen/TwelfParser | src/Language/Twelf/TwelfServer.hs | bsd-3-clause | runTwelfCmd' :: MonadIO m => String -> TwelfMonadT m (String, Bool)
runTwelfCmd' cmd = do
twelfin <- asks twelfStdin
twelfout <- asks twelfStdout
let getresp = do
l <- hGetLine twelfout
case l of
"%% ABORT %%" -> return ([], False)
"%% OK %%" -> return ([], True)
_... | 505 | runTwelfCmd' :: MonadIO m => String -> TwelfMonadT m (String, Bool)
runTwelfCmd' cmd = do
twelfin <- asks twelfStdin
twelfout <- asks twelfStdout
let getresp = do
l <- hGetLine twelfout
case l of
"%% ABORT %%" -> return ([], False)
"%% OK %%" -> return ([], True)
_... | 505 | runTwelfCmd' cmd = do
twelfin <- asks twelfStdin
twelfout <- asks twelfStdout
let getresp = do
l <- hGetLine twelfout
case l of
"%% ABORT %%" -> return ([], False)
"%% OK %%" -> return ([], True)
_ -> do (ls, status) <- getresp
return (l:ls, statu... | 437 | false | true | 0 | 19 | 154 | 202 | 97 | 105 | null | null |
BeautifulDestinations/fb | src/Facebook/Object/Marketing/AdsPixel.hs | bsd-3-clause | code r = r `Rec.get` Code | 25 | code r = r `Rec.get` Code | 25 | code r = r `Rec.get` Code | 25 | false | false | 0 | 5 | 5 | 17 | 9 | 8 | null | null |
abau/co4 | test/CO4/Example/BinaryStandalone.hs | gpl-3.0 | eqNat' :: Nat -> Nat -> Bool
eqNat' n1 n2 = case n1 of
[] -> case n2 of [] -> True
_ -> False
x:xs -> case n2 of [] -> False
y:ys -> (not (xor x y)) && (eqNat' xs ys) | 215 | eqNat' :: Nat -> Nat -> Bool
eqNat' n1 n2 = case n1 of
[] -> case n2 of [] -> True
_ -> False
x:xs -> case n2 of [] -> False
y:ys -> (not (xor x y)) && (eqNat' xs ys) | 215 | eqNat' n1 n2 = case n1 of
[] -> case n2 of [] -> True
_ -> False
x:xs -> case n2 of [] -> False
y:ys -> (not (xor x y)) && (eqNat' xs ys) | 186 | false | true | 2 | 12 | 91 | 115 | 56 | 59 | null | null |
frerich/brainfuck | src/lib/Data/Language/Brainfuck/Optimizer.hs | bsd-3-clause | fuseMove :: Optimization
fuseMove = foldr go []
where
go (AdjustCellPtr x) (AdjustCellPtr y:is) = AdjustCellPtr (x+y) : is
go i p' = i : p' | 183 | fuseMove :: Optimization
fuseMove = foldr go []
where
go (AdjustCellPtr x) (AdjustCellPtr y:is) = AdjustCellPtr (x+y) : is
go i p' = i : p' | 183 | fuseMove = foldr go []
where
go (AdjustCellPtr x) (AdjustCellPtr y:is) = AdjustCellPtr (x+y) : is
go i p' = i : p' | 158 | false | true | 1 | 9 | 69 | 79 | 37 | 42 | null | null |
maurer/bil | src/BIL.hs | bsd-3-clause | cjmpP = do
reserved "cjmp"
i <- astExprParser
comma
t <- astExprParser
comma
e <- astExprParser
as <- attrsParser
return $ CJmp i t e as | 155 | cjmpP = do
reserved "cjmp"
i <- astExprParser
comma
t <- astExprParser
comma
e <- astExprParser
as <- attrsParser
return $ CJmp i t e as | 155 | cjmpP = do
reserved "cjmp"
i <- astExprParser
comma
t <- astExprParser
comma
e <- astExprParser
as <- attrsParser
return $ CJmp i t e as | 155 | false | false | 1 | 9 | 44 | 66 | 26 | 40 | null | null |
martijnbastiaan/sprockell | src/Sprockell/System.hs | mit | stdDevice _ (a, TestReq) = error ("TestAndSet not supported on address: " ++ show a) | 86 | stdDevice _ (a, TestReq) = error ("TestAndSet not supported on address: " ++ show a) | 86 | stdDevice _ (a, TestReq) = error ("TestAndSet not supported on address: " ++ show a) | 86 | false | false | 0 | 8 | 16 | 30 | 15 | 15 | null | null |
ComputationWithBoundedResources/jat | src/Jat/PState/Frame.hs | bsd-3-clause | -- | Initializes local variable register with unit values.
initL :: [AbstrValue i] -> Int -> LocVars i
initL vs n = vs ++ replicate n Unit | 138 | initL :: [AbstrValue i] -> Int -> LocVars i
initL vs n = vs ++ replicate n Unit | 79 | initL vs n = vs ++ replicate n Unit | 35 | true | true | 2 | 8 | 26 | 48 | 22 | 26 | null | null |
beni55/hermit | src/HERMIT/Dictionary/Reasoning.hs | bsd-2-clause | mergeQuantifiers :: MonadCatch m => (Var -> Bool) -> (Var -> Bool) -> Clause -> m Clause
mergeQuantifiers pl pr cl = prefixFailMsg "merge-quantifiers failed: " $ do
(con,lq,rq) <- case cl of
Conj q1 q2 -> return (Conj,q1,q2)
Disj q1 q2 -> return (Disj,q1,q2)
Impl nm q1 q2 -> return (Impl nm,... | 1,957 | mergeQuantifiers :: MonadCatch m => (Var -> Bool) -> (Var -> Bool) -> Clause -> m Clause
mergeQuantifiers pl pr cl = prefixFailMsg "merge-quantifiers failed: " $ do
(con,lq,rq) <- case cl of
Conj q1 q2 -> return (Conj,q1,q2)
Disj q1 q2 -> return (Disj,q1,q2)
Impl nm q1 q2 -> return (Impl nm,... | 1,957 | mergeQuantifiers pl pr cl = prefixFailMsg "merge-quantifiers failed: " $ do
(con,lq,rq) <- case cl of
Conj q1 q2 -> return (Conj,q1,q2)
Disj q1 q2 -> return (Disj,q1,q2)
Impl nm q1 q2 -> return (Impl nm,q1,q2)
_ -> fail "no quantifiers on either side."
let (bsl, cll) = collectQs... | 1,868 | false | true | 0 | 22 | 649 | 705 | 346 | 359 | null | null |
sergei-romanenko/sc-mini | src/Prototype.hs | unlicense | bft :: Machine Conf -> NameSupply -> Conf -> Tree Conf
bft d (n:ns) e | whistle e = bft d ns $ generalize n e | 109 | bft :: Machine Conf -> NameSupply -> Conf -> Tree Conf
bft d (n:ns) e | whistle e = bft d ns $ generalize n e | 109 | bft d (n:ns) e | whistle e = bft d ns $ generalize n e | 54 | false | true | 0 | 8 | 25 | 70 | 31 | 39 | null | null |
qnikst/distributed-process | src/Control/Distributed/Process/Internal/Closure/BuiltIn.hs | bsd-3-clause | cpEnableTraceRemote :: ProcessId -> Closure (Process ())
cpEnableTraceRemote =
closure (enableTraceStatic `staticCompose` decodeProcessIdStatic) . encode
where
enableTraceStatic :: Static (ProcessId -> Process ())
enableTraceStatic = staticLabel "$enableTraceRemote"
--------------------------------------... | 812 | cpEnableTraceRemote :: ProcessId -> Closure (Process ())
cpEnableTraceRemote =
closure (enableTraceStatic `staticCompose` decodeProcessIdStatic) . encode
where
enableTraceStatic :: Static (ProcessId -> Process ())
enableTraceStatic = staticLabel "$enableTraceRemote"
--------------------------------------... | 812 | cpEnableTraceRemote =
closure (enableTraceStatic `staticCompose` decodeProcessIdStatic) . encode
where
enableTraceStatic :: Static (ProcessId -> Process ())
enableTraceStatic = staticLabel "$enableTraceRemote"
--------------------------------------------------------------------------------
-- Support for... | 755 | false | true | 0 | 9 | 160 | 80 | 44 | 36 | null | null |
BarrelfishOS/barrelfish | tools/mackerel/CSyntax.hs | mit | multerm :: (Integer, [String] ) -> String
multerm (i, []) = printf "0x%x" i | 75 | multerm :: (Integer, [String] ) -> String
multerm (i, []) = printf "0x%x" i | 75 | multerm (i, []) = printf "0x%x" i | 33 | false | true | 0 | 7 | 13 | 44 | 23 | 21 | null | null |
GaloisInc/halvm-ghc | compiler/basicTypes/SrcLoc.hs | bsd-3-clause | -- | Move the 'SrcLoc' down by one line if the character is a newline,
-- to the next 8-char tabstop if it is a tab, and across by one
-- character in any other case
advanceSrcLoc :: RealSrcLoc -> Char -> RealSrcLoc
advanceSrcLoc (SrcLoc f l _) '\n' = SrcLoc f (l + 1) 1 | 271 | advanceSrcLoc :: RealSrcLoc -> Char -> RealSrcLoc
advanceSrcLoc (SrcLoc f l _) '\n' = SrcLoc f (l + 1) 1 | 105 | advanceSrcLoc (SrcLoc f l _) '\n' = SrcLoc f (l + 1) 1 | 55 | true | true | 0 | 7 | 56 | 51 | 27 | 24 | null | null |
SebastianCallh/liu-courses | src/Api/Course.hs | mit | getCourse :: Action ()
getCourse = do
code <- param "code"
maybecourse <- (lift . selectCourse) [CourseCode ==. code]
case maybecourse of
Nothing -> fourOhFour
Just course -> json course | 200 | getCourse :: Action ()
getCourse = do
code <- param "code"
maybecourse <- (lift . selectCourse) [CourseCode ==. code]
case maybecourse of
Nothing -> fourOhFour
Just course -> json course | 200 | getCourse = do
code <- param "code"
maybecourse <- (lift . selectCourse) [CourseCode ==. code]
case maybecourse of
Nothing -> fourOhFour
Just course -> json course | 177 | false | true | 0 | 10 | 43 | 75 | 35 | 40 | null | null |
tjakway/ghcjvm | compiler/types/OptCoercion.hs | bsd-3-clause | opt_co4 env sym rep r (CoherenceCo co1 co2)
| TransCo col1 cor1 <- co1
= opt_co4_wrap env sym rep r (mkTransCo (mkCoherenceCo col1 co2) cor1)
| TransCo col1' cor1' <- co1'
= if sym then opt_trans in_scope col1'
(optCoercion (zapTCvSubst (lcTCvSubst env))
(mkCohe... | 646 | opt_co4 env sym rep r (CoherenceCo co1 co2)
| TransCo col1 cor1 <- co1
= opt_co4_wrap env sym rep r (mkTransCo (mkCoherenceCo col1 co2) cor1)
| TransCo col1' cor1' <- co1'
= if sym then opt_trans in_scope col1'
(optCoercion (zapTCvSubst (lcTCvSubst env))
(mkCohe... | 646 | opt_co4 env sym rep r (CoherenceCo co1 co2)
| TransCo col1 cor1 <- co1
= opt_co4_wrap env sym rep r (mkTransCo (mkCoherenceCo col1 co2) cor1)
| TransCo col1' cor1' <- co1'
= if sym then opt_trans in_scope col1'
(optCoercion (zapTCvSubst (lcTCvSubst env))
(mkCohe... | 646 | false | false | 2 | 13 | 188 | 225 | 107 | 118 | null | null |
beni55/hspec-snap | src/Test/Hspec/Snap.hs | bsd-3-clause | should404 r = setResult (Fail Nothing (show r)) | 47 | should404 r = setResult (Fail Nothing (show r)) | 47 | should404 r = setResult (Fail Nothing (show r)) | 47 | false | false | 1 | 9 | 7 | 30 | 12 | 18 | null | null |
kazu-yamamoto/http2 | Network/HTTP2/Arch/HPACK.hs | bsd-3-clause | headersToBeRemoved :: [H.HeaderName]
headersToBeRemoved = [ H.hConnection
, "Transfer-Encoding"
-- Keep-Alive
-- Proxy-Connection
-- Upgrade
] | 247 | headersToBeRemoved :: [H.HeaderName]
headersToBeRemoved = [ H.hConnection
, "Transfer-Encoding"
-- Keep-Alive
-- Proxy-Connection
-- Upgrade
] | 247 | headersToBeRemoved = [ H.hConnection
, "Transfer-Encoding"
-- Keep-Alive
-- Proxy-Connection
-- Upgrade
] | 210 | false | true | 0 | 8 | 120 | 34 | 18 | 16 | null | null |
unknownloner/calccomp | C/Compiler.hs | mit | exprAsm x = [] | 14 | exprAsm x = [] | 14 | exprAsm x = [] | 14 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
michaelaerni/haskell-bf | NavSeq.hs | mit | moveLeft :: NavSeq a -> NavSeq a
moveLeft (LEnd _) = error "Left end already reached" | 85 | moveLeft :: NavSeq a -> NavSeq a
moveLeft (LEnd _) = error "Left end already reached" | 85 | moveLeft (LEnd _) = error "Left end already reached" | 52 | false | true | 0 | 7 | 15 | 33 | 15 | 18 | null | null |
emilaxelsson/ag-graph | src/Projection/TypeFam.hs | bsd-3-clause | -- | If @e@ is a part of type @p@, witnessed by constraint @e :< p@,
-- project out the corresponding value.
pr :: forall e p . (e :< p) => p -> e
pr p = pr' (pointer :: Pointer (Elem e p) e p) p | 197 | pr :: forall e p . (e :< p) => p -> e
pr p = pr' (pointer :: Pointer (Elem e p) e p) p | 86 | pr p = pr' (pointer :: Pointer (Elem e p) e p) p | 48 | true | true | 0 | 9 | 49 | 66 | 35 | 31 | null | null |
rleshchinskiy/vector | Data/Vector/Fusion/Bundle/Monadic.hs | bsd-3-clause | unsafeFromList sz xs = fromStream (S.fromList xs) sz | 52 | unsafeFromList sz xs = fromStream (S.fromList xs) sz | 52 | unsafeFromList sz xs = fromStream (S.fromList xs) sz | 52 | false | false | 0 | 8 | 7 | 24 | 11 | 13 | null | null |
hargettp/raft | tests/TestRaft.hs | mit | testConsistency :: (IO Transport) -> RaftConfiguration -> Assertion
testConsistency transportF cfg = do
transport <- transportF
with3Servers transport cfg $ \vRafts -> do
pause
errOrResult <- race (do
_ <- waitForLeader vRafts
threadDelay $ 30 * 1000 * 1000
... | 1,098 | testConsistency :: (IO Transport) -> RaftConfiguration -> Assertion
testConsistency transportF cfg = do
transport <- transportF
with3Servers transport cfg $ \vRafts -> do
pause
errOrResult <- race (do
_ <- waitForLeader vRafts
threadDelay $ 30 * 1000 * 1000
... | 1,098 | testConsistency transportF cfg = do
transport <- transportF
with3Servers transport cfg $ \vRafts -> do
pause
errOrResult <- race (do
_ <- waitForLeader vRafts
threadDelay $ 30 * 1000 * 1000
return ())
(withClient transport "client1" cf... | 1,030 | false | true | 0 | 24 | 460 | 279 | 126 | 153 | null | null |
blitzcode/conduit-chunked | Main.hs | mit | outputByteBB :: BB.Builder -> Word8 -> BB.Builder
outputByteBB builder w8 = BB.fromWord8 w8 <> builder | 102 | outputByteBB :: BB.Builder -> Word8 -> BB.Builder
outputByteBB builder w8 = BB.fromWord8 w8 <> builder | 102 | outputByteBB builder w8 = BB.fromWord8 w8 <> builder | 52 | false | true | 0 | 7 | 14 | 37 | 18 | 19 | null | null |
chadbrewbaker/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | addNote note = tell [note] | 26 | addNote note = tell [note] | 26 | addNote note = tell [note] | 26 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
peterokagey/haskellOEIS | test/HelperSequences/A057944Spec.hs | apache-2.0 | spec :: Spec
spec = describe "A057944" $
it "correctly computes the first 20 elements" $
take 20 (map a057944 [0..]) `shouldBe` expectedValue where
expectedValue = [0,1,1,3,3,3,6,6,6,6,10,10,10,10,10,15,15,15,15,15] | 227 | spec :: Spec
spec = describe "A057944" $
it "correctly computes the first 20 elements" $
take 20 (map a057944 [0..]) `shouldBe` expectedValue where
expectedValue = [0,1,1,3,3,3,6,6,6,6,10,10,10,10,10,15,15,15,15,15] | 227 | spec = describe "A057944" $
it "correctly computes the first 20 elements" $
take 20 (map a057944 [0..]) `shouldBe` expectedValue where
expectedValue = [0,1,1,3,3,3,6,6,6,6,10,10,10,10,10,15,15,15,15,15] | 214 | false | true | 0 | 10 | 38 | 114 | 68 | 46 | null | null |
dvvc/gapaint | Bitmap.hs | gpl-3.0 | -- |Reads a PNM image into a Bitmap2
readPNM2 :: String -> IO Bitmap2
readPNM2 filename = do
contents <- readFile filename
let noHeaders = drop 2 $ lines contents
[w,h] = map read $ words $ head noHeaders
pixels = map read $ drop 2 noHeaders
return (Bitmap2 (BS.pack pixels) (w,h)) | 299 | readPNM2 :: String -> IO Bitmap2
readPNM2 filename = do
contents <- readFile filename
let noHeaders = drop 2 $ lines contents
[w,h] = map read $ words $ head noHeaders
pixels = map read $ drop 2 noHeaders
return (Bitmap2 (BS.pack pixels) (w,h)) | 262 | readPNM2 filename = do
contents <- readFile filename
let noHeaders = drop 2 $ lines contents
[w,h] = map read $ words $ head noHeaders
pixels = map read $ drop 2 noHeaders
return (Bitmap2 (BS.pack pixels) (w,h)) | 229 | true | true | 0 | 12 | 69 | 122 | 58 | 64 | null | null |
iljakuklic/eel-proto | src/Sema/Infer.hs | bsd-3-clause | -- | infer type of a literal being pushed to the stack
inferLiteral t = niceTyVars (tFunc ph row pr)
where row = TyVar (genTyVar t); pr = row `tProd` t; ph = TyVar (genTyVar pr)
-- | infer type of the function composition g(f(x)), written f g | 247 | inferLiteral t = niceTyVars (tFunc ph row pr)
where row = TyVar (genTyVar t); pr = row `tProd` t; ph = TyVar (genTyVar pr)
-- | infer type of the function composition g(f(x)), written f g | 192 | inferLiteral t = niceTyVars (tFunc ph row pr)
where row = TyVar (genTyVar t); pr = row `tProd` t; ph = TyVar (genTyVar pr)
-- | infer type of the function composition g(f(x)), written f g | 192 | true | false | 0 | 7 | 52 | 68 | 36 | 32 | null | null |
sajith/cis194 | hw07/JoinList.hs | mit | (+++) xs ys = Append (mappend (tag xs) (tag ys)) xs ys | 57 | (+++) xs ys = Append (mappend (tag xs) (tag ys)) xs ys | 57 | (+++) xs ys = Append (mappend (tag xs) (tag ys)) xs ys | 57 | false | false | 0 | 9 | 14 | 41 | 20 | 21 | null | null |
gspindles/mj-score-eval | src/Game/Mahjong/Tile.hs | mit | singEq _ _ = False | 20 | singEq _ _ = False | 20 | singEq _ _ = False | 20 | false | false | 0 | 5 | 6 | 11 | 5 | 6 | null | null |
Lazersmoke/rhc | src/Old/ParseFEST.hs | bsd-3-clause | patternClause :: IParser PatternClause
patternClause =
PatternClause
<$> varName
<*> many patternParser <* lexString "="
<*> expression | 149 | patternClause :: IParser PatternClause
patternClause =
PatternClause
<$> varName
<*> many patternParser <* lexString "="
<*> expression | 149 | patternClause =
PatternClause
<$> varName
<*> many patternParser <* lexString "="
<*> expression | 110 | false | true | 0 | 8 | 30 | 36 | 17 | 19 | null | null |
traunio/helen-haskell | src/Lib.hs | gpl-2.0 | accumulate :: (Reqs, [Unit],[Unit]) -> Unit -> (Reqs, [Unit], [Unit])
accumulate (a,b,c) d =
if lastHour d then flush else (a,b,day)
where day = c++[d]
highs = localMax day
lows = localMin day
optimal = snd (bestMoney a highs lows)
cut = cutTime (tag $ head c) optimal
eqs (TS... | 491 | accumulate :: (Reqs, [Unit],[Unit]) -> Unit -> (Reqs, [Unit], [Unit])
accumulate (a,b,c) d =
if lastHour d then flush else (a,b,day)
where day = c++[d]
highs = localMax day
lows = localMin day
optimal = snd (bestMoney a highs lows)
cut = cutTime (tag $ head c) optimal
eqs (TS... | 491 | accumulate (a,b,c) d =
if lastHour d then flush else (a,b,day)
where day = c++[d]
highs = localMax day
lows = localMin day
optimal = snd (bestMoney a highs lows)
cut = cutTime (tag $ head c) optimal
eqs (TS _ hours) = hours == "14-15"
newA = lastReq a cut
newB... | 421 | false | true | 9 | 10 | 158 | 258 | 128 | 130 | null | null |
akc/sym | Sym/Perm/SSYT.hs | bsd-3-clause | trim :: SSYT -> SSYT
trim = takeWhile (/=[]) | 44 | trim :: SSYT -> SSYT
trim = takeWhile (/=[]) | 44 | trim = takeWhile (/=[]) | 23 | false | true | 0 | 7 | 8 | 24 | 13 | 11 | null | null |
MasseR/xmonadcontrib | XMonad/Prompt.hs | bsd-3-clause | historyNextMatching :: HistoryMatches -> (W.Stack String -> W.Stack String) -> XP ()
historyNextMatching hm@(HistoryMatches ref) next = do
(completed,completions) <- io $ readIORef ref
input <- getInput
if input `elem` completed
then case completions of
Just cs -> do
let cmd = W.f... | 1,353 | historyNextMatching :: HistoryMatches -> (W.Stack String -> W.Stack String) -> XP ()
historyNextMatching hm@(HistoryMatches ref) next = do
(completed,completions) <- io $ readIORef ref
input <- getInput
if input `elem` completed
then case completions of
Just cs -> do
let cmd = W.f... | 1,353 | historyNextMatching hm@(HistoryMatches ref) next = do
(completed,completions) <- io $ readIORef ref
input <- getInput
if input `elem` completed
then case completions of
Just cs -> do
let cmd = W.focus cs
modify $ setCommand cmd
modify $ \s -> s { of... | 1,268 | false | true | 0 | 17 | 377 | 315 | 161 | 154 | null | null |
andorp/bead | src/Bead/View/Content/NewTestScript/Page.hs | bsd-3-clause | hasNoCourses :: PageData -> IHtml
hasNoCourses pd = do
msg <- getI18N
return $ do
let pageTitle = pageDataCata (const $ msg_LinkText_NewTestScript "New Test") (const3 $ msg_LinkText_ModifyTestScript "Modify Test Script") pd
Bootstrap.rowColMd12 $ p $
fromString . msg $ msg_NewTestScript_HasNoCourses "... | 361 | hasNoCourses :: PageData -> IHtml
hasNoCourses pd = do
msg <- getI18N
return $ do
let pageTitle = pageDataCata (const $ msg_LinkText_NewTestScript "New Test") (const3 $ msg_LinkText_ModifyTestScript "Modify Test Script") pd
Bootstrap.rowColMd12 $ p $
fromString . msg $ msg_NewTestScript_HasNoCourses "... | 361 | hasNoCourses pd = do
msg <- getI18N
return $ do
let pageTitle = pageDataCata (const $ msg_LinkText_NewTestScript "New Test") (const3 $ msg_LinkText_ModifyTestScript "Modify Test Script") pd
Bootstrap.rowColMd12 $ p $
fromString . msg $ msg_NewTestScript_HasNoCourses "This user cannot administer any co... | 327 | false | true | 0 | 16 | 63 | 92 | 43 | 49 | null | null |
erochest/betacode | src/Text/BetaCode.hs | apache-2.0 | cchar '\x03f2' = 's' | 20 | cchar '\x03f2' = 's' | 20 | cchar '\x03f2' = 's' | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Ekleog/hasklate | examples/InfiniteList.hs | mit | take x (MyCons y l) = if x == 0 then MyNil else MyCons y (take (x - 1) l) | 73 | take x (MyCons y l) = if x == 0 then MyNil else MyCons y (take (x - 1) l) | 73 | take x (MyCons y l) = if x == 0 then MyNil else MyCons y (take (x - 1) l) | 73 | false | false | 0 | 10 | 19 | 51 | 26 | 25 | null | null |
FranklinChen/musicxml2 | src/Data/Music/MusicXml/Write/Score.hs | bsd-3-clause | riteNoteHead ClusterNoteHead = "cluster"
| 51 | writeNoteHead ClusterNoteHead = "cluster" | 51 | writeNoteHead ClusterNoteHead = "cluster" | 51 | false | false | 0 | 4 | 14 | 10 | 4 | 6 | null | null |
gridaphobe/cabal | Cabal/Distribution/Simple/GHC.hs | bsd-3-clause | buildLib, replLib :: Verbosity -> Cabal.Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Library -> ComponentLocalBuildInfo -> IO ()
buildLib = buildOrReplLib False | 231 | buildLib, replLib :: Verbosity -> Cabal.Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Library -> ComponentLocalBuildInfo -> IO ()
buildLib = buildOrReplLib False | 231 | buildLib = buildOrReplLib False | 31 | false | true | 0 | 12 | 78 | 56 | 28 | 28 | null | null |
danidiaz/lens | tests/templates.hs | bsd-3-clause | checkMansion' :: Lens' (Lebowski a) String
checkMansion' = mansion | 66 | checkMansion' :: Lens' (Lebowski a) String
checkMansion' = mansion | 66 | checkMansion' = mansion | 23 | false | true | 0 | 7 | 8 | 22 | 11 | 11 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/general/haskellforall/src/X_2012_01_01_loops.hs | unlicense | -- LOOPS
{-
C:
void printer(double *xs, size_t num_xs)
{
for (i = 0; i < num_xs; i++)
{ printf("%f\n", xs[i]); }
}
-}
{- TODO
-- printer1 :: (Show a) => [a] -> Int -> IO ()
printer1 xs n = flip execStateT 0 $
for (put 0) (liftM (< n) get) (modify (+ 1)) $ do
i' <- get
print $ xs !! i'
-}
... | 395 | printer2 :: (Show a) => [a] -> IO ()
printer2 xs = forM_ xs $ \x -> print x | 75 | printer2 xs = forM_ xs $ \x -> print x | 38 | true | true | 2 | 9 | 116 | 58 | 29 | 29 | null | null |
TomMD/cryptol | sbv/Data/SBV/Provers/Prover.hs | bsd-3-clause | prove :: Provable a => a -> IO ThmResult
prove = proveWith defaultSMTCfg | 72 | prove :: Provable a => a -> IO ThmResult
prove = proveWith defaultSMTCfg | 72 | prove = proveWith defaultSMTCfg | 31 | false | true | 0 | 7 | 12 | 28 | 13 | 15 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.