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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dbp/mealstrat | src/Lib.hs | isc | fieldRead :: Read a => RowParser a
fieldRead = do s <- field
case readMaybe s of
Nothing -> fail ("Could not read value: " <> s)
Just v -> return v | 196 | fieldRead :: Read a => RowParser a
fieldRead = do s <- field
case readMaybe s of
Nothing -> fail ("Could not read value: " <> s)
Just v -> return v | 196 | fieldRead = do s <- field
case readMaybe s of
Nothing -> fail ("Could not read value: " <> s)
Just v -> return v | 161 | false | true | 0 | 12 | 80 | 66 | 30 | 36 | null | null |
AaronFriel/eff-experiments | src/Data/Iota/Tagged/Eff1.hs | bsd-3-clause | ts1r = ((10,10) ==) $ run (runState ts1 (0::Int)) | 49 | ts1r = ((10,10) ==) $ run (runState ts1 (0::Int)) | 49 | ts1r = ((10,10) ==) $ run (runState ts1 (0::Int)) | 49 | false | false | 3 | 8 | 8 | 41 | 21 | 20 | null | null |
jystic/QuickSpec | new/Utils.hs | bsd-3-clause | repeatM :: Monad m => m a -> m [a]
repeatM = sequence . repeat | 62 | repeatM :: Monad m => m a -> m [a]
repeatM = sequence . repeat | 62 | repeatM = sequence . repeat | 27 | false | true | 0 | 8 | 14 | 35 | 17 | 18 | null | null |
romanb/amazonka | amazonka-cloudhsm/gen/Network/AWS/CloudHSM/DeleteLunaClient.hs | mpl-2.0 | -- | 'DeleteLunaClient' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'dlc1ClientArn' @::@ 'Text'
--
deleteLunaClient :: Text -- ^ 'dlc1ClientArn'
-> DeleteLunaClient
deleteLunaClient p1 = DeleteLunaClient
{ _dlc1ClientArn = p1
} | 291 | deleteLunaClient :: Text -- ^ 'dlc1ClientArn'
-> DeleteLunaClient
deleteLunaClient p1 = DeleteLunaClient
{ _dlc1ClientArn = p1
} | 153 | deleteLunaClient p1 = DeleteLunaClient
{ _dlc1ClientArn = p1
} | 70 | true | true | 0 | 6 | 61 | 33 | 21 | 12 | null | null |
sopvop/cabal | cabal-install/Distribution/Client/BuildTarget.hs | bsd-3-clause | -- | Get the 'ComponentName' that the 'BuildTarget' is referring to, if any.
-- The 'BuildTargetPackage' target kind doesn't refer to any individual
-- component, while the component, module and file kinds do.
--
buildTargetComponentName :: BuildTarget pkg -> Maybe ComponentName
buildTargetComponentName (BuildTargetPackage _p) = Nothing | 347 | buildTargetComponentName :: BuildTarget pkg -> Maybe ComponentName
buildTargetComponentName (BuildTargetPackage _p) = Nothing | 134 | buildTargetComponentName (BuildTargetPackage _p) = Nothing | 67 | true | true | 0 | 7 | 54 | 34 | 18 | 16 | null | null |
mtolly/rhythm | src/Data/Rhythm/Time.hs | gpl-3.0 | -- | Uses tempos to convert an event-list from timestamps to beatstamps.
fromTimeTrack :: Status.T Seconds BPS -> RTB.T Seconds a -> RTB.T Beats a
fromTimeTrack = Status.applyTime . fmap fromTime | 195 | fromTimeTrack :: Status.T Seconds BPS -> RTB.T Seconds a -> RTB.T Beats a
fromTimeTrack = Status.applyTime . fmap fromTime | 122 | fromTimeTrack = Status.applyTime . fmap fromTime | 48 | true | true | 0 | 8 | 30 | 50 | 24 | 26 | null | null |
VictorCMiraldo/mmm | MMM/OOP/OrdVarSet.hs | mit | ordvsUnifyWith :: (IsVar id, Monad m) => VS id -> OrdVS id m HsExp
ordvsUnifyWith target
= do
vs <- get
-- two var-sets curr and new are unifiable when new \subseteq curr
when (not $ unifiable (vsKeys vs) (vsKeys target))
$ bug (target, vs) "Can't unify the varsets."
let projs = map (fromJust . flip vsMkProj vs) $ vsSortedKeys target
put target
let i = vsCata (\_ -> 0) (\i _ -> i) target
return $ buildSplit i projs
where
unifiable currVs = all (`elem` currVs)
buildSplit _ [] = HsEId
buildSplit 0 ls = foldl1 HsESplit ls
buildSplit i ls = let (focus, rest) = splitAt i ls
in case rest of
[] -> (foldl1 HsESplit focus)
_ -> HsESplit (foldl1 HsESplit focus) (foldl1 HsESplit rest)
-- |Performs an assoc operation, by selecting a list of variables and
-- pushing them to the beginning of the list.
--
-- @ordvsAssoc ["d", "c"] = split (split p4 p3) (split p1 p2)@
--
-- Note that after a ordvsAssoc the input type becomes focused. There's
-- more detail on this in the report, but we have to fix it afterwards, otherwise
-- some OrdVS functions might fail. You should call 'ordvsRmFocus' to get back to
-- a single VS. | 1,269 | ordvsUnifyWith :: (IsVar id, Monad m) => VS id -> OrdVS id m HsExp
ordvsUnifyWith target
= do
vs <- get
-- two var-sets curr and new are unifiable when new \subseteq curr
when (not $ unifiable (vsKeys vs) (vsKeys target))
$ bug (target, vs) "Can't unify the varsets."
let projs = map (fromJust . flip vsMkProj vs) $ vsSortedKeys target
put target
let i = vsCata (\_ -> 0) (\i _ -> i) target
return $ buildSplit i projs
where
unifiable currVs = all (`elem` currVs)
buildSplit _ [] = HsEId
buildSplit 0 ls = foldl1 HsESplit ls
buildSplit i ls = let (focus, rest) = splitAt i ls
in case rest of
[] -> (foldl1 HsESplit focus)
_ -> HsESplit (foldl1 HsESplit focus) (foldl1 HsESplit rest)
-- |Performs an assoc operation, by selecting a list of variables and
-- pushing them to the beginning of the list.
--
-- @ordvsAssoc ["d", "c"] = split (split p4 p3) (split p1 p2)@
--
-- Note that after a ordvsAssoc the input type becomes focused. There's
-- more detail on this in the report, but we have to fix it afterwards, otherwise
-- some OrdVS functions might fail. You should call 'ordvsRmFocus' to get back to
-- a single VS. | 1,269 | ordvsUnifyWith target
= do
vs <- get
-- two var-sets curr and new are unifiable when new \subseteq curr
when (not $ unifiable (vsKeys vs) (vsKeys target))
$ bug (target, vs) "Can't unify the varsets."
let projs = map (fromJust . flip vsMkProj vs) $ vsSortedKeys target
put target
let i = vsCata (\_ -> 0) (\i _ -> i) target
return $ buildSplit i projs
where
unifiable currVs = all (`elem` currVs)
buildSplit _ [] = HsEId
buildSplit 0 ls = foldl1 HsESplit ls
buildSplit i ls = let (focus, rest) = splitAt i ls
in case rest of
[] -> (foldl1 HsESplit focus)
_ -> HsESplit (foldl1 HsESplit focus) (foldl1 HsESplit rest)
-- |Performs an assoc operation, by selecting a list of variables and
-- pushing them to the beginning of the list.
--
-- @ordvsAssoc ["d", "c"] = split (split p4 p3) (split p1 p2)@
--
-- Note that after a ordvsAssoc the input type becomes focused. There's
-- more detail on this in the report, but we have to fix it afterwards, otherwise
-- some OrdVS functions might fail. You should call 'ordvsRmFocus' to get back to
-- a single VS. | 1,202 | false | true | 3 | 14 | 358 | 334 | 160 | 174 | null | null |
barrucadu/nagi | lib/Prelude.hs | mit | sequence_ = F.sequenceA_ | 24 | sequence_ = F.sequenceA_ | 24 | sequence_ = F.sequenceA_ | 24 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
matthewSorensen/himpress | Himpress/Modes/Haskell.hs | bsd-3-clause | haskBox = Mode {name = "haskell-box",parser = parseCredit,format = Right $ (Left .). form} | 90 | haskBox = Mode {name = "haskell-box",parser = parseCredit,format = Right $ (Left .). form} | 90 | haskBox = Mode {name = "haskell-box",parser = parseCredit,format = Right $ (Left .). form} | 90 | false | false | 0 | 9 | 13 | 38 | 23 | 15 | null | null |
ajsmith/project-euler-solutions | src/Problem59.hs | gpl-2.0 | decrypt (k1:k2:k3:[]) (c1:[]) = [c1 `xor` k1] | 45 | decrypt (k1:k2:k3:[]) (c1:[]) = [c1 `xor` k1] | 45 | decrypt (k1:k2:k3:[]) (c1:[]) = [c1 `xor` k1] | 45 | false | false | 0 | 10 | 6 | 46 | 25 | 21 | null | null |
andir/ganeti | src/Ganeti/HTools/Program/Hcheck.hs | bsd-2-clause | -- | Print mapping from group idx to group uuid (only in machine
-- readable mode).
printGroupsMappings :: Group.List -> IO ()
printGroupsMappings gl = do
let extract_vals g = (printf "GROUP_UUID_%d" $ Group.idx g :: String,
Group.uuid g)
printpairs = map extract_vals (Container.elems gl)
printKeysHTC printpairs
-- | Prepare a single key given a certain level and phase of simulation. | 429 | printGroupsMappings :: Group.List -> IO ()
printGroupsMappings gl = do
let extract_vals g = (printf "GROUP_UUID_%d" $ Group.idx g :: String,
Group.uuid g)
printpairs = map extract_vals (Container.elems gl)
printKeysHTC printpairs
-- | Prepare a single key given a certain level and phase of simulation. | 345 | printGroupsMappings gl = do
let extract_vals g = (printf "GROUP_UUID_%d" $ Group.idx g :: String,
Group.uuid g)
printpairs = map extract_vals (Container.elems gl)
printKeysHTC printpairs
-- | Prepare a single key given a certain level and phase of simulation. | 302 | true | true | 0 | 13 | 103 | 90 | 44 | 46 | null | null |
sdiehl/ghc | libraries/base/System/IO/Error.hs | bsd-3-clause | -- | I\/O error where the operation failed because the device is full.
fullErrorType :: IOErrorType
fullErrorType = ResourceExhausted | 156 | fullErrorType :: IOErrorType
fullErrorType = ResourceExhausted | 85 | fullErrorType = ResourceExhausted | 45 | true | true | 0 | 4 | 41 | 12 | 7 | 5 | null | null |
flocc-net/flocc | v0.1/Compiler/Types2/TypeInfo.hs | apache-2.0 | partDimLocations = [("DMap", 5), ("DArr", 5), ("DList", 3)] :: TyLocs | 69 | partDimLocations = [("DMap", 5), ("DArr", 5), ("DList", 3)] :: TyLocs | 69 | partDimLocations = [("DMap", 5), ("DArr", 5), ("DList", 3)] :: TyLocs | 69 | false | false | 0 | 6 | 9 | 36 | 23 | 13 | null | null |
HaskellCNOrg/snap-web | tests/Controllers/TagsTest.hs | bsd-3-clause | tests :: Test
tests = testGroup "Test.Controllers.Tag.saveTags"
[ testCase "just empty if input empty" $ (@?=) (filterExistsTags [] []) []
, testCase "just return if no-exists" $ (@?=) (filterExistsTags inputTags []) inputTags
, testCase "just empty if input empyt" $ (@?=) (filterExistsTags [] exTags) []
, testCase "got tag1 as only it is new" $ (@?=) (filterExistsTags inputTags exTags) newTag
] | 418 | tests :: Test
tests = testGroup "Test.Controllers.Tag.saveTags"
[ testCase "just empty if input empty" $ (@?=) (filterExistsTags [] []) []
, testCase "just return if no-exists" $ (@?=) (filterExistsTags inputTags []) inputTags
, testCase "just empty if input empyt" $ (@?=) (filterExistsTags [] exTags) []
, testCase "got tag1 as only it is new" $ (@?=) (filterExistsTags inputTags exTags) newTag
] | 418 | tests = testGroup "Test.Controllers.Tag.saveTags"
[ testCase "just empty if input empty" $ (@?=) (filterExistsTags [] []) []
, testCase "just return if no-exists" $ (@?=) (filterExistsTags inputTags []) inputTags
, testCase "just empty if input empyt" $ (@?=) (filterExistsTags [] exTags) []
, testCase "got tag1 as only it is new" $ (@?=) (filterExistsTags inputTags exTags) newTag
] | 404 | false | true | 0 | 11 | 80 | 128 | 66 | 62 | null | null |
uduki/hsQt | demos/PathDeform.hs | bsd-2-clause | pdRenderer_mouseDrag :: PathDeformRenderer -> IO Bool
pdRenderer_mouseDrag pdr = readIORef $ pdRr_m_mouseDrag_io pdr | 116 | pdRenderer_mouseDrag :: PathDeformRenderer -> IO Bool
pdRenderer_mouseDrag pdr = readIORef $ pdRr_m_mouseDrag_io pdr | 116 | pdRenderer_mouseDrag pdr = readIORef $ pdRr_m_mouseDrag_io pdr | 62 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
bennofs/cabal2nix | src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs | bsd-3-clause | libNixName "ruby1.8" = return "ruby" | 63 | libNixName "ruby1.8" = return "ruby" | 63 | libNixName "ruby1.8" = return "ruby" | 63 | false | false | 0 | 5 | 31 | 13 | 5 | 8 | null | null |
nickng/gong | Gong.hs | apache-2.0 | subargs = Checker { check = submodes
, gofile = def &= argPos 0 &= typ "FILE"
, kbound = def &= opt "-1" &= argPos 1 &= typ "INT (optional bound)"
}
&= help "Go-Types liveness and safety checks" | 259 | subargs = Checker { check = submodes
, gofile = def &= argPos 0 &= typ "FILE"
, kbound = def &= opt "-1" &= argPos 1 &= typ "INT (optional bound)"
}
&= help "Go-Types liveness and safety checks" | 259 | subargs = Checker { check = submodes
, gofile = def &= argPos 0 &= typ "FILE"
, kbound = def &= opt "-1" &= argPos 1 &= typ "INT (optional bound)"
}
&= help "Go-Types liveness and safety checks" | 259 | false | false | 3 | 10 | 104 | 73 | 35 | 38 | null | null |
lukexi/ghc | compiler/simplCore/CallArity.hs | bsd-3-clause | resDel :: Var -> CallArityRes -> CallArityRes
resDel v (g, ae) = (g `delNode` v, ae `delVarEnv` v) | 98 | resDel :: Var -> CallArityRes -> CallArityRes
resDel v (g, ae) = (g `delNode` v, ae `delVarEnv` v) | 98 | resDel v (g, ae) = (g `delNode` v, ae `delVarEnv` v) | 52 | false | true | 0 | 9 | 17 | 54 | 29 | 25 | null | null |
keithodulaigh/Hets | CSL/Print_AS.hs | gpl-2.0 | printDomain :: (Ord a, Pretty a) => SetOrInterval a -> Doc
printDomain (Set s) = pretty s | 89 | printDomain :: (Ord a, Pretty a) => SetOrInterval a -> Doc
printDomain (Set s) = pretty s | 89 | printDomain (Set s) = pretty s | 30 | false | true | 0 | 7 | 16 | 45 | 22 | 23 | null | null |
edom/sound | src/Sound/Function.hs | bsd-3-clause | -- | This is specialized 'id'.
fid :: F a a
fid = mkf id | 56 | fid :: F a a
fid = mkf id | 25 | fid = mkf id | 12 | true | true | 1 | 5 | 14 | 23 | 10 | 13 | null | null |
forste/haReFork | refactorer/RefacUnfoldAsPatterns.hs | bsd-3-clause | -- modify this? lets in e2?
getPats _ = error "Pattern is not associated with an as-pattern. Check Pattern is highlight correctly!" | 132 | getPats _ = error "Pattern is not associated with an as-pattern. Check Pattern is highlight correctly!" | 103 | getPats _ = error "Pattern is not associated with an as-pattern. Check Pattern is highlight correctly!" | 103 | true | false | 0 | 5 | 22 | 13 | 6 | 7 | null | null |
google/hs-fin-vec | short-vec/test/Benchmark.hs | apache-2.0 | benchPure = G.bench "pure" $ G.whnf (pure :: Int -> Vec 64 Int) 42 | 66 | benchPure = G.bench "pure" $ G.whnf (pure :: Int -> Vec 64 Int) 42 | 66 | benchPure = G.bench "pure" $ G.whnf (pure :: Int -> Vec 64 Int) 42 | 66 | false | false | 0 | 9 | 13 | 37 | 18 | 19 | null | null |
fedelebron/AVL | Data/Tree/AVL/Static/Internal.hs | bsd-3-clause | deleteBST :: Eq a => Zipper a -> AVLTree a
deleteBST (Zipper (Balanced _ Nil Nil) ctx) = rebalance Nil ctx | 106 | deleteBST :: Eq a => Zipper a -> AVLTree a
deleteBST (Zipper (Balanced _ Nil Nil) ctx) = rebalance Nil ctx | 106 | deleteBST (Zipper (Balanced _ Nil Nil) ctx) = rebalance Nil ctx | 63 | false | true | 0 | 8 | 20 | 58 | 26 | 32 | null | null |
AaronFriel/hyhac | sandbox/src/Chaos/IORef.hs | bsd-3-clause | readIORef = withChaos . IORef.readIORef | 39 | readIORef = withChaos . IORef.readIORef | 39 | readIORef = withChaos . IORef.readIORef | 39 | false | false | 2 | 6 | 4 | 17 | 6 | 11 | null | null |
esmolanka/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | ppSideBySideConstr :: [(DocName, DocForDecl DocName)] -> Bool -> LaTeX
-> LConDecl DocName -> LaTeX
ppSideBySideConstr subdocs unicode leader (L _ con) =
leader <->
case con_res con of
ResTyH98 -> case con_details con of
PrefixCon args ->
decltt (hsep ((header_ unicode <+> ppOcc) :
map (ppLParendType unicode) args))
<-> rDoc mbDoc <+> nl
RecCon (L _ fields) ->
(decltt (header_ unicode <+> ppOcc)
<-> rDoc mbDoc <+> nl)
$$
doRecordFields fields
InfixCon arg1 arg2 ->
decltt (hsep [ header_ unicode <+> ppLParendType unicode arg1,
ppOcc,
ppLParendType unicode arg2 ])
<-> rDoc mbDoc <+> nl
ResTyGADT _ resTy -> case con_details con of
-- prefix & infix could also use hsConDeclArgTys if it seemed to
-- simplify the code.
PrefixCon args -> doGADTCon args resTy
cd@(RecCon (L _ fields)) -> doGADTCon (hsConDeclArgTys cd) resTy <+> nl $$
doRecordFields fields
InfixCon arg1 arg2 -> doGADTCon [arg1, arg2] resTy
where
doRecordFields fields =
vcat (map (ppSideBySideField subdocs unicode) (map unLoc fields))
doGADTCon args resTy = decltt (ppOcc <+> dcolon unicode <+> hsep [
ppForAll forall ltvs (con_cxt con) unicode,
ppLType unicode (foldr mkFunTy resTy args) ]
) <-> rDoc mbDoc
header_ = ppConstrHdr forall tyVars context
occ = map (nameOccName . getName . unLoc) $ con_names con
ppOcc = case occ of
[one] -> ppBinder one
_ -> cat (punctuate comma (map ppBinder occ))
ltvs = con_qvars con
tyVars = tyvarNames (con_qvars con)
context = unLoc (con_cxt con)
forall = con_explicit con
-- don't use "con_doc con", in case it's reconstructed from a .hi file,
-- or also because we want Haddock to do the doc-parsing, not GHC.
mbDoc = case con_names con of
[] -> panic "empty con_names"
(cn:_) -> lookup (unLoc cn) subdocs >>=
fmap _doc . combineDocumentation . fst
mkFunTy a b = noLoc (HsFunTy a b) | 2,228 | ppSideBySideConstr :: [(DocName, DocForDecl DocName)] -> Bool -> LaTeX
-> LConDecl DocName -> LaTeX
ppSideBySideConstr subdocs unicode leader (L _ con) =
leader <->
case con_res con of
ResTyH98 -> case con_details con of
PrefixCon args ->
decltt (hsep ((header_ unicode <+> ppOcc) :
map (ppLParendType unicode) args))
<-> rDoc mbDoc <+> nl
RecCon (L _ fields) ->
(decltt (header_ unicode <+> ppOcc)
<-> rDoc mbDoc <+> nl)
$$
doRecordFields fields
InfixCon arg1 arg2 ->
decltt (hsep [ header_ unicode <+> ppLParendType unicode arg1,
ppOcc,
ppLParendType unicode arg2 ])
<-> rDoc mbDoc <+> nl
ResTyGADT _ resTy -> case con_details con of
-- prefix & infix could also use hsConDeclArgTys if it seemed to
-- simplify the code.
PrefixCon args -> doGADTCon args resTy
cd@(RecCon (L _ fields)) -> doGADTCon (hsConDeclArgTys cd) resTy <+> nl $$
doRecordFields fields
InfixCon arg1 arg2 -> doGADTCon [arg1, arg2] resTy
where
doRecordFields fields =
vcat (map (ppSideBySideField subdocs unicode) (map unLoc fields))
doGADTCon args resTy = decltt (ppOcc <+> dcolon unicode <+> hsep [
ppForAll forall ltvs (con_cxt con) unicode,
ppLType unicode (foldr mkFunTy resTy args) ]
) <-> rDoc mbDoc
header_ = ppConstrHdr forall tyVars context
occ = map (nameOccName . getName . unLoc) $ con_names con
ppOcc = case occ of
[one] -> ppBinder one
_ -> cat (punctuate comma (map ppBinder occ))
ltvs = con_qvars con
tyVars = tyvarNames (con_qvars con)
context = unLoc (con_cxt con)
forall = con_explicit con
-- don't use "con_doc con", in case it's reconstructed from a .hi file,
-- or also because we want Haddock to do the doc-parsing, not GHC.
mbDoc = case con_names con of
[] -> panic "empty con_names"
(cn:_) -> lookup (unLoc cn) subdocs >>=
fmap _doc . combineDocumentation . fst
mkFunTy a b = noLoc (HsFunTy a b) | 2,228 | ppSideBySideConstr subdocs unicode leader (L _ con) =
leader <->
case con_res con of
ResTyH98 -> case con_details con of
PrefixCon args ->
decltt (hsep ((header_ unicode <+> ppOcc) :
map (ppLParendType unicode) args))
<-> rDoc mbDoc <+> nl
RecCon (L _ fields) ->
(decltt (header_ unicode <+> ppOcc)
<-> rDoc mbDoc <+> nl)
$$
doRecordFields fields
InfixCon arg1 arg2 ->
decltt (hsep [ header_ unicode <+> ppLParendType unicode arg1,
ppOcc,
ppLParendType unicode arg2 ])
<-> rDoc mbDoc <+> nl
ResTyGADT _ resTy -> case con_details con of
-- prefix & infix could also use hsConDeclArgTys if it seemed to
-- simplify the code.
PrefixCon args -> doGADTCon args resTy
cd@(RecCon (L _ fields)) -> doGADTCon (hsConDeclArgTys cd) resTy <+> nl $$
doRecordFields fields
InfixCon arg1 arg2 -> doGADTCon [arg1, arg2] resTy
where
doRecordFields fields =
vcat (map (ppSideBySideField subdocs unicode) (map unLoc fields))
doGADTCon args resTy = decltt (ppOcc <+> dcolon unicode <+> hsep [
ppForAll forall ltvs (con_cxt con) unicode,
ppLType unicode (foldr mkFunTy resTy args) ]
) <-> rDoc mbDoc
header_ = ppConstrHdr forall tyVars context
occ = map (nameOccName . getName . unLoc) $ con_names con
ppOcc = case occ of
[one] -> ppBinder one
_ -> cat (punctuate comma (map ppBinder occ))
ltvs = con_qvars con
tyVars = tyvarNames (con_qvars con)
context = unLoc (con_cxt con)
forall = con_explicit con
-- don't use "con_doc con", in case it's reconstructed from a .hi file,
-- or also because we want Haddock to do the doc-parsing, not GHC.
mbDoc = case con_names con of
[] -> panic "empty con_names"
(cn:_) -> lookup (unLoc cn) subdocs >>=
fmap _doc . combineDocumentation . fst
mkFunTy a b = noLoc (HsFunTy a b) | 2,109 | false | true | 10 | 18 | 731 | 640 | 313 | 327 | null | null |
jyp/Parsek | Text/ParserCombinators/Parsek.hs | gpl-3.0 | first f (a,b) = (f a,b) | 23 | first f (a,b) = (f a,b) | 23 | first f (a,b) = (f a,b) | 23 | false | false | 0 | 6 | 5 | 26 | 14 | 12 | null | null |
ichistmeinname/holumbus | src/Holumbus/Query/Language/Grammar.hs | mit | optimize q = q | 14 | optimize q = q | 14 | optimize q = q | 14 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
sdiehl/ghc | compiler/GHC/Hs/Expr.hs | bsd-3-clause | isQuietHsCmd :: HsCmd id -> Bool
-- Parentheses do display something, but it gives little info and
-- if we go deeper when we go inside them then we get ugly things
-- like (...)
isQuietHsCmd (HsCmdPar {}) = True | 212 | isQuietHsCmd :: HsCmd id -> Bool
isQuietHsCmd (HsCmdPar {}) = True | 66 | isQuietHsCmd (HsCmdPar {}) = True | 33 | true | true | 0 | 7 | 39 | 31 | 17 | 14 | null | null |
sbergot/ArgParser | tests/System/Console/ArgParser/ParserTest.hs | bsd-3-clause | prop_parse
:: Positive Int
-> Positive Int
-> Bool
prop_parse (Positive i) (Positive j) =
Right (MyTest i j) == specRun myTestParser [show i, show j] | 162 | prop_parse
:: Positive Int
-> Positive Int
-> Bool
prop_parse (Positive i) (Positive j) =
Right (MyTest i j) == specRun myTestParser [show i, show j] | 161 | prop_parse (Positive i) (Positive j) =
Right (MyTest i j) == specRun myTestParser [show i, show j] | 101 | false | true | 2 | 10 | 38 | 66 | 31 | 35 | null | null |
josercruz01/hsoptions | src/System/Console/HsOptions/ParserCore.hs | apache-2.0 | -- | Map of operation keywords to the corresponding operation token.
operationsKeyMap :: [(String, OperationToken)]
operationsKeyMap = [ ("+=!", OperationTokenAppend')
, ("+=", OperationTokenAppend)
, ("=+!", OperationTokenPrepend')
, ("=+", OperationTokenPrepend)
, ("=", OperationTokenAssign)
] | 391 | operationsKeyMap :: [(String, OperationToken)]
operationsKeyMap = [ ("+=!", OperationTokenAppend')
, ("+=", OperationTokenAppend)
, ("=+!", OperationTokenPrepend')
, ("=+", OperationTokenPrepend)
, ("=", OperationTokenAssign)
] | 322 | operationsKeyMap = [ ("+=!", OperationTokenAppend')
, ("+=", OperationTokenAppend)
, ("=+!", OperationTokenPrepend')
, ("=+", OperationTokenPrepend)
, ("=", OperationTokenAssign)
] | 275 | true | true | 0 | 6 | 127 | 66 | 43 | 23 | null | null |
FranklinChen/IHaskell | main/Main.hs | mit | showingHelp :: IHaskellMode -> [Argument] -> IO () -> IO ()
showingHelp mode flags act =
case find (== Help) flags of
Just _ ->
putStrLn $ help mode
Nothing ->
act
-- | Parse initialization information from the flags. | 240 | showingHelp :: IHaskellMode -> [Argument] -> IO () -> IO ()
showingHelp mode flags act =
case find (== Help) flags of
Just _ ->
putStrLn $ help mode
Nothing ->
act
-- | Parse initialization information from the flags. | 240 | showingHelp mode flags act =
case find (== Help) flags of
Just _ ->
putStrLn $ help mode
Nothing ->
act
-- | Parse initialization information from the flags. | 180 | false | true | 0 | 10 | 62 | 84 | 40 | 44 | null | null |
wereHamster/nauva | pkg/hs/nauva/src/Nauva/View/Terms.hs | mit | div_ :: Term arg res => arg -> res
div_ = term "div" | 52 | div_ :: Term arg res => arg -> res
div_ = term "div" | 52 | div_ = term "div" | 17 | false | true | 0 | 8 | 12 | 34 | 14 | 20 | null | null |
ethercrow/y | src/Y/Mode/Erlang.hs | bsd-3-clause | erlangMode :: Mode
erlangMode bufBehavior = do
let Just highlighter = kateHighlighter "Erlang"
overlayEvent <- highlightEventForBuffer bufBehavior highlighter
return $! ModeOutput overlayEvent id Indenter | 216 | erlangMode :: Mode
erlangMode bufBehavior = do
let Just highlighter = kateHighlighter "Erlang"
overlayEvent <- highlightEventForBuffer bufBehavior highlighter
return $! ModeOutput overlayEvent id Indenter | 216 | erlangMode bufBehavior = do
let Just highlighter = kateHighlighter "Erlang"
overlayEvent <- highlightEventForBuffer bufBehavior highlighter
return $! ModeOutput overlayEvent id Indenter | 197 | false | true | 0 | 10 | 35 | 56 | 24 | 32 | null | null |
ganeti/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | ndsParameters :: FrozenSet String
ndsParameters = ConstantUtils.mkSet (Map.keys ndsParameterTypes) | 98 | ndsParameters :: FrozenSet String
ndsParameters = ConstantUtils.mkSet (Map.keys ndsParameterTypes) | 98 | ndsParameters = ConstantUtils.mkSet (Map.keys ndsParameterTypes) | 64 | false | true | 0 | 8 | 8 | 27 | 13 | 14 | null | null |
elginer/Delve | src/VMASTCompiler.hs | gpl-3.0 | write_args :: [ Symbol ] -> [ Exp ]
write_args args = L.zipWith ( \ i a -> appl [ ast_var "WriteArg" , Lit $ Int $ fromIntegral i , ast_symbol a ] ) [ 0 .. ] args | 163 | write_args :: [ Symbol ] -> [ Exp ]
write_args args = L.zipWith ( \ i a -> appl [ ast_var "WriteArg" , Lit $ Int $ fromIntegral i , ast_symbol a ] ) [ 0 .. ] args | 163 | write_args args = L.zipWith ( \ i a -> appl [ ast_var "WriteArg" , Lit $ Int $ fromIntegral i , ast_symbol a ] ) [ 0 .. ] args | 127 | false | true | 0 | 11 | 39 | 76 | 40 | 36 | null | null |
inq/agitpunkt | src/Core/Request.hs | agpl-3.0 | splitLines :: Text -> [Text]
-- ^ Split the lines from the HTTP header
splitLines str =
case Text.findIndex (== '\r') str of
Just i
| i > 2 -> Text.take i str : splitLines (Text.drop (i + 2) str)
Just _ -> [Text.drop 2 str]
Nothing -> [""] | 259 | splitLines :: Text -> [Text]
splitLines str =
case Text.findIndex (== '\r') str of
Just i
| i > 2 -> Text.take i str : splitLines (Text.drop (i + 2) str)
Just _ -> [Text.drop 2 str]
Nothing -> [""] | 217 | splitLines str =
case Text.findIndex (== '\r') str of
Just i
| i > 2 -> Text.take i str : splitLines (Text.drop (i + 2) str)
Just _ -> [Text.drop 2 str]
Nothing -> [""] | 188 | true | true | 0 | 14 | 68 | 115 | 57 | 58 | null | null |
badp/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | -- This is 'create and get'
cryptoActionCreate :: String
cryptoActionCreate = "create" | 86 | cryptoActionCreate :: String
cryptoActionCreate = "create" | 58 | cryptoActionCreate = "create" | 29 | true | true | 0 | 4 | 11 | 12 | 7 | 5 | null | null |
sdiehl/ghc | compiler/GHC/Hs/Decls.hs | bsd-3-clause | annProvenanceName_maybe (TypeAnnProvenance (L _ name)) = Just name | 67 | annProvenanceName_maybe (TypeAnnProvenance (L _ name)) = Just name | 67 | annProvenanceName_maybe (TypeAnnProvenance (L _ name)) = Just name | 67 | false | false | 0 | 9 | 8 | 26 | 12 | 14 | null | null |
CloudI/CloudI | src/api/haskell/external/binary-0.8.7.0/tests/QC.hs | mit | -- low level ones:
--
-- Words
prop_Word8 :: Word8 -> Property
prop_Word8 = roundTripWith putWord8 getWord8 | 108 | prop_Word8 :: Word8 -> Property
prop_Word8 = roundTripWith putWord8 getWord8 | 76 | prop_Word8 = roundTripWith putWord8 getWord8 | 44 | true | true | 0 | 5 | 17 | 23 | 13 | 10 | null | null |
frantisekfarka/ghc-dsi | libraries/base/Data/List.hs | bsd-3-clause | nubBy eq [] = [] | 29 | nubBy eq [] = [] | 29 | nubBy eq [] = [] | 29 | false | false | 0 | 6 | 17 | 15 | 7 | 8 | null | null |
vollmerm/accelerate-apart | Data/Array/Accelerate/Apart/Exp.hs | bsd-3-clause | fun2ToC _aenv _ = error "D.A.A.A.Exp.fun2ToC: unreachable" | 58 | fun2ToC _aenv _ = error "D.A.A.A.Exp.fun2ToC: unreachable" | 58 | fun2ToC _aenv _ = error "D.A.A.A.Exp.fun2ToC: unreachable" | 58 | false | false | 0 | 5 | 6 | 14 | 6 | 8 | null | null |
Davorak/mdistribute | src/Control/Monad/Distribute.hs | bsd-3-clause | distributeRWSStrict m = rwsGS (\w s -> RWSS.runRWST m w s) | 58 | distributeRWSStrict m = rwsGS (\w s -> RWSS.runRWST m w s) | 58 | distributeRWSStrict m = rwsGS (\w s -> RWSS.runRWST m w s) | 58 | false | false | 1 | 9 | 10 | 35 | 15 | 20 | null | null |
emhoracek/explora | library/Actions.hs | gpl-2.0 | -- TODO: fix this whole mess. Per R0ml: Actions are actions, i.e. functions. Lookup reification.
-- | Checks if it's possible to verb that noun.
validateAction :: Either Response Input -> Game -> Response
validateAction input game = case input of
Left response -> response
Right goodInput -> tryAction goodInput game
-- | Takes a verb, noun input and find the appropriate response. | 394 | validateAction :: Either Response Input -> Game -> Response
validateAction input game = case input of
Left response -> response
Right goodInput -> tryAction goodInput game
-- | Takes a verb, noun input and find the appropriate response. | 248 | validateAction input game = case input of
Left response -> response
Right goodInput -> tryAction goodInput game
-- | Takes a verb, noun input and find the appropriate response. | 188 | true | true | 0 | 8 | 75 | 59 | 29 | 30 | null | null |
j-mueller/hldb | webapp/VirtualHom/Svg.hs | bsd-3-clause | -- | The @startoffset@ attribute.
startOffset :: AttrTag
startOffset = makeAttribute "startOffset" | 98 | startOffset :: AttrTag
startOffset = makeAttribute "startOffset" | 64 | startOffset = makeAttribute "startOffset" | 41 | true | true | 0 | 5 | 11 | 15 | 8 | 7 | null | null |
fhaust/kdtree | src/Data/KDTree.hs | mit | vecSortBy :: G.Vector v a => I.Comparison a -> v a -> v a
vecSortBy f = G.modify (I.sortBy f) | 93 | vecSortBy :: G.Vector v a => I.Comparison a -> v a -> v a
vecSortBy f = G.modify (I.sortBy f) | 93 | vecSortBy f = G.modify (I.sortBy f) | 35 | false | true | 0 | 8 | 19 | 57 | 26 | 31 | null | null |
fredmorcos/attic | projects/pet/archive/pet_haskell_master_complete/Commands.hs | isc | showElements ("months":_) _ _ = Left $ show $ ExcessiveArgs "show months" | 73 | showElements ("months":_) _ _ = Left $ show $ ExcessiveArgs "show months" | 73 | showElements ("months":_) _ _ = Left $ show $ ExcessiveArgs "show months" | 73 | false | false | 0 | 7 | 11 | 31 | 15 | 16 | null | null |
tippenein/google-calendar | test/Web/Google/CalendarSpec.hs | mit | spec :: Spec
spec =
describe "main" $ do
it "returns the unit" $
main `shouldReturn` () | 99 | spec :: Spec
spec =
describe "main" $ do
it "returns the unit" $
main `shouldReturn` () | 99 | spec =
describe "main" $ do
it "returns the unit" $
main `shouldReturn` () | 86 | false | true | 0 | 10 | 28 | 36 | 18 | 18 | null | null |
tuura/fantasi | src/Tuura/Fantasi/VHDL/Internal/GraphWriter.hs | mit | -- | Writes a Pangraph to VHDL
writeGraph :: P.Pangraph -> String
writeGraph g = do
let stats = "-- Nodes: " ++ show (length $ P.vertexList g) ++ " - Edges: " ++ show (length $ P.edgeList g) ++ "\n"
library = createLibrary
entity = createEntity (P.vertexList g)
archOpen = openArchitecture g
regs = "\t-- Registers\n" ++ bindRegisters (P.vertexList g) 0
wiresIn = "\t-- Wire connections: inputs\n" ++ bindWiresIn g
wiresOut = "\t-- Wire connections: outputs\n" ++ bindWiresOut ((length (P.vertexList g)) -1)
archClose = closeArchitecture
stats ++ library ++ entity ++ archOpen ++ regs ++ wiresIn ++ wiresOut ++ archClose | 719 | writeGraph :: P.Pangraph -> String
writeGraph g = do
let stats = "-- Nodes: " ++ show (length $ P.vertexList g) ++ " - Edges: " ++ show (length $ P.edgeList g) ++ "\n"
library = createLibrary
entity = createEntity (P.vertexList g)
archOpen = openArchitecture g
regs = "\t-- Registers\n" ++ bindRegisters (P.vertexList g) 0
wiresIn = "\t-- Wire connections: inputs\n" ++ bindWiresIn g
wiresOut = "\t-- Wire connections: outputs\n" ++ bindWiresOut ((length (P.vertexList g)) -1)
archClose = closeArchitecture
stats ++ library ++ entity ++ archOpen ++ regs ++ wiresIn ++ wiresOut ++ archClose | 687 | writeGraph g = do
let stats = "-- Nodes: " ++ show (length $ P.vertexList g) ++ " - Edges: " ++ show (length $ P.edgeList g) ++ "\n"
library = createLibrary
entity = createEntity (P.vertexList g)
archOpen = openArchitecture g
regs = "\t-- Registers\n" ++ bindRegisters (P.vertexList g) 0
wiresIn = "\t-- Wire connections: inputs\n" ++ bindWiresIn g
wiresOut = "\t-- Wire connections: outputs\n" ++ bindWiresOut ((length (P.vertexList g)) -1)
archClose = closeArchitecture
stats ++ library ++ entity ++ archOpen ++ regs ++ wiresIn ++ wiresOut ++ archClose | 652 | true | true | 0 | 18 | 199 | 208 | 104 | 104 | null | null |
ekmett/wxHaskell | wx/src/Graphics/UI/WX/Menu.hs | lgpl-2.1 | menuUpdateEvtHandlers menu f
= do hs <- menuGetEvtHandlers menu
menuSetEvtHandlers menu (f hs) | 103 | menuUpdateEvtHandlers menu f
= do hs <- menuGetEvtHandlers menu
menuSetEvtHandlers menu (f hs) | 103 | menuUpdateEvtHandlers menu f
= do hs <- menuGetEvtHandlers menu
menuSetEvtHandlers menu (f hs) | 103 | false | false | 0 | 9 | 21 | 35 | 15 | 20 | null | null |
esmolanka/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | lookupAnySubdoc :: (Eq name1) =>
name1 -> [(name1, DocForDecl name2)] -> DocForDecl name2
lookupAnySubdoc n subdocs = case lookup n subdocs of
Nothing -> noDocForDecl
Just docs -> docs
-------------------------------------------------------------------------------
-- * Data & newtype declarations
------------------------------------------------------------------------------- | 402 | lookupAnySubdoc :: (Eq name1) =>
name1 -> [(name1, DocForDecl name2)] -> DocForDecl name2
lookupAnySubdoc n subdocs = case lookup n subdocs of
Nothing -> noDocForDecl
Just docs -> docs
-------------------------------------------------------------------------------
-- * Data & newtype declarations
------------------------------------------------------------------------------- | 402 | lookupAnySubdoc n subdocs = case lookup n subdocs of
Nothing -> noDocForDecl
Just docs -> docs
-------------------------------------------------------------------------------
-- * Data & newtype declarations
------------------------------------------------------------------------------- | 293 | false | true | 3 | 10 | 61 | 77 | 39 | 38 | null | null |
markflorisson/hpack | testrepo/bytestring-0.9.1.9/Data/ByteString/Lazy.hs | bsd-3-clause | eq (Chunk a as) (Chunk b bs) =
case compare (S.length a) (S.length b) of
LT -> a == (S.take (S.length a) b) && eq as (Chunk (S.drop (S.length a) b) bs)
EQ -> a == b && eq as bs
GT -> (S.take (S.length b) a) == b && eq (Chunk (S.drop (S.length b) a) as) bs | 291 | eq (Chunk a as) (Chunk b bs) =
case compare (S.length a) (S.length b) of
LT -> a == (S.take (S.length a) b) && eq as (Chunk (S.drop (S.length a) b) bs)
EQ -> a == b && eq as bs
GT -> (S.take (S.length b) a) == b && eq (Chunk (S.drop (S.length b) a) as) bs | 291 | eq (Chunk a as) (Chunk b bs) =
case compare (S.length a) (S.length b) of
LT -> a == (S.take (S.length a) b) && eq as (Chunk (S.drop (S.length a) b) bs)
EQ -> a == b && eq as bs
GT -> (S.take (S.length b) a) == b && eq (Chunk (S.drop (S.length b) a) as) bs | 291 | false | false | 0 | 16 | 93 | 197 | 96 | 101 | null | null |
maurotrb/haskdeep | src/HaskDeep/Computation.hs | bsd-3-clause | -- | Compute @HashSet@ traversing recursively through the directory structure.
compute :: Hash ctx a => HaskDeepConfiguration
-> ComputationMode a
-> IO HashSet
compute conf cm = runResourceT $ CCB.sourceDirectoryDeep False root $$ CCB.foldM insert_hash empty_with_symbol
where
root = rootDirectory conf
regex = excludeRegex conf
mod_from = includeModFrom conf
mod_upto = includeModUpTo conf
empty_with_symbol = HS.setSymbol (symbol cm) HS.empty
insert_hash :: HashSet -> FilePath -> ResourceT IO HashSet
insert_hash hs fp = do let fpt = T.pack $ makeRelative root fp
fmt <- liftIO $ D.getModificationTime fp
if excRegex fpt regex || excMod fmt mod_from mod_upto
then return hs
else do s <- liftIO $ getFileSize fp
h <- liftM (runComputation cm) $ runResourceT
$ CB.sourceFile fp $$ CC.sinkHash
return $ HS.insert (HashInfo fpt s h) hs | 1,173 | compute :: Hash ctx a => HaskDeepConfiguration
-> ComputationMode a
-> IO HashSet
compute conf cm = runResourceT $ CCB.sourceDirectoryDeep False root $$ CCB.foldM insert_hash empty_with_symbol
where
root = rootDirectory conf
regex = excludeRegex conf
mod_from = includeModFrom conf
mod_upto = includeModUpTo conf
empty_with_symbol = HS.setSymbol (symbol cm) HS.empty
insert_hash :: HashSet -> FilePath -> ResourceT IO HashSet
insert_hash hs fp = do let fpt = T.pack $ makeRelative root fp
fmt <- liftIO $ D.getModificationTime fp
if excRegex fpt regex || excMod fmt mod_from mod_upto
then return hs
else do s <- liftIO $ getFileSize fp
h <- liftM (runComputation cm) $ runResourceT
$ CB.sourceFile fp $$ CC.sinkHash
return $ HS.insert (HashInfo fpt s h) hs | 1,094 | compute conf cm = runResourceT $ CCB.sourceDirectoryDeep False root $$ CCB.foldM insert_hash empty_with_symbol
where
root = rootDirectory conf
regex = excludeRegex conf
mod_from = includeModFrom conf
mod_upto = includeModUpTo conf
empty_with_symbol = HS.setSymbol (symbol cm) HS.empty
insert_hash :: HashSet -> FilePath -> ResourceT IO HashSet
insert_hash hs fp = do let fpt = T.pack $ makeRelative root fp
fmt <- liftIO $ D.getModificationTime fp
if excRegex fpt regex || excMod fmt mod_from mod_upto
then return hs
else do s <- liftIO $ getFileSize fp
h <- liftM (runComputation cm) $ runResourceT
$ CB.sourceFile fp $$ CC.sinkHash
return $ HS.insert (HashInfo fpt s h) hs | 996 | true | true | 3 | 17 | 464 | 300 | 135 | 165 | null | null |
vTurbine/ghc | compiler/iface/IfaceType.hs | bsd-3-clause | ppr_ty _ (IfaceTupleTy s i tys) = pprTuple s i tys | 58 | ppr_ty _ (IfaceTupleTy s i tys) = pprTuple s i tys | 58 | ppr_ty _ (IfaceTupleTy s i tys) = pprTuple s i tys | 58 | false | false | 0 | 7 | 18 | 28 | 13 | 15 | null | null |
fffej/codekatas | 99Problems/31-41/Problems.hs | mit | goldbach :: Integer -> (Integer,Integer)
goldbach n = head (goldbachs n) | 72 | goldbach :: Integer -> (Integer,Integer)
goldbach n = head (goldbachs n) | 72 | goldbach n = head (goldbachs n) | 31 | false | true | 0 | 8 | 10 | 38 | 18 | 20 | null | null |
hesiod/units | Data/Metrology/Z.hs | bsd-3-clause | sMTwo = SP sMOne | 18 | sMTwo = SP sMOne | 18 | sMTwo = SP sMOne | 18 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | Postal code or ZIP (e.g. \"94043\").
aaPostalCode :: Lens' AccountAddress (Maybe Text)
aaPostalCode
= lens _aaPostalCode (\ s a -> s{_aaPostalCode = a}) | 159 | aaPostalCode :: Lens' AccountAddress (Maybe Text)
aaPostalCode
= lens _aaPostalCode (\ s a -> s{_aaPostalCode = a}) | 117 | aaPostalCode
= lens _aaPostalCode (\ s a -> s{_aaPostalCode = a}) | 67 | true | true | 0 | 9 | 26 | 48 | 25 | 23 | null | null |
facebookincubator/duckling | Duckling/Numeral/KM/Rules.hs | bsd-3-clause | -- សម្រាប់លេខចាប់ពីខ្ទង់រយទៅ
ruleMultiply :: Rule
ruleMultiply = Rule
{ name = "compose by multiplication"
, pattern =
[ dimension Numeral
, Predicate isMultipliable
]
, prod = \tokens -> case tokens of
(token1:token2:_) -> multiply token1 token2
_ -> Nothing
} | 293 | ruleMultiply :: Rule
ruleMultiply = Rule
{ name = "compose by multiplication"
, pattern =
[ dimension Numeral
, Predicate isMultipliable
]
, prod = \tokens -> case tokens of
(token1:token2:_) -> multiply token1 token2
_ -> Nothing
} | 264 | ruleMultiply = Rule
{ name = "compose by multiplication"
, pattern =
[ dimension Numeral
, Predicate isMultipliable
]
, prod = \tokens -> case tokens of
(token1:token2:_) -> multiply token1 token2
_ -> Nothing
} | 243 | true | true | 0 | 14 | 72 | 85 | 46 | 39 | null | null |
meteficha/yesod | yesod-core/Yesod/Core/Internal/TH.hs | mit | -- | 'Left' arguments indicate a monomorphic type, a 'Right' argument
-- indicates a polymorphic type, and provides the list of classes
-- the type must be instance of.
mkYesodGeneral :: String -- ^ foundation type
-> [Either String [String]] -- ^ arguments for the type
-> Bool -- ^ is this a subsite
-> (Exp -> Q Exp) -- ^ unwrap handler
-> [ResourceTree String]
-> Q([Dec],[Dec])
mkYesodGeneral namestr args isSub f resS = do
mname <- lookupTypeName namestr
arity <- case mname of
Just name -> do
info <- reify name
return $
case info of
TyConI dec ->
case dec of
DataD _ _ vs _ _ -> length vs
NewtypeD _ _ vs _ _ -> length vs
_ -> 0
_ -> 0
_ -> return 0
let name = mkName namestr
(mtys,_) = partitionEithers args
-- Generate as many variable names as the arity indicates
vns <- replicateM (arity - length mtys) $ newName "t"
-- Base type (site type with variables)
let (argtypes,cxt) = (\(ns,r,cs) -> (ns ++ fmap VarT r, cs)) $
foldr (\arg (xs,n:ns,cs) ->
case arg of
Left t -> ( ConT (mkName t):xs, n:ns, cs )
Right ts -> ( VarT n :xs, ns
, fmap (\t ->
#if MIN_VERSION_template_haskell(2,10,0)
AppT (ConT $ mkName t) (VarT n)
#else
ClassP (mkName t) [VarT n]
#endif
) ts ++ cs )
) ([],vns,[]) args
site = foldl' AppT (ConT name) argtypes
res = map (fmap parseType) resS
renderRouteDec <- mkRenderRouteInstance site res
routeAttrsDec <- mkRouteAttrsInstance site res
dispatchDec <- mkDispatchInstance site cxt f res
parse <- mkParseRouteInstance site res
let rname = mkName $ "resources" ++ namestr
eres <- lift resS
let resourcesDec =
[ SigD rname $ ListT `AppT` (ConT ''ResourceTree `AppT` ConT ''String)
, FunD rname [Clause [] (NormalB eres) []]
]
let dataDec = concat
[ [parse]
, renderRouteDec
, [routeAttrsDec]
, resourcesDec
, if isSub then [] else masterTypeSyns vns site
]
return (dataDec, dispatchDec) | 2,644 | mkYesodGeneral :: String -- ^ foundation type
-> [Either String [String]] -- ^ arguments for the type
-> Bool -- ^ is this a subsite
-> (Exp -> Q Exp) -- ^ unwrap handler
-> [ResourceTree String]
-> Q([Dec],[Dec])
mkYesodGeneral namestr args isSub f resS = do
mname <- lookupTypeName namestr
arity <- case mname of
Just name -> do
info <- reify name
return $
case info of
TyConI dec ->
case dec of
DataD _ _ vs _ _ -> length vs
NewtypeD _ _ vs _ _ -> length vs
_ -> 0
_ -> 0
_ -> return 0
let name = mkName namestr
(mtys,_) = partitionEithers args
-- Generate as many variable names as the arity indicates
vns <- replicateM (arity - length mtys) $ newName "t"
-- Base type (site type with variables)
let (argtypes,cxt) = (\(ns,r,cs) -> (ns ++ fmap VarT r, cs)) $
foldr (\arg (xs,n:ns,cs) ->
case arg of
Left t -> ( ConT (mkName t):xs, n:ns, cs )
Right ts -> ( VarT n :xs, ns
, fmap (\t ->
#if MIN_VERSION_template_haskell(2,10,0)
AppT (ConT $ mkName t) (VarT n)
#else
ClassP (mkName t) [VarT n]
#endif
) ts ++ cs )
) ([],vns,[]) args
site = foldl' AppT (ConT name) argtypes
res = map (fmap parseType) resS
renderRouteDec <- mkRenderRouteInstance site res
routeAttrsDec <- mkRouteAttrsInstance site res
dispatchDec <- mkDispatchInstance site cxt f res
parse <- mkParseRouteInstance site res
let rname = mkName $ "resources" ++ namestr
eres <- lift resS
let resourcesDec =
[ SigD rname $ ListT `AppT` (ConT ''ResourceTree `AppT` ConT ''String)
, FunD rname [Clause [] (NormalB eres) []]
]
let dataDec = concat
[ [parse]
, renderRouteDec
, [routeAttrsDec]
, resourcesDec
, if isSub then [] else masterTypeSyns vns site
]
return (dataDec, dispatchDec) | 2,471 | mkYesodGeneral namestr args isSub f resS = do
mname <- lookupTypeName namestr
arity <- case mname of
Just name -> do
info <- reify name
return $
case info of
TyConI dec ->
case dec of
DataD _ _ vs _ _ -> length vs
NewtypeD _ _ vs _ _ -> length vs
_ -> 0
_ -> 0
_ -> return 0
let name = mkName namestr
(mtys,_) = partitionEithers args
-- Generate as many variable names as the arity indicates
vns <- replicateM (arity - length mtys) $ newName "t"
-- Base type (site type with variables)
let (argtypes,cxt) = (\(ns,r,cs) -> (ns ++ fmap VarT r, cs)) $
foldr (\arg (xs,n:ns,cs) ->
case arg of
Left t -> ( ConT (mkName t):xs, n:ns, cs )
Right ts -> ( VarT n :xs, ns
, fmap (\t ->
#if MIN_VERSION_template_haskell(2,10,0)
AppT (ConT $ mkName t) (VarT n)
#else
ClassP (mkName t) [VarT n]
#endif
) ts ++ cs )
) ([],vns,[]) args
site = foldl' AppT (ConT name) argtypes
res = map (fmap parseType) resS
renderRouteDec <- mkRenderRouteInstance site res
routeAttrsDec <- mkRouteAttrsInstance site res
dispatchDec <- mkDispatchInstance site cxt f res
parse <- mkParseRouteInstance site res
let rname = mkName $ "resources" ++ namestr
eres <- lift resS
let resourcesDec =
[ SigD rname $ ListT `AppT` (ConT ''ResourceTree `AppT` ConT ''String)
, FunD rname [Clause [] (NormalB eres) []]
]
let dataDec = concat
[ [parse]
, renderRouteDec
, [routeAttrsDec]
, resourcesDec
, if isSub then [] else masterTypeSyns vns site
]
return (dataDec, dispatchDec) | 2,130 | true | true | 0 | 25 | 1,155 | 717 | 364 | 353 | null | null |
green-haskell/ghc | compiler/deSugar/DsForeign.hs | bsd-3-clause | -- This function returns the primitive type associated with the boxed
-- type argument to a foreign export (eg. Int ==> Int#).
getPrimTyOf :: Type -> UnaryType
getPrimTyOf ty
| isBoolTy rep_ty = intPrimTy
-- Except for Bool, the types we are interested in have a single constructor
-- with a single primitive-typed argument (see TcType.legalFEArgTyCon).
| otherwise =
case splitDataProductType_maybe rep_ty of
Just (_, _, data_con, [prim_ty]) ->
ASSERT(dataConSourceArity data_con == 1)
ASSERT2(isUnLiftedType prim_ty, ppr prim_ty)
prim_ty
_other -> pprPanic "DsForeign.getPrimTyOf" (ppr ty)
where
UnaryRep rep_ty = repType ty
-- represent a primitive type as a Char, for building a string that
-- described the foreign function type. The types are size-dependent,
-- e.g. 'W' is a signed 32-bit integer. | 860 | getPrimTyOf :: Type -> UnaryType
getPrimTyOf ty
| isBoolTy rep_ty = intPrimTy
-- Except for Bool, the types we are interested in have a single constructor
-- with a single primitive-typed argument (see TcType.legalFEArgTyCon).
| otherwise =
case splitDataProductType_maybe rep_ty of
Just (_, _, data_con, [prim_ty]) ->
ASSERT(dataConSourceArity data_con == 1)
ASSERT2(isUnLiftedType prim_ty, ppr prim_ty)
prim_ty
_other -> pprPanic "DsForeign.getPrimTyOf" (ppr ty)
where
UnaryRep rep_ty = repType ty
-- represent a primitive type as a Char, for building a string that
-- described the foreign function type. The types are size-dependent,
-- e.g. 'W' is a signed 32-bit integer. | 733 | getPrimTyOf ty
| isBoolTy rep_ty = intPrimTy
-- Except for Bool, the types we are interested in have a single constructor
-- with a single primitive-typed argument (see TcType.legalFEArgTyCon).
| otherwise =
case splitDataProductType_maybe rep_ty of
Just (_, _, data_con, [prim_ty]) ->
ASSERT(dataConSourceArity data_con == 1)
ASSERT2(isUnLiftedType prim_ty, ppr prim_ty)
prim_ty
_other -> pprPanic "DsForeign.getPrimTyOf" (ppr ty)
where
UnaryRep rep_ty = repType ty
-- represent a primitive type as a Char, for building a string that
-- described the foreign function type. The types are size-dependent,
-- e.g. 'W' is a signed 32-bit integer. | 700 | true | true | 1 | 11 | 176 | 133 | 69 | 64 | null | null |
Fuuzetsu/haddock | haddock-library/vendor/attoparsec-0.13.1.0/Data/Attoparsec/ByteString/Char8.hs | bsd-2-clause | -- | Match any character, to perform lookahead. Does not consume any
-- input, but will fail if end of input has been reached.
peekChar' :: Parser Char
peekChar' = w2c `fmap` I.peekWord8' | 188 | peekChar' :: Parser Char
peekChar' = w2c `fmap` I.peekWord8' | 60 | peekChar' = w2c `fmap` I.peekWord8' | 35 | true | true | 0 | 6 | 33 | 24 | 14 | 10 | null | null |
ezyang/ghc | compiler/nativeGen/SPARC/Ppr.hs | bsd-3-clause | pprInstr NOP
= text "\tnop" | 35 | pprInstr NOP
= text "\tnop" | 35 | pprInstr NOP
= text "\tnop" | 35 | false | false | 0 | 5 | 12 | 12 | 5 | 7 | null | null |
markus1189/lambda-feed | src/LambdaFeed.hs | gpl-3.0 | showChannels :: LF ()
showChannels = switchUsing switchToChannels | 65 | showChannels :: LF ()
showChannels = switchUsing switchToChannels | 65 | showChannels = switchUsing switchToChannels | 43 | false | true | 0 | 7 | 7 | 24 | 10 | 14 | null | null |
mattias-lundell/timber-llvm | src/Termred.hs | bsd-3-clause | redApp env (ELam te e) es = do redBeta env te e es | 56 | redApp env (ELam te e) es = do redBeta env te e es | 56 | redApp env (ELam te e) es = do redBeta env te e es | 56 | false | false | 0 | 7 | 18 | 33 | 15 | 18 | null | null |
nomicflux/threals | src/Threal/Tests.hs | gpl-2.0 | compNub compList (x:xs)
| compElem compList xs x = compNub compList xs
| otherwise = x : compNub compList xs | 116 | compNub compList (x:xs)
| compElem compList xs x = compNub compList xs
| otherwise = x : compNub compList xs | 116 | compNub compList (x:xs)
| compElem compList xs x = compNub compList xs
| otherwise = x : compNub compList xs | 116 | false | false | 0 | 8 | 27 | 58 | 25 | 33 | null | null |
creswick/HaVSA | src/AI/Examples.hs | bsd-3-clause | -- | Rectangle VS learns rectangles contained in a rectangular region.
-- This is simply a join of two 1-D regions, wrapped in a transform.
rectangleVS :: VersionSpace Rectangle Rectangle
rectangleVS = rectTr $ region1d `join` region1d
where
rectTr = Tr decompose decompose compose
compose ((x, w), (y, h)) = Rect x y w h
decompose (Rect x y w h) = ((x, w), (y, h))
-- | The core components of RectangleVS: (1-D regions) | 484 | rectangleVS :: VersionSpace Rectangle Rectangle
rectangleVS = rectTr $ region1d `join` region1d
where
rectTr = Tr decompose decompose compose
compose ((x, w), (y, h)) = Rect x y w h
decompose (Rect x y w h) = ((x, w), (y, h))
-- | The core components of RectangleVS: (1-D regions) | 344 | rectangleVS = rectTr $ region1d `join` region1d
where
rectTr = Tr decompose decompose compose
compose ((x, w), (y, h)) = Rect x y w h
decompose (Rect x y w h) = ((x, w), (y, h))
-- | The core components of RectangleVS: (1-D regions) | 296 | true | true | 0 | 9 | 138 | 116 | 66 | 50 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Readers/Org.hs | gpl-2.0 | surroundingEmphasisChar :: OrgParser [Char]
surroundingEmphasisChar =
take 1 . drop 1 . orgStateEmphasisCharStack <$> getState | 128 | surroundingEmphasisChar :: OrgParser [Char]
surroundingEmphasisChar =
take 1 . drop 1 . orgStateEmphasisCharStack <$> getState | 128 | surroundingEmphasisChar =
take 1 . drop 1 . orgStateEmphasisCharStack <$> getState | 84 | false | true | 3 | 6 | 16 | 40 | 17 | 23 | null | null |
seantalts/hasktrip | src/Datalog.hs | bsd-3-clause | emptyState :: (Substitution, Int)
emptyState = (true, 0) | 56 | emptyState :: (Substitution, Int)
emptyState = (true, 0) | 56 | emptyState = (true, 0) | 22 | false | true | 0 | 5 | 7 | 23 | 14 | 9 | null | null |
Kyly/liquidhaskell | src/Language/Haskell/Liquid/GhcInterface.hs | bsd-3-clause | transParseSpecs exts paths seenFiles specs newFiles
= do newSpecs <- liftIO $ mapM (\f -> addFst3 f <$> parseSpec f) newFiles
impFiles <- moduleImports exts paths $ specsImports newSpecs
let seenFiles' = seenFiles `S.union` (S.fromList newFiles)
let specs' = specs ++ map (third noTerm) newSpecs
let newFiles' = [f | (_,f) <- impFiles, not (f `S.member` seenFiles')]
transParseSpecs exts paths seenFiles' specs' newFiles'
where
specsImports ss = nub $ concatMap (map symbolString . Ms.imports . thd3) ss
noTerm spec = spec { Ms.decr=mempty, Ms.lazy=mempty, Ms.termexprs=mempty }
third f (a,b,c) = (a,b,f c) | 665 | transParseSpecs exts paths seenFiles specs newFiles
= do newSpecs <- liftIO $ mapM (\f -> addFst3 f <$> parseSpec f) newFiles
impFiles <- moduleImports exts paths $ specsImports newSpecs
let seenFiles' = seenFiles `S.union` (S.fromList newFiles)
let specs' = specs ++ map (third noTerm) newSpecs
let newFiles' = [f | (_,f) <- impFiles, not (f `S.member` seenFiles')]
transParseSpecs exts paths seenFiles' specs' newFiles'
where
specsImports ss = nub $ concatMap (map symbolString . Ms.imports . thd3) ss
noTerm spec = spec { Ms.decr=mempty, Ms.lazy=mempty, Ms.termexprs=mempty }
third f (a,b,c) = (a,b,f c) | 665 | transParseSpecs exts paths seenFiles specs newFiles
= do newSpecs <- liftIO $ mapM (\f -> addFst3 f <$> parseSpec f) newFiles
impFiles <- moduleImports exts paths $ specsImports newSpecs
let seenFiles' = seenFiles `S.union` (S.fromList newFiles)
let specs' = specs ++ map (third noTerm) newSpecs
let newFiles' = [f | (_,f) <- impFiles, not (f `S.member` seenFiles')]
transParseSpecs exts paths seenFiles' specs' newFiles'
where
specsImports ss = nub $ concatMap (map symbolString . Ms.imports . thd3) ss
noTerm spec = spec { Ms.decr=mempty, Ms.lazy=mempty, Ms.termexprs=mempty }
third f (a,b,c) = (a,b,f c) | 665 | false | false | 0 | 14 | 150 | 278 | 141 | 137 | null | null |
fehu/min-dat--a-priori | core/test/AprioriSpec.hs | mit | matchWithExample :: (Itemset set it, Ord (set it), Ord it) =>
AprioriTestData set it -> [Spec]
matchWithExample (AprioriTestData transactions minsup runs) = beforeAll printDD testNRuns : testRuns
where (res, ddata) = runApriori minsup transactions
testNRuns = it "has the same number of runs" $ length runs `shouldBe` length ddata
testRuns = do (AprioriDebugData seeds joined pruned, AprioriDebugData seeds' joined' pruned', i) <- zip3 runs ddata [1..]
[
it (printf "receives the same seeds L_{%s}" (show i)) $ sort seeds == sort seeds'
, it (printf "produces the same joined L_{%s}" (show $ i+1)) $ sort joined == sort joined'
, it (printf "produces the same pruned L_{%s}" (show $ i+1)) $ sort pruned == sort pruned'
]
printDD = sequence_ $
do (AprioriDebugData seeds joined pruned, AprioriDebugData seeds' joined' pruned', i) <- zip3 runs ddata [1..]
return $ do putStrLn $ "\nOn Run " ++ show i ++ ":\n"
putStrLn $ "Seeds (Example): " ++ show seeds
putStrLn $ "Seeds (Result) : " ++ show seeds'
putStrLn ""
putStrLn $ "Joined (Example): " ++ show joined
putStrLn $ "Joined (Result) : " ++ show joined'
putStrLn ""
putStrLn $ "Pruned (Example): " ++ show pruned
putStrLn $ "Pruned (Result) : " ++ show pruned'
putStrLn "\n" | 1,675 | matchWithExample :: (Itemset set it, Ord (set it), Ord it) =>
AprioriTestData set it -> [Spec]
matchWithExample (AprioriTestData transactions minsup runs) = beforeAll printDD testNRuns : testRuns
where (res, ddata) = runApriori minsup transactions
testNRuns = it "has the same number of runs" $ length runs `shouldBe` length ddata
testRuns = do (AprioriDebugData seeds joined pruned, AprioriDebugData seeds' joined' pruned', i) <- zip3 runs ddata [1..]
[
it (printf "receives the same seeds L_{%s}" (show i)) $ sort seeds == sort seeds'
, it (printf "produces the same joined L_{%s}" (show $ i+1)) $ sort joined == sort joined'
, it (printf "produces the same pruned L_{%s}" (show $ i+1)) $ sort pruned == sort pruned'
]
printDD = sequence_ $
do (AprioriDebugData seeds joined pruned, AprioriDebugData seeds' joined' pruned', i) <- zip3 runs ddata [1..]
return $ do putStrLn $ "\nOn Run " ++ show i ++ ":\n"
putStrLn $ "Seeds (Example): " ++ show seeds
putStrLn $ "Seeds (Result) : " ++ show seeds'
putStrLn ""
putStrLn $ "Joined (Example): " ++ show joined
putStrLn $ "Joined (Result) : " ++ show joined'
putStrLn ""
putStrLn $ "Pruned (Example): " ++ show pruned
putStrLn $ "Pruned (Result) : " ++ show pruned'
putStrLn "\n" | 1,674 | matchWithExample (AprioriTestData transactions minsup runs) = beforeAll printDD testNRuns : testRuns
where (res, ddata) = runApriori minsup transactions
testNRuns = it "has the same number of runs" $ length runs `shouldBe` length ddata
testRuns = do (AprioriDebugData seeds joined pruned, AprioriDebugData seeds' joined' pruned', i) <- zip3 runs ddata [1..]
[
it (printf "receives the same seeds L_{%s}" (show i)) $ sort seeds == sort seeds'
, it (printf "produces the same joined L_{%s}" (show $ i+1)) $ sort joined == sort joined'
, it (printf "produces the same pruned L_{%s}" (show $ i+1)) $ sort pruned == sort pruned'
]
printDD = sequence_ $
do (AprioriDebugData seeds joined pruned, AprioriDebugData seeds' joined' pruned', i) <- zip3 runs ddata [1..]
return $ do putStrLn $ "\nOn Run " ++ show i ++ ":\n"
putStrLn $ "Seeds (Example): " ++ show seeds
putStrLn $ "Seeds (Result) : " ++ show seeds'
putStrLn ""
putStrLn $ "Joined (Example): " ++ show joined
putStrLn $ "Joined (Result) : " ++ show joined'
putStrLn ""
putStrLn $ "Pruned (Example): " ++ show pruned
putStrLn $ "Pruned (Result) : " ++ show pruned'
putStrLn "\n" | 1,575 | false | true | 3 | 18 | 654 | 456 | 215 | 241 | null | null |
tysonzero/dama | src/Dama/Core/Render.hs | mit | renderExpr (Case e os) = renderExpr e <> " => { " <> intercalate " | " (renderOption <$> os) <> " }" | 100 | renderExpr (Case e os) = renderExpr e <> " => { " <> intercalate " | " (renderOption <$> os) <> " }" | 100 | renderExpr (Case e os) = renderExpr e <> " => { " <> intercalate " | " (renderOption <$> os) <> " }" | 100 | false | false | 0 | 9 | 22 | 44 | 21 | 23 | null | null |
YelaSeamless/cgrep | src/Util.hs | gpl-2.0 | toMaybe :: a -> Bool -> Maybe a
toMaybe a True = Just a | 56 | toMaybe :: a -> Bool -> Maybe a
toMaybe a True = Just a | 56 | toMaybe a True = Just a | 24 | false | true | 0 | 7 | 14 | 34 | 15 | 19 | null | null |
acowley/ghc | compiler/types/Type.hs | bsd-3-clause | funResultTy ty = pprPanic "funResultTy" (ppr ty) | 63 | funResultTy ty = pprPanic "funResultTy" (ppr ty) | 63 | funResultTy ty = pprPanic "funResultTy" (ppr ty) | 63 | false | false | 0 | 7 | 21 | 20 | 9 | 11 | null | null |
capn-freako/lambda-ccc | src/LambdaCCC/Unused/SReify.hs | bsd-3-clause | isEP :: Type -> Bool
isEP (TyConApp (tyConName -> name) [_]) = uqName name == epS | 81 | isEP :: Type -> Bool
isEP (TyConApp (tyConName -> name) [_]) = uqName name == epS | 81 | isEP (TyConApp (tyConName -> name) [_]) = uqName name == epS | 60 | false | true | 0 | 11 | 15 | 49 | 23 | 26 | null | null |
d0kt0r0/Tidal | src/Sound/Tidal/Stream.hs | gpl-3.0 | hasSolo :: Map.Map k PlayState -> Bool
hasSolo = (>= 1) . length . filter solo . Map.elems | 90 | hasSolo :: Map.Map k PlayState -> Bool
hasSolo = (>= 1) . length . filter solo . Map.elems | 90 | hasSolo = (>= 1) . length . filter solo . Map.elems | 51 | false | true | 2 | 8 | 17 | 52 | 23 | 29 | null | null |
aparent/qacg | src/QACG/CircGen/Cordic.hs | bsd-3-clause | toBin :: Int -> [Bool]
toBin 0 = [] | 35 | toBin :: Int -> [Bool]
toBin 0 = [] | 35 | toBin 0 = [] | 12 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/course/2014-06-upenn/cis194/src/HW08_HC.hs | unlicense | me :: Employee
me = Emp "me" 10 | 36 | me :: Employee
me = Emp "me" 10 | 36 | me = Emp "me" 10 | 19 | false | true | 0 | 5 | 12 | 16 | 8 | 8 | null | null |
timjb/lens | src/Control/Lens/Review.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- Review
------------------------------------------------------------------------------
-- | An analogue of 'to' for 'review'.
--
-- @
-- 'unto' :: (b -> t) -> 'Review'' t b
-- @
--
-- @
-- 'unto' = 'un' . 'to'
-- @
unto :: (Profunctor p, Bifunctor p, Functor f) => (b -> t) -> Optic p f s t a b
unto f = first absurd . lmap absurd . rmap (fmap f) | 428 | unto :: (Profunctor p, Bifunctor p, Functor f) => (b -> t) -> Optic p f s t a b
unto f = first absurd . lmap absurd . rmap (fmap f) | 131 | unto f = first absurd . lmap absurd . rmap (fmap f) | 51 | true | true | 0 | 8 | 70 | 94 | 52 | 42 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/network/tests/URITest.hs | bsd-3-clause | testURIRef085 = testURIRef InvRf "%ZZ" | 38 | testURIRef085 = testURIRef InvRf "%ZZ" | 38 | testURIRef085 = testURIRef InvRf "%ZZ" | 38 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
NorfairKing/sus-depot | shared/shared/xmonad/dvorak.kinesis/Keys.hs | gpl-2.0 | -- Switch to the letter of a workspace by pressing mod + letter
navigationKeys :: [((KeyMask, KeySym), X ())]
navigationKeys =
[
(
(mask .|. mod, key)
,
windows $ switch ws
)
|
(ws, key) <- zip myWorkspaces workspaceKeys,
(switch, mask) <- [(W.greedyView, 0), (W.shift, shiftMask)]
] | 367 | navigationKeys :: [((KeyMask, KeySym), X ())]
navigationKeys =
[
(
(mask .|. mod, key)
,
windows $ switch ws
)
|
(ws, key) <- zip myWorkspaces workspaceKeys,
(switch, mask) <- [(W.greedyView, 0), (W.shift, shiftMask)]
] | 303 | navigationKeys =
[
(
(mask .|. mod, key)
,
windows $ switch ws
)
|
(ws, key) <- zip myWorkspaces workspaceKeys,
(switch, mask) <- [(W.greedyView, 0), (W.shift, shiftMask)]
] | 257 | true | true | 0 | 10 | 131 | 113 | 66 | 47 | null | null |
GaloisInc/galua | lib/macho/src/Data/Macho.hs | mit | n_type 0x20 = N_GSYM | 20 | n_type 0x20 = N_GSYM | 20 | n_type 0x20 = N_GSYM | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-containerbuilder/gen/Network/Google/Resource/Cloudbuild/Projects/Locations/Builds/Cancel.hs | mpl-2.0 | -- | The name of the \`Build\` to cancel. Format:
-- \`projects\/{project}\/locations\/{location}\/builds\/{build}\`
plbcName :: Lens' ProjectsLocationsBuildsCancel Text
plbcName = lens _plbcName (\ s a -> s{_plbcName = a}) | 223 | plbcName :: Lens' ProjectsLocationsBuildsCancel Text
plbcName = lens _plbcName (\ s a -> s{_plbcName = a}) | 106 | plbcName = lens _plbcName (\ s a -> s{_plbcName = a}) | 53 | true | true | 0 | 9 | 27 | 48 | 24 | 24 | null | null |
bitc/omegagb | src/Cpu.hs | gpl-2.0 | mcti 0xEA (_,nn) = (LDPN nn, 16, 2) | 62 | mcti 0xEA (_,nn) = (LDPN nn, 16, 2) | 62 | mcti 0xEA (_,nn) = (LDPN nn, 16, 2) | 62 | false | false | 0 | 6 | 34 | 31 | 16 | 15 | null | null |
forste/haReFork | tools/base/tests/HaskellLibraries/PreludeList.hs | bsd-3-clause | inimum [] = error "Prelude.minimum: empty list"
| 55 | minimum [] = error "Prelude.minimum: empty list" | 55 | minimum [] = error "Prelude.minimum: empty list" | 55 | false | false | 0 | 5 | 14 | 15 | 6 | 9 | null | null |
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | Number of days that a user should remain in the remarketing list without
-- an impression.
rlLifeSpan :: Lens' RemarketingList (Maybe Int64)
rlLifeSpan
= lens _rlLifeSpan (\ s a -> s{_rlLifeSpan = a}) .
mapping _Coerce | 231 | rlLifeSpan :: Lens' RemarketingList (Maybe Int64)
rlLifeSpan
= lens _rlLifeSpan (\ s a -> s{_rlLifeSpan = a}) .
mapping _Coerce | 135 | rlLifeSpan
= lens _rlLifeSpan (\ s a -> s{_rlLifeSpan = a}) .
mapping _Coerce | 85 | true | true | 1 | 10 | 45 | 59 | 29 | 30 | null | null |
Numberartificial/workflow | haskell-first-principles/haskell-programming-from-first-principles-master/src/Chapter9.hs | mit | {-
5. To do the final exercise in this section, we’ll need another stan-
dard function for lists called head . Query the type of head and
experiment with it to see what it does. Now write a function that
will capitalize the first letter of a String and return only that letter
as the result.
-}
capFst :: String -> Char
capFst xs = toUpper $ head xs | 352 | capFst :: String -> Char
capFst xs = toUpper $ head xs | 54 | capFst xs = toUpper $ head xs | 29 | true | true | 0 | 6 | 71 | 26 | 13 | 13 | null | null |
konn/hskk | src/Text/InputMethod/SKK/Dictionary.hs | bsd-3-clause | okuriDic :: Parser (Either [(T.Text, [Candidate])] [((T.Text, Char), GuardedCandidates)])
okuriDic = do
okr <- okuriPragma
skipMany line
case okr of
Ari -> Right <$> ariEntry `sepBy` skipMany line
Nasi -> Left <$> nasiEntry `sepBy` skipMany line | 262 | okuriDic :: Parser (Either [(T.Text, [Candidate])] [((T.Text, Char), GuardedCandidates)])
okuriDic = do
okr <- okuriPragma
skipMany line
case okr of
Ari -> Right <$> ariEntry `sepBy` skipMany line
Nasi -> Left <$> nasiEntry `sepBy` skipMany line | 262 | okuriDic = do
okr <- okuriPragma
skipMany line
case okr of
Ari -> Right <$> ariEntry `sepBy` skipMany line
Nasi -> Left <$> nasiEntry `sepBy` skipMany line | 172 | false | true | 0 | 11 | 52 | 111 | 59 | 52 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Params.hs | gpl-3.0 | beginrecv :: Pattern Int -> ControlPattern
beginrecv busid = pI "^begin" busid | 78 | beginrecv :: Pattern Int -> ControlPattern
beginrecv busid = pI "^begin" busid | 78 | beginrecv busid = pI "^begin" busid | 35 | false | true | 0 | 7 | 11 | 33 | 13 | 20 | null | null |
GaloisInc/saw-script | src/SAWScript/CongruenceClosure.hs | bsd-3-clause | splitClass (h:l) sets = splitClass l (sets `Set.union` newSets)
where insertEqualToH t = Set.map (insertEquation h t) sets
newSets = Set.unions (map insertEqualToH l)
-- | Returns all congruence-closed sets generated by the may alias
-- configurations. | 261 | splitClass (h:l) sets = splitClass l (sets `Set.union` newSets)
where insertEqualToH t = Set.map (insertEquation h t) sets
newSets = Set.unions (map insertEqualToH l)
-- | Returns all congruence-closed sets generated by the may alias
-- configurations. | 261 | splitClass (h:l) sets = splitClass l (sets `Set.union` newSets)
where insertEqualToH t = Set.map (insertEquation h t) sets
newSets = Set.unions (map insertEqualToH l)
-- | Returns all congruence-closed sets generated by the may alias
-- configurations. | 261 | false | false | 1 | 7 | 45 | 79 | 41 | 38 | null | null |
kayhide/deep-learning-from-scratch | src/NeuralNetwork.hs | bsd-3-clause | meanSquaredError :: Vector R -> Vector R -> Double
meanSquaredError t y = (/2) $ sumElements $ cmap (^2) $ t - y | 112 | meanSquaredError :: Vector R -> Vector R -> Double
meanSquaredError t y = (/2) $ sumElements $ cmap (^2) $ t - y | 112 | meanSquaredError t y = (/2) $ sumElements $ cmap (^2) $ t - y | 61 | false | true | 0 | 9 | 22 | 57 | 29 | 28 | null | null |
bitemyapp/github | samples/Repos/Starring/ListStarred.hs | bsd-3-clause | formatDate Nothing = "" | 23 | formatDate Nothing = "" | 23 | formatDate Nothing = "" | 23 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
alphalambda/codeworld | codeworld-server/src/Util.hs | apache-2.0 | dashToUnderscore :: Char -> Char
dashToUnderscore '-' = '_' | 59 | dashToUnderscore :: Char -> Char
dashToUnderscore '-' = '_' | 59 | dashToUnderscore '-' = '_' | 26 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/Instances/GetEffectiveFirewalls.hs | mpl-2.0 | -- | Project ID for this request.
igefProject :: Lens' InstancesGetEffectiveFirewalls Text
igefProject
= lens _igefProject (\ s a -> s{_igefProject = a}) | 155 | igefProject :: Lens' InstancesGetEffectiveFirewalls Text
igefProject
= lens _igefProject (\ s a -> s{_igefProject = a}) | 121 | igefProject
= lens _igefProject (\ s a -> s{_igefProject = a}) | 64 | true | true | 0 | 9 | 24 | 42 | 22 | 20 | null | null |
fpco/async | Control/Concurrent/Async.hs | bsd-3-clause | -- | Like 'waitEither', but the result is ignored.
--
waitEither_ :: Async a -> Async b -> IO ()
waitEither_ left right =
atomically $
(void $ waitSTM left)
`orElse`
(void $ waitSTM right) | 204 | waitEither_ :: Async a -> Async b -> IO ()
waitEither_ left right =
atomically $
(void $ waitSTM left)
`orElse`
(void $ waitSTM right) | 150 | waitEither_ left right =
atomically $
(void $ waitSTM left)
`orElse`
(void $ waitSTM right) | 107 | true | true | 0 | 9 | 50 | 67 | 34 | 33 | null | null |
beni55/haste-compiler | libraries/ghc-7.10/base/GHC/IO/Handle/Internals.hs | bsd-3-clause | withHandle :: String -> Handle -> (Handle__ -> IO (Handle__,a)) -> IO a
withHandle fun h@(FileHandle _ m) act = withHandle' fun h m act | 139 | withHandle :: String -> Handle -> (Handle__ -> IO (Handle__,a)) -> IO a
withHandle fun h@(FileHandle _ m) act = withHandle' fun h m act | 139 | withHandle fun h@(FileHandle _ m) act = withHandle' fun h m act | 67 | false | true | 0 | 11 | 28 | 69 | 35 | 34 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/UX/DiffCheck.hs | bsd-3-clause | diffLines curr (First lnsChgd : d) = [curr..(toTake-1)] ++ diffLines toTake d
where toTake = curr + lnsChgd | 113 | diffLines curr (First lnsChgd : d) = [curr..(toTake-1)] ++ diffLines toTake d
where toTake = curr + lnsChgd | 113 | diffLines curr (First lnsChgd : d) = [curr..(toTake-1)] ++ diffLines toTake d
where toTake = curr + lnsChgd | 113 | false | false | 0 | 8 | 23 | 54 | 27 | 27 | null | null |
ezyang/ghc | testsuite/tests/codeGen/should_run/CmmSwitchTest32.hs | bsd-3-clause | ax 2## = 43## | 13 | ax 2## = 43## | 13 | ax 2## = 43## | 13 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
badi/super-user-spark | src/Compiler/Internal.hs | mit | compileDec (DeployKindOverride kind) = do
modify (\s -> s { state_deployment_kind_override = Just kind }) | 109 | compileDec (DeployKindOverride kind) = do
modify (\s -> s { state_deployment_kind_override = Just kind }) | 109 | compileDec (DeployKindOverride kind) = do
modify (\s -> s { state_deployment_kind_override = Just kind }) | 109 | false | false | 0 | 12 | 18 | 40 | 20 | 20 | null | null |
tpsinnem/Idris-dev | src/Idris/Elab/Rewrite.hs | bsd-3-clause | isParam ImplicitParam = True | 28 | isParam ImplicitParam = True | 28 | isParam ImplicitParam = True | 28 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
DaMSL/K3 | src/Language/K3/Codegen/Common.hs | apache-2.0 | annotationComboIdL (namedLAnnotations -> ids) = Just $ annotationComboId ids | 76 | annotationComboIdL (namedLAnnotations -> ids) = Just $ annotationComboId ids | 76 | annotationComboIdL (namedLAnnotations -> ids) = Just $ annotationComboId ids | 76 | false | false | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
spell-music/temporal-music-notation-demo | src/Temporal/Music/Demo/GeneralMidi.hs | bsd-3-clause | hammondOrgan = instr 16 | 23 | hammondOrgan = instr 16 | 23 | hammondOrgan = instr 16 | 23 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Subsets and Splits