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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Cahu/krpc-hs | src/KRPCHS/SpaceCenter.hs | gpl-3.0 | {-
- Returns the position vector of the center of mass of the vessel in the given reference frame.<param name="referenceFrame">
-}
vesselPosition :: KRPCHS.SpaceCenter.Vessel -> KRPCHS.SpaceCenter.ReferenceFrame -> RPCContext ((Double, Double, Double))
vesselPosition thisArg referenceFrameArg = do
let r = makeRequest "SpaceCenter" "Vessel_Position" [makeArgument 0 thisArg, makeArgument 1 referenceFrameArg]
res <- sendRequest r
processResponse res | 464 | vesselPosition :: KRPCHS.SpaceCenter.Vessel -> KRPCHS.SpaceCenter.ReferenceFrame -> RPCContext ((Double, Double, Double))
vesselPosition thisArg referenceFrameArg = do
let r = makeRequest "SpaceCenter" "Vessel_Position" [makeArgument 0 thisArg, makeArgument 1 referenceFrameArg]
res <- sendRequest r
processResponse res | 331 | vesselPosition thisArg referenceFrameArg = do
let r = makeRequest "SpaceCenter" "Vessel_Position" [makeArgument 0 thisArg, makeArgument 1 referenceFrameArg]
res <- sendRequest r
processResponse res | 209 | true | true | 0 | 13 | 67 | 99 | 48 | 51 | null | null |
langthom/stats | Parsing.hs | bsd-3-clause | removeSpaces = filter (\x -> (not (" " == x)) && (not ("" == x))) | 65 | removeSpaces = filter (\x -> (not (" " == x)) && (not ("" == x))) | 65 | removeSpaces = filter (\x -> (not (" " == x)) && (not ("" == x))) | 65 | false | false | 0 | 12 | 14 | 47 | 25 | 22 | null | null |
kajigor/uKanren_transformations | test/resources/Program/Prop.hs | bsd-3-clause | -- ando/oro first
-- uses elemo
evalo'''Def :: Def
evalo'''Def =
( Def "evalo" ["st", "fm", "u"]
(
fresh ["x", "y", "v", "w"]
(
(
fm === C "conj" [x, y] &&&
call "ando" [v, w, u] &&&
call "evalo" [st, x, v] &&&
call "evalo" [st, y, w]
) |||
(
fm === C "disj" [x, y] &&&
call "oro" [v, w, u] &&&
call "evalo" [st, x, v] &&&
call "evalo" [st, y, w]
) |||
(
fm === C "neg" [x] &&&
call "evalo" [st, x, v] &&&
call "noto" [v, u]
) |||
(
fm === C "var" [x] &&&
call "elemo" [x, st, u]
)
)
)
)
where
[st, fm, u, x, y, v, w] = map V ["st", "fm", "u", "x", "y", "v", "w"]
-- table implementation of ando/oro | 891 | evalo'''Def :: Def
evalo'''Def =
( Def "evalo" ["st", "fm", "u"]
(
fresh ["x", "y", "v", "w"]
(
(
fm === C "conj" [x, y] &&&
call "ando" [v, w, u] &&&
call "evalo" [st, x, v] &&&
call "evalo" [st, y, w]
) |||
(
fm === C "disj" [x, y] &&&
call "oro" [v, w, u] &&&
call "evalo" [st, x, v] &&&
call "evalo" [st, y, w]
) |||
(
fm === C "neg" [x] &&&
call "evalo" [st, x, v] &&&
call "noto" [v, u]
) |||
(
fm === C "var" [x] &&&
call "elemo" [x, st, u]
)
)
)
)
where
[st, fm, u, x, y, v, w] = map V ["st", "fm", "u", "x", "y", "v", "w"]
-- table implementation of ando/oro | 859 | evalo'''Def =
( Def "evalo" ["st", "fm", "u"]
(
fresh ["x", "y", "v", "w"]
(
(
fm === C "conj" [x, y] &&&
call "ando" [v, w, u] &&&
call "evalo" [st, x, v] &&&
call "evalo" [st, y, w]
) |||
(
fm === C "disj" [x, y] &&&
call "oro" [v, w, u] &&&
call "evalo" [st, x, v] &&&
call "evalo" [st, y, w]
) |||
(
fm === C "neg" [x] &&&
call "evalo" [st, x, v] &&&
call "noto" [v, u]
) |||
(
fm === C "var" [x] &&&
call "elemo" [x, st, u]
)
)
)
)
where
[st, fm, u, x, y, v, w] = map V ["st", "fm", "u", "x", "y", "v", "w"]
-- table implementation of ando/oro | 840 | true | true | 0 | 19 | 427 | 349 | 198 | 151 | null | null |
zorion/acm-uva | H99/Problems010.hs | gpl-3.0 | compress [x] = [x] | 18 | compress [x] = [x] | 18 | compress [x] = [x] | 18 | false | false | 0 | 6 | 3 | 15 | 8 | 7 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | Site ID associated with this placement group. On insert, you must set
-- either this field or the directorySiteId field to specify the site
-- associated with this placement group. This is a required field that is
-- read-only after insertion.
plalSiteId :: Lens' PlacementGroup (Maybe Int64)
plalSiteId
= lens _plalSiteId (\ s a -> s{_plalSiteId = a}) .
mapping _Coerce | 383 | plalSiteId :: Lens' PlacementGroup (Maybe Int64)
plalSiteId
= lens _plalSiteId (\ s a -> s{_plalSiteId = a}) .
mapping _Coerce | 134 | plalSiteId
= lens _plalSiteId (\ s a -> s{_plalSiteId = a}) .
mapping _Coerce | 85 | true | true | 0 | 10 | 70 | 56 | 31 | 25 | null | null |
mattias-lundell/timber-llvm | src/LLVMKindle.hs | bsd-3-clause | array :: Int -> LLVMType -> LLVMType
array = Tarray | 51 | array :: Int -> LLVMType -> LLVMType
array = Tarray | 51 | array = Tarray | 14 | false | true | 0 | 6 | 9 | 19 | 10 | 9 | null | null |
uduki/hsQt | Qtc/Gui/QTabletEvent.hs | bsd-2-clause | qTabletEvent_delete :: QTabletEvent a -> IO ()
qTabletEvent_delete x0
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QTabletEvent_delete cobj_x0 | 140 | qTabletEvent_delete :: QTabletEvent a -> IO ()
qTabletEvent_delete x0
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QTabletEvent_delete cobj_x0 | 140 | qTabletEvent_delete x0
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QTabletEvent_delete cobj_x0 | 93 | false | true | 0 | 7 | 22 | 41 | 19 | 22 | null | null |
jvictor0/JoSQL | Server/QueryCompile.hs | mit | queryModuleName q = "CQ_" ++ (name q) ++ (hexPrint $ hashQuery q) | 65 | queryModuleName q = "CQ_" ++ (name q) ++ (hexPrint $ hashQuery q) | 65 | queryModuleName q = "CQ_" ++ (name q) ++ (hexPrint $ hashQuery q) | 65 | false | false | 0 | 8 | 11 | 33 | 16 | 17 | null | null |
CarmineM74/haskell_craft3e | Chapter17.hs | mit | -- Another definition of listSums which uses scanl1', a generalisation of the
-- original function.
listSums' = scanl' (+) 0 | 125 | listSums' = scanl' (+) 0 | 24 | listSums' = scanl' (+) 0 | 24 | true | false | 0 | 5 | 20 | 15 | 9 | 6 | null | null |
ghcjs/ghcjs-base | test/Tests/Marshal.hs | mit | to_from_jsval_maybe :: (ToJSVal a, FromJSVal a, Eq a) => TypeName a -> Maybe a -> Property
to_from_jsval_maybe _ = to_from_jsval' | 129 | to_from_jsval_maybe :: (ToJSVal a, FromJSVal a, Eq a) => TypeName a -> Maybe a -> Property
to_from_jsval_maybe _ = to_from_jsval' | 129 | to_from_jsval_maybe _ = to_from_jsval' | 38 | false | true | 0 | 8 | 19 | 49 | 24 | 25 | null | null |
bitemyapp/ganeti | test/hs/Test/Ganeti/Objects.hs | bsd-2-clause | prop_fillDict :: [(Int, Int)] -> [(Int, Int)] -> Property
prop_fillDict defaults custom =
let d_map = Map.fromList defaults
d_keys = map fst defaults
c_map = Map.fromList custom
c_keys = map fst custom
in conjoin [ counterexample "Empty custom filling"
(fillDict d_map Map.empty [] == d_map)
, counterexample "Empty defaults filling"
(fillDict Map.empty c_map [] == c_map)
, counterexample "Delete all keys"
(fillDict d_map c_map (d_keys++c_keys) == Map.empty)
] | 568 | prop_fillDict :: [(Int, Int)] -> [(Int, Int)] -> Property
prop_fillDict defaults custom =
let d_map = Map.fromList defaults
d_keys = map fst defaults
c_map = Map.fromList custom
c_keys = map fst custom
in conjoin [ counterexample "Empty custom filling"
(fillDict d_map Map.empty [] == d_map)
, counterexample "Empty defaults filling"
(fillDict Map.empty c_map [] == c_map)
, counterexample "Delete all keys"
(fillDict d_map c_map (d_keys++c_keys) == Map.empty)
] | 568 | prop_fillDict defaults custom =
let d_map = Map.fromList defaults
d_keys = map fst defaults
c_map = Map.fromList custom
c_keys = map fst custom
in conjoin [ counterexample "Empty custom filling"
(fillDict d_map Map.empty [] == d_map)
, counterexample "Empty defaults filling"
(fillDict Map.empty c_map [] == c_map)
, counterexample "Delete all keys"
(fillDict d_map c_map (d_keys++c_keys) == Map.empty)
] | 510 | false | true | 0 | 14 | 173 | 174 | 89 | 85 | null | null |
dterei/Scraps | haskell/prettyGenerics/D3.hs | bsd-3-clause | comma :: DocBase a => Doc a
comma = DocStr (chr ',') | 52 | comma :: DocBase a => Doc a
comma = DocStr (chr ',') | 52 | comma = DocStr (chr ',') | 24 | false | true | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
christiaanb/clash-tryout | src/CLaSH/Util/Core/Tools.hs | bsd-3-clause | isVar _ = False | 29 | isVar _ = False | 29 | isVar _ = False | 29 | false | false | 0 | 5 | 17 | 9 | 4 | 5 | null | null |
liyanchang/scheme-in-haskell | src/chp4.hs | mit | symbol :: Parser Char
symbol = oneOf "!$%&|*+-/:<=?>@^~#" | 57 | symbol :: Parser Char
symbol = oneOf "!$%&|*+-/:<=?>@^~#" | 57 | symbol = oneOf "!$%&|*+-/:<=?>@^~#" | 35 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
jdreaver/iris | src/Iris/Backends/GLFW.hs | mit | -- | Convert from GLFW MouseButtonState to MouseButtonState
mouseButtonState :: GLFW.MouseButtonState -> MouseButtonState
mouseButtonState GLFW.MouseButtonState'Pressed = Pressed | 178 | mouseButtonState :: GLFW.MouseButtonState -> MouseButtonState
mouseButtonState GLFW.MouseButtonState'Pressed = Pressed | 118 | mouseButtonState GLFW.MouseButtonState'Pressed = Pressed | 56 | true | true | 0 | 6 | 16 | 23 | 12 | 11 | null | null |
meteficha/yesod | yesod-form/Yesod/Form/Functions.hs | mit | renderDivs = renderDivsMaybeLabels True | 39 | renderDivs = renderDivsMaybeLabels True | 39 | renderDivs = renderDivsMaybeLabels True | 39 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
apyrgio/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | ndSpindleCount :: String
ndSpindleCount = "spindle_count" | 57 | ndSpindleCount :: String
ndSpindleCount = "spindle_count" | 57 | ndSpindleCount = "spindle_count" | 32 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
webcrank/webcrank.hs | src/Webcrank/Internal/DecisionCore.hs | bsd-3-clause | -- If-Modified-Since exists?
l13
:: (Applicative m, MonadReader r m, HasResourceData r m, MonadState s m, HasReqData s)
=> FlowChart (HaltT m) Status
l13 = decision "l13" $ maybe m16 l14 <$> getRequestHeader hIfModifiedSince | 228 | l13
:: (Applicative m, MonadReader r m, HasResourceData r m, MonadState s m, HasReqData s)
=> FlowChart (HaltT m) Status
l13 = decision "l13" $ maybe m16 l14 <$> getRequestHeader hIfModifiedSince | 199 | l13 = decision "l13" $ maybe m16 l14 <$> getRequestHeader hIfModifiedSince | 74 | true | true | 0 | 8 | 37 | 84 | 41 | 43 | null | null |
knalbant/wrangell | DataOperations.hs | bsd-3-clause | getAt :: [Integer] -> [a] -> [a]
getAt ns l = map ((l !!) . fromIntegral) ns | 76 | getAt :: [Integer] -> [a] -> [a]
getAt ns l = map ((l !!) . fromIntegral) ns | 76 | getAt ns l = map ((l !!) . fromIntegral) ns | 43 | false | true | 0 | 9 | 16 | 55 | 28 | 27 | null | null |
JamieBeverley/InnerEar | src/InnerEar/Types/Response.hs | gpl-3.0 | justRecordResponses :: Response -> Maybe Record
justRecordResponses (RecordResponse r) = Just r | 95 | justRecordResponses :: Response -> Maybe Record
justRecordResponses (RecordResponse r) = Just r | 95 | justRecordResponses (RecordResponse r) = Just r | 47 | false | true | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
sdiehl/ghc | compiler/basicTypes/PatSyn.hs | bsd-3-clause | patSynUnivTyVarBinders :: PatSyn -> [TyVarBinder]
patSynUnivTyVarBinders = psUnivTyVars | 87 | patSynUnivTyVarBinders :: PatSyn -> [TyVarBinder]
patSynUnivTyVarBinders = psUnivTyVars | 87 | patSynUnivTyVarBinders = psUnivTyVars | 37 | false | true | 0 | 6 | 7 | 18 | 10 | 8 | null | null |
mthom/abominable-klambda-compiler | Compiler/Backend.hs | bsd-3-clause | getTable :: Symbol -> Symbol -> [FileName] -> IO (Table, [Symbol], Int)
getTable modPrefix folderName =
foldM (buildTable modPrefix folderName) (primitiveTable, [], 0) | 174 | getTable :: Symbol -> Symbol -> [FileName] -> IO (Table, [Symbol], Int)
getTable modPrefix folderName =
foldM (buildTable modPrefix folderName) (primitiveTable, [], 0) | 173 | getTable modPrefix folderName =
foldM (buildTable modPrefix folderName) (primitiveTable, [], 0) | 101 | false | true | 0 | 10 | 29 | 70 | 38 | 32 | null | null |
snoyberg/ghc | compiler/backpack/RnModIface.hs | bsd-3-clause | rnIfaceExpr (IfaceLam lam_bndr expr)
= IfaceLam <$> rnIfaceLamBndr lam_bndr <*> rnIfaceExpr expr | 100 | rnIfaceExpr (IfaceLam lam_bndr expr)
= IfaceLam <$> rnIfaceLamBndr lam_bndr <*> rnIfaceExpr expr | 100 | rnIfaceExpr (IfaceLam lam_bndr expr)
= IfaceLam <$> rnIfaceLamBndr lam_bndr <*> rnIfaceExpr expr | 100 | false | false | 0 | 7 | 15 | 31 | 14 | 17 | null | null |
damianfral/clay | src/Clay/Color.hs | bsd-3-clause | bisque = rgb 255 228 196 | 38 | bisque = rgb 255 228 196 | 38 | bisque = rgb 255 228 196 | 38 | false | false | 0 | 5 | 19 | 13 | 6 | 7 | null | null |
kmilner/tamarin-prover | lib/term/src/Term/LTerm.hs | gpl-3.0 | -- | Is a term a public constant?
isPubConst :: LNTerm -> Bool
isPubConst (viewTerm -> Lit (Con v)) = (sortOfName v == LSortPub) | 128 | isPubConst :: LNTerm -> Bool
isPubConst (viewTerm -> Lit (Con v)) = (sortOfName v == LSortPub) | 94 | isPubConst (viewTerm -> Lit (Con v)) = (sortOfName v == LSortPub) | 65 | true | true | 0 | 10 | 23 | 45 | 23 | 22 | null | null |
ocean0yohsuke/Simply-Typed-Lambda | src/Lambda/Parser.hs | bsd-3-clause | ------------------------------------
-- sentence
------------------------------------
pDef :: Parser SExpr
pDef = do
sp <- getSourcePos
id <- pLowerId <|> parens pSymbolId
pms <- manytry $ spaces1 *> (tryparens pPM <|> pPMSingle)
spaces1 *> string "=" <* csnl
t <- pLexeme <* spaces
let d = (pms, t, Just sp)
ds <- manytry $ newlines1 *> pDefline id -- TODO: comment
(*:) $ DEF id (d:ds)
<?> "definition"
where
pDefline id = do
sp <- getSourcePos
if and $ id <$| (`elem` oprchars)
then string ("("++ id ++")")
else string id
pms <- manytry $ spaces1 *> (tryparens pPM <|> pPMSingle)
spaces1 *> string "=" <* csnl
t <- pLexeme <* spaces
(*:) (pms, t, Just sp)
-- type signature | 793 | pDef :: Parser SExpr
pDef = do
sp <- getSourcePos
id <- pLowerId <|> parens pSymbolId
pms <- manytry $ spaces1 *> (tryparens pPM <|> pPMSingle)
spaces1 *> string "=" <* csnl
t <- pLexeme <* spaces
let d = (pms, t, Just sp)
ds <- manytry $ newlines1 *> pDefline id -- TODO: comment
(*:) $ DEF id (d:ds)
<?> "definition"
where
pDefline id = do
sp <- getSourcePos
if and $ id <$| (`elem` oprchars)
then string ("("++ id ++")")
else string id
pms <- manytry $ spaces1 *> (tryparens pPM <|> pPMSingle)
spaces1 *> string "=" <* csnl
t <- pLexeme <* spaces
(*:) (pms, t, Just sp)
-- type signature | 706 | pDef = do
sp <- getSourcePos
id <- pLowerId <|> parens pSymbolId
pms <- manytry $ spaces1 *> (tryparens pPM <|> pPMSingle)
spaces1 *> string "=" <* csnl
t <- pLexeme <* spaces
let d = (pms, t, Just sp)
ds <- manytry $ newlines1 *> pDefline id -- TODO: comment
(*:) $ DEF id (d:ds)
<?> "definition"
where
pDefline id = do
sp <- getSourcePos
if and $ id <$| (`elem` oprchars)
then string ("("++ id ++")")
else string id
pms <- manytry $ spaces1 *> (tryparens pPM <|> pPMSingle)
spaces1 *> string "=" <* csnl
t <- pLexeme <* spaces
(*:) (pms, t, Just sp)
-- type signature | 685 | true | true | 3 | 12 | 234 | 289 | 141 | 148 | null | null |
rahulmutt/ghcvm | compiler/Eta/CodeGen/Rts.hs | bsd-3-clause | stgTVar = stm "TVar" | 26 | stgTVar = stm "TVar" | 26 | stgTVar = stm "TVar" | 26 | false | false | 0 | 5 | 9 | 9 | 4 | 5 | null | null |
slyrz/phantom | src/Phantom/Util.hs | mit | textBold :: String -> String
textBold text =
ansiEscTextBold ++ text ++ ansiEscTextNorm | 89 | textBold :: String -> String
textBold text =
ansiEscTextBold ++ text ++ ansiEscTextNorm | 89 | textBold text =
ansiEscTextBold ++ text ++ ansiEscTextNorm | 60 | false | true | 0 | 6 | 14 | 26 | 13 | 13 | null | null |
sru-systems/protobuf-simple | src/Parser/Generator.hs | mit | addMessageCodeInfo :: FileDesc -> MessageDesc -> State GenState ()
addMessageCodeInfo fd md = do
state <- get
fdirs <- getDirectories fd
fname <- getMessageFilename md
fcode <- getMessageCode fd md
put $ state{codeInfos = CodeInfo fdirs fname fcode : codeInfos state} | 287 | addMessageCodeInfo :: FileDesc -> MessageDesc -> State GenState ()
addMessageCodeInfo fd md = do
state <- get
fdirs <- getDirectories fd
fname <- getMessageFilename md
fcode <- getMessageCode fd md
put $ state{codeInfos = CodeInfo fdirs fname fcode : codeInfos state} | 287 | addMessageCodeInfo fd md = do
state <- get
fdirs <- getDirectories fd
fname <- getMessageFilename md
fcode <- getMessageCode fd md
put $ state{codeInfos = CodeInfo fdirs fname fcode : codeInfos state} | 220 | false | true | 0 | 11 | 60 | 99 | 45 | 54 | null | null |
Cahu/krpc-hs | src/KRPCHS/SpaceCenter.hs | gpl-3.0 | getPartsSensorsStreamReq :: KRPCHS.SpaceCenter.Parts -> KRPCStreamReq ([KRPCHS.SpaceCenter.Sensor])
getPartsSensorsStreamReq thisArg =
let req = makeRequest "SpaceCenter" "Parts_get_Sensors" [makeArgument 0 thisArg]
in makeStream req | 242 | getPartsSensorsStreamReq :: KRPCHS.SpaceCenter.Parts -> KRPCStreamReq ([KRPCHS.SpaceCenter.Sensor])
getPartsSensorsStreamReq thisArg =
let req = makeRequest "SpaceCenter" "Parts_get_Sensors" [makeArgument 0 thisArg]
in makeStream req | 242 | getPartsSensorsStreamReq thisArg =
let req = makeRequest "SpaceCenter" "Parts_get_Sensors" [makeArgument 0 thisArg]
in makeStream req | 142 | false | true | 0 | 11 | 29 | 67 | 32 | 35 | null | null |
brendanhay/gogol | gogol-gmail/gen/Network/Google/Gmail/Types/Product.hs | mpl-2.0 | -- | The number of unread messages with the label.
lMessagesUnread :: Lens' Label (Maybe Int32)
lMessagesUnread
= lens _lMessagesUnread
(\ s a -> s{_lMessagesUnread = a})
. mapping _Coerce | 202 | lMessagesUnread :: Lens' Label (Maybe Int32)
lMessagesUnread
= lens _lMessagesUnread
(\ s a -> s{_lMessagesUnread = a})
. mapping _Coerce | 151 | lMessagesUnread
= lens _lMessagesUnread
(\ s a -> s{_lMessagesUnread = a})
. mapping _Coerce | 106 | true | true | 3 | 8 | 43 | 63 | 28 | 35 | null | null |
brendanhay/gogol | gogol-adexchangebuyer2/gen/Network/Google/AdExchangeBuyer2/Types/Product.hs | mpl-2.0 | -- | For video creatives specifies the sizes of companion ads (if present).
-- Companion sizes may be filled in only when creative_size_type = VIDEO
csCompanionSizes :: Lens' CreativeSize [Size]
csCompanionSizes
= lens _csCompanionSizes
(\ s a -> s{_csCompanionSizes = a})
. _Default
. _Coerce | 313 | csCompanionSizes :: Lens' CreativeSize [Size]
csCompanionSizes
= lens _csCompanionSizes
(\ s a -> s{_csCompanionSizes = a})
. _Default
. _Coerce | 164 | csCompanionSizes
= lens _csCompanionSizes
(\ s a -> s{_csCompanionSizes = a})
. _Default
. _Coerce | 118 | true | true | 2 | 8 | 64 | 61 | 30 | 31 | null | null |
SKA-ScienceDataProcessor/RC | MS6/programs/Kernel/Facet.hs | apache-2.0 | -- | Defacetting image initialisation
imageInit :: GridPar -> Kernel Image
imageInit gp = halideKernel0 "imageInit" (imageRepr gp) kern_image_init | 146 | imageInit :: GridPar -> Kernel Image
imageInit gp = halideKernel0 "imageInit" (imageRepr gp) kern_image_init | 108 | imageInit gp = halideKernel0 "imageInit" (imageRepr gp) kern_image_init | 71 | true | true | 0 | 7 | 18 | 35 | 17 | 18 | null | null |
hjwylde/werewolf | app/Game/Werewolf/Message/Command.hs | bsd-3-clause | pingVillageMessage :: Message
pingVillageMessage = publicMessage villagePingedText | 82 | pingVillageMessage :: Message
pingVillageMessage = publicMessage villagePingedText | 82 | pingVillageMessage = publicMessage villagePingedText | 52 | false | true | 0 | 6 | 6 | 20 | 8 | 12 | null | null |
dimara/ganeti | src/Ganeti/Types.hs | bsd-2-clause | diskTemplateMovable DTPlain = False | 41 | diskTemplateMovable DTPlain = False | 41 | diskTemplateMovable DTPlain = False | 41 | false | false | 0 | 4 | 9 | 10 | 4 | 6 | null | null |
urbanslug/ghc | compiler/basicTypes/Name.hs | bsd-3-clause | -- | Make a name for a foreign call
mkFCallName :: Unique -> String -> Name
mkFCallName uniq str = mkInternalName uniq (mkVarOcc str) noSrcSpan | 143 | mkFCallName :: Unique -> String -> Name
mkFCallName uniq str = mkInternalName uniq (mkVarOcc str) noSrcSpan | 107 | mkFCallName uniq str = mkInternalName uniq (mkVarOcc str) noSrcSpan | 67 | true | true | 0 | 8 | 24 | 45 | 20 | 25 | null | null |
mariefarrell/Hets | Comorphisms/ExtModal2HasCASL.hs | gpl-2.0 | numId :: Id
numId = genName "num" | 33 | numId :: Id
numId = genName "num" | 33 | numId = genName "num" | 21 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
ddssff/pandoc | src/Text/Pandoc/Writers/Docx.hs | gpl-2.0 | -- | Certain characters are invalid in XML even if escaped.
-- See #1992
stripInvalidChars :: String -> String
stripInvalidChars = filter isValidChar | 149 | stripInvalidChars :: String -> String
stripInvalidChars = filter isValidChar | 76 | stripInvalidChars = filter isValidChar | 38 | true | true | 0 | 5 | 22 | 20 | 11 | 9 | null | null |
sdiehl/ghc | testsuite/tests/gadt/T14808.hs | bsd-3-clause | f :: [()] -> ECC () [] ()
f = ECC @() @[] @() | 45 | f :: [()] -> ECC () [] ()
f = ECC @() @[] @() | 45 | f = ECC @() @[] @() | 19 | false | true | 0 | 8 | 13 | 60 | 27 | 33 | null | null |
leptonyu/mint | corn/src/Base/Logger.hs | bsd-3-clause | warnLn :: (MonadLogger m) => Text -> m ()
warnLn = logLn WARN | 63 | warnLn :: (MonadLogger m) => Text -> m ()
warnLn = logLn WARN | 63 | warnLn = logLn WARN | 20 | false | true | 0 | 8 | 14 | 32 | 16 | 16 | null | null |
andre-artus/handbook-of-practical-logic-and-automated-reasoning-haskell | src/ATP/Util/List.hs | gpl-3.0 | {-
| Given two lists l1 l2 where |l1| >= |l2|, return all
injective maps between the two lists. For example
allInjectiveMaps [1,2,3] [4,5,6] = [[(1,4), (2,5), (3,6)], [(1,5),(2,4),(3,6)], ...]
-}
allInjectiveMaps :: [a] -> [b] -> [[(a,b)]]
allInjectiveMaps [] _ = [[]] | 272 | allInjectiveMaps :: [a] -> [b] -> [[(a,b)]]
allInjectiveMaps [] _ = [[]] | 72 | allInjectiveMaps [] _ = [[]] | 28 | true | true | 0 | 9 | 46 | 50 | 29 | 21 | null | null |
ksaveljev/hake-2 | src/Client/MenuGlobals.hs | bsd-3-clause | loadGameActions :: V.Vector (Ref MenuActionS)
loadGameActions = V.generate maxSaveGames (\idx -> Ref (idx + loadGameActionsOffset)) | 131 | loadGameActions :: V.Vector (Ref MenuActionS)
loadGameActions = V.generate maxSaveGames (\idx -> Ref (idx + loadGameActionsOffset)) | 131 | loadGameActions = V.generate maxSaveGames (\idx -> Ref (idx + loadGameActionsOffset)) | 85 | false | true | 0 | 10 | 14 | 47 | 24 | 23 | null | null |
henrytill/deviser | src/Deviser/Evaluator.hs | bsd-3-clause | expandQuasiquoted (List [Atom "unquote", xs@(List _)]) = eval xs | 64 | expandQuasiquoted (List [Atom "unquote", xs@(List _)]) = eval xs | 64 | expandQuasiquoted (List [Atom "unquote", xs@(List _)]) = eval xs | 64 | false | false | 0 | 11 | 8 | 36 | 18 | 18 | null | null |
vikraman/ghc | compiler/codeGen/StgCmmEnv.hs | bsd-3-clause | getNonVoidArgAmodes (arg:args)
| isVoidRep (argPrimRep arg) = getNonVoidArgAmodes args
| otherwise = do { amode <- getArgAmode (NonVoid arg)
; amodes <- getNonVoidArgAmodes args
; return ( amode : amodes ) } | 252 | getNonVoidArgAmodes (arg:args)
| isVoidRep (argPrimRep arg) = getNonVoidArgAmodes args
| otherwise = do { amode <- getArgAmode (NonVoid arg)
; amodes <- getNonVoidArgAmodes args
; return ( amode : amodes ) } | 252 | getNonVoidArgAmodes (arg:args)
| isVoidRep (argPrimRep arg) = getNonVoidArgAmodes args
| otherwise = do { amode <- getArgAmode (NonVoid arg)
; amodes <- getNonVoidArgAmodes args
; return ( amode : amodes ) } | 252 | false | false | 1 | 11 | 76 | 85 | 40 | 45 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/Compatibility/Tokens.hs | bsd-3-clause | gl_SEPARATE_SPECULAR_COLOR :: GLenum
gl_SEPARATE_SPECULAR_COLOR = 0x81FA | 72 | gl_SEPARATE_SPECULAR_COLOR :: GLenum
gl_SEPARATE_SPECULAR_COLOR = 0x81FA | 72 | gl_SEPARATE_SPECULAR_COLOR = 0x81FA | 35 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
karamellpelle/grid | test/source/Test/_TestGUI.hs | gpl-3.0 | testFinish :: TestGUI -> TestGUI
testFinish test =
test { testValueFinish = True } | 86 | testFinish :: TestGUI -> TestGUI
testFinish test =
test { testValueFinish = True } | 86 | testFinish test =
test { testValueFinish = True } | 53 | false | true | 0 | 6 | 17 | 26 | 14 | 12 | null | null |
alphalambda/k12math | contrib/MHills/GeometryLessons/code/teacher/key_lesson8j.hs | mit | dilate a (x,y) = a'
where (x1,y1) = a
a' = (x*x1,y*y1) | 69 | dilate a (x,y) = a'
where (x1,y1) = a
a' = (x*x1,y*y1) | 69 | dilate a (x,y) = a'
where (x1,y1) = a
a' = (x*x1,y*y1) | 69 | false | false | 1 | 7 | 26 | 57 | 28 | 29 | null | null |
mdsteele/fallback | src/Fallback/View/Abilities.hs | gpl-3.0 | -------------------------------------------------------------------------------
newAbilitiesView :: (MonadDraw m) => Resources -> HoverSink Cursor
-> m (View AbilitiesState AbilitiesAction)
newAbilitiesView resources cursorSink = do
let margin = 20
headingHeight = 20
sectionSpacing = 10
let headingFont = rsrcFont resources FontGeorgiaBold11
tooltipRef <- newHoverRef NoTooltip
let tooltipSink = hoverSink tooltipRef
let makeAbilityWidget abilNum index =
subView_ (Rect (margin + (index `mod` 5) *
(buttonSize + buttonSpacing))
(margin + headingHeight +
(index `div` 5) * (buttonSize + buttonSpacing))
buttonSize buttonSize) <$>
newAbilityWidget resources tooltipSink abilNum
let rectFn _ (w, h) =
let w' = 2 * margin + 5 * buttonSize + 4 * buttonSpacing
h' = 2 * margin + 2 * headingHeight +
3 * buttonSize + buttonSpacing + sectionSpacing
in Rect ((w - w') `div` 2) ((h - h') `div` 2) w' h'
hoverJunction tooltipRef <$> compoundViewM [
(return $ hoverView tooltipSink NoTooltip nullView),
(subView rectFn <$> compoundViewM [
(hoverView cursorSink DefaultCursor <$> newDialogBackgroundView),
(return $ vmap (const "Abilities") $ makeLabel headingFont blackColor $
\(w, _) -> LocMidtop $ Point (w `div` 2) margin),
(compoundView <$> zipWithM makeAbilityWidget [minBound .. maxBound]
[0 ..]),
(subView_ (Rect margin (margin + headingHeight + 2 * buttonSize +
buttonSpacing + sectionSpacing)
(buttonSize * 2 + buttonSpacing)
(buttonSize + headingHeight)) <$>
newAttackSection resources tooltipSink),
(subView_ (Rect (margin + 2 * buttonSize + 2 * buttonSpacing)
(margin + headingHeight + 2 * buttonSize +
buttonSpacing + sectionSpacing)
(buttonSize * 3 + buttonSpacing * 2)
(buttonSize + headingHeight)) <$>
newFeatsSection resources tooltipSink)]),
(newAbilityInfoView resources tooltipRef),
(newFeatInfoView resources tooltipRef)]
------------------------------------------------------------------------------- | 2,417 | newAbilitiesView :: (MonadDraw m) => Resources -> HoverSink Cursor
-> m (View AbilitiesState AbilitiesAction)
newAbilitiesView resources cursorSink = do
let margin = 20
headingHeight = 20
sectionSpacing = 10
let headingFont = rsrcFont resources FontGeorgiaBold11
tooltipRef <- newHoverRef NoTooltip
let tooltipSink = hoverSink tooltipRef
let makeAbilityWidget abilNum index =
subView_ (Rect (margin + (index `mod` 5) *
(buttonSize + buttonSpacing))
(margin + headingHeight +
(index `div` 5) * (buttonSize + buttonSpacing))
buttonSize buttonSize) <$>
newAbilityWidget resources tooltipSink abilNum
let rectFn _ (w, h) =
let w' = 2 * margin + 5 * buttonSize + 4 * buttonSpacing
h' = 2 * margin + 2 * headingHeight +
3 * buttonSize + buttonSpacing + sectionSpacing
in Rect ((w - w') `div` 2) ((h - h') `div` 2) w' h'
hoverJunction tooltipRef <$> compoundViewM [
(return $ hoverView tooltipSink NoTooltip nullView),
(subView rectFn <$> compoundViewM [
(hoverView cursorSink DefaultCursor <$> newDialogBackgroundView),
(return $ vmap (const "Abilities") $ makeLabel headingFont blackColor $
\(w, _) -> LocMidtop $ Point (w `div` 2) margin),
(compoundView <$> zipWithM makeAbilityWidget [minBound .. maxBound]
[0 ..]),
(subView_ (Rect margin (margin + headingHeight + 2 * buttonSize +
buttonSpacing + sectionSpacing)
(buttonSize * 2 + buttonSpacing)
(buttonSize + headingHeight)) <$>
newAttackSection resources tooltipSink),
(subView_ (Rect (margin + 2 * buttonSize + 2 * buttonSpacing)
(margin + headingHeight + 2 * buttonSize +
buttonSpacing + sectionSpacing)
(buttonSize * 3 + buttonSpacing * 2)
(buttonSize + headingHeight)) <$>
newFeatsSection resources tooltipSink)]),
(newAbilityInfoView resources tooltipRef),
(newFeatInfoView resources tooltipRef)]
------------------------------------------------------------------------------- | 2,336 | newAbilitiesView resources cursorSink = do
let margin = 20
headingHeight = 20
sectionSpacing = 10
let headingFont = rsrcFont resources FontGeorgiaBold11
tooltipRef <- newHoverRef NoTooltip
let tooltipSink = hoverSink tooltipRef
let makeAbilityWidget abilNum index =
subView_ (Rect (margin + (index `mod` 5) *
(buttonSize + buttonSpacing))
(margin + headingHeight +
(index `div` 5) * (buttonSize + buttonSpacing))
buttonSize buttonSize) <$>
newAbilityWidget resources tooltipSink abilNum
let rectFn _ (w, h) =
let w' = 2 * margin + 5 * buttonSize + 4 * buttonSpacing
h' = 2 * margin + 2 * headingHeight +
3 * buttonSize + buttonSpacing + sectionSpacing
in Rect ((w - w') `div` 2) ((h - h') `div` 2) w' h'
hoverJunction tooltipRef <$> compoundViewM [
(return $ hoverView tooltipSink NoTooltip nullView),
(subView rectFn <$> compoundViewM [
(hoverView cursorSink DefaultCursor <$> newDialogBackgroundView),
(return $ vmap (const "Abilities") $ makeLabel headingFont blackColor $
\(w, _) -> LocMidtop $ Point (w `div` 2) margin),
(compoundView <$> zipWithM makeAbilityWidget [minBound .. maxBound]
[0 ..]),
(subView_ (Rect margin (margin + headingHeight + 2 * buttonSize +
buttonSpacing + sectionSpacing)
(buttonSize * 2 + buttonSpacing)
(buttonSize + headingHeight)) <$>
newAttackSection resources tooltipSink),
(subView_ (Rect (margin + 2 * buttonSize + 2 * buttonSpacing)
(margin + headingHeight + 2 * buttonSize +
buttonSpacing + sectionSpacing)
(buttonSize * 3 + buttonSpacing * 2)
(buttonSize + headingHeight)) <$>
newFeatsSection resources tooltipSink)]),
(newAbilityInfoView resources tooltipRef),
(newFeatInfoView resources tooltipRef)]
------------------------------------------------------------------------------- | 2,209 | true | true | 0 | 24 | 754 | 663 | 345 | 318 | null | null |
Numberartificial/workflow | haskell-first-principles/haskell-programming-from-first-principles-master/src/Cipher.hs | mit | shiftLeft :: Int -> Char -> Char
shiftLeft = shift pred | 55 | shiftLeft :: Int -> Char -> Char
shiftLeft = shift pred | 55 | shiftLeft = shift pred | 22 | false | true | 0 | 8 | 10 | 28 | 12 | 16 | null | null |
maximilianhuber/softwareProjekt | src/GalFld/Algorithmen/Berlekamp.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- Wrapper
appBerlekamp :: (Show a, FiniteField a, Num a, Fractional a) =>
[(Int,Polynom a)] -> [(Int,Polynom a)]
appBerlekamp = appFact berlekampFactor | 275 | appBerlekamp :: (Show a, FiniteField a, Num a, Fractional a) =>
[(Int,Polynom a)] -> [(Int,Polynom a)]
appBerlekamp = appFact berlekampFactor | 181 | appBerlekamp = appFact berlekampFactor | 38 | true | true | 0 | 9 | 64 | 71 | 39 | 32 | null | null |
JoeyEremondi/elm-type-effect | src/Generate/JavaScript.hs | bsd-3-clause | _List :: String -> Expression ()
_List x =
obj ["_L", x] | 60 | _List :: String -> Expression ()
_List x =
obj ["_L", x] | 60 | _List x =
obj ["_L", x] | 27 | false | true | 0 | 7 | 15 | 32 | 16 | 16 | null | null |
xcv-/LCC | lib/Data/TaggedTree/Flat.hs | gpl-3.0 | groupOverloads :: Eq s => [(s, a)] -> [(s, [a])]
groupOverloads = groupByFst | 76 | groupOverloads :: Eq s => [(s, a)] -> [(s, [a])]
groupOverloads = groupByFst | 76 | groupOverloads = groupByFst | 27 | false | true | 0 | 9 | 12 | 43 | 25 | 18 | null | null |
NightRa/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | writeIFace :: ExportIFace -> IO ()
writeIFace (Export ffic hdr exps)
| ffic == sNS (sUN "FFI_C") ["FFI_C"]
= do let hfile = "#ifndef " ++ hdr_guard hdr ++ "\n" ++
"#define " ++ hdr_guard hdr ++ "\n\n" ++
"#include <idris_rts.h>\n\n" ++
concatMap hdr_export exps ++ "\n" ++
"#endif\n\n"
writeFile hdr hfile
| otherwise = return () | 450 | writeIFace :: ExportIFace -> IO ()
writeIFace (Export ffic hdr exps)
| ffic == sNS (sUN "FFI_C") ["FFI_C"]
= do let hfile = "#ifndef " ++ hdr_guard hdr ++ "\n" ++
"#define " ++ hdr_guard hdr ++ "\n\n" ++
"#include <idris_rts.h>\n\n" ++
concatMap hdr_export exps ++ "\n" ++
"#endif\n\n"
writeFile hdr hfile
| otherwise = return () | 450 | writeIFace (Export ffic hdr exps)
| ffic == sNS (sUN "FFI_C") ["FFI_C"]
= do let hfile = "#ifndef " ++ hdr_guard hdr ++ "\n" ++
"#define " ++ hdr_guard hdr ++ "\n\n" ++
"#include <idris_rts.h>\n\n" ++
concatMap hdr_export exps ++ "\n" ++
"#endif\n\n"
writeFile hdr hfile
| otherwise = return () | 415 | false | true | 1 | 21 | 177 | 134 | 62 | 72 | null | null |
CulpaBS/wbBach | src/Futhark/Representation/SOACS.hs | bsd-3-clause | removeRetTypeLore :: IsRetType rt => rt -> RetType
removeRetTypeLore = ExtRetType . retTypeValues | 97 | removeRetTypeLore :: IsRetType rt => rt -> RetType
removeRetTypeLore = ExtRetType . retTypeValues | 97 | removeRetTypeLore = ExtRetType . retTypeValues | 46 | false | true | 0 | 6 | 12 | 26 | 13 | 13 | null | null |
formrre/yi | yi-core/src/Yi/Buffer/Misc.hs | gpl-2.0 | -- | Returns end of line for given point.
eolPointB :: Point -> BufferM Point
eolPointB p = queryBuffer $ eolPoint' p | 117 | eolPointB :: Point -> BufferM Point
eolPointB p = queryBuffer $ eolPoint' p | 75 | eolPointB p = queryBuffer $ eolPoint' p | 39 | true | true | 0 | 6 | 21 | 29 | 14 | 15 | null | null |
alphaHeavy/cabal | cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs | bsd-3-clause | showCI (Constrained vr) = showVR (collapse vr) | 46 | showCI (Constrained vr) = showVR (collapse vr) | 46 | showCI (Constrained vr) = showVR (collapse vr) | 46 | false | false | 0 | 7 | 6 | 25 | 11 | 14 | null | null |
hendrysuwanda/101dev | tools/mongoRDF/X2Graph.hs | gpl-3.0 | titTriple tit sort = triple
(unode $ s2b $ ns101 ++ sort ++ tit)
(unode $ s2b $ ns101 ++ sort ++ "Name")
(lnode $ TypedL (s2b tit) (mkFastString (s2b ((b2s (uriOf rdfs)) ++ "string")))) | 208 | titTriple tit sort = triple
(unode $ s2b $ ns101 ++ sort ++ tit)
(unode $ s2b $ ns101 ++ sort ++ "Name")
(lnode $ TypedL (s2b tit) (mkFastString (s2b ((b2s (uriOf rdfs)) ++ "string")))) | 208 | titTriple tit sort = triple
(unode $ s2b $ ns101 ++ sort ++ tit)
(unode $ s2b $ ns101 ++ sort ++ "Name")
(lnode $ TypedL (s2b tit) (mkFastString (s2b ((b2s (uriOf rdfs)) ++ "string")))) | 208 | false | false | 0 | 18 | 57 | 105 | 53 | 52 | null | null |
JustinUnger/haskell-book | ch12/ch12.hs | mit | lefts' (x:xs) = case x of
Left x -> x : lefts' xs
Right _ -> lefts' xs | 107 | lefts' (x:xs) = case x of
Left x -> x : lefts' xs
Right _ -> lefts' xs | 107 | lefts' (x:xs) = case x of
Left x -> x : lefts' xs
Right _ -> lefts' xs | 107 | false | false | 0 | 9 | 54 | 48 | 22 | 26 | null | null |
probcomp/haxcat | GewekeTest.hs | apache-2.0 | chain init step k = chain (init >>= step) step (k-1) | 52 | chain init step k = chain (init >>= step) step (k-1) | 52 | chain init step k = chain (init >>= step) step (k-1) | 52 | false | false | 1 | 7 | 10 | 39 | 17 | 22 | null | null |
antalsz/hs-to-coq | src/lib/Control/Monad/Trans/NewlinesParse.hs | mit | evalNewlinesParseT :: Monad m => NewlinesParseT m a -> Text -> m (Either [ParseError] a)
evalNewlinesParseT (NewlinesParseT act) = eval_newline . evalParseT act | 160 | evalNewlinesParseT :: Monad m => NewlinesParseT m a -> Text -> m (Either [ParseError] a)
evalNewlinesParseT (NewlinesParseT act) = eval_newline . evalParseT act | 160 | evalNewlinesParseT (NewlinesParseT act) = eval_newline . evalParseT act | 71 | false | true | 0 | 11 | 22 | 61 | 29 | 32 | null | null |
kmate/HaRe | old/testing/liftOneLevel/LetIn2AST.hs | bsd-3-clause | anotherFun 0 y = sq y where sq x = x ^ 2 | 40 | anotherFun 0 y = sq y where sq x = x ^ 2 | 40 | anotherFun 0 y = sq y where sq x = x ^ 2 | 40 | false | false | 0 | 7 | 12 | 28 | 13 | 15 | null | null |
florianpilz/autotool | src/Wash/HTMLMonad.hs | gpl-2.0 | caption :: Monad m => HTMLCons m a
caption = addMaker $ element_ "caption" [] [] | 80 | caption :: Monad m => HTMLCons m a
caption = addMaker $ element_ "caption" [] [] | 80 | caption = addMaker $ element_ "caption" [] [] | 45 | false | true | 0 | 7 | 15 | 43 | 19 | 24 | null | null |
AndrewBallinger/versionopolis | Main.hs | gpl-3.0 | replaceWithText :: ArrowXml a => String -> a XmlTree XmlTree
replaceWithText text = replaceChildren (txt text) | 110 | replaceWithText :: ArrowXml a => String -> a XmlTree XmlTree
replaceWithText text = replaceChildren (txt text) | 110 | replaceWithText text = replaceChildren (txt text) | 49 | false | true | 0 | 7 | 15 | 39 | 18 | 21 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Compute/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'Image' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iStatus'
--
-- * 'iImageEncryptionKey'
--
-- * 'iDiskSizeGb'
--
-- * 'iSourceType'
--
-- * 'iSourceDiskId'
--
-- * 'iKind'
--
-- * 'iSourceDiskEncryptionKey'
--
-- * 'iGuestOSFeatures'
--
-- * 'iArchiveSizeBytes'
--
-- * 'iFamily'
--
-- * 'iRawDisk'
--
-- * 'iSelfLink'
--
-- * 'iName'
--
-- * 'iCreationTimestamp'
--
-- * 'iId'
--
-- * 'iLicenses'
--
-- * 'iSourceDisk'
--
-- * 'iDescription'
--
-- * 'iDeprecated'
image
:: Image
image =
Image'
{ _iStatus = Nothing
, _iImageEncryptionKey = Nothing
, _iDiskSizeGb = Nothing
, _iSourceType = Raw
, _iSourceDiskId = Nothing
, _iKind = "compute#image"
, _iSourceDiskEncryptionKey = Nothing
, _iGuestOSFeatures = Nothing
, _iArchiveSizeBytes = Nothing
, _iFamily = Nothing
, _iRawDisk = Nothing
, _iSelfLink = Nothing
, _iName = Nothing
, _iCreationTimestamp = Nothing
, _iId = Nothing
, _iLicenses = Nothing
, _iSourceDisk = Nothing
, _iDescription = Nothing
, _iDeprecated = Nothing
} | 1,187 | image
:: Image
image =
Image'
{ _iStatus = Nothing
, _iImageEncryptionKey = Nothing
, _iDiskSizeGb = Nothing
, _iSourceType = Raw
, _iSourceDiskId = Nothing
, _iKind = "compute#image"
, _iSourceDiskEncryptionKey = Nothing
, _iGuestOSFeatures = Nothing
, _iArchiveSizeBytes = Nothing
, _iFamily = Nothing
, _iRawDisk = Nothing
, _iSelfLink = Nothing
, _iName = Nothing
, _iCreationTimestamp = Nothing
, _iId = Nothing
, _iLicenses = Nothing
, _iSourceDisk = Nothing
, _iDescription = Nothing
, _iDeprecated = Nothing
} | 605 | image =
Image'
{ _iStatus = Nothing
, _iImageEncryptionKey = Nothing
, _iDiskSizeGb = Nothing
, _iSourceType = Raw
, _iSourceDiskId = Nothing
, _iKind = "compute#image"
, _iSourceDiskEncryptionKey = Nothing
, _iGuestOSFeatures = Nothing
, _iArchiveSizeBytes = Nothing
, _iFamily = Nothing
, _iRawDisk = Nothing
, _iSelfLink = Nothing
, _iName = Nothing
, _iCreationTimestamp = Nothing
, _iId = Nothing
, _iLicenses = Nothing
, _iSourceDisk = Nothing
, _iDescription = Nothing
, _iDeprecated = Nothing
} | 586 | true | true | 0 | 7 | 276 | 178 | 126 | 52 | null | null |
rueshyna/gogol | gogol-discovery/gen/Network/Google/Discovery/Types/Product.hs | mpl-2.0 | -- | MIME Media Ranges for acceptable media uploads to this method.
rmmuAccept :: Lens' RestMethodMediaUpload [Text]
rmmuAccept
= lens _rmmuAccept (\ s a -> s{_rmmuAccept = a}) .
_Default
. _Coerce | 211 | rmmuAccept :: Lens' RestMethodMediaUpload [Text]
rmmuAccept
= lens _rmmuAccept (\ s a -> s{_rmmuAccept = a}) .
_Default
. _Coerce | 143 | rmmuAccept
= lens _rmmuAccept (\ s a -> s{_rmmuAccept = a}) .
_Default
. _Coerce | 94 | true | true | 0 | 11 | 45 | 53 | 28 | 25 | null | null |
alexbaluta/courseography | app/Css/Constants.hs | gpl-3.0 | regionFontSize :: Num a => a
regionFontSize = 14 | 48 | regionFontSize :: Num a => a
regionFontSize = 14 | 48 | regionFontSize = 14 | 19 | false | true | 0 | 6 | 8 | 18 | 9 | 9 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/tests/UnitTests/Distribution/Utils/NubList.hs | bsd-3-clause | someIntList :: [Int]
-- This list must not have duplicate entries.
someIntList = [ 1, 3, 4, 2, 0, 7, 6, 5, 9, -1 ] | 114 | someIntList :: [Int]
someIntList = [ 1, 3, 4, 2, 0, 7, 6, 5, 9, -1 ] | 68 | someIntList = [ 1, 3, 4, 2, 0, 7, 6, 5, 9, -1 ] | 47 | true | true | 0 | 6 | 24 | 47 | 30 | 17 | null | null |
jwiegley/simple-conduit | Conduit/Simple/Core.hs | mit | rewrap :: Monad m => (a -> b) -> EitherT a m a -> EitherT b m b
rewrap f k = EitherT $ bimap f f `liftM` runEitherT k | 117 | rewrap :: Monad m => (a -> b) -> EitherT a m a -> EitherT b m b
rewrap f k = EitherT $ bimap f f `liftM` runEitherT k | 117 | rewrap f k = EitherT $ bimap f f `liftM` runEitherT k | 53 | false | true | 0 | 8 | 29 | 70 | 34 | 36 | null | null |
jspahrsummers/documentalist | Main/Main.hs | mit | main :: IO ()
main = do
sources <- getArgs
docs <- runClangParser $ mapM parse sources
let commented = map (parseDocs TomDocParser) docs
displayable <- mapM (traverse showErrors) commented
print displayable | 226 | main :: IO ()
main = do
sources <- getArgs
docs <- runClangParser $ mapM parse sources
let commented = map (parseDocs TomDocParser) docs
displayable <- mapM (traverse showErrors) commented
print displayable | 226 | main = do
sources <- getArgs
docs <- runClangParser $ mapM parse sources
let commented = map (parseDocs TomDocParser) docs
displayable <- mapM (traverse showErrors) commented
print displayable | 212 | false | true | 0 | 12 | 51 | 83 | 37 | 46 | null | null |
stites/reinforce | reinforce-environments/src/Environments/CartPole.hs | bsd-3-clause | -- | Angle at which to fail the episode
thetaThresholdRadians :: Float
thetaThresholdRadians = 12 * 2 * pi / 360 | 112 | thetaThresholdRadians :: Float
thetaThresholdRadians = 12 * 2 * pi / 360 | 72 | thetaThresholdRadians = 12 * 2 * pi / 360 | 41 | true | true | 0 | 7 | 20 | 24 | 13 | 11 | null | null |
krgn/hamdrill | src/Network/API/Mandrill/Exports.hs | mit | -- | Begins an export of your rejection blacklist. The blacklist will be
-- exported to a zip archive containing a single file named rejects.csv that
-- includes the following fields: email, reason, detail, created_at,
-- expires_at, last_event_at, expires_at.
rejects :: (MonadIO m) =>
Email ->
MandrillT m (Either ApiError Export)
rejects e = performRequest "/exports/rejects.json" [ "notify_email" .= e ] | 432 | rejects :: (MonadIO m) =>
Email ->
MandrillT m (Either ApiError Export)
rejects e = performRequest "/exports/rejects.json" [ "notify_email" .= e ] | 168 | rejects e = performRequest "/exports/rejects.json" [ "notify_email" .= e ] | 74 | true | true | 0 | 9 | 85 | 56 | 30 | 26 | null | null |
fffej/sql-server-gen | src/Database/SqlServer/Create/DataType.hs | bsd-2-clause | rowGuidOptions :: Type -> Bool
rowGuidOptions (UniqueIdentifier a) = maybe False isRowGuidCol a | 95 | rowGuidOptions :: Type -> Bool
rowGuidOptions (UniqueIdentifier a) = maybe False isRowGuidCol a | 95 | rowGuidOptions (UniqueIdentifier a) = maybe False isRowGuidCol a | 64 | false | true | 0 | 7 | 12 | 31 | 15 | 16 | null | null |
beni55/haste-compiler | libraries/ghc-7.10/base/GHC/Event/IntTable.hs | bsd-3-clause | -- | Remove the given key from the table and return its associated value.
delete :: Int -> IntTable a -> IO (Maybe a)
delete k t = updateWith (const Nothing) k t | 161 | delete :: Int -> IntTable a -> IO (Maybe a)
delete k t = updateWith (const Nothing) k t | 87 | delete k t = updateWith (const Nothing) k t | 43 | true | true | 0 | 9 | 32 | 50 | 24 | 26 | null | null |
alexander-at-github/eta | compiler/ETA/TypeCheck/TcGenGenerics.hs | bsd-3-clause | genLR_E :: Int -> Int -> LHsExpr RdrName -> LHsExpr RdrName
genLR_E i n e
| n == 0 = error "impossible"
| n == 1 = e
| i <= div n 2 = nlHsVar l1DataCon_RDR `nlHsApp` genLR_E i (div n 2) e
| otherwise = nlHsVar r1DataCon_RDR `nlHsApp` genLR_E (i-m) (n-m) e
where m = div n 2
--------------------------------------------------------------------------------
-- Dealing with products
--------------------------------------------------------------------------------
-- Build a product expression | 544 | genLR_E :: Int -> Int -> LHsExpr RdrName -> LHsExpr RdrName
genLR_E i n e
| n == 0 = error "impossible"
| n == 1 = e
| i <= div n 2 = nlHsVar l1DataCon_RDR `nlHsApp` genLR_E i (div n 2) e
| otherwise = nlHsVar r1DataCon_RDR `nlHsApp` genLR_E (i-m) (n-m) e
where m = div n 2
--------------------------------------------------------------------------------
-- Dealing with products
--------------------------------------------------------------------------------
-- Build a product expression | 544 | genLR_E i n e
| n == 0 = error "impossible"
| n == 1 = e
| i <= div n 2 = nlHsVar l1DataCon_RDR `nlHsApp` genLR_E i (div n 2) e
| otherwise = nlHsVar r1DataCon_RDR `nlHsApp` genLR_E (i-m) (n-m) e
where m = div n 2
--------------------------------------------------------------------------------
-- Dealing with products
--------------------------------------------------------------------------------
-- Build a product expression | 484 | false | true | 2 | 9 | 124 | 159 | 79 | 80 | null | null |
vdweegen/UvA-Software_Testing | Lab5/Final/Lecture5NRC.hs | gpl-3.0 | getRandomInt :: Int -> IO Int
getRandomInt n = getStdRandom (randomR (0,n)) | 75 | getRandomInt :: Int -> IO Int
getRandomInt n = getStdRandom (randomR (0,n)) | 75 | getRandomInt n = getStdRandom (randomR (0,n)) | 45 | false | true | 0 | 8 | 11 | 41 | 19 | 22 | null | null |
tonyday567/hdcharts | src/Chart/Types.hs | mit | -- type UC = forall a b . UpdateableChart a b
-- css
chartCss :: String -> Css
chartCss cl =
Css.body ? Css.element ("."<>Css.pack cl) ? do
Css.float Css.floatLeft
Css.border Css.solid (px 1) Css.grey
Css.margin
(px 10)
(px 10)
(px 10)
(px 10)
-- Css.clear Css.clearLeft
".axis path, .axis line" ? do
Css.fill Css.none
Css.stroke "#000"
Css.shapeRendering Css.crispEdges
".x.axis path" ?
Css.display Css.none
".tick text" ?
Css.fontSize (px 8)
-- chart creation | 549 | chartCss :: String -> Css
chartCss cl =
Css.body ? Css.element ("."<>Css.pack cl) ? do
Css.float Css.floatLeft
Css.border Css.solid (px 1) Css.grey
Css.margin
(px 10)
(px 10)
(px 10)
(px 10)
-- Css.clear Css.clearLeft
".axis path, .axis line" ? do
Css.fill Css.none
Css.stroke "#000"
Css.shapeRendering Css.crispEdges
".x.axis path" ?
Css.display Css.none
".tick text" ?
Css.fontSize (px 8)
-- chart creation | 494 | chartCss cl =
Css.body ? Css.element ("."<>Css.pack cl) ? do
Css.float Css.floatLeft
Css.border Css.solid (px 1) Css.grey
Css.margin
(px 10)
(px 10)
(px 10)
(px 10)
-- Css.clear Css.clearLeft
".axis path, .axis line" ? do
Css.fill Css.none
Css.stroke "#000"
Css.shapeRendering Css.crispEdges
".x.axis path" ?
Css.display Css.none
".tick text" ?
Css.fontSize (px 8)
-- chart creation | 468 | true | true | 0 | 12 | 160 | 186 | 86 | 100 | null | null |
maxwellsayles/disjoint-set | Data/IntDisjointSet.hs | bsd-3-clause | -- Find the set representative.
-- This traverses parents until the parent of y == y and returns y.
find :: Int -> IntDisjointSet -> Maybe Int
find !x (IntDisjointSet p _) =
do x' <- IntMap.lookup x p
return $! if x == x' then x' else find' x'
where find' y = let y' = p IntMap.! y
in if y == y' then y' else find' y'
-- Given a start node and its representative, compress
-- the path to the root. | 426 | find :: Int -> IntDisjointSet -> Maybe Int
find !x (IntDisjointSet p _) =
do x' <- IntMap.lookup x p
return $! if x == x' then x' else find' x'
where find' y = let y' = p IntMap.! y
in if y == y' then y' else find' y'
-- Given a start node and its representative, compress
-- the path to the root. | 326 | find !x (IntDisjointSet p _) =
do x' <- IntMap.lookup x p
return $! if x == x' then x' else find' x'
where find' y = let y' = p IntMap.! y
in if y == y' then y' else find' y'
-- Given a start node and its representative, compress
-- the path to the root. | 283 | true | true | 0 | 9 | 113 | 118 | 59 | 59 | null | null |
zaxtax/hakaru | haskell/Tests/Distribution.hs | bsd-3-clause | laplaceTest = do
mu <- QM.pick arbitrary
sd <- QM.pick $ choose (1, 10)
g <- QM.run $ MWC.create
let nsamples = floor (1000 * sd) -- larger standard deviations need more samples
-- to be shown as correct
samples <- QM.run $ replicateM nsamples $ distSample (laplace mu sd) g
let (mean, variance) = meanVariance (map fromLebesgue samples)
QM.assert $ (almostEqual tol mean mu ) &&
(almostEqual tol variance (var sd))
where tol = 1e-1
var sd = 2*(sq sd) | 531 | laplaceTest = do
mu <- QM.pick arbitrary
sd <- QM.pick $ choose (1, 10)
g <- QM.run $ MWC.create
let nsamples = floor (1000 * sd) -- larger standard deviations need more samples
-- to be shown as correct
samples <- QM.run $ replicateM nsamples $ distSample (laplace mu sd) g
let (mean, variance) = meanVariance (map fromLebesgue samples)
QM.assert $ (almostEqual tol mean mu ) &&
(almostEqual tol variance (var sd))
where tol = 1e-1
var sd = 2*(sq sd) | 531 | laplaceTest = do
mu <- QM.pick arbitrary
sd <- QM.pick $ choose (1, 10)
g <- QM.run $ MWC.create
let nsamples = floor (1000 * sd) -- larger standard deviations need more samples
-- to be shown as correct
samples <- QM.run $ replicateM nsamples $ distSample (laplace mu sd) g
let (mean, variance) = meanVariance (map fromLebesgue samples)
QM.assert $ (almostEqual tol mean mu ) &&
(almostEqual tol variance (var sd))
where tol = 1e-1
var sd = 2*(sq sd) | 531 | false | false | 1 | 12 | 160 | 203 | 97 | 106 | null | null |
brendanhay/gogol | gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Systemapks/Variants/List.hs | mpl-2.0 | -- | V1 error format.
svlXgafv :: Lens' SystemapksVariantsList (Maybe Xgafv)
svlXgafv = lens _svlXgafv (\ s a -> s{_svlXgafv = a}) | 130 | svlXgafv :: Lens' SystemapksVariantsList (Maybe Xgafv)
svlXgafv = lens _svlXgafv (\ s a -> s{_svlXgafv = a}) | 108 | svlXgafv = lens _svlXgafv (\ s a -> s{_svlXgafv = a}) | 53 | true | true | 1 | 9 | 21 | 51 | 25 | 26 | null | null |
konn/objc-messaging | src/Messaging/Core.hs | bsd-3-clause | (===) :: Object t -> Object t1 -> Bool
Object fptr === Object fptr' = fptr == fptr' | 83 | (===) :: Object t -> Object t1 -> Bool
Object fptr === Object fptr' = fptr == fptr' | 83 | Object fptr === Object fptr' = fptr == fptr' | 44 | false | true | 0 | 7 | 17 | 47 | 21 | 26 | null | null |
bartoszw/haslo | Haslo/FinancingConfiguration.hs | bsd-3-clause | paramEx2 = Param (IPP Monthly Truncated) finTypeEx2 | 51 | paramEx2 = Param (IPP Monthly Truncated) finTypeEx2 | 51 | paramEx2 = Param (IPP Monthly Truncated) finTypeEx2 | 51 | false | false | 0 | 7 | 6 | 19 | 9 | 10 | null | null |
soenkehahn/cabal-macosx | Distribution/MacOSX.hs | bsd-3-clause | makeAppBundle ::
LocalBuildInfo -> MacApp -> IO ()
makeAppBundle localb app =
do appPath <- createAppDir localb app
maybeCopyPlist appPath app
maybeCopyIcon appPath app
`catch` \err -> putStrLn ("Warning: could not set up icon for " ++
appName app ++ ": " ++ show err)
includeResources appPath app
includeDependencies appPath app
osxIncantations appPath app
-- | Create application bundle directory structure in build directory
-- and copy executable into it. Returns path to newly created
-- directory. | 574 | makeAppBundle ::
LocalBuildInfo -> MacApp -> IO ()
makeAppBundle localb app =
do appPath <- createAppDir localb app
maybeCopyPlist appPath app
maybeCopyIcon appPath app
`catch` \err -> putStrLn ("Warning: could not set up icon for " ++
appName app ++ ": " ++ show err)
includeResources appPath app
includeDependencies appPath app
osxIncantations appPath app
-- | Create application bundle directory structure in build directory
-- and copy executable into it. Returns path to newly created
-- directory. | 574 | makeAppBundle localb app =
do appPath <- createAppDir localb app
maybeCopyPlist appPath app
maybeCopyIcon appPath app
`catch` \err -> putStrLn ("Warning: could not set up icon for " ++
appName app ++ ": " ++ show err)
includeResources appPath app
includeDependencies appPath app
osxIncantations appPath app
-- | Create application bundle directory structure in build directory
-- and copy executable into it. Returns path to newly created
-- directory. | 521 | false | true | 0 | 14 | 147 | 119 | 55 | 64 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/HaXml/src/Text/XML/HaXml/Html/ParseLazy.hs | bsd-3-clause | encodingdecl :: HParser EncodingDecl
encodingdecl = do
(word "encoding" `onFail` word "ENCODING")
tok TokEqual `onFail` failBadP "expected = in 'encoding' decl"
f <- bracket (tok TokQuote) (tok TokQuote) freetext
return (EncodingDecl f)
--notationdecl :: HParser NotationDecl
--notationdecl = do
-- tok TokSpecialOpen
-- word "NOTATION"
-- n <- name
-- e <- either externalid publicid
-- tok TokAnyClose `onFail` failP "expected > terminating NOTATION decl"
-- return (NOTATION n e) | 517 | encodingdecl :: HParser EncodingDecl
encodingdecl = do
(word "encoding" `onFail` word "ENCODING")
tok TokEqual `onFail` failBadP "expected = in 'encoding' decl"
f <- bracket (tok TokQuote) (tok TokQuote) freetext
return (EncodingDecl f)
--notationdecl :: HParser NotationDecl
--notationdecl = do
-- tok TokSpecialOpen
-- word "NOTATION"
-- n <- name
-- e <- either externalid publicid
-- tok TokAnyClose `onFail` failP "expected > terminating NOTATION decl"
-- return (NOTATION n e) | 517 | encodingdecl = do
(word "encoding" `onFail` word "ENCODING")
tok TokEqual `onFail` failBadP "expected = in 'encoding' decl"
f <- bracket (tok TokQuote) (tok TokQuote) freetext
return (EncodingDecl f)
--notationdecl :: HParser NotationDecl
--notationdecl = do
-- tok TokSpecialOpen
-- word "NOTATION"
-- n <- name
-- e <- either externalid publicid
-- tok TokAnyClose `onFail` failP "expected > terminating NOTATION decl"
-- return (NOTATION n e) | 480 | false | true | 0 | 10 | 104 | 93 | 48 | 45 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/GuardDutyFilterCondition.hs | mit | guardDutyFilterCondition
:: GuardDutyFilterCondition
guardDutyFilterCondition =
GuardDutyFilterCondition
{ _guardDutyFilterConditionEq = Nothing
, _guardDutyFilterConditionGte = Nothing
, _guardDutyFilterConditionLt = Nothing
, _guardDutyFilterConditionLte = Nothing
, _guardDutyFilterConditionNeq = Nothing
} | 326 | guardDutyFilterCondition
:: GuardDutyFilterCondition
guardDutyFilterCondition =
GuardDutyFilterCondition
{ _guardDutyFilterConditionEq = Nothing
, _guardDutyFilterConditionGte = Nothing
, _guardDutyFilterConditionLt = Nothing
, _guardDutyFilterConditionLte = Nothing
, _guardDutyFilterConditionNeq = Nothing
} | 326 | guardDutyFilterCondition =
GuardDutyFilterCondition
{ _guardDutyFilterConditionEq = Nothing
, _guardDutyFilterConditionGte = Nothing
, _guardDutyFilterConditionLt = Nothing
, _guardDutyFilterConditionLte = Nothing
, _guardDutyFilterConditionNeq = Nothing
} | 271 | false | true | 1 | 7 | 43 | 50 | 28 | 22 | null | null |
lostbean/neo4j-conduit | src/Database/CouchDB/Conduit/View.hs | bsd-2-clause | couchViewPost :: (MonadCouch m, A.ToJSON a) =>
Path -- ^ Database
-> Path -- ^ Design document
-> Path -- ^ View name
-> HT.Query -- ^ Query parameters
-> a -- ^ View @keys@. Must be list or cortege.
-> m (Source m A.Object)
couchViewPost db design view q ks = do
H.Response _ _ _ bsrc <- couch HT.methodPost
(viewPath db design view)
[]
q
(H.RequestBodyLBS mkPost) protect'
bsrc $$+- conduitRows
where
mkPost = A.encode $ A.object ["keys" A..= ks]
-- | Brain-free version of 'couchViewPost'. Takes 'Sink' to consume response. | 721 | couchViewPost :: (MonadCouch m, A.ToJSON a) =>
Path -- ^ Database
-> Path -- ^ Design document
-> Path -- ^ View name
-> HT.Query -- ^ Query parameters
-> a -- ^ View @keys@. Must be list or cortege.
-> m (Source m A.Object)
couchViewPost db design view q ks = do
H.Response _ _ _ bsrc <- couch HT.methodPost
(viewPath db design view)
[]
q
(H.RequestBodyLBS mkPost) protect'
bsrc $$+- conduitRows
where
mkPost = A.encode $ A.object ["keys" A..= ks]
-- | Brain-free version of 'couchViewPost'. Takes 'Sink' to consume response. | 716 | couchViewPost db design view q ks = do
H.Response _ _ _ bsrc <- couch HT.methodPost
(viewPath db design view)
[]
q
(H.RequestBodyLBS mkPost) protect'
bsrc $$+- conduitRows
where
mkPost = A.encode $ A.object ["keys" A..= ks]
-- | Brain-free version of 'couchViewPost'. Takes 'Sink' to consume response. | 379 | false | true | 0 | 14 | 287 | 168 | 85 | 83 | null | null |
prb/perpubplat | testsrc/UtilitiesTests.hs | bsd-3-clause | testPaginate = test [
-- empty list
"empty list paginates to empty list" ~: (U.paginate 20 10 ([]::[Int])) ~?= ([]::[Int])
-- spot testing
, "first 10-item page of [1..500]" ~: (U.paginate 10 1 [1..500]) ~?= [1..10]
, "10th 10-item page of [1..500]" ~: (U.paginate 10 10 [1..500]) ~?= [91..100]
-- pages hanging over the end
, "second 3-item page of [1,2,3,4,5]" ~: (U.paginate 3 2 [1,2,3,4,5]) ~?= [4,5]
, "third 3-item page of [1,2,3,4,5]" ~: (U.paginate 3 3 [1,2,3,4,5]) ~?= [4,5]
-- first page not full
, "first 3-item page of [1,2]" ~: (U.paginate 3 1 [1,2]) ~?= [1,2] ] | 736 | testPaginate = test [
-- empty list
"empty list paginates to empty list" ~: (U.paginate 20 10 ([]::[Int])) ~?= ([]::[Int])
-- spot testing
, "first 10-item page of [1..500]" ~: (U.paginate 10 1 [1..500]) ~?= [1..10]
, "10th 10-item page of [1..500]" ~: (U.paginate 10 10 [1..500]) ~?= [91..100]
-- pages hanging over the end
, "second 3-item page of [1,2,3,4,5]" ~: (U.paginate 3 2 [1,2,3,4,5]) ~?= [4,5]
, "third 3-item page of [1,2,3,4,5]" ~: (U.paginate 3 3 [1,2,3,4,5]) ~?= [4,5]
-- first page not full
, "first 3-item page of [1,2]" ~: (U.paginate 3 1 [1,2]) ~?= [1,2] ] | 736 | testPaginate = test [
-- empty list
"empty list paginates to empty list" ~: (U.paginate 20 10 ([]::[Int])) ~?= ([]::[Int])
-- spot testing
, "first 10-item page of [1..500]" ~: (U.paginate 10 1 [1..500]) ~?= [1..10]
, "10th 10-item page of [1..500]" ~: (U.paginate 10 10 [1..500]) ~?= [91..100]
-- pages hanging over the end
, "second 3-item page of [1,2,3,4,5]" ~: (U.paginate 3 2 [1,2,3,4,5]) ~?= [4,5]
, "third 3-item page of [1,2,3,4,5]" ~: (U.paginate 3 3 [1,2,3,4,5]) ~?= [4,5]
-- first page not full
, "first 3-item page of [1,2]" ~: (U.paginate 3 1 [1,2]) ~?= [1,2] ] | 736 | false | false | 0 | 12 | 260 | 247 | 142 | 105 | null | null |
futtetennista/IntroductionToFunctionalProgramming | itfp/src/Chapter4.hs | mit | -- 4.4.1
left :: Command
left (d, pen, point) =
((d - 1) `mod` 4, pen, point) | 79 | left :: Command
left (d, pen, point) =
((d - 1) `mod` 4, pen, point) | 70 | left (d, pen, point) =
((d - 1) `mod` 4, pen, point) | 54 | true | true | 0 | 8 | 18 | 46 | 28 | 18 | null | null |
ambiata/jetski | src/Jetski/Foreign/Argument.hs | bsd-3-clause | argWord8 :: Word8 -> Argument
argWord8 =
storableArgument ffi_type_uint8 | 74 | argWord8 :: Word8 -> Argument
argWord8 =
storableArgument ffi_type_uint8 | 74 | argWord8 =
storableArgument ffi_type_uint8 | 44 | false | true | 0 | 5 | 10 | 18 | 9 | 9 | null | null |
ekmett/hmpfr | src/Data/Number/MPFR/Special.hs | bsd-3-clause | j1_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
j1_ r p d = withMPFR r p d mpfr_j1 | 93 | j1_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
j1_ r p d = withMPFR r p d mpfr_j1 | 93 | j1_ r p d = withMPFR r p d mpfr_j1 | 34 | false | true | 0 | 8 | 25 | 46 | 23 | 23 | null | null |
fmapfmapfmap/amazonka | amazonka-storagegateway/gen/Network/AWS/StorageGateway/ListVolumeRecoveryPoints.hs | mpl-2.0 | -- | Creates a value of 'ListVolumeRecoveryPoints' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lvrpGatewayARN'
listVolumeRecoveryPoints
:: Text -- ^ 'lvrpGatewayARN'
-> ListVolumeRecoveryPoints
listVolumeRecoveryPoints pGatewayARN_ =
ListVolumeRecoveryPoints'
{ _lvrpGatewayARN = pGatewayARN_
} | 404 | listVolumeRecoveryPoints
:: Text -- ^ 'lvrpGatewayARN'
-> ListVolumeRecoveryPoints
listVolumeRecoveryPoints pGatewayARN_ =
ListVolumeRecoveryPoints'
{ _lvrpGatewayARN = pGatewayARN_
} | 203 | listVolumeRecoveryPoints pGatewayARN_ =
ListVolumeRecoveryPoints'
{ _lvrpGatewayARN = pGatewayARN_
} | 112 | true | true | 0 | 7 | 70 | 41 | 22 | 19 | null | null |
cnc-patch/disass | src/Language/Assembly/X86/Parse.hs | bsd-3-clause | parsePINSRW :: (Stream s m Word8, Monad m) => Word8 -> ParsecT s PState m Instr
parsePINSRW = parseUnimplemented | 112 | parsePINSRW :: (Stream s m Word8, Monad m) => Word8 -> ParsecT s PState m Instr
parsePINSRW = parseUnimplemented | 112 | parsePINSRW = parseUnimplemented | 32 | false | true | 0 | 7 | 18 | 43 | 22 | 21 | null | null |
ciderpunx/57-exercises-for-programmers | test/P19BMISpec.hs | gpl-3.0 | main :: IO ()
main = hspec spec | 31 | main :: IO ()
main = hspec spec | 31 | main = hspec spec | 17 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
WraithM/fingmodules | src/Language/Lambda/Lexer.hs | bsd-3-clause | angles = P.angles lexer | 27 | angles = P.angles lexer | 27 | angles = P.angles lexer | 27 | false | false | 1 | 6 | 7 | 14 | 5 | 9 | null | null |
ndmitchell/tagsoup | test/TagSoup/Generate/Type.hs | bsd-3-clause | fromRedex (RLit x) = ELit x | 27 | fromRedex (RLit x) = ELit x | 27 | fromRedex (RLit x) = ELit x | 27 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
sopvop/snap-core | src/Snap/Internal/Parsing.hs | bsd-3-clause | finish x = x | 22 | finish x = x | 22 | finish x = x | 22 | false | false | 0 | 5 | 13 | 9 | 4 | 5 | null | null |
ml9951/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | gHC_CONC = mkBaseModule (fsLit "GHC.Conc") | 49 | gHC_CONC = mkBaseModule (fsLit "GHC.Conc") | 49 | gHC_CONC = mkBaseModule (fsLit "GHC.Conc") | 49 | false | false | 0 | 7 | 11 | 15 | 7 | 8 | null | null |
adamse/hindent | src/HIndent/Pretty.hs | bsd-3-clause | -- | Maybe render an overlap definition.
maybeOverlap :: MonadState (PrintState s) m => Maybe (Overlap NodeInfo) -> m ()
maybeOverlap =
maybe (return ())
(\p ->
pretty p >>
space) | 211 | maybeOverlap :: MonadState (PrintState s) m => Maybe (Overlap NodeInfo) -> m ()
maybeOverlap =
maybe (return ())
(\p ->
pretty p >>
space) | 170 | maybeOverlap =
maybe (return ())
(\p ->
pretty p >>
space) | 90 | true | true | 0 | 9 | 62 | 73 | 36 | 37 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/book/2009-Real_World_Haskell/Logger.hs | unlicense | globToRegex' ('[':c:cs) =
record "character class" >>
charClass cs >>= \ds ->
return ("[" ++ c : ds) | 112 | globToRegex' ('[':c:cs) =
record "character class" >>
charClass cs >>= \ds ->
return ("[" ++ c : ds) | 112 | globToRegex' ('[':c:cs) =
record "character class" >>
charClass cs >>= \ds ->
return ("[" ++ c : ds) | 112 | false | false | 0 | 10 | 29 | 53 | 26 | 27 | null | null |
mstksg/hledger | hledger/Text/Tabular/AsciiWide.hs | gpl-3.0 | doubleHorizontalBar :: Bool -> Char
doubleHorizontalBar pretty = if pretty then '═' else '=' | 92 | doubleHorizontalBar :: Bool -> Char
doubleHorizontalBar pretty = if pretty then '═' else '=' | 92 | doubleHorizontalBar pretty = if pretty then '═' else '=' | 56 | false | true | 0 | 6 | 13 | 30 | 15 | 15 | null | null |
input-output-hk/pos-haskell-prototype | chain/src/Pos/Chain/Ssc/Base.hs | mit | ----------------------------------------------------------------------------
-- Verifications
----------------------------------------------------------------------------
-- CHECK: @verifyCommitment
-- | Verify some /basic/ things about 'Commitment' (like “whether it contains
-- any shares”).
--
-- * We don't check that the commitment is generated for proper set of
-- participants. This is done in 'checkCommitmentShares'.
--
-- * We also don't verify the shares, because that requires 'MonadRandom' and
-- we want to keep this check pure because it's performed in the 'Bi'
-- instance for blocks.
verifyCommitment :: Commitment -> Bool
verifyCommitment Commitment {..} = fromMaybe False $ do
-- The shares can be deserialized
mapM_ (rightToMaybe . fromBinary) (HM.keys commShares)
mapM_ (mapM_ (rightToMaybe . fromBinary)) (HM.elems commShares)
-- The commitment contains shares
pure $ not (null commShares)
-- CHECK: @verifyCommitmentSignature
-- | Verify signature in SignedCommitment using epoch index.
--
-- #checkSig | 1,053 | verifyCommitment :: Commitment -> Bool
verifyCommitment Commitment {..} = fromMaybe False $ do
-- The shares can be deserialized
mapM_ (rightToMaybe . fromBinary) (HM.keys commShares)
mapM_ (mapM_ (rightToMaybe . fromBinary)) (HM.elems commShares)
-- The commitment contains shares
pure $ not (null commShares)
-- CHECK: @verifyCommitmentSignature
-- | Verify signature in SignedCommitment using epoch index.
--
-- #checkSig | 445 | verifyCommitment Commitment {..} = fromMaybe False $ do
-- The shares can be deserialized
mapM_ (rightToMaybe . fromBinary) (HM.keys commShares)
mapM_ (mapM_ (rightToMaybe . fromBinary)) (HM.elems commShares)
-- The commitment contains shares
pure $ not (null commShares)
-- CHECK: @verifyCommitmentSignature
-- | Verify signature in SignedCommitment using epoch index.
--
-- #checkSig | 406 | true | true | 0 | 12 | 160 | 118 | 66 | 52 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.