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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jcf42b/tutorials-1 | theSantaClausProblem.hs | cc0-1.0 | newGroup :: Int -> IO Group
newGroup n = atomically (do { g1 <- newGate n;
g2 <- newGate n;
tv <- newTVar (n, g1, g2);
return (MkGroup n tv) }) | 179 | newGroup :: Int -> IO Group
newGroup n = atomically (do { g1 <- newGate n;
g2 <- newGate n;
tv <- newTVar (n, g1, g2);
return (MkGroup n tv) }) | 179 | newGroup n = atomically (do { g1 <- newGate n;
g2 <- newGate n;
tv <- newTVar (n, g1, g2);
return (MkGroup n tv) }) | 151 | false | true | 0 | 11 | 66 | 90 | 43 | 47 | null | null |
mainland/nikola | tests/unit/Main.hs | bsd-3-clause | th_const_array :: Test
th_const_array = testCase "TH array of constants" $
assert (toHostList arr == replicate 100 1)
where
arr :: R.Array R.CUF R.DIM1 Float
arr = $(NTH.compile Funs.const_array) | 209 | th_const_array :: Test
th_const_array = testCase "TH array of constants" $
assert (toHostList arr == replicate 100 1)
where
arr :: R.Array R.CUF R.DIM1 Float
arr = $(NTH.compile Funs.const_array) | 209 | th_const_array = testCase "TH array of constants" $
assert (toHostList arr == replicate 100 1)
where
arr :: R.Array R.CUF R.DIM1 Float
arr = $(NTH.compile Funs.const_array) | 186 | false | true | 1 | 9 | 42 | 85 | 36 | 49 | null | null |
ford-prefect/haskell-gi | base/Data/GI/Base/ManagedPtr.hs | lgpl-2.1 | copyBytes :: WrappedPtr a => Int -> Ptr a -> IO (Ptr a)
copyBytes size ptr = do
ptr' <- wrappedPtrCalloc
memcpy ptr' ptr size
return ptr' | 143 | copyBytes :: WrappedPtr a => Int -> Ptr a -> IO (Ptr a)
copyBytes size ptr = do
ptr' <- wrappedPtrCalloc
memcpy ptr' ptr size
return ptr' | 143 | copyBytes size ptr = do
ptr' <- wrappedPtrCalloc
memcpy ptr' ptr size
return ptr' | 87 | false | true | 0 | 11 | 32 | 71 | 30 | 41 | null | null |
tulcod/megaparsec | benchmarks/Main.hs | bsd-2-clause | pack :: String -> String
pack = id | 34 | pack :: String -> String
pack = id | 34 | pack = id | 9 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
jbandlow/learn-me-a-haskell | baby.hs | mit | -- Reimplementing reverse, a more clever illustration:
reverse' :: [a] -> [a]
reverse' = List.foldl (\acc x -> x : acc) [] | 122 | reverse' :: [a] -> [a]
reverse' = List.foldl (\acc x -> x : acc) [] | 67 | reverse' = List.foldl (\acc x -> x : acc) [] | 44 | true | true | 0 | 8 | 21 | 52 | 26 | 26 | null | null |
crockeo/netwire-vinyl | src/Config.hs | mit | -- | The render width of the screen in an OpenGL format.
glRenderWidth :: GLint
glRenderWidth = fromIntegral renderWidth | 120 | glRenderWidth :: GLint
glRenderWidth = fromIntegral renderWidth | 63 | glRenderWidth = fromIntegral renderWidth | 40 | true | true | 0 | 5 | 18 | 15 | 8 | 7 | null | null |
andreyk0/hs-send-gcode | send-gcode/GCodeDictionary.hs | gpl-2.0 | extruderTemperatureOff :: Text
extruderTemperatureOff = "M104 S0" | 65 | extruderTemperatureOff :: Text
extruderTemperatureOff = "M104 S0" | 65 | extruderTemperatureOff = "M104 S0" | 34 | false | true | 0 | 4 | 6 | 11 | 6 | 5 | null | null |
gokhankici/symmetry | checker/include/TargetClient.hs | mit | lhs_gen :: Gen Pred
lhs_gen = do len <- frequency (zip freqs sizes)
pc_ts <- shuffle thisPcs >>= return . (take len)
let pcs = mkpc <$> pc_ts
ops = const AIntEq <$> pc_ts
ns <- sequence (rand_pc <$> pc_ts)
let as = map (uncurry3 IntCmp) (zip3 pcs ops ns)
return (AndP as)
where freqs = if length thisPcs < 3 then [2,3] else [2,3,1]
sizes = map return [1..3]
rand_pc (_,n) = let maxPc = find' n pcCounts
allPcs = (range ((-1),maxPc)) :: [Int]
in elements (AConst <$> allPcs)
mkpc (v,n) = if isAbs n
then let k = AIntSingle $ getClassK n
in AIntClass v k
else AIntSingle v | 940 | lhs_gen :: Gen Pred
lhs_gen = do len <- frequency (zip freqs sizes)
pc_ts <- shuffle thisPcs >>= return . (take len)
let pcs = mkpc <$> pc_ts
ops = const AIntEq <$> pc_ts
ns <- sequence (rand_pc <$> pc_ts)
let as = map (uncurry3 IntCmp) (zip3 pcs ops ns)
return (AndP as)
where freqs = if length thisPcs < 3 then [2,3] else [2,3,1]
sizes = map return [1..3]
rand_pc (_,n) = let maxPc = find' n pcCounts
allPcs = (range ((-1),maxPc)) :: [Int]
in elements (AConst <$> allPcs)
mkpc (v,n) = if isAbs n
then let k = AIntSingle $ getClassK n
in AIntClass v k
else AIntSingle v | 940 | lhs_gen = do len <- frequency (zip freqs sizes)
pc_ts <- shuffle thisPcs >>= return . (take len)
let pcs = mkpc <$> pc_ts
ops = const AIntEq <$> pc_ts
ns <- sequence (rand_pc <$> pc_ts)
let as = map (uncurry3 IntCmp) (zip3 pcs ops ns)
return (AndP as)
where freqs = if length thisPcs < 3 then [2,3] else [2,3,1]
sizes = map return [1..3]
rand_pc (_,n) = let maxPc = find' n pcCounts
allPcs = (range ((-1),maxPc)) :: [Int]
in elements (AConst <$> allPcs)
mkpc (v,n) = if isAbs n
then let k = AIntSingle $ getClassK n
in AIntClass v k
else AIntSingle v | 920 | false | true | 0 | 15 | 480 | 311 | 157 | 154 | null | null |
keithodulaigh/Hets | ExtModal/Ship.hs | gpl-2.0 | aBoxAnds :: CharParser st ABoxAnds
aBoxAnds = sepBy1 aBoxLit (skipKey "and") | 76 | aBoxAnds :: CharParser st ABoxAnds
aBoxAnds = sepBy1 aBoxLit (skipKey "and") | 76 | aBoxAnds = sepBy1 aBoxLit (skipKey "and") | 41 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
rueshyna/gogol | gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs | mpl-2.0 | -- | Column Type. Either DIMENSION or METRIC.
rdchiColumnType :: Lens' RealtimeDataColumnHeadersItem (Maybe Text)
rdchiColumnType
= lens _rdchiColumnType
(\ s a -> s{_rdchiColumnType = a}) | 196 | rdchiColumnType :: Lens' RealtimeDataColumnHeadersItem (Maybe Text)
rdchiColumnType
= lens _rdchiColumnType
(\ s a -> s{_rdchiColumnType = a}) | 150 | rdchiColumnType
= lens _rdchiColumnType
(\ s a -> s{_rdchiColumnType = a}) | 82 | true | true | 0 | 9 | 32 | 48 | 25 | 23 | null | null |
ml9951/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | tcTyVarsOfType :: Type -> TcTyVarSet
-- Just the *TcTyVars* free in the type
-- (Types.tyVarsOfTypes finds all free TyVars)
tcTyVarsOfType (TyVarTy tv) = if isTcTyVar tv then unitVarSet tv
else emptyVarSet | 267 | tcTyVarsOfType :: Type -> TcTyVarSet
tcTyVarsOfType (TyVarTy tv) = if isTcTyVar tv then unitVarSet tv
else emptyVarSet | 180 | tcTyVarsOfType (TyVarTy tv) = if isTcTyVar tv then unitVarSet tv
else emptyVarSet | 143 | true | true | 0 | 9 | 92 | 46 | 22 | 24 | null | null |
ndmitchell/tagsoup | dead/parser/Compiler/old/Parser.hs | bsd-3-clause | parseItem :: String -> Item1
parseItem ('\"':xs) | "\"" `isSuffixOf` xs = Literal1 $ init xs | 92 | parseItem :: String -> Item1
parseItem ('\"':xs) | "\"" `isSuffixOf` xs = Literal1 $ init xs | 92 | parseItem ('\"':xs) | "\"" `isSuffixOf` xs = Literal1 $ init xs | 63 | false | true | 0 | 8 | 15 | 44 | 22 | 22 | null | null |
froozen/simple-wiki | src/Configuration.hs | bsd-3-clause | defaultConfiguration :: Configuration
defaultConfiguration = Configuration {
style = Nothing
, servePort = 8000
, index = "index"
} | 157 | defaultConfiguration :: Configuration
defaultConfiguration = Configuration {
style = Nothing
, servePort = 8000
, index = "index"
} | 157 | defaultConfiguration = Configuration {
style = Nothing
, servePort = 8000
, index = "index"
} | 119 | false | true | 0 | 6 | 44 | 31 | 19 | 12 | null | null |
ezyang/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | doIndexByteArrayOp _ _ _ _
= panic "StgCmmPrim: doIndexByteArrayOp" | 70 | doIndexByteArrayOp _ _ _ _
= panic "StgCmmPrim: doIndexByteArrayOp" | 70 | doIndexByteArrayOp _ _ _ _
= panic "StgCmmPrim: doIndexByteArrayOp" | 70 | false | false | 1 | 5 | 11 | 18 | 7 | 11 | null | null |
romanb/amazonka | amazonka-emr/gen/Network/AWS/EMR/Types.hs | mpl-2.0 | -- | A timeline that represents the status of a cluster over the lifetime of the
-- cluster.
csTimeline :: Lens' ClusterStatus (Maybe ClusterTimeline)
csTimeline = lens _csTimeline (\s a -> s { _csTimeline = a }) | 212 | csTimeline :: Lens' ClusterStatus (Maybe ClusterTimeline)
csTimeline = lens _csTimeline (\s a -> s { _csTimeline = a }) | 119 | csTimeline = lens _csTimeline (\s a -> s { _csTimeline = a }) | 61 | true | true | 0 | 9 | 36 | 47 | 26 | 21 | null | null |
dolio/vector | Data/Vector/Fusion/Bundle/Monadic.hs | bsd-3-clause | zipWith3 f = zipWith3M (\a b c -> return (f a b c)) | 51 | zipWith3 f = zipWith3M (\a b c -> return (f a b c)) | 51 | zipWith3 f = zipWith3M (\a b c -> return (f a b c)) | 51 | false | false | 1 | 10 | 12 | 40 | 18 | 22 | null | null |
pbrisbin/yesod-comments | Yesod/Comments/Management.hs | bsd-3-clause | getCommentsAdmin :: a -> CommentsAdmin
getCommentsAdmin = const CommentsAdmin | 77 | getCommentsAdmin :: a -> CommentsAdmin
getCommentsAdmin = const CommentsAdmin | 77 | getCommentsAdmin = const CommentsAdmin | 38 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
edsko/cabal | Cabal/src/Distribution/PackageDescription.hs | bsd-3-clause | defaultRenaming :: ModuleRenaming
defaultRenaming = ModuleRenaming True [] | 74 | defaultRenaming :: ModuleRenaming
defaultRenaming = ModuleRenaming True [] | 74 | defaultRenaming = ModuleRenaming True [] | 40 | false | true | 0 | 6 | 7 | 18 | 9 | 9 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/deSugar/DsBinds.hs | bsd-3-clause | dsEvTypeable :: EvTypeable -> DsM CoreExpr
dsEvTypeable ev =
do tyCl <- dsLookupTyCon typeableClassName
typeRepTc <- dsLookupTyCon typeRepTyConName
let tyRepType = mkTyConApp typeRepTc []
(ty, rep) <-
case ev of
EvTypeableTyCon tc ks ->
do ctr <- dsLookupGlobalId mkPolyTyConAppName
mkTyCon <- dsLookupGlobalId mkTyConName
dflags <- getDynFlags
let mkRep cRep kReps tReps =
mkApps (Var ctr) [ cRep, mkListExpr tyRepType kReps
, mkListExpr tyRepType tReps ]
let kindRep k =
case splitTyConApp_maybe k of
Nothing -> panic "dsEvTypeable: not a kind constructor"
Just (kc,ks) ->
do kcRep <- tyConRep dflags mkTyCon kc
reps <- mapM kindRep ks
return (mkRep kcRep [] reps)
tcRep <- tyConRep dflags mkTyCon tc
kReps <- mapM kindRep ks
return ( mkTyConApp tc ks
, mkRep tcRep kReps []
)
EvTypeableTyApp t1 t2 ->
do e1 <- getRep tyCl t1
e2 <- getRep tyCl t2
ctr <- dsLookupGlobalId mkAppTyName
return ( mkAppTy (snd t1) (snd t2)
, mkApps (Var ctr) [ e1, e2 ]
)
EvTypeableTyLit ty ->
do str <- case (isNumLitTy ty, isStrLitTy ty) of
(Just n, _) -> return (show n)
(_, Just n) -> return (show n)
_ -> panic "dsEvTypeable: malformed TyLit evidence"
ctr <- dsLookupGlobalId typeLitTypeRepName
tag <- mkStringExpr str
return (ty, mkApps (Var ctr) [ tag ])
-- TyRep -> Typeable t
-- see also: Note [Memoising typeOf]
repName <- newSysLocalDs tyRepType
let proxyT = mkProxyPrimTy (typeKind ty) ty
method = bindNonRec repName rep
$ mkLams [mkWildValBinder proxyT] (Var repName)
-- package up the method as `Typeable` dictionary
return $ mkCast method $ mkSymCo $ getTypeableCo tyCl ty
where
-- co: method -> Typeable k t
getTypeableCo tc t =
case instNewTyCon_maybe tc [typeKind t, t] of
Just (_,co) -> co
_ -> panic "Class `Typeable` is not a `newtype`."
-- Typeable t -> TyRep
getRep tc (ev,t) =
do typeableExpr <- dsEvTerm ev
let co = getTypeableCo tc t
method = mkCast typeableExpr co
proxy = mkTyApps (Var proxyHashId) [typeKind t, t]
return (mkApps method [proxy])
-- This part could be cached
tyConRep dflags mkTyCon tc =
do pkgStr <- mkStringExprFS pkg_fs
modStr <- mkStringExprFS modl_fs
nameStr <- mkStringExprFS name_fs
return (mkApps (Var mkTyCon) [ int64 high, int64 low
, pkgStr, modStr, nameStr
])
where
tycon_name = tyConName tc
modl = nameModule tycon_name
pkg = modulePackageKey modl
modl_fs = moduleNameFS (moduleName modl)
pkg_fs = packageKeyFS pkg
name_fs = occNameFS (nameOccName tycon_name)
hash_name_fs
| isPromotedTyCon tc = appendFS (mkFastString "$k") name_fs
| isPromotedDataCon tc = appendFS (mkFastString "$c") name_fs
| otherwise = name_fs
hashThis = unwords $ map unpackFS [pkg_fs, modl_fs, hash_name_fs]
Fingerprint high low = fingerprintString hashThis
int64
| wORD_SIZE dflags == 4 = mkWord64LitWord64
| otherwise = mkWordLit dflags . fromIntegral
{- Note [Memoising typeOf]
~~~~~~~~~~~~~~~~~~~~~~~~~~
See #3245, #9203
IMPORTANT: we don't want to recalculate the TypeRep once per call with
the proxy argument. This is what went wrong in #3245 and #9203. So we
help GHC by manually keeping the 'rep' *outside* the lambda.
-}
--------------------------------------- | 4,244 | dsEvTypeable :: EvTypeable -> DsM CoreExpr
dsEvTypeable ev =
do tyCl <- dsLookupTyCon typeableClassName
typeRepTc <- dsLookupTyCon typeRepTyConName
let tyRepType = mkTyConApp typeRepTc []
(ty, rep) <-
case ev of
EvTypeableTyCon tc ks ->
do ctr <- dsLookupGlobalId mkPolyTyConAppName
mkTyCon <- dsLookupGlobalId mkTyConName
dflags <- getDynFlags
let mkRep cRep kReps tReps =
mkApps (Var ctr) [ cRep, mkListExpr tyRepType kReps
, mkListExpr tyRepType tReps ]
let kindRep k =
case splitTyConApp_maybe k of
Nothing -> panic "dsEvTypeable: not a kind constructor"
Just (kc,ks) ->
do kcRep <- tyConRep dflags mkTyCon kc
reps <- mapM kindRep ks
return (mkRep kcRep [] reps)
tcRep <- tyConRep dflags mkTyCon tc
kReps <- mapM kindRep ks
return ( mkTyConApp tc ks
, mkRep tcRep kReps []
)
EvTypeableTyApp t1 t2 ->
do e1 <- getRep tyCl t1
e2 <- getRep tyCl t2
ctr <- dsLookupGlobalId mkAppTyName
return ( mkAppTy (snd t1) (snd t2)
, mkApps (Var ctr) [ e1, e2 ]
)
EvTypeableTyLit ty ->
do str <- case (isNumLitTy ty, isStrLitTy ty) of
(Just n, _) -> return (show n)
(_, Just n) -> return (show n)
_ -> panic "dsEvTypeable: malformed TyLit evidence"
ctr <- dsLookupGlobalId typeLitTypeRepName
tag <- mkStringExpr str
return (ty, mkApps (Var ctr) [ tag ])
-- TyRep -> Typeable t
-- see also: Note [Memoising typeOf]
repName <- newSysLocalDs tyRepType
let proxyT = mkProxyPrimTy (typeKind ty) ty
method = bindNonRec repName rep
$ mkLams [mkWildValBinder proxyT] (Var repName)
-- package up the method as `Typeable` dictionary
return $ mkCast method $ mkSymCo $ getTypeableCo tyCl ty
where
-- co: method -> Typeable k t
getTypeableCo tc t =
case instNewTyCon_maybe tc [typeKind t, t] of
Just (_,co) -> co
_ -> panic "Class `Typeable` is not a `newtype`."
-- Typeable t -> TyRep
getRep tc (ev,t) =
do typeableExpr <- dsEvTerm ev
let co = getTypeableCo tc t
method = mkCast typeableExpr co
proxy = mkTyApps (Var proxyHashId) [typeKind t, t]
return (mkApps method [proxy])
-- This part could be cached
tyConRep dflags mkTyCon tc =
do pkgStr <- mkStringExprFS pkg_fs
modStr <- mkStringExprFS modl_fs
nameStr <- mkStringExprFS name_fs
return (mkApps (Var mkTyCon) [ int64 high, int64 low
, pkgStr, modStr, nameStr
])
where
tycon_name = tyConName tc
modl = nameModule tycon_name
pkg = modulePackageKey modl
modl_fs = moduleNameFS (moduleName modl)
pkg_fs = packageKeyFS pkg
name_fs = occNameFS (nameOccName tycon_name)
hash_name_fs
| isPromotedTyCon tc = appendFS (mkFastString "$k") name_fs
| isPromotedDataCon tc = appendFS (mkFastString "$c") name_fs
| otherwise = name_fs
hashThis = unwords $ map unpackFS [pkg_fs, modl_fs, hash_name_fs]
Fingerprint high low = fingerprintString hashThis
int64
| wORD_SIZE dflags == 4 = mkWord64LitWord64
| otherwise = mkWordLit dflags . fromIntegral
{- Note [Memoising typeOf]
~~~~~~~~~~~~~~~~~~~~~~~~~~
See #3245, #9203
IMPORTANT: we don't want to recalculate the TypeRep once per call with
the proxy argument. This is what went wrong in #3245 and #9203. So we
help GHC by manually keeping the 'rep' *outside* the lambda.
-}
--------------------------------------- | 4,244 | dsEvTypeable ev =
do tyCl <- dsLookupTyCon typeableClassName
typeRepTc <- dsLookupTyCon typeRepTyConName
let tyRepType = mkTyConApp typeRepTc []
(ty, rep) <-
case ev of
EvTypeableTyCon tc ks ->
do ctr <- dsLookupGlobalId mkPolyTyConAppName
mkTyCon <- dsLookupGlobalId mkTyConName
dflags <- getDynFlags
let mkRep cRep kReps tReps =
mkApps (Var ctr) [ cRep, mkListExpr tyRepType kReps
, mkListExpr tyRepType tReps ]
let kindRep k =
case splitTyConApp_maybe k of
Nothing -> panic "dsEvTypeable: not a kind constructor"
Just (kc,ks) ->
do kcRep <- tyConRep dflags mkTyCon kc
reps <- mapM kindRep ks
return (mkRep kcRep [] reps)
tcRep <- tyConRep dflags mkTyCon tc
kReps <- mapM kindRep ks
return ( mkTyConApp tc ks
, mkRep tcRep kReps []
)
EvTypeableTyApp t1 t2 ->
do e1 <- getRep tyCl t1
e2 <- getRep tyCl t2
ctr <- dsLookupGlobalId mkAppTyName
return ( mkAppTy (snd t1) (snd t2)
, mkApps (Var ctr) [ e1, e2 ]
)
EvTypeableTyLit ty ->
do str <- case (isNumLitTy ty, isStrLitTy ty) of
(Just n, _) -> return (show n)
(_, Just n) -> return (show n)
_ -> panic "dsEvTypeable: malformed TyLit evidence"
ctr <- dsLookupGlobalId typeLitTypeRepName
tag <- mkStringExpr str
return (ty, mkApps (Var ctr) [ tag ])
-- TyRep -> Typeable t
-- see also: Note [Memoising typeOf]
repName <- newSysLocalDs tyRepType
let proxyT = mkProxyPrimTy (typeKind ty) ty
method = bindNonRec repName rep
$ mkLams [mkWildValBinder proxyT] (Var repName)
-- package up the method as `Typeable` dictionary
return $ mkCast method $ mkSymCo $ getTypeableCo tyCl ty
where
-- co: method -> Typeable k t
getTypeableCo tc t =
case instNewTyCon_maybe tc [typeKind t, t] of
Just (_,co) -> co
_ -> panic "Class `Typeable` is not a `newtype`."
-- Typeable t -> TyRep
getRep tc (ev,t) =
do typeableExpr <- dsEvTerm ev
let co = getTypeableCo tc t
method = mkCast typeableExpr co
proxy = mkTyApps (Var proxyHashId) [typeKind t, t]
return (mkApps method [proxy])
-- This part could be cached
tyConRep dflags mkTyCon tc =
do pkgStr <- mkStringExprFS pkg_fs
modStr <- mkStringExprFS modl_fs
nameStr <- mkStringExprFS name_fs
return (mkApps (Var mkTyCon) [ int64 high, int64 low
, pkgStr, modStr, nameStr
])
where
tycon_name = tyConName tc
modl = nameModule tycon_name
pkg = modulePackageKey modl
modl_fs = moduleNameFS (moduleName modl)
pkg_fs = packageKeyFS pkg
name_fs = occNameFS (nameOccName tycon_name)
hash_name_fs
| isPromotedTyCon tc = appendFS (mkFastString "$k") name_fs
| isPromotedDataCon tc = appendFS (mkFastString "$c") name_fs
| otherwise = name_fs
hashThis = unwords $ map unpackFS [pkg_fs, modl_fs, hash_name_fs]
Fingerprint high low = fingerprintString hashThis
int64
| wORD_SIZE dflags == 4 = mkWord64LitWord64
| otherwise = mkWordLit dflags . fromIntegral
{- Note [Memoising typeOf]
~~~~~~~~~~~~~~~~~~~~~~~~~~
See #3245, #9203
IMPORTANT: we don't want to recalculate the TypeRep once per call with
the proxy argument. This is what went wrong in #3245 and #9203. So we
help GHC by manually keeping the 'rep' *outside* the lambda.
-}
--------------------------------------- | 4,201 | false | true | 0 | 24 | 1,651 | 1,036 | 487 | 549 | null | null |
rimmington/eclogues | eclogues/src/Eclogues/API.hs | bsd-3-clause | actCreate (Job.BoxSpec s) = ActCreateBox s | 42 | actCreate (Job.BoxSpec s) = ActCreateBox s | 42 | actCreate (Job.BoxSpec s) = ActCreateBox s | 42 | false | false | 0 | 7 | 5 | 21 | 9 | 12 | null | null |
momomimachli/Hedsql | tests/Database/Hedsql/Statements/Create.hs | gpl-3.0 | {-|
CREATE TABLE "People" (
"firstName" varchar(256),
"lastName" varchar(256),
CONSTRAINT "pk" PRIMARY KEY ("firstName", "lastName")
)
-}
primaryKeyTable :: Create dbVendor
primaryKeyTable =
createTable
"People"
[ wrap $ col "firstName" (varchar 256)
, wrap $ col "lastName" (varchar 256)]
|> constraints (primaryT (Just "pk") ["firstName", "lastName"])
|> end | 429 | primaryKeyTable :: Create dbVendor
primaryKeyTable =
createTable
"People"
[ wrap $ col "firstName" (varchar 256)
, wrap $ col "lastName" (varchar 256)]
|> constraints (primaryT (Just "pk") ["firstName", "lastName"])
|> end | 266 | primaryKeyTable =
createTable
"People"
[ wrap $ col "firstName" (varchar 256)
, wrap $ col "lastName" (varchar 256)]
|> constraints (primaryT (Just "pk") ["firstName", "lastName"])
|> end | 231 | true | true | 0 | 12 | 116 | 87 | 44 | 43 | null | null |
jecisc/TP_PF_L3 | PF-TP3/src/TP3_PF_FERLICOT/Main.hs | mit | ymbolesTortue :: Config -> [Symbole]
symbolesTortue (_,_,_,_,t) = t
| 68 | symbolesTortue :: Config -> [Symbole]
symbolesTortue (_,_,_,_,t) = t | 68 | symbolesTortue (_,_,_,_,t) = t | 30 | false | true | 0 | 6 | 9 | 39 | 22 | 17 | null | null |
duairc/pipes | src/Control/Pipe/Text/IO.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | Stream the contents of a file as binary data.
produceFile
:: (MonadResource m, MonadException m)
=> FilePath
-> Producer Text m ()
produceFile file = produceIOHandle (openFile file ReadMode) | 286 | produceFile
:: (MonadResource m, MonadException m)
=> FilePath
-> Producer Text m ()
produceFile file = produceIOHandle (openFile file ReadMode) | 156 | produceFile file = produceIOHandle (openFile file ReadMode) | 59 | true | true | 0 | 9 | 43 | 59 | 29 | 30 | null | null |
rueshyna/gogol | gogol-appengine/gen/Network/Google/AppEngine/Types/Product.hs | mpl-2.0 | -- | Hostname used to reach this application, as resolved by App
-- Engine.\'OutputOnly
aDefaultHostname :: Lens' Application (Maybe Text)
aDefaultHostname
= lens _aDefaultHostname
(\ s a -> s{_aDefaultHostname = a}) | 224 | aDefaultHostname :: Lens' Application (Maybe Text)
aDefaultHostname
= lens _aDefaultHostname
(\ s a -> s{_aDefaultHostname = a}) | 136 | aDefaultHostname
= lens _aDefaultHostname
(\ s a -> s{_aDefaultHostname = a}) | 85 | true | true | 0 | 9 | 38 | 49 | 26 | 23 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/Simple/Program/Db.hs | bsd-3-clause | -- | Like 'userSpecifyPath' but for a list of progs and their paths.
--
userSpecifyPaths :: [(String, FilePath)]
-> ProgramDb
-> ProgramDb
userSpecifyPaths paths conf =
foldl' (\conf' (prog, path) -> userSpecifyPath prog path conf') conf paths | 279 | userSpecifyPaths :: [(String, FilePath)]
-> ProgramDb
-> ProgramDb
userSpecifyPaths paths conf =
foldl' (\conf' (prog, path) -> userSpecifyPath prog path conf') conf paths | 207 | userSpecifyPaths paths conf =
foldl' (\conf' (prog, path) -> userSpecifyPath prog path conf') conf paths | 106 | true | true | 0 | 8 | 72 | 65 | 36 | 29 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | fromJStringIdKey = mkPreludeMiscIdUnique 512 | 48 | fromJStringIdKey = mkPreludeMiscIdUnique 512 | 48 | fromJStringIdKey = mkPreludeMiscIdUnique 512 | 48 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
sebastiaanvisser/orchid-doc | src/Text/Xhtml/Xhtml.hs | bsd-3-clause | body = element "body" | 25 | body = element "body" | 25 | body = element "body" | 25 | false | false | 1 | 5 | 7 | 13 | 4 | 9 | null | null |
andir/ganeti | test/hs/Test/Ganeti/Luxi.hs | bsd-2-clause | case_AllDefined :: Assertion
case_AllDefined = do
py_stdout <- runPython "from ganeti import luxi\n\
\print '\\n'.join(luxi.REQ_ALL)" "" >>=
checkPythonResult
let py_ops = sort $ lines py_stdout
hs_ops = Luxi.allLuxiCalls
extra_py = py_ops \\ hs_ops
extra_hs = hs_ops \\ py_ops
assertBool ("Luxi calls missing from Haskell code:\n" ++
unlines extra_py) (null extra_py)
assertBool ("Extra Luxi calls in the Haskell code:\n" ++
unlines extra_hs) (null extra_hs) | 553 | case_AllDefined :: Assertion
case_AllDefined = do
py_stdout <- runPython "from ganeti import luxi\n\
\print '\\n'.join(luxi.REQ_ALL)" "" >>=
checkPythonResult
let py_ops = sort $ lines py_stdout
hs_ops = Luxi.allLuxiCalls
extra_py = py_ops \\ hs_ops
extra_hs = hs_ops \\ py_ops
assertBool ("Luxi calls missing from Haskell code:\n" ++
unlines extra_py) (null extra_py)
assertBool ("Extra Luxi calls in the Haskell code:\n" ++
unlines extra_hs) (null extra_hs) | 553 | case_AllDefined = do
py_stdout <- runPython "from ganeti import luxi\n\
\print '\\n'.join(luxi.REQ_ALL)" "" >>=
checkPythonResult
let py_ops = sort $ lines py_stdout
hs_ops = Luxi.allLuxiCalls
extra_py = py_ops \\ hs_ops
extra_hs = hs_ops \\ py_ops
assertBool ("Luxi calls missing from Haskell code:\n" ++
unlines extra_py) (null extra_py)
assertBool ("Extra Luxi calls in the Haskell code:\n" ++
unlines extra_hs) (null extra_hs) | 524 | false | true | 0 | 12 | 156 | 123 | 57 | 66 | null | null |
tonyfloatersu/solution-haskell-craft-of-FP | Chapter_14_my_note.hs | mit | sumTree (Node val tree1 tree2) = val + sumTree tree1 + sumTree tree2 | 71 | sumTree (Node val tree1 tree2) = val + sumTree tree1 + sumTree tree2 | 71 | sumTree (Node val tree1 tree2) = val + sumTree tree1 + sumTree tree2 | 71 | false | false | 0 | 7 | 15 | 34 | 15 | 19 | null | null |
rahulmutt/ghcvm | compiler/Eta/Utils/State.hs | bsd-3-clause | modify :: (s -> s) -> State s ()
modify f = State $ \s -> (# (), f s #) | 71 | modify :: (s -> s) -> State s ()
modify f = State $ \s -> (# (), f s #) | 71 | modify f = State $ \s -> (# (), f s #) | 38 | false | true | 2 | 8 | 20 | 57 | 27 | 30 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Arrow notation
arrAIdKey, composeAIdKey, firstAIdKey, appAIdKey, choiceAIdKey,
loopAIdKey :: Unique
arrAIdKey = mkPreludeMiscIdUnique 180 | 150 | arrAIdKey, composeAIdKey, firstAIdKey, appAIdKey, choiceAIdKey,
loopAIdKey :: Unique
arrAIdKey = mkPreludeMiscIdUnique 180 | 132 | arrAIdKey = mkPreludeMiscIdUnique 180 | 43 | true | true | 5 | 5 | 24 | 36 | 18 | 18 | null | null |
silkapp/heist | test/suite/Heist/Tests.hs | bsd-3-clause | tdirCacheTest :: IO ()
tdirCacheTest = do
let rSplices = [ ("foosplice", fooSplice) ]
dSplices = [ ("foosplice", stateSplice) ]
hc = HeistConfig rSplices [] dSplices [] mempty
td <- newTemplateDirectory' "templates" hc
[a,b,c,d] <- evalStateT (testInterpreted td) 5
H.assertBool "interpreted doesn't cache" $ a == b
H.assertBool "interpreted doesn't clear" $ b /= c
H.assertBool "interpreted doesn't reload" $ c /= d
td' <- newTemplateDirectory' "templates" hc
[e,f,g,h] <- evalStateT (testCompiled td') 5
H.assertBool "compiled doesn't cache" $ e == f
H.assertBool "compiled doesn't clear" $ f /= g
H.assertBool "compiled doesn't reload" $ g /= h
where
testInterpreted td = do
hs <- liftIO $ getDirectoryHS td
cts <- liftIO $ getDirectoryCTS td
a <- I.renderTemplate hs "cache"
modify (+1)
b <- I.renderTemplate hs "cache"
liftIO $ clearCacheTagState cts
c <- I.renderTemplate hs "cache"
modify (+1)
_ <- liftIO $ reloadTemplateDirectory td
-- The reload changes the HeistState, so we have to get it again
hs' <- liftIO $ getDirectoryHS td
d <- I.renderTemplate hs' "cache"
return $ map (toByteString . fst . fromJust) [a,b,c,d]
testCompiled td = do
hs <- liftIO $ getDirectoryHS td
cts <- liftIO $ getDirectoryCTS td
a <- fst $ fromJust $ C.renderTemplate hs "cache"
modify (+1)
b <- fst $ fromJust $ C.renderTemplate hs "cache"
liftIO $ clearCacheTagState cts
c <- fst $ fromJust $ C.renderTemplate hs "cache"
modify (+1)
_ <- liftIO $ reloadTemplateDirectory td
-- The reload changes the HeistState, so we have to get it again
hs' <- liftIO $ getDirectoryHS td
d <- fst $ fromJust $ C.renderTemplate hs' "cache"
return $ map toByteString [a,b,c,d] | 1,946 | tdirCacheTest :: IO ()
tdirCacheTest = do
let rSplices = [ ("foosplice", fooSplice) ]
dSplices = [ ("foosplice", stateSplice) ]
hc = HeistConfig rSplices [] dSplices [] mempty
td <- newTemplateDirectory' "templates" hc
[a,b,c,d] <- evalStateT (testInterpreted td) 5
H.assertBool "interpreted doesn't cache" $ a == b
H.assertBool "interpreted doesn't clear" $ b /= c
H.assertBool "interpreted doesn't reload" $ c /= d
td' <- newTemplateDirectory' "templates" hc
[e,f,g,h] <- evalStateT (testCompiled td') 5
H.assertBool "compiled doesn't cache" $ e == f
H.assertBool "compiled doesn't clear" $ f /= g
H.assertBool "compiled doesn't reload" $ g /= h
where
testInterpreted td = do
hs <- liftIO $ getDirectoryHS td
cts <- liftIO $ getDirectoryCTS td
a <- I.renderTemplate hs "cache"
modify (+1)
b <- I.renderTemplate hs "cache"
liftIO $ clearCacheTagState cts
c <- I.renderTemplate hs "cache"
modify (+1)
_ <- liftIO $ reloadTemplateDirectory td
-- The reload changes the HeistState, so we have to get it again
hs' <- liftIO $ getDirectoryHS td
d <- I.renderTemplate hs' "cache"
return $ map (toByteString . fst . fromJust) [a,b,c,d]
testCompiled td = do
hs <- liftIO $ getDirectoryHS td
cts <- liftIO $ getDirectoryCTS td
a <- fst $ fromJust $ C.renderTemplate hs "cache"
modify (+1)
b <- fst $ fromJust $ C.renderTemplate hs "cache"
liftIO $ clearCacheTagState cts
c <- fst $ fromJust $ C.renderTemplate hs "cache"
modify (+1)
_ <- liftIO $ reloadTemplateDirectory td
-- The reload changes the HeistState, so we have to get it again
hs' <- liftIO $ getDirectoryHS td
d <- fst $ fromJust $ C.renderTemplate hs' "cache"
return $ map toByteString [a,b,c,d] | 1,946 | tdirCacheTest = do
let rSplices = [ ("foosplice", fooSplice) ]
dSplices = [ ("foosplice", stateSplice) ]
hc = HeistConfig rSplices [] dSplices [] mempty
td <- newTemplateDirectory' "templates" hc
[a,b,c,d] <- evalStateT (testInterpreted td) 5
H.assertBool "interpreted doesn't cache" $ a == b
H.assertBool "interpreted doesn't clear" $ b /= c
H.assertBool "interpreted doesn't reload" $ c /= d
td' <- newTemplateDirectory' "templates" hc
[e,f,g,h] <- evalStateT (testCompiled td') 5
H.assertBool "compiled doesn't cache" $ e == f
H.assertBool "compiled doesn't clear" $ f /= g
H.assertBool "compiled doesn't reload" $ g /= h
where
testInterpreted td = do
hs <- liftIO $ getDirectoryHS td
cts <- liftIO $ getDirectoryCTS td
a <- I.renderTemplate hs "cache"
modify (+1)
b <- I.renderTemplate hs "cache"
liftIO $ clearCacheTagState cts
c <- I.renderTemplate hs "cache"
modify (+1)
_ <- liftIO $ reloadTemplateDirectory td
-- The reload changes the HeistState, so we have to get it again
hs' <- liftIO $ getDirectoryHS td
d <- I.renderTemplate hs' "cache"
return $ map (toByteString . fst . fromJust) [a,b,c,d]
testCompiled td = do
hs <- liftIO $ getDirectoryHS td
cts <- liftIO $ getDirectoryCTS td
a <- fst $ fromJust $ C.renderTemplate hs "cache"
modify (+1)
b <- fst $ fromJust $ C.renderTemplate hs "cache"
liftIO $ clearCacheTagState cts
c <- fst $ fromJust $ C.renderTemplate hs "cache"
modify (+1)
_ <- liftIO $ reloadTemplateDirectory td
-- The reload changes the HeistState, so we have to get it again
hs' <- liftIO $ getDirectoryHS td
d <- fst $ fromJust $ C.renderTemplate hs' "cache"
return $ map toByteString [a,b,c,d] | 1,923 | false | true | 0 | 11 | 561 | 644 | 304 | 340 | null | null |
rueshyna/gogol | gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/Products/Get.hs | mpl-2.0 | -- | The BCP47 tag for the user\'s preferred language (e.g. \"en-US\",
-- \"de\").
proLanguage :: Lens' ProductsGet (Maybe Text)
proLanguage
= lens _proLanguage (\ s a -> s{_proLanguage = a}) | 193 | proLanguage :: Lens' ProductsGet (Maybe Text)
proLanguage
= lens _proLanguage (\ s a -> s{_proLanguage = a}) | 110 | proLanguage
= lens _proLanguage (\ s a -> s{_proLanguage = a}) | 64 | true | true | 0 | 9 | 32 | 49 | 26 | 23 | null | null |
Fuuzetsu/yi | yi-core/src/Yi/Config/Simple.hs | gpl-2.0 | fontName :: Field (Maybe String)
fontName = configUIA . configFontNameA | 71 | fontName :: Field (Maybe String)
fontName = configUIA . configFontNameA | 71 | fontName = configUIA . configFontNameA | 38 | false | true | 3 | 6 | 9 | 32 | 12 | 20 | null | null |
KaneTW/knxd-native-client | src/KNXd/Client/Internal/Types.hs | mit | fromPacketType MIndividualAddressRead = 50 | 42 | fromPacketType MIndividualAddressRead = 50 | 42 | fromPacketType MIndividualAddressRead = 50 | 42 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-bigtableadmin/gen/Network/Google/Resource/BigtableAdmin/Projects/Instances/Tables/Get.hs | mpl-2.0 | -- | OAuth access token.
pitgAccessToken :: Lens' ProjectsInstancesTablesGet (Maybe Text)
pitgAccessToken
= lens _pitgAccessToken
(\ s a -> s{_pitgAccessToken = a}) | 172 | pitgAccessToken :: Lens' ProjectsInstancesTablesGet (Maybe Text)
pitgAccessToken
= lens _pitgAccessToken
(\ s a -> s{_pitgAccessToken = a}) | 147 | pitgAccessToken
= lens _pitgAccessToken
(\ s a -> s{_pitgAccessToken = a}) | 82 | true | true | 1 | 9 | 29 | 52 | 25 | 27 | null | null |
ctford/Idris-Elba-dev | src/Idris/Core/TT.hs | bsd-3-clause | isInjective (P (TCon _ _) _ _) = True | 37 | isInjective (P (TCon _ _) _ _) = True | 37 | isInjective (P (TCon _ _) _ _) = True | 37 | false | false | 0 | 9 | 8 | 27 | 13 | 14 | null | null |
jamwt/altis | src/Database/Altis/Storage.hs | bsd-3-clause | -- why?
modify :: AltisDataset -> AltisKey -> Modifier -> IO ModifyResult
modify db key mod = atomically $ do
mp <- readTVar db
let !mv = M.lookup key mp
let modres = mod mv
case modres of
ModifyOkay (Just !new) -> do
let !added = M.insert key new mp
writeTVar db added
ModifyOkay Nothing -> do
let !removed = M.delete key mp
writeTVar db removed
ModifyFail _ -> return ()
return $ modres | 494 | modify :: AltisDataset -> AltisKey -> Modifier -> IO ModifyResult
modify db key mod = atomically $ do
mp <- readTVar db
let !mv = M.lookup key mp
let modres = mod mv
case modres of
ModifyOkay (Just !new) -> do
let !added = M.insert key new mp
writeTVar db added
ModifyOkay Nothing -> do
let !removed = M.delete key mp
writeTVar db removed
ModifyFail _ -> return ()
return $ modres | 485 | modify db key mod = atomically $ do
mp <- readTVar db
let !mv = M.lookup key mp
let modres = mod mv
case modres of
ModifyOkay (Just !new) -> do
let !added = M.insert key new mp
writeTVar db added
ModifyOkay Nothing -> do
let !removed = M.delete key mp
writeTVar db removed
ModifyFail _ -> return ()
return $ modres | 419 | true | true | 0 | 17 | 179 | 185 | 79 | 106 | null | null |
ademinn/JavaWithClasses | test/src/TestLexer.hs | bsd-3-clause | isFloat :: TokenType -> Bool
isFloat (TLiteral (LFloat _)) = True | 65 | isFloat :: TokenType -> Bool
isFloat (TLiteral (LFloat _)) = True | 65 | isFloat (TLiteral (LFloat _)) = True | 36 | false | true | 0 | 9 | 10 | 30 | 15 | 15 | null | null |
Alllex/stm-data-collection | src/Data/STM/PriorityQueue/Internal/HeapPQ.hs | bsd-3-clause | union :: Ord k => Heap k v -> Heap k v -> Heap k v
h `union` Nil = h | 68 | union :: Ord k => Heap k v -> Heap k v -> Heap k v
h `union` Nil = h | 68 | h `union` Nil = h | 17 | false | true | 0 | 8 | 20 | 53 | 24 | 29 | null | null |
glguy/advent2016 | Day15.hs | isc | -- | Figure out what time to drop the capsule
solve :: [Disc] -> Int
solve = snd
. foldl aux (1,0)
. zipWith fixup [1..] | 132 | solve :: [Disc] -> Int
solve = snd
. foldl aux (1,0)
. zipWith fixup [1..] | 86 | solve = snd
. foldl aux (1,0)
. zipWith fixup [1..] | 63 | true | true | 0 | 8 | 37 | 46 | 25 | 21 | null | null |
jwiegley/ghc-release | libraries/base/GHC/Event/Thread.hs | gpl-3.0 | threadWaitRead :: Fd -> IO ()
threadWaitRead = threadWait evtRead | 65 | threadWaitRead :: Fd -> IO ()
threadWaitRead = threadWait evtRead | 65 | threadWaitRead = threadWait evtRead | 35 | false | true | 0 | 7 | 9 | 23 | 11 | 12 | null | null |
neosam/esge | src/HSpecTests.hs | bsd-3-clause | foobarParser :: EP.BlockParser
foobarParser = do
_ <- Parsec.string "Foobar"
EP.dbleol
return $ EC.Storage "foo" "bar" [] | 133 | foobarParser :: EP.BlockParser
foobarParser = do
_ <- Parsec.string "Foobar"
EP.dbleol
return $ EC.Storage "foo" "bar" [] | 133 | foobarParser = do
_ <- Parsec.string "Foobar"
EP.dbleol
return $ EC.Storage "foo" "bar" [] | 102 | false | true | 0 | 9 | 28 | 48 | 22 | 26 | null | null |
mcschroeder/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | rhssOfAlts :: [Alt b] -> [Expr b]
rhssOfAlts alts = [e | (_,_,e) <- alts] | 73 | rhssOfAlts :: [Alt b] -> [Expr b]
rhssOfAlts alts = [e | (_,_,e) <- alts] | 73 | rhssOfAlts alts = [e | (_,_,e) <- alts] | 39 | false | true | 0 | 8 | 14 | 50 | 27 | 23 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-printers/Language/Drasil/Printing/Import.hs | bsd-2-clause | spec sm (a :+: b) = spec sm a P.:+: spec sm b | 50 | spec sm (a :+: b) = spec sm a P.:+: spec sm b | 50 | spec sm (a :+: b) = spec sm a P.:+: spec sm b | 50 | false | false | 0 | 6 | 17 | 36 | 16 | 20 | null | null |
rwbarton/rw | Crawl/Move.hs | bsd-3-clause | moveProgram (Quaff slot) = do
press "q"
expectMenu (== "<white>Drink which item?")
press (T.singleton $ slotLetter slot) | 126 | moveProgram (Quaff slot) = do
press "q"
expectMenu (== "<white>Drink which item?")
press (T.singleton $ slotLetter slot) | 126 | moveProgram (Quaff slot) = do
press "q"
expectMenu (== "<white>Drink which item?")
press (T.singleton $ slotLetter slot) | 126 | false | false | 0 | 10 | 22 | 49 | 22 | 27 | null | null |
sdiehl/ghc | libraries/template-haskell/Language/Haskell/TH/PprLib.hs | bsd-3-clause | parens = liftM HPJ.parens | 25 | parens = liftM HPJ.parens | 25 | parens = liftM HPJ.parens | 25 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
shicks/shsh | Language/Sh/Expansion.hs | bsd-3-clause | home :: Monad m => String -> Exp m (Maybe String)
home u = use homeDir u | 72 | home :: Monad m => String -> Exp m (Maybe String)
home u = use homeDir u | 72 | home u = use homeDir u | 22 | false | true | 0 | 10 | 16 | 46 | 20 | 26 | null | null |
sakana/HaPy | example/haskell/ExampleModule.hs | mit | arr_complex :: [[Int]] -> [[Int]]
arr_complex = map (map (* 2)) | 63 | arr_complex :: [[Int]] -> [[Int]]
arr_complex = map (map (* 2)) | 63 | arr_complex = map (map (* 2)) | 29 | false | true | 0 | 8 | 10 | 40 | 23 | 17 | null | null |
rahulmutt/codec-jvm | src/Codec/JVM/Types.hs | apache-2.0 | mkFieldRef :: Text -> Text -> FieldType -> FieldRef
mkFieldRef cn un ft = FieldRef (IClassName cn) (UName un) ft | 112 | mkFieldRef :: Text -> Text -> FieldType -> FieldRef
mkFieldRef cn un ft = FieldRef (IClassName cn) (UName un) ft | 112 | mkFieldRef cn un ft = FieldRef (IClassName cn) (UName un) ft | 60 | false | true | 0 | 9 | 19 | 55 | 25 | 30 | null | null |
abdulrahimnizamani/OccamStar | interpreter.hs | gpl-2.0 | varBindings :: Axiom -> [(HsQName,HsExp)]
varBindings (DArrow _ (HsVar q) exp) = [(q,exp)] | 90 | varBindings :: Axiom -> [(HsQName,HsExp)]
varBindings (DArrow _ (HsVar q) exp) = [(q,exp)] | 90 | varBindings (DArrow _ (HsVar q) exp) = [(q,exp)] | 48 | false | true | 0 | 9 | 12 | 52 | 29 | 23 | null | null |
foreverbell/parakeet | src/Parakeet/Linguistics/RawData.hs | mit | kRaw = [
("ア", "a"), ("イ", "i"), ("ウ", "u"), ("エ", "e"), ("オ", "o"),
("カ", "ka"), ("キ", "ki"), ("ク", "ku"), ("ケ", "ke"), ("コ", "ko"),
("ガ", "ga"), ("ギ", "gi"), ("グ", "gu"), ("ゲ", "ge"), ("ゴ", "go"),
("サ", "sa"), ("シ", "shi"), ("ス", "su"), ("セ", "se"), ("ソ", "so"),
("ザ", "za"), ("ジ", "ji"), ("ズ", "zu"), ("ゼ", "ze"), ("ゾ", "zo"),
("タ", "ta"), ("チ", "chi"), ("ツ", "tsu"), ("テ", "te"), ("ト", "to"),
("ダ", "da"), ("ヂ", "di"), ("ヅ", "du"), ("デ", "de"), ("ド", "do"),
("ナ", "na"), ("ニ", "ni"), ("ヌ", "nu"), ("ネ", "ne"), ("ノ", "no"),
("ハ", "ha"), ("ヒ", "hi"), ("フ", "fu"), ("ヘ", "he"), ("ホ", "ho"),
("バ", "ba"), ("ビ", "bi"), ("ブ", "bu"), ("ベ", "be"), ("ボ", "bo"),
("パ", "pa"), ("ピ", "pi"), ("プ", "pu"), ("ペ", "pe"), ("ポ", "po"),
("マ", "ma"), ("ミ", "mi"), ("ム", "mu"), ("メ", "me"), ("モ", "mo"),
("ヤ", "ya"), ("ユ", "yu"), ("ヨ", "yo"), ("ラ", "ra"), ("リ", "ri"),
("ル", "ru"), ("レ", "re"), ("ロ", "ro"), ("ワ", "wa"), ("ヲ", "wo"),
("ン", "n"),
("キャ", "kya"), ("キュ", "kyu"), ("キョ", "kyo"),
("ギャ", "gya"), ("ギュ", "gyu"), ("ギョ", "gyo"),
("シャ", "sha"), ("シュ", "shu"), ("ショ", "sho"),
("ジャ", "ja"), ("ジュ", "ju"), ("ジョ", "jo"),
("チャ", "cha"), ("チュ", "chu"), ("チョ", "cho"),
("ニャ", "nya"), ("ニュ", "nyu"), ("ニョ", "nyo"),
("ヒャ", "hya"), ("ヒュ", "hyu"), ("ヒョ", "hyo"),
("ビャ", "bya"), ("ビュ", "byu"), ("ビョ", "byo"),
("ピャ", "pya"), ("ピュ", "pyu"), ("ピョ", "pyo"),
("ミャ", "mya"), ("ミュ", "myu"), ("ミョ", "myo"),
("リャ", "rya"), ("リュ", "ryu"), ("リョ", "ryo") ] | 1,482 | kRaw = [
("ア", "a"), ("イ", "i"), ("ウ", "u"), ("エ", "e"), ("オ", "o"),
("カ", "ka"), ("キ", "ki"), ("ク", "ku"), ("ケ", "ke"), ("コ", "ko"),
("ガ", "ga"), ("ギ", "gi"), ("グ", "gu"), ("ゲ", "ge"), ("ゴ", "go"),
("サ", "sa"), ("シ", "shi"), ("ス", "su"), ("セ", "se"), ("ソ", "so"),
("ザ", "za"), ("ジ", "ji"), ("ズ", "zu"), ("ゼ", "ze"), ("ゾ", "zo"),
("タ", "ta"), ("チ", "chi"), ("ツ", "tsu"), ("テ", "te"), ("ト", "to"),
("ダ", "da"), ("ヂ", "di"), ("ヅ", "du"), ("デ", "de"), ("ド", "do"),
("ナ", "na"), ("ニ", "ni"), ("ヌ", "nu"), ("ネ", "ne"), ("ノ", "no"),
("ハ", "ha"), ("ヒ", "hi"), ("フ", "fu"), ("ヘ", "he"), ("ホ", "ho"),
("バ", "ba"), ("ビ", "bi"), ("ブ", "bu"), ("ベ", "be"), ("ボ", "bo"),
("パ", "pa"), ("ピ", "pi"), ("プ", "pu"), ("ペ", "pe"), ("ポ", "po"),
("マ", "ma"), ("ミ", "mi"), ("ム", "mu"), ("メ", "me"), ("モ", "mo"),
("ヤ", "ya"), ("ユ", "yu"), ("ヨ", "yo"), ("ラ", "ra"), ("リ", "ri"),
("ル", "ru"), ("レ", "re"), ("ロ", "ro"), ("ワ", "wa"), ("ヲ", "wo"),
("ン", "n"),
("キャ", "kya"), ("キュ", "kyu"), ("キョ", "kyo"),
("ギャ", "gya"), ("ギュ", "gyu"), ("ギョ", "gyo"),
("シャ", "sha"), ("シュ", "shu"), ("ショ", "sho"),
("ジャ", "ja"), ("ジュ", "ju"), ("ジョ", "jo"),
("チャ", "cha"), ("チュ", "chu"), ("チョ", "cho"),
("ニャ", "nya"), ("ニュ", "nyu"), ("ニョ", "nyo"),
("ヒャ", "hya"), ("ヒュ", "hyu"), ("ヒョ", "hyo"),
("ビャ", "bya"), ("ビュ", "byu"), ("ビョ", "byo"),
("ピャ", "pya"), ("ピュ", "pyu"), ("ピョ", "pyo"),
("ミャ", "mya"), ("ミュ", "myu"), ("ミョ", "myo"),
("リャ", "rya"), ("リュ", "ryu"), ("リョ", "ryo") ] | 1,482 | kRaw = [
("ア", "a"), ("イ", "i"), ("ウ", "u"), ("エ", "e"), ("オ", "o"),
("カ", "ka"), ("キ", "ki"), ("ク", "ku"), ("ケ", "ke"), ("コ", "ko"),
("ガ", "ga"), ("ギ", "gi"), ("グ", "gu"), ("ゲ", "ge"), ("ゴ", "go"),
("サ", "sa"), ("シ", "shi"), ("ス", "su"), ("セ", "se"), ("ソ", "so"),
("ザ", "za"), ("ジ", "ji"), ("ズ", "zu"), ("ゼ", "ze"), ("ゾ", "zo"),
("タ", "ta"), ("チ", "chi"), ("ツ", "tsu"), ("テ", "te"), ("ト", "to"),
("ダ", "da"), ("ヂ", "di"), ("ヅ", "du"), ("デ", "de"), ("ド", "do"),
("ナ", "na"), ("ニ", "ni"), ("ヌ", "nu"), ("ネ", "ne"), ("ノ", "no"),
("ハ", "ha"), ("ヒ", "hi"), ("フ", "fu"), ("ヘ", "he"), ("ホ", "ho"),
("バ", "ba"), ("ビ", "bi"), ("ブ", "bu"), ("ベ", "be"), ("ボ", "bo"),
("パ", "pa"), ("ピ", "pi"), ("プ", "pu"), ("ペ", "pe"), ("ポ", "po"),
("マ", "ma"), ("ミ", "mi"), ("ム", "mu"), ("メ", "me"), ("モ", "mo"),
("ヤ", "ya"), ("ユ", "yu"), ("ヨ", "yo"), ("ラ", "ra"), ("リ", "ri"),
("ル", "ru"), ("レ", "re"), ("ロ", "ro"), ("ワ", "wa"), ("ヲ", "wo"),
("ン", "n"),
("キャ", "kya"), ("キュ", "kyu"), ("キョ", "kyo"),
("ギャ", "gya"), ("ギュ", "gyu"), ("ギョ", "gyo"),
("シャ", "sha"), ("シュ", "shu"), ("ショ", "sho"),
("ジャ", "ja"), ("ジュ", "ju"), ("ジョ", "jo"),
("チャ", "cha"), ("チュ", "chu"), ("チョ", "cho"),
("ニャ", "nya"), ("ニュ", "nyu"), ("ニョ", "nyo"),
("ヒャ", "hya"), ("ヒュ", "hyu"), ("ヒョ", "hyo"),
("ビャ", "bya"), ("ビュ", "byu"), ("ビョ", "byo"),
("ピャ", "pya"), ("ピュ", "pyu"), ("ピョ", "pyo"),
("ミャ", "mya"), ("ミュ", "myu"), ("ミョ", "myo"),
("リャ", "rya"), ("リュ", "ryu"), ("リョ", "ryo") ] | 1,482 | false | false | 1 | 6 | 272 | 945 | 627 | 318 | null | null |
rahulmutt/ghcvm | compiler/Eta/TypeCheck/TcForeign.hs | bsd-3-clause | -- Exports a binding
isForeignExport :: LForeignDecl name -> Bool
isForeignExport (L _ ForeignExport {}) = True | 111 | isForeignExport :: LForeignDecl name -> Bool
isForeignExport (L _ ForeignExport {}) = True | 90 | isForeignExport (L _ ForeignExport {}) = True | 45 | true | true | 0 | 8 | 16 | 34 | 17 | 17 | null | null |
facebookincubator/duckling | Duckling/Time/EN/Rules.hs | bsd-3-clause | ruleHHMMLatent :: Rule
ruleHHMMLatent = Rule
{ name = "hhmm (latent)"
, pattern =
[ regex "((?:[01]?\\d)|(?:2[0-3]))([0-5]\\d)(?!.\\d)"
]
, prod = \tokens -> case tokens of
(Token RegexMatch (GroupMatch (hh:mm:_)):_) -> do
h <- parseInt hh
m <- parseInt mm
tt $ mkLatent $ hourMinute (h < 12) h m
_ -> Nothing
} | 363 | ruleHHMMLatent :: Rule
ruleHHMMLatent = Rule
{ name = "hhmm (latent)"
, pattern =
[ regex "((?:[01]?\\d)|(?:2[0-3]))([0-5]\\d)(?!.\\d)"
]
, prod = \tokens -> case tokens of
(Token RegexMatch (GroupMatch (hh:mm:_)):_) -> do
h <- parseInt hh
m <- parseInt mm
tt $ mkLatent $ hourMinute (h < 12) h m
_ -> Nothing
} | 363 | ruleHHMMLatent = Rule
{ name = "hhmm (latent)"
, pattern =
[ regex "((?:[01]?\\d)|(?:2[0-3]))([0-5]\\d)(?!.\\d)"
]
, prod = \tokens -> case tokens of
(Token RegexMatch (GroupMatch (hh:mm:_)):_) -> do
h <- parseInt hh
m <- parseInt mm
tt $ mkLatent $ hourMinute (h < 12) h m
_ -> Nothing
} | 340 | false | true | 0 | 19 | 105 | 142 | 70 | 72 | null | null |
momomimachli/Hedsql | tests/Database/Hedsql/CodeGenerator/Quoter/Tests.hs | gpl-3.0 | -- | Gather all tests.
tests :: Test
tests = testGroup "Hedsql.Common.CodeGenerator.Quoter"
[ testBasicQuoteElem
, testBasicQuoteVal
, testQuotedQuoteElem
, testQuotedQuoteVal
] | 197 | tests :: Test
tests = testGroup "Hedsql.Common.CodeGenerator.Quoter"
[ testBasicQuoteElem
, testBasicQuoteVal
, testQuotedQuoteElem
, testQuotedQuoteVal
] | 174 | tests = testGroup "Hedsql.Common.CodeGenerator.Quoter"
[ testBasicQuoteElem
, testBasicQuoteVal
, testQuotedQuoteElem
, testQuotedQuoteVal
] | 160 | true | true | 0 | 6 | 40 | 29 | 17 | 12 | null | null |
romanb/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/CreateApp.hs | mpl-2.0 | -- | The app type. Each supported type is associated with a particular layer. For
-- example, PHP applications are associated with a PHP layer. AWS OpsWorks
-- deploys an application to those instances that are members of the
-- corresponding layer. If your app isn't one of the standard types, or you
-- prefer to implement your own Deploy recipes, specify 'other'.
caType :: Lens' CreateApp AppType
caType = lens _caType (\s a -> s { _caType = a }) | 450 | caType :: Lens' CreateApp AppType
caType = lens _caType (\s a -> s { _caType = a }) | 83 | caType = lens _caType (\s a -> s { _caType = a }) | 49 | true | true | 0 | 9 | 80 | 44 | 26 | 18 | null | null |
shlevy/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | maybeTyConKey = mkPreludeTyConUnique 26 | 65 | maybeTyConKey = mkPreludeTyConUnique 26 | 65 | maybeTyConKey = mkPreludeTyConUnique 26 | 65 | false | false | 0 | 5 | 29 | 9 | 4 | 5 | null | null |
adamschoenemann/wysas | src/Eval.hs | gpl-3.0 | eqv [(String arg1), (String arg2)] = return $ Bool $ arg1 == arg2 | 73 | eqv [(String arg1), (String arg2)] = return $ Bool $ arg1 == arg2 | 73 | eqv [(String arg1), (String arg2)] = return $ Bool $ arg1 == arg2 | 73 | false | false | 0 | 7 | 20 | 40 | 20 | 20 | null | null |
lpeterse/koka | src/Type/InferMonad.hs | apache-2.0 | findDataInfo :: Name -> Inf DataInfo
findDataInfo typeName
= do env <- getEnv
case newtypesLookup typeName (types env) of
Just info -> return info
Nothing -> failure ("Type.InferMonad.findDataInfo: unknown type: " ++ show typeName ++ "\n in: " ++ show (types env))
-- | Lookup a name with a certain type and return the fully qualified name and its type | 382 | findDataInfo :: Name -> Inf DataInfo
findDataInfo typeName
= do env <- getEnv
case newtypesLookup typeName (types env) of
Just info -> return info
Nothing -> failure ("Type.InferMonad.findDataInfo: unknown type: " ++ show typeName ++ "\n in: " ++ show (types env))
-- | Lookup a name with a certain type and return the fully qualified name and its type | 382 | findDataInfo typeName
= do env <- getEnv
case newtypesLookup typeName (types env) of
Just info -> return info
Nothing -> failure ("Type.InferMonad.findDataInfo: unknown type: " ++ show typeName ++ "\n in: " ++ show (types env))
-- | Lookup a name with a certain type and return the fully qualified name and its type | 345 | false | true | 0 | 15 | 89 | 95 | 44 | 51 | null | null |
benjaminselfridge/logix | src/Main.hs | bsd-3-clause | quit :: Env -> String -> IO Env
quit env _ = do { putStrLn "Bye."; return env {quitFlag = True} } | 97 | quit :: Env -> String -> IO Env
quit env _ = do { putStrLn "Bye."; return env {quitFlag = True} } | 97 | quit env _ = do { putStrLn "Bye."; return env {quitFlag = True} } | 65 | false | true | 0 | 10 | 21 | 55 | 26 | 29 | null | null |
tsahyt/lmrbot | src/Commands/Quote.hs | agpl-3.0 | fromEmbed :: ByteString -> Vector ByteString
fromEmbed = V.fromList . B.lines | 77 | fromEmbed :: ByteString -> Vector ByteString
fromEmbed = V.fromList . B.lines | 77 | fromEmbed = V.fromList . B.lines | 32 | false | true | 0 | 6 | 10 | 26 | 13 | 13 | null | null |
khajavi/pandoc | src/Text/Pandoc/Writers/LaTeX.hs | gpl-2.0 | inlineToLaTeX (Superscript lst) =
inlineListToLaTeX (deVerb lst) >>= return . inCmd "textsuperscript" | 103 | inlineToLaTeX (Superscript lst) =
inlineListToLaTeX (deVerb lst) >>= return . inCmd "textsuperscript" | 103 | inlineToLaTeX (Superscript lst) =
inlineListToLaTeX (deVerb lst) >>= return . inCmd "textsuperscript" | 103 | false | false | 0 | 8 | 13 | 36 | 16 | 20 | null | null |
bergmark/purescript | src/Language/PureScript/Parser/Common.hs | mit | -- |
-- Parse a token
--
lexeme :: P.Parsec String u a -> P.Parsec String u a
lexeme = PT.lexeme tokenParser | 108 | lexeme :: P.Parsec String u a -> P.Parsec String u a
lexeme = PT.lexeme tokenParser | 83 | lexeme = PT.lexeme tokenParser | 30 | true | true | 0 | 8 | 21 | 47 | 22 | 25 | null | null |
Athas/afterburner-pascal | src/Afterburner/CodeGen.hs | mit | liftError :: Monad m =>
ExceptT e m (Either e a)
-> ExceptT e m a
liftError m = do v <- lift $ runExceptT m
case v of Left e -> throwError e
Right (Left e) -> throwError e
Right (Right v') -> return v' | 307 | liftError :: Monad m =>
ExceptT e m (Either e a)
-> ExceptT e m a
liftError m = do v <- lift $ runExceptT m
case v of Left e -> throwError e
Right (Left e) -> throwError e
Right (Right v') -> return v' | 307 | liftError m = do v <- lift $ runExceptT m
case v of Left e -> throwError e
Right (Left e) -> throwError e
Right (Right v') -> return v' | 218 | false | true | 0 | 13 | 151 | 121 | 53 | 68 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 3285 = 3284 | 11 | 3285 = 3284 | 11 | 3285 = 3284 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Seq/SimpleQueue.hs | mit | rcons y (Q xs ys) = Q xs (y:ys) | 31 | rcons y (Q xs ys) = Q xs (y:ys) | 31 | rcons y (Q xs ys) = Q xs (y:ys) | 31 | false | false | 0 | 7 | 8 | 31 | 15 | 16 | null | null |
kmate/HaRe | old/testing/introNewDef/FunIn3.hs | bsd-3-clause | --A new definition can be introduced to denote an identified sub-expression.
--The newly introduced definition may be a function binding
--or a simple constant binding. The new binding will be put at the end of the
--local 'where' or 'let' clause depending on the scope of high lighted source.
--In this example: Introduce a new definition to denote 'x*5*z'
foo x=x*5*z*w where z=3
w=5 {-there is a comment-} | 434 | foo x=x*5*z*w where z=3
w=5 {-there is a comment-} | 73 | foo x=x*5*z*w where z=3
w=5 {-there is a comment-} | 73 | true | false | 0 | 7 | 93 | 39 | 23 | 16 | null | null |
mlitchard/IX | src/IX/Universe/Input.hs | mit | findPlanetBound _ _ = Nothing | 57 | findPlanetBound _ _ = Nothing | 57 | findPlanetBound _ _ = Nothing | 57 | false | false | 0 | 5 | 32 | 11 | 5 | 6 | null | null |
zerobuzz/tables | src/Data/Table.hs | bsd-3-clause | fromList :: Tabular t => [t] -> Table t
fromList = foldl' (flip insert) empty | 77 | fromList :: Tabular t => [t] -> Table t
fromList = foldl' (flip insert) empty | 77 | fromList = foldl' (flip insert) empty | 37 | false | true | 0 | 7 | 14 | 39 | 19 | 20 | null | null |
flipstone/orville | orville-postgresql-libpq/src/Orville/PostgreSQL/PgCatalog/DatabaseDescription.hs | mit | describeConstraint :: Plan.Plan scope (PgClassAndAttributes, PgConstraint) ConstraintDescription
describeConstraint =
let prepareAttributeLookups :: (PgClassAndAttributes, PgConstraint) -> Maybe [(PgClassAndAttributes, AttributeNumber)]
prepareAttributeLookups (pgClassAndAttrs, pgConstraint) =
case pgConstraintKey pgConstraint of
Nothing -> Nothing
Just key -> Just (fmap (\attNum -> (pgClassAndAttrs, attNum)) key)
in Plan.bind (snd <$> Plan.askParam) $ \constraint ->
Plan.bind (Plan.using constraint findConstraintForeignRelationClass) $ \maybeForeignPgClass ->
let maybeForeignClassAndAttrNums =
liftA2
(liftA2 (,))
(Plan.use maybeForeignPgClass)
(fmap (pgConstraintForeignKey . snd) Plan.askParam)
in ConstraintDescription
<$> Plan.use constraint
<*> Plan.focusParam prepareAttributeLookups (Plan.planMaybe $ Plan.planList findAttributeByNumber)
<*> Plan.using maybeForeignPgClass (Plan.planMaybe describeForeignRelation)
<*> Plan.chain maybeForeignClassAndAttrNums (Plan.planMaybe findForeignKeyAttributes) | 1,216 | describeConstraint :: Plan.Plan scope (PgClassAndAttributes, PgConstraint) ConstraintDescription
describeConstraint =
let prepareAttributeLookups :: (PgClassAndAttributes, PgConstraint) -> Maybe [(PgClassAndAttributes, AttributeNumber)]
prepareAttributeLookups (pgClassAndAttrs, pgConstraint) =
case pgConstraintKey pgConstraint of
Nothing -> Nothing
Just key -> Just (fmap (\attNum -> (pgClassAndAttrs, attNum)) key)
in Plan.bind (snd <$> Plan.askParam) $ \constraint ->
Plan.bind (Plan.using constraint findConstraintForeignRelationClass) $ \maybeForeignPgClass ->
let maybeForeignClassAndAttrNums =
liftA2
(liftA2 (,))
(Plan.use maybeForeignPgClass)
(fmap (pgConstraintForeignKey . snd) Plan.askParam)
in ConstraintDescription
<$> Plan.use constraint
<*> Plan.focusParam prepareAttributeLookups (Plan.planMaybe $ Plan.planList findAttributeByNumber)
<*> Plan.using maybeForeignPgClass (Plan.planMaybe describeForeignRelation)
<*> Plan.chain maybeForeignClassAndAttrNums (Plan.planMaybe findForeignKeyAttributes) | 1,216 | describeConstraint =
let prepareAttributeLookups :: (PgClassAndAttributes, PgConstraint) -> Maybe [(PgClassAndAttributes, AttributeNumber)]
prepareAttributeLookups (pgClassAndAttrs, pgConstraint) =
case pgConstraintKey pgConstraint of
Nothing -> Nothing
Just key -> Just (fmap (\attNum -> (pgClassAndAttrs, attNum)) key)
in Plan.bind (snd <$> Plan.askParam) $ \constraint ->
Plan.bind (Plan.using constraint findConstraintForeignRelationClass) $ \maybeForeignPgClass ->
let maybeForeignClassAndAttrNums =
liftA2
(liftA2 (,))
(Plan.use maybeForeignPgClass)
(fmap (pgConstraintForeignKey . snd) Plan.askParam)
in ConstraintDescription
<$> Plan.use constraint
<*> Plan.focusParam prepareAttributeLookups (Plan.planMaybe $ Plan.planList findAttributeByNumber)
<*> Plan.using maybeForeignPgClass (Plan.planMaybe describeForeignRelation)
<*> Plan.chain maybeForeignClassAndAttrNums (Plan.planMaybe findForeignKeyAttributes) | 1,119 | false | true | 0 | 20 | 290 | 291 | 148 | 143 | null | null |
erantapaa/simple-hunt | src/Hayoo/ParseSignature.hs | bsd-3-clause | complexSignatures :: Int -> [Signature] -> [Signature]
complexSignatures c = filter (isComplex c) | 97 | complexSignatures :: Int -> [Signature] -> [Signature]
complexSignatures c = filter (isComplex c) | 97 | complexSignatures c = filter (isComplex c) | 42 | false | true | 0 | 7 | 12 | 37 | 19 | 18 | null | null |
spechub/Hets | QBF/Parse_AS_Basic.hs | gpl-2.0 | -- | parser for AxiomItems
parseAxItems :: AnnoState.AParser st AS_BASIC.BASICITEMS
parseAxItems = do
d <- AnnoState.dotT
(fs, ds) <- aFormula `Lexer.separatedBy` AnnoState.dotT
(_, an) <- AnnoState.optSemi
let _ = Id.catRange (d : ds)
ns = init fs ++ [Annotation.appendAnno (last fs) an]
return $ AS_BASIC.AxiomItems ns
-- | Any word to token | 390 | parseAxItems :: AnnoState.AParser st AS_BASIC.BASICITEMS
parseAxItems = do
d <- AnnoState.dotT
(fs, ds) <- aFormula `Lexer.separatedBy` AnnoState.dotT
(_, an) <- AnnoState.optSemi
let _ = Id.catRange (d : ds)
ns = init fs ++ [Annotation.appendAnno (last fs) an]
return $ AS_BASIC.AxiomItems ns
-- | Any word to token | 363 | parseAxItems = do
d <- AnnoState.dotT
(fs, ds) <- aFormula `Lexer.separatedBy` AnnoState.dotT
(_, an) <- AnnoState.optSemi
let _ = Id.catRange (d : ds)
ns = init fs ++ [Annotation.appendAnno (last fs) an]
return $ AS_BASIC.AxiomItems ns
-- | Any word to token | 306 | true | true | 0 | 14 | 98 | 131 | 66 | 65 | null | null |
mdsteele/fallback | src/Fallback/State/Tileset.hs | gpl-3.0 | tileTagId WoodDoorClosedTile = 6162 | 35 | tileTagId WoodDoorClosedTile = 6162 | 35 | tileTagId WoodDoorClosedTile = 6162 | 35 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
Hamcha/dvx | Dvx/Parser.hs | mit | discover (TBool b) = DvxConst $ TypeBool b | 44 | discover (TBool b) = DvxConst $ TypeBool b | 44 | discover (TBool b) = DvxConst $ TypeBool b | 44 | false | false | 0 | 7 | 9 | 22 | 10 | 12 | null | null |
rueshyna/gogol | gogol-freebasesearch/gen/Network/Google/Method/Freebase/Reconcile.hs | mpl-2.0 | -- | Classifications of entity e.g. type, category, title.
rKind :: Lens' Reconcile [Text]
rKind
= lens _rKind (\ s a -> s{_rKind = a}) . _Default .
_Coerce | 164 | rKind :: Lens' Reconcile [Text]
rKind
= lens _rKind (\ s a -> s{_rKind = a}) . _Default .
_Coerce | 105 | rKind
= lens _rKind (\ s a -> s{_rKind = a}) . _Default .
_Coerce | 73 | true | true | 0 | 11 | 36 | 53 | 28 | 25 | null | null |
kishoredbn/barrelfish | tools/flounder/BackendCommon.hs | mit | call_rpc_handler :: String -> String -> [TypeDef] -> [RPCArgument] -> [C.Stmt]
call_rpc_handler ifn mn typedefs msgargs
= [C.Ex $ C.CallInd handler (bindvar:args)]
where
handler = C.DerefField bindvar "rpc_rx_vtbl" `C.FieldOf` (rpc_call_name mn)
args = concat [mkargs a | a <- msgargs]
mkargs (RPCArgIn _ (Name n)) = [local_rx_union_elem mn n]
mkargs (RPCArgIn _ (StringArray n l)) = [local_rx_union_elem mn n]
mkargs (RPCArgIn _ (DynamicArray n l _)) = [local_rx_union_elem mn n, local_rx_union_elem mn l]
mkargs (RPCArgOut tr (Name n)) = case lookup_typeref typedefs tr of
TArray _ _ _ -> [C.DerefPtr $ local_tx_union_elem mn n]
_ -> [C.AddressOf $ local_tx_union_elem mn n]
mkargs (RPCArgOut _ (StringArray n l)) = [local_tx_union_elem mn n]
mkargs (RPCArgOut _ (DynamicArray n l _)) = [local_tx_union_elem mn n, C.AddressOf $ local_tx_union_elem mn l]
-- send response | 969 | call_rpc_handler :: String -> String -> [TypeDef] -> [RPCArgument] -> [C.Stmt]
call_rpc_handler ifn mn typedefs msgargs
= [C.Ex $ C.CallInd handler (bindvar:args)]
where
handler = C.DerefField bindvar "rpc_rx_vtbl" `C.FieldOf` (rpc_call_name mn)
args = concat [mkargs a | a <- msgargs]
mkargs (RPCArgIn _ (Name n)) = [local_rx_union_elem mn n]
mkargs (RPCArgIn _ (StringArray n l)) = [local_rx_union_elem mn n]
mkargs (RPCArgIn _ (DynamicArray n l _)) = [local_rx_union_elem mn n, local_rx_union_elem mn l]
mkargs (RPCArgOut tr (Name n)) = case lookup_typeref typedefs tr of
TArray _ _ _ -> [C.DerefPtr $ local_tx_union_elem mn n]
_ -> [C.AddressOf $ local_tx_union_elem mn n]
mkargs (RPCArgOut _ (StringArray n l)) = [local_tx_union_elem mn n]
mkargs (RPCArgOut _ (DynamicArray n l _)) = [local_tx_union_elem mn n, C.AddressOf $ local_tx_union_elem mn l]
-- send response | 969 | call_rpc_handler ifn mn typedefs msgargs
= [C.Ex $ C.CallInd handler (bindvar:args)]
where
handler = C.DerefField bindvar "rpc_rx_vtbl" `C.FieldOf` (rpc_call_name mn)
args = concat [mkargs a | a <- msgargs]
mkargs (RPCArgIn _ (Name n)) = [local_rx_union_elem mn n]
mkargs (RPCArgIn _ (StringArray n l)) = [local_rx_union_elem mn n]
mkargs (RPCArgIn _ (DynamicArray n l _)) = [local_rx_union_elem mn n, local_rx_union_elem mn l]
mkargs (RPCArgOut tr (Name n)) = case lookup_typeref typedefs tr of
TArray _ _ _ -> [C.DerefPtr $ local_tx_union_elem mn n]
_ -> [C.AddressOf $ local_tx_union_elem mn n]
mkargs (RPCArgOut _ (StringArray n l)) = [local_tx_union_elem mn n]
mkargs (RPCArgOut _ (DynamicArray n l _)) = [local_tx_union_elem mn n, C.AddressOf $ local_tx_union_elem mn l]
-- send response | 890 | false | true | 2 | 12 | 226 | 402 | 195 | 207 | null | null |
nandotorterolo/Tactics | src/Main.hs | bsd-3-clause | fichaStr (Caballo,Blanca) = 'C' | 31 | fichaStr (Caballo,Blanca) = 'C' | 31 | fichaStr (Caballo,Blanca) = 'C' | 31 | false | false | 0 | 6 | 3 | 15 | 8 | 7 | null | null |
mrshannon/trees | src/Graphics/Rendering/OpenGL/Help.hs | gpl-2.0 | red :: Color3f
red = Color3 1.0 0.0 0.0 :: Color3f | 58 | red :: Color3f
red = Color3 1.0 0.0 0.0 :: Color3f | 58 | red = Color3 1.0 0.0 0.0 :: Color3f | 39 | false | true | 0 | 5 | 18 | 21 | 11 | 10 | null | null |
NICTA/aremi-tmy | src/Tmy/OneMinSolar/Main.hs | apache-2.0 | mkAwStats :: Text -> LocalTime -> AwStats
mkAwStats stNum lt = AwStats stNum (LTime lt)
Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing | 199 | mkAwStats :: Text -> LocalTime -> AwStats
mkAwStats stNum lt = AwStats stNum (LTime lt)
Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing | 199 | mkAwStats stNum lt = AwStats stNum (LTime lt)
Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing | 157 | false | true | 0 | 7 | 49 | 57 | 28 | 29 | null | null |
alexander-at-github/eta | compiler/ETA/Interactive/ByteCodeAsm.hs | bsd-3-clause | addToSS :: SizedSeq a -> a -> SizedSeq a
addToSS (SizedSeq n r_xs) x = SizedSeq (n+1) (x:r_xs) | 94 | addToSS :: SizedSeq a -> a -> SizedSeq a
addToSS (SizedSeq n r_xs) x = SizedSeq (n+1) (x:r_xs) | 94 | addToSS (SizedSeq n r_xs) x = SizedSeq (n+1) (x:r_xs) | 53 | false | true | 0 | 10 | 17 | 61 | 29 | 32 | null | null |
balez/ag-a-la-carte | Language/Grammars/AGalacarte/Attribute.hs | gpl-3.0 | bimap_attr :: (Bifunctor l, Container c) =>
Rec r' :~~~> Rec r -> Rec r :~~~> Rec r' ->
Attr l r c x n -> Attr l r' c x n
bimap_attr f t = \case
Attr x -> Attr $ bimap_famNCase f t x
AttrDual -> AttrDual
-- ** Coercion | 227 | bimap_attr :: (Bifunctor l, Container c) =>
Rec r' :~~~> Rec r -> Rec r :~~~> Rec r' ->
Attr l r c x n -> Attr l r' c x n
bimap_attr f t = \case
Attr x -> Attr $ bimap_famNCase f t x
AttrDual -> AttrDual
-- ** Coercion | 227 | bimap_attr f t = \case
Attr x -> Attr $ bimap_famNCase f t x
AttrDual -> AttrDual
-- ** Coercion | 101 | false | true | 4 | 9 | 60 | 106 | 52 | 54 | null | null |
themoritz/cabal | Cabal/Distribution/Simple/Program/Run.hs | bsd-3-clause | runProgramInvocation :: Verbosity -> ProgramInvocation -> IO ()
runProgramInvocation verbosity
ProgramInvocation {
progInvokePath = path,
progInvokeArgs = args,
progInvokeEnv = [],
progInvokePathEnv = [],
progInvokeCwd = Nothing,
progInvokeInput = Nothing
} =
rawSystemExit verbosity path args | 329 | runProgramInvocation :: Verbosity -> ProgramInvocation -> IO ()
runProgramInvocation verbosity
ProgramInvocation {
progInvokePath = path,
progInvokeArgs = args,
progInvokeEnv = [],
progInvokePathEnv = [],
progInvokeCwd = Nothing,
progInvokeInput = Nothing
} =
rawSystemExit verbosity path args | 329 | runProgramInvocation verbosity
ProgramInvocation {
progInvokePath = path,
progInvokeArgs = args,
progInvokeEnv = [],
progInvokePathEnv = [],
progInvokeCwd = Nothing,
progInvokeInput = Nothing
} =
rawSystemExit verbosity path args | 265 | false | true | 0 | 9 | 71 | 79 | 44 | 35 | null | null |
UCSD-PL/nano-smt | Language/Nano/SMT/Misc.hs | bsd-3-clause | safeFromList msg = L.foldl' safeAdd M.empty
where safeAdd m (k, v)
| k `M.member` m = errorstar $ msg ++ "Duplicate key " ++ show k ++ "maps to: \n" ++ (show v) ++ "\n and \n" ++ show (m M.! k)
| otherwise = M.insert k v m | 251 | safeFromList msg = L.foldl' safeAdd M.empty
where safeAdd m (k, v)
| k `M.member` m = errorstar $ msg ++ "Duplicate key " ++ show k ++ "maps to: \n" ++ (show v) ++ "\n and \n" ++ show (m M.! k)
| otherwise = M.insert k v m | 251 | safeFromList msg = L.foldl' safeAdd M.empty
where safeAdd m (k, v)
| k `M.member` m = errorstar $ msg ++ "Duplicate key " ++ show k ++ "maps to: \n" ++ (show v) ++ "\n and \n" ++ show (m M.! k)
| otherwise = M.insert k v m | 251 | false | false | 0 | 12 | 77 | 117 | 57 | 60 | null | null |
netrium/Netrium | src/Contract.hs | mit | -- | Once you acquire @anytime obs c@, you /may/ acquire @c@ at any time the
-- observable @obs@ is true.
anytime :: ChoiceId -> Obs Bool -> Contract -> Contract
anytime = Anytime | 179 | anytime :: ChoiceId -> Obs Bool -> Contract -> Contract
anytime = Anytime | 73 | anytime = Anytime | 17 | true | true | 0 | 7 | 33 | 28 | 15 | 13 | null | null |
kosmoskatten/nats-client | src/Network/Nats/Writer.hs | mit | -- Pong message.
writeMessage' Pong = byteString "PONG" <> byteString "\r\n" | 76 | writeMessage' Pong = byteString "PONG" <> byteString "\r\n" | 59 | writeMessage' Pong = byteString "PONG" <> byteString "\r\n" | 59 | true | false | 0 | 6 | 10 | 20 | 9 | 11 | null | null |
DougBurke/swish | src/Swish/RDF/Vocabulary/DublinCore.hs | lgpl-2.1 | -- | @dcterms:SizeOrDuration@ from <http://dublincore.org/documents/dcmi-terms/#classes-SizeOrDuration>.
dctSizeOrDuration :: ScopedName
dctSizeOrDuration = toDCT "SizeOrDuration" | 179 | dctSizeOrDuration :: ScopedName
dctSizeOrDuration = toDCT "SizeOrDuration" | 74 | dctSizeOrDuration = toDCT "SizeOrDuration" | 42 | true | true | 0 | 6 | 11 | 21 | 9 | 12 | null | null |
diku-dk/futhark | src/Futhark/Error.hs | isc | -- | Throw an t'InternalError' that is a 'CompilerLimitation'.
compilerLimitation :: T.Text -> a
compilerLimitation = throw . Error CompilerLimitation | 150 | compilerLimitation :: T.Text -> a
compilerLimitation = throw . Error CompilerLimitation | 87 | compilerLimitation = throw . Error CompilerLimitation | 53 | true | true | 1 | 7 | 19 | 32 | 14 | 18 | null | null |
mtolly/rail | src/Language/Rail/Parse.hs | gpl-3.0 | trySecondary :: Direction -> Char -> Maybe Direction
trySecondary d c = lookup d $ case c of
'-' -> zip [NE, SE, NW, SW] [E, E, W, W]
'|' -> zip [NE, NW, SE, SW] [N, N, S, S]
'/' -> zip [N, E, S, W] [NE, NE, SW, SW]
'\\' -> zip [N, W, S, E] [NW, NW, SE, SE]
_ -> [] -- can't be a secondary connection
-- | Reads a single function from a grid. The function beginning (@$@) must be
-- at @(0, 0)@, going 'SE'. | 435 | trySecondary :: Direction -> Char -> Maybe Direction
trySecondary d c = lookup d $ case c of
'-' -> zip [NE, SE, NW, SW] [E, E, W, W]
'|' -> zip [NE, NW, SE, SW] [N, N, S, S]
'/' -> zip [N, E, S, W] [NE, NE, SW, SW]
'\\' -> zip [N, W, S, E] [NW, NW, SE, SE]
_ -> [] -- can't be a secondary connection
-- | Reads a single function from a grid. The function beginning (@$@) must be
-- at @(0, 0)@, going 'SE'. | 435 | trySecondary d c = lookup d $ case c of
'-' -> zip [NE, SE, NW, SW] [E, E, W, W]
'|' -> zip [NE, NW, SE, SW] [N, N, S, S]
'/' -> zip [N, E, S, W] [NE, NE, SW, SW]
'\\' -> zip [N, W, S, E] [NW, NW, SE, SE]
_ -> [] -- can't be a secondary connection
-- | Reads a single function from a grid. The function beginning (@$@) must be
-- at @(0, 0)@, going 'SE'. | 382 | false | true | 5 | 7 | 119 | 194 | 109 | 85 | null | null |
lambda-11235/pure-hlisp | src/Eval.hs | gpl-2.0 | lambda :: [AST] -> LispState LDatum
lambda [(SSymbol args), body] =
do env <- get
return (Function env Nothing (Left args) body) | 135 | lambda :: [AST] -> LispState LDatum
lambda [(SSymbol args), body] =
do env <- get
return (Function env Nothing (Left args) body) | 135 | lambda [(SSymbol args), body] =
do env <- get
return (Function env Nothing (Left args) body) | 99 | false | true | 0 | 11 | 28 | 71 | 34 | 37 | null | null |
justinethier/husk-scheme | hs-src/Language/Scheme/Numerical.hs | mit | numDiv [Float n] = return $ Float $ 1.0 / n | 43 | numDiv [Float n] = return $ Float $ 1.0 / n | 43 | numDiv [Float n] = return $ Float $ 1.0 / n | 43 | false | false | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
nikita-volkov/hasql-transaction | library/Hasql/Transaction/Private/Statements.hs | mit | commitTransaction :: Bool -> A.Statement () ()
commitTransaction preparable =
A.Statement "COMMIT" B.noParams C.noResult preparable | 133 | commitTransaction :: Bool -> A.Statement () ()
commitTransaction preparable =
A.Statement "COMMIT" B.noParams C.noResult preparable | 133 | commitTransaction preparable =
A.Statement "COMMIT" B.noParams C.noResult preparable | 86 | false | true | 0 | 7 | 16 | 44 | 21 | 23 | null | null |
spoqa/nirum | src/Nirum/Targets.hs | gpl-3.0 | targetNames :: Set TargetName
targetNames = M.keysSet packageBuilders | 69 | targetNames :: Set TargetName
targetNames = M.keysSet packageBuilders | 69 | targetNames = M.keysSet packageBuilders | 39 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
charleso/haskell-in-haste | src/Chat/Web.hs | bsd-3-clause | currentUser :: ActionM User
currentUser = unpack . fromMaybe "unknown" <$> getCookie "SESSION" | 94 | currentUser :: ActionM User
currentUser = unpack . fromMaybe "unknown" <$> getCookie "SESSION" | 94 | currentUser = unpack . fromMaybe "unknown" <$> getCookie "SESSION" | 66 | false | true | 0 | 7 | 12 | 28 | 13 | 15 | null | null |
snoyberg/ghc | compiler/types/Type.hs | bsd-3-clause | tyConAppTyCon_maybe (FunTy {}) = Just funTyCon | 51 | tyConAppTyCon_maybe (FunTy {}) = Just funTyCon | 51 | tyConAppTyCon_maybe (FunTy {}) = Just funTyCon | 51 | false | false | 0 | 6 | 10 | 20 | 9 | 11 | null | null |
phischu/hackage-analysis | src/Fragmentation.hs | bsd-3-clause | declGenre (GDataDecl _ _ _ _ _ _ _) = Type | 42 | declGenre (GDataDecl _ _ _ _ _ _ _) = Type | 42 | declGenre (GDataDecl _ _ _ _ _ _ _) = Type | 42 | false | false | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
steve-chavez/postgrest | test/SpecHelper.hs | mit | testCfgNoJWT :: Text -> AppConfig
testCfgNoJWT testDbConn = (testCfg testDbConn) { configJwtSecret = Nothing, configJWKS = Nothing } | 132 | testCfgNoJWT :: Text -> AppConfig
testCfgNoJWT testDbConn = (testCfg testDbConn) { configJwtSecret = Nothing, configJWKS = Nothing } | 132 | testCfgNoJWT testDbConn = (testCfg testDbConn) { configJwtSecret = Nothing, configJWKS = Nothing } | 98 | false | true | 0 | 7 | 17 | 38 | 21 | 17 | null | null |
vTurbine/ghc | compiler/basicTypes/Avail.hs | bsd-3-clause | availFlds _ = [] | 31 | availFlds _ = [] | 31 | availFlds _ = [] | 31 | false | false | 0 | 5 | 18 | 11 | 5 | 6 | null | null |
meiersi/bytestring-builder | bench/BenchFloatDec.hs | bsd-3-clause | digit :: Int -> Builder
digit = char7 . chr . (ord '0' +) | 57 | digit :: Int -> Builder
digit = char7 . chr . (ord '0' +) | 57 | digit = char7 . chr . (ord '0' +) | 33 | false | true | 2 | 7 | 13 | 39 | 17 | 22 | null | null |
xunilrj/sandbox | sources/haskell/parsercombinators/parsers.hs | apache-2.0 | upper :: Parser Char
upper = sat (\x -> 'A' <= x && x <= 'Z') | 61 | upper :: Parser Char
upper = sat (\x -> 'A' <= x && x <= 'Z') | 61 | upper = sat (\x -> 'A' <= x && x <= 'Z') | 40 | false | true | 1 | 10 | 15 | 40 | 19 | 21 | null | null |
neothemachine/monadiccp | src/Control/CP/FD/Expr.hs | bsd-3-clause | simplify (Minus (Mult a b) (Mult c d)) | a==c = (b-d) * a | 57 | simplify (Minus (Mult a b) (Mult c d)) | a==c = (b-d) * a | 57 | simplify (Minus (Mult a b) (Mult c d)) | a==c = (b-d) * a | 57 | false | false | 0 | 8 | 13 | 55 | 26 | 29 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.