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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
avh4/elm-format | elm-format-lib/src/Parse/String.hs | bsd-3-clause | -- SINGLE STRINGS
singleString :: Ptr Word8 -> Ptr Word8 -> Row -> Col -> Ptr Word8 -> [ES.Chunk] -> StringResult
singleString pos end row col initialPos revChunks =
if pos >= end then
Err row col E.StringEndless_Single
else
let
!word = P.unsafeIndex pos
in
if word == 0x22 {- " -} then
Ok (plusPtr pos 1) row (col + 1) $
finalize initialPos pos revChunks
else if word == 0x0A {- \n -} then
let !newPos = plusPtr pos 1 in
singleString newPos end (row + 1) 1 newPos $
addChunk newline initialPos pos revChunks
else if word == 0x0D {- \r -} && isNewline (plusPtr pos 1) end then
let !newPos = plusPtr pos 2 in
singleString newPos end (row + 1) 1 newPos $
addChunk newline initialPos pos revChunks
else if word == 0x5C {- \ -} then
case eatEscape (plusPtr pos 1) end row col of
EscapeNormal code ->
let !newPos = plusPtr pos 2 in
singleString newPos end row (col + 2) newPos $
addChunk (ES.AsciiChar code) initialPos pos revChunks
EscapeUnicode delta code ->
let !newPos = plusPtr pos delta in
singleString newPos end row (col + fromIntegral delta) newPos $
addChunk (ES.CodePoint code) initialPos pos revChunks
EscapeProblem r c x ->
Err r c (E.StringEscape x)
EscapeEndOfFile ->
Err row (col + 1) E.StringEndless_Single
else
let !newPos = plusPtr pos (P.getCharWidth word) in
singleString newPos end row (col + 1) initialPos revChunks | 1,629 | singleString :: Ptr Word8 -> Ptr Word8 -> Row -> Col -> Ptr Word8 -> [ES.Chunk] -> StringResult
singleString pos end row col initialPos revChunks =
if pos >= end then
Err row col E.StringEndless_Single
else
let
!word = P.unsafeIndex pos
in
if word == 0x22 {- " -} then
Ok (plusPtr pos 1) row (col + 1) $
finalize initialPos pos revChunks
else if word == 0x0A {- \n -} then
let !newPos = plusPtr pos 1 in
singleString newPos end (row + 1) 1 newPos $
addChunk newline initialPos pos revChunks
else if word == 0x0D {- \r -} && isNewline (plusPtr pos 1) end then
let !newPos = plusPtr pos 2 in
singleString newPos end (row + 1) 1 newPos $
addChunk newline initialPos pos revChunks
else if word == 0x5C {- \ -} then
case eatEscape (plusPtr pos 1) end row col of
EscapeNormal code ->
let !newPos = plusPtr pos 2 in
singleString newPos end row (col + 2) newPos $
addChunk (ES.AsciiChar code) initialPos pos revChunks
EscapeUnicode delta code ->
let !newPos = plusPtr pos delta in
singleString newPos end row (col + fromIntegral delta) newPos $
addChunk (ES.CodePoint code) initialPos pos revChunks
EscapeProblem r c x ->
Err r c (E.StringEscape x)
EscapeEndOfFile ->
Err row (col + 1) E.StringEndless_Single
else
let !newPos = plusPtr pos (P.getCharWidth word) in
singleString newPos end row (col + 1) initialPos revChunks | 1,609 | singleString pos end row col initialPos revChunks =
if pos >= end then
Err row col E.StringEndless_Single
else
let
!word = P.unsafeIndex pos
in
if word == 0x22 {- " -} then
Ok (plusPtr pos 1) row (col + 1) $
finalize initialPos pos revChunks
else if word == 0x0A {- \n -} then
let !newPos = plusPtr pos 1 in
singleString newPos end (row + 1) 1 newPos $
addChunk newline initialPos pos revChunks
else if word == 0x0D {- \r -} && isNewline (plusPtr pos 1) end then
let !newPos = plusPtr pos 2 in
singleString newPos end (row + 1) 1 newPos $
addChunk newline initialPos pos revChunks
else if word == 0x5C {- \ -} then
case eatEscape (plusPtr pos 1) end row col of
EscapeNormal code ->
let !newPos = plusPtr pos 2 in
singleString newPos end row (col + 2) newPos $
addChunk (ES.AsciiChar code) initialPos pos revChunks
EscapeUnicode delta code ->
let !newPos = plusPtr pos delta in
singleString newPos end row (col + fromIntegral delta) newPos $
addChunk (ES.CodePoint code) initialPos pos revChunks
EscapeProblem r c x ->
Err r c (E.StringEscape x)
EscapeEndOfFile ->
Err row (col + 1) E.StringEndless_Single
else
let !newPos = plusPtr pos (P.getCharWidth word) in
singleString newPos end row (col + 1) initialPos revChunks | 1,513 | true | true | 0 | 21 | 533 | 560 | 267 | 293 | null | null |
dysinger/amazonka | amazonka-s3/gen/Network/AWS/S3/GetObject.hs | mpl-2.0 | -- | Return the object only if its entity tag (ETag) is the same as the one
-- specified, otherwise return a 412 (precondition failed).
goIfMatch :: Lens' GetObject (Maybe Text)
goIfMatch = lens _goIfMatch (\s a -> s { _goIfMatch = a }) | 236 | goIfMatch :: Lens' GetObject (Maybe Text)
goIfMatch = lens _goIfMatch (\s a -> s { _goIfMatch = a }) | 100 | goIfMatch = lens _goIfMatch (\s a -> s { _goIfMatch = a }) | 58 | true | true | 0 | 9 | 43 | 47 | 26 | 21 | null | null |
jstolarek/ghc | compiler/main/DynFlags.hs | bsd-3-clause | dopt_set :: DynFlags -> DumpFlag -> DynFlags
dopt_set dfs f = dfs{ dumpFlags = IntSet.insert (fromEnum f) (dumpFlags dfs) } | 123 | dopt_set :: DynFlags -> DumpFlag -> DynFlags
dopt_set dfs f = dfs{ dumpFlags = IntSet.insert (fromEnum f) (dumpFlags dfs) } | 123 | dopt_set dfs f = dfs{ dumpFlags = IntSet.insert (fromEnum f) (dumpFlags dfs) } | 78 | false | true | 0 | 10 | 19 | 56 | 27 | 29 | null | null |
mgsloan/compconfig | env/kinesis/generate.hs | mit | main :: IO ()
main = shelly $ do
writefile layout $ T.unlines
-- Tilde in top right corner, next to number keys, like on most
-- keyboards.
[ "[=]>[`]"
-- Escape key is to the left on the home row - nice for vim-ey
-- bindings.
, "[caps]>[escape]"
-- Brackets on either sides, under the pinkies.
, "[lshift]>[obrack]", "[rshift]>[cbrack]"
-- Arrow keys are similar to the hjkl layout, but shifted one
-- over. Not sure how I got used to that, but I did.
, "[up]>[left]"
, "[obrack]>[up]"
, "[cbrack]>[right]"
-- Bottom row of keys for left hand has finger rolls for `<-`,
-- `->`, `<->`. Naturally, for typing Haskell code. `=` is also
-- on this row for niceness of typing `=>`, `<=`, `>=`, `>>=`,
-- etc. This also works nicely because it means `+` and `-` are
-- near-ish eachother.
, "[`]>[=]"
, "[left]>[hyphen]"
, "{right}>{speed9}{-rshift}{.}{+rshift}"
-- Since the default location for `=` got bound to backtick, need
-- a place to put `=`. Since hyphen is available on middle finger
-- of right hand, we can use it's position, so effectively the `=`
-- key is still in a corner, just on the opposite side.
, "[hyphen]>[=]"
-- Left thumb keys
--
-- NOTE: The usage of "calc" here gets remapped by my xkb config
-- to be the hyper modifier key.
--
-- NOTE: In most applications, "menu" brings up
-- right-click. However, in my emacs configuration, it enters into
-- a mode for quickly moving the cursor (avy jump).
--
-- \----/ \----/
-- |hype| |alt |
-- /----\ /----\
--
-- \----/ \----/ \----/
-- |bksp| |lshi| |ctrl|
-- | | |ft | /----\
-- | | | |
-- | | | | \----/
-- | | | | |menu|
-- /----\ /----\ /----\
--
-- (backspace is in its default location)
-- (left alt is in its default location)
, "[lctrl]>[calc]"
, "[delete]>[lshift]"
, "[home]>[lctrl]"
, "[end]>[menu]"
-- Right thumb keys
--
-- \----/ \----/
-- |alt | |win |
-- /----\ /----\
--
-- \----/ \----/ \----/
-- |ctrl| |rshi| |spac|
-- /----\ |ft | |e |
-- | | | |
-- \----/ | | | |
-- |entr| | | | |
-- /----\ /----\ /----\
--
, "[rwin]>[lalt]"
, "[rctrl]>[rwin]"
, "[pup]>[rctrl]"
, "[enter]>[rshift]"
-- (space is in its default location)
, "[pdown]>[enter]"
-- Actions that don't have keys, since I don't seem to use them:
-- `[delete]`, `[pup]`, `[pdown]`.
-- Keys not yet remapped (redundant):
--
-- , "[hyphen]>"
]
-- Copy over old layout
let destination = kinesisMount </> ("active" :: FilePath)
rm_f (destination </> layout)
cp layout destination
liftIO $ putStrLn $ "keymap copied to " ++ show destination | 2,897 | main :: IO ()
main = shelly $ do
writefile layout $ T.unlines
-- Tilde in top right corner, next to number keys, like on most
-- keyboards.
[ "[=]>[`]"
-- Escape key is to the left on the home row - nice for vim-ey
-- bindings.
, "[caps]>[escape]"
-- Brackets on either sides, under the pinkies.
, "[lshift]>[obrack]", "[rshift]>[cbrack]"
-- Arrow keys are similar to the hjkl layout, but shifted one
-- over. Not sure how I got used to that, but I did.
, "[up]>[left]"
, "[obrack]>[up]"
, "[cbrack]>[right]"
-- Bottom row of keys for left hand has finger rolls for `<-`,
-- `->`, `<->`. Naturally, for typing Haskell code. `=` is also
-- on this row for niceness of typing `=>`, `<=`, `>=`, `>>=`,
-- etc. This also works nicely because it means `+` and `-` are
-- near-ish eachother.
, "[`]>[=]"
, "[left]>[hyphen]"
, "{right}>{speed9}{-rshift}{.}{+rshift}"
-- Since the default location for `=` got bound to backtick, need
-- a place to put `=`. Since hyphen is available on middle finger
-- of right hand, we can use it's position, so effectively the `=`
-- key is still in a corner, just on the opposite side.
, "[hyphen]>[=]"
-- Left thumb keys
--
-- NOTE: The usage of "calc" here gets remapped by my xkb config
-- to be the hyper modifier key.
--
-- NOTE: In most applications, "menu" brings up
-- right-click. However, in my emacs configuration, it enters into
-- a mode for quickly moving the cursor (avy jump).
--
-- \----/ \----/
-- |hype| |alt |
-- /----\ /----\
--
-- \----/ \----/ \----/
-- |bksp| |lshi| |ctrl|
-- | | |ft | /----\
-- | | | |
-- | | | | \----/
-- | | | | |menu|
-- /----\ /----\ /----\
--
-- (backspace is in its default location)
-- (left alt is in its default location)
, "[lctrl]>[calc]"
, "[delete]>[lshift]"
, "[home]>[lctrl]"
, "[end]>[menu]"
-- Right thumb keys
--
-- \----/ \----/
-- |alt | |win |
-- /----\ /----\
--
-- \----/ \----/ \----/
-- |ctrl| |rshi| |spac|
-- /----\ |ft | |e |
-- | | | |
-- \----/ | | | |
-- |entr| | | | |
-- /----\ /----\ /----\
--
, "[rwin]>[lalt]"
, "[rctrl]>[rwin]"
, "[pup]>[rctrl]"
, "[enter]>[rshift]"
-- (space is in its default location)
, "[pdown]>[enter]"
-- Actions that don't have keys, since I don't seem to use them:
-- `[delete]`, `[pup]`, `[pdown]`.
-- Keys not yet remapped (redundant):
--
-- , "[hyphen]>"
]
-- Copy over old layout
let destination = kinesisMount </> ("active" :: FilePath)
rm_f (destination </> layout)
cp layout destination
liftIO $ putStrLn $ "keymap copied to " ++ show destination | 2,897 | main = shelly $ do
writefile layout $ T.unlines
-- Tilde in top right corner, next to number keys, like on most
-- keyboards.
[ "[=]>[`]"
-- Escape key is to the left on the home row - nice for vim-ey
-- bindings.
, "[caps]>[escape]"
-- Brackets on either sides, under the pinkies.
, "[lshift]>[obrack]", "[rshift]>[cbrack]"
-- Arrow keys are similar to the hjkl layout, but shifted one
-- over. Not sure how I got used to that, but I did.
, "[up]>[left]"
, "[obrack]>[up]"
, "[cbrack]>[right]"
-- Bottom row of keys for left hand has finger rolls for `<-`,
-- `->`, `<->`. Naturally, for typing Haskell code. `=` is also
-- on this row for niceness of typing `=>`, `<=`, `>=`, `>>=`,
-- etc. This also works nicely because it means `+` and `-` are
-- near-ish eachother.
, "[`]>[=]"
, "[left]>[hyphen]"
, "{right}>{speed9}{-rshift}{.}{+rshift}"
-- Since the default location for `=` got bound to backtick, need
-- a place to put `=`. Since hyphen is available on middle finger
-- of right hand, we can use it's position, so effectively the `=`
-- key is still in a corner, just on the opposite side.
, "[hyphen]>[=]"
-- Left thumb keys
--
-- NOTE: The usage of "calc" here gets remapped by my xkb config
-- to be the hyper modifier key.
--
-- NOTE: In most applications, "menu" brings up
-- right-click. However, in my emacs configuration, it enters into
-- a mode for quickly moving the cursor (avy jump).
--
-- \----/ \----/
-- |hype| |alt |
-- /----\ /----\
--
-- \----/ \----/ \----/
-- |bksp| |lshi| |ctrl|
-- | | |ft | /----\
-- | | | |
-- | | | | \----/
-- | | | | |menu|
-- /----\ /----\ /----\
--
-- (backspace is in its default location)
-- (left alt is in its default location)
, "[lctrl]>[calc]"
, "[delete]>[lshift]"
, "[home]>[lctrl]"
, "[end]>[menu]"
-- Right thumb keys
--
-- \----/ \----/
-- |alt | |win |
-- /----\ /----\
--
-- \----/ \----/ \----/
-- |ctrl| |rshi| |spac|
-- /----\ |ft | |e |
-- | | | |
-- \----/ | | | |
-- |entr| | | | |
-- /----\ /----\ /----\
--
, "[rwin]>[lalt]"
, "[rctrl]>[rwin]"
, "[pup]>[rctrl]"
, "[enter]>[rshift]"
-- (space is in its default location)
, "[pdown]>[enter]"
-- Actions that don't have keys, since I don't seem to use them:
-- `[delete]`, `[pup]`, `[pdown]`.
-- Keys not yet remapped (redundant):
--
-- , "[hyphen]>"
]
-- Copy over old layout
let destination = kinesisMount </> ("active" :: FilePath)
rm_f (destination </> layout)
cp layout destination
liftIO $ putStrLn $ "keymap copied to " ++ show destination | 2,883 | false | true | 2 | 12 | 863 | 220 | 144 | 76 | null | null |
gridaphobe/liquid-fixpoint | src/Language/Fixpoint/SortCheck.hs | bsd-3-clause | errUnexpectedPred p = printf "Sort Checking: Unexpected Predicate %s" (showpp p) | 81 | errUnexpectedPred p = printf "Sort Checking: Unexpected Predicate %s" (showpp p) | 81 | errUnexpectedPred p = printf "Sort Checking: Unexpected Predicate %s" (showpp p) | 81 | false | false | 1 | 7 | 11 | 23 | 9 | 14 | null | null |
OS2World/DEV-UTIL-HUGS | oldlib/CollectionDefaults.hs | bsd-3-clause | subsetEqOnOrdLists [] _ = True | 30 | subsetEqOnOrdLists [] _ = True | 30 | subsetEqOnOrdLists [] _ = True | 30 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
benekastah/ebitor | src/Ebitor/Server.hs | bsd-3-clause | normalMode [EvKey (KChar 'w') [MCtrl], EvKey key []]
| key == KChar 'h' || key == KBS = \s ->
returnClear $ s { editors = W.focusPrev (editors s) } | 159 | normalMode [EvKey (KChar 'w') [MCtrl], EvKey key []]
| key == KChar 'h' || key == KBS = \s ->
returnClear $ s { editors = W.focusPrev (editors s) } | 159 | normalMode [EvKey (KChar 'w') [MCtrl], EvKey key []]
| key == KChar 'h' || key == KBS = \s ->
returnClear $ s { editors = W.focusPrev (editors s) } | 159 | false | false | 0 | 12 | 41 | 86 | 42 | 44 | null | null |
jcristovao/transfomers-convert | src/Control/Monad/Trans/Convert.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- Maybe ---------------------------------------------------------------------
------------------------------------------------------------------------------
-- | Lift a 'Maybe' to the 'MaybeT' monad
-- Shamelessly copied from "Control.Error.Util"
hoistMaybe :: (Monad m) => Maybe b -> MaybeT m b
hoistMaybe = MaybeT . return | 405 | hoistMaybe :: (Monad m) => Maybe b -> MaybeT m b
hoistMaybe = MaybeT . return | 77 | hoistMaybe = MaybeT . return | 28 | true | true | 0 | 8 | 35 | 47 | 24 | 23 | null | null |
brendanhay/gogol | gogol-books/gen/Network/Google/Books/Types/Product.hs | mpl-2.0 | -- | Number of volumes in this bookshelf.
bVolumeCount :: Lens' Bookshelf (Maybe Int32)
bVolumeCount
= lens _bVolumeCount (\ s a -> s{_bVolumeCount = a})
. mapping _Coerce | 179 | bVolumeCount :: Lens' Bookshelf (Maybe Int32)
bVolumeCount
= lens _bVolumeCount (\ s a -> s{_bVolumeCount = a})
. mapping _Coerce | 137 | bVolumeCount
= lens _bVolumeCount (\ s a -> s{_bVolumeCount = a})
. mapping _Coerce | 91 | true | true | 1 | 9 | 35 | 56 | 28 | 28 | null | null |
spacekitteh/smcghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | getOperand_generic :: CmmExpr -> NatM (Operand, InstrBlock)
getOperand_generic e = do
(reg, code) <- getSomeReg e
return (OpReg reg, code) | 146 | getOperand_generic :: CmmExpr -> NatM (Operand, InstrBlock)
getOperand_generic e = do
(reg, code) <- getSomeReg e
return (OpReg reg, code) | 146 | getOperand_generic e = do
(reg, code) <- getSomeReg e
return (OpReg reg, code) | 86 | false | true | 0 | 10 | 27 | 63 | 30 | 33 | null | null |
choener/BiobaseBlast | Biobase/BLAST/Import.hs | gpl-3.0 | toLB :: C.ByteString -> B.ByteString
toLB = S.toLazyByteString . S.byteString | 77 | toLB :: C.ByteString -> B.ByteString
toLB = S.toLazyByteString . S.byteString | 77 | toLB = S.toLazyByteString . S.byteString | 40 | false | true | 0 | 6 | 9 | 27 | 14 | 13 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Resource/Compute/TargetPools/List.hs | mpl-2.0 | -- | Sorts list results by a certain order. By default, results are returned
-- in alphanumerical order based on the resource name. You can also sort
-- results in descending order based on the creation timestamp using
-- orderBy=\"creationTimestamp desc\". This sorts results based on the
-- creationTimestamp field in reverse chronological order (newest result
-- first). Use this to sort resources like operations so that the newest
-- operation is returned first. Currently, only sorting by name or
-- creationTimestamp desc is supported.
tplOrderBy :: Lens' TargetPoolsList (Maybe Text)
tplOrderBy
= lens _tplOrderBy (\ s a -> s{_tplOrderBy = a}) | 653 | tplOrderBy :: Lens' TargetPoolsList (Maybe Text)
tplOrderBy
= lens _tplOrderBy (\ s a -> s{_tplOrderBy = a}) | 110 | tplOrderBy
= lens _tplOrderBy (\ s a -> s{_tplOrderBy = a}) | 61 | true | true | 0 | 9 | 103 | 55 | 32 | 23 | null | null |
elginer/shpider | Network/Shpider/Curl/Opts.hs | mit | verboseUnmarshaller :: Unmarshaller a -> Unmarshaller a
verboseUnmarshaller u =
let two m f x y = putStrLn m >> f u x y
twoS m f x y = putStrLn (m ++ ": " ++ show (x,y)) >> f u x y
in u
{ u_long = twoS "u_long" u_long
, u_llong = twoS "u_llong" u_llong
, u_string = twoS "u_string" u_string
, u_strings = twoS "u_strings" u_strings
, u_ptr = twoS "u_ptr" u_ptr
, u_writeFun = two "u_writeFun" u_writeFun
, u_readFun = two "u_readFun" u_readFun
, u_progressFun = two "u_progressFun" u_progressFun
, u_debugFun = two "u_debugFun" u_debugFun
, u_posts = two "u_posts" u_posts
, u_sslctxt = two "u_sslctxt" u_sslctxt
, u_ioctl_fun = two "u_ioctl_fun" u_ioctl_fun
, u_convFromNetwork = twoS "u_convFromNetwork" u_convFromNetwork
, u_convToNetwork = twoS "u_convToNetwork" u_convToNetwork
, u_convFromUtf8 = twoS "u_convFromUtf8" u_convFromUtf8
, u_sockoptFun = twoS "u_sockoptFun" u_sockoptFun
} | 1,043 | verboseUnmarshaller :: Unmarshaller a -> Unmarshaller a
verboseUnmarshaller u =
let two m f x y = putStrLn m >> f u x y
twoS m f x y = putStrLn (m ++ ": " ++ show (x,y)) >> f u x y
in u
{ u_long = twoS "u_long" u_long
, u_llong = twoS "u_llong" u_llong
, u_string = twoS "u_string" u_string
, u_strings = twoS "u_strings" u_strings
, u_ptr = twoS "u_ptr" u_ptr
, u_writeFun = two "u_writeFun" u_writeFun
, u_readFun = two "u_readFun" u_readFun
, u_progressFun = two "u_progressFun" u_progressFun
, u_debugFun = two "u_debugFun" u_debugFun
, u_posts = two "u_posts" u_posts
, u_sslctxt = two "u_sslctxt" u_sslctxt
, u_ioctl_fun = two "u_ioctl_fun" u_ioctl_fun
, u_convFromNetwork = twoS "u_convFromNetwork" u_convFromNetwork
, u_convToNetwork = twoS "u_convToNetwork" u_convToNetwork
, u_convFromUtf8 = twoS "u_convFromUtf8" u_convFromUtf8
, u_sockoptFun = twoS "u_sockoptFun" u_sockoptFun
} | 1,043 | verboseUnmarshaller u =
let two m f x y = putStrLn m >> f u x y
twoS m f x y = putStrLn (m ++ ": " ++ show (x,y)) >> f u x y
in u
{ u_long = twoS "u_long" u_long
, u_llong = twoS "u_llong" u_llong
, u_string = twoS "u_string" u_string
, u_strings = twoS "u_strings" u_strings
, u_ptr = twoS "u_ptr" u_ptr
, u_writeFun = two "u_writeFun" u_writeFun
, u_readFun = two "u_readFun" u_readFun
, u_progressFun = two "u_progressFun" u_progressFun
, u_debugFun = two "u_debugFun" u_debugFun
, u_posts = two "u_posts" u_posts
, u_sslctxt = two "u_sslctxt" u_sslctxt
, u_ioctl_fun = two "u_ioctl_fun" u_ioctl_fun
, u_convFromNetwork = twoS "u_convFromNetwork" u_convFromNetwork
, u_convToNetwork = twoS "u_convToNetwork" u_convToNetwork
, u_convFromUtf8 = twoS "u_convFromUtf8" u_convFromUtf8
, u_sockoptFun = twoS "u_sockoptFun" u_sockoptFun
} | 987 | false | true | 0 | 14 | 294 | 284 | 147 | 137 | null | null |
Mic92/yammat | Handler/Select.hs | agpl-3.0 | rechargeForm :: AForm Handler Int
rechargeForm = areq currencyField (bfs MsgValue) (Just 0)
<* bootstrapSubmit (msgToBSSubmit MsgRecharge) | 140 | rechargeForm :: AForm Handler Int
rechargeForm = areq currencyField (bfs MsgValue) (Just 0)
<* bootstrapSubmit (msgToBSSubmit MsgRecharge) | 140 | rechargeForm = areq currencyField (bfs MsgValue) (Just 0)
<* bootstrapSubmit (msgToBSSubmit MsgRecharge) | 106 | false | true | 2 | 7 | 18 | 50 | 24 | 26 | null | null |
cjhveal/H-99 | 10.hs | mit | pack [x] = [[x]] | 16 | pack [x] = [[x]] | 16 | pack [x] = [[x]] | 16 | false | false | 0 | 6 | 3 | 18 | 10 | 8 | null | null |
aaronc/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | deleteDefExact :: Name -> Ctxt a -> Ctxt a
deleteDefExact n = Map.adjust (Map.delete n) (nsroot n) | 98 | deleteDefExact :: Name -> Ctxt a -> Ctxt a
deleteDefExact n = Map.adjust (Map.delete n) (nsroot n) | 98 | deleteDefExact n = Map.adjust (Map.delete n) (nsroot n) | 55 | false | true | 0 | 8 | 16 | 55 | 24 | 31 | null | null |
houshuang/frame | src/Data/Frame/Types.hs | mit | -- like (T _) (T _) = True
like (M (Just a)) (M (Just b)) = like a b | 70 | like (M (Just a)) (M (Just b)) = like a b | 42 | like (M (Just a)) (M (Just b)) = like a b | 42 | true | false | 0 | 9 | 20 | 41 | 20 | 21 | null | null |
lamdu/lamdu | src/Lamdu/GUI/EvalView.hs | gpl-3.0 | makeTable :: _ => Sugar.ResTable Name # Annotated Sugar.EntityId -> M env m (WithTextPos View)
makeTable (Sugar.ResTable headers valss) =
do
header <- traverse TagView.make headers
rows <- take (tableCutoff-1) valss & traverse . traverse %%~ makeInner
s <- Spacer.stdHSpace
table <-
GridView.make ??
( header : rows <&> traverse %~ (^. Align.tValue)
<&> List.intersperse s
<&> traverse %~ Aligned 0.5
) <&> snd <&> Align.WithTextPos 0
remainView <-
if null (drop tableCutoff rows)
then pure Element.empty
else Label.make "…"
pure (Aligned 0.5 table) /-/ pure (Aligned 0.5 remainView)
<&> (^. Align.value) | 772 | makeTable :: _ => Sugar.ResTable Name # Annotated Sugar.EntityId -> M env m (WithTextPos View)
makeTable (Sugar.ResTable headers valss) =
do
header <- traverse TagView.make headers
rows <- take (tableCutoff-1) valss & traverse . traverse %%~ makeInner
s <- Spacer.stdHSpace
table <-
GridView.make ??
( header : rows <&> traverse %~ (^. Align.tValue)
<&> List.intersperse s
<&> traverse %~ Aligned 0.5
) <&> snd <&> Align.WithTextPos 0
remainView <-
if null (drop tableCutoff rows)
then pure Element.empty
else Label.make "…"
pure (Aligned 0.5 table) /-/ pure (Aligned 0.5 remainView)
<&> (^. Align.value) | 772 | makeTable (Sugar.ResTable headers valss) =
do
header <- traverse TagView.make headers
rows <- take (tableCutoff-1) valss & traverse . traverse %%~ makeInner
s <- Spacer.stdHSpace
table <-
GridView.make ??
( header : rows <&> traverse %~ (^. Align.tValue)
<&> List.intersperse s
<&> traverse %~ Aligned 0.5
) <&> snd <&> Align.WithTextPos 0
remainView <-
if null (drop tableCutoff rows)
then pure Element.empty
else Label.make "…"
pure (Aligned 0.5 table) /-/ pure (Aligned 0.5 remainView)
<&> (^. Align.value) | 677 | false | true | 0 | 17 | 259 | 256 | 122 | 134 | null | null |
diku-dk/futhark | src/Futhark/IR/Primitive.hs | isc | doSExt (Int16Value x) t = intValue t $ toInteger x | 50 | doSExt (Int16Value x) t = intValue t $ toInteger x | 50 | doSExt (Int16Value x) t = intValue t $ toInteger x | 50 | false | false | 0 | 7 | 9 | 27 | 12 | 15 | null | null |
julianalucena/mancala | dist/build/autogen/Paths_mancala.hs | lgpl-3.0 | getDataDir = catch (getEnv "mancala_datadir") (\_ -> return datadir) | 68 | getDataDir = catch (getEnv "mancala_datadir") (\_ -> return datadir) | 68 | getDataDir = catch (getEnv "mancala_datadir") (\_ -> return datadir) | 68 | false | false | 0 | 8 | 8 | 28 | 14 | 14 | null | null |
davidzhulijun/TAM | RegisterMachine/Models/CM2.hs | bsd-3-clause | trans Halt = id | 23 | trans Halt = id | 23 | trans Halt = id | 23 | false | false | 0 | 5 | 11 | 9 | 4 | 5 | null | null |
amccausl/Swish | Swish/HaskellRDF/RDFDatatypeXsdIntegerTest.hs | lgpl-2.1 | dmodXsdIntegerSum = xsd_int_name "sum" | 41 | dmodXsdIntegerSum = xsd_int_name "sum" | 41 | dmodXsdIntegerSum = xsd_int_name "sum" | 41 | false | false | 0 | 5 | 6 | 9 | 4 | 5 | null | null |
bens/libmpd-haskell | tests/CommandSpec.hs | lgpl-2.1 | testLoad =
cmd_ [("load \"foo\"", Right "OK")] (load "foo") | 63 | testLoad =
cmd_ [("load \"foo\"", Right "OK")] (load "foo") | 63 | testLoad =
cmd_ [("load \"foo\"", Right "OK")] (load "foo") | 63 | false | false | 0 | 8 | 12 | 29 | 15 | 14 | null | null |
SeanTater/albemarle | src/NLP/Albemarle/Dict.hs | bsd-3-clause | -- | Get the ID of a word from a Dictionary. Unknown words get a 0 (by design).
idOf :: Dict -> Text -> Int
idOf Dict{_ids=vec} word = runST $ do
mvec <- Vec.thaw vec
idx <- VSearch.binarySearch mvec word -- Why is this not pure?!
return $! maybe 0 (\it-> if it == word then idx else 0) $ (Vec.!?) vec idx
-- | Make a sparse vector representing one document using this dict.
--
-- The length of the vector is the size of the vocabulary, plus one. Keep in
-- mind that the length is determined at runtime so pay attention that you do
-- not use vectors from different dictionaries together lest you cause
-- runtime errors. | 637 | idOf :: Dict -> Text -> Int
idOf Dict{_ids=vec} word = runST $ do
mvec <- Vec.thaw vec
idx <- VSearch.binarySearch mvec word -- Why is this not pure?!
return $! maybe 0 (\it-> if it == word then idx else 0) $ (Vec.!?) vec idx
-- | Make a sparse vector representing one document using this dict.
--
-- The length of the vector is the size of the vocabulary, plus one. Keep in
-- mind that the length is determined at runtime so pay attention that you do
-- not use vectors from different dictionaries together lest you cause
-- runtime errors. | 557 | idOf Dict{_ids=vec} word = runST $ do
mvec <- Vec.thaw vec
idx <- VSearch.binarySearch mvec word -- Why is this not pure?!
return $! maybe 0 (\it-> if it == word then idx else 0) $ (Vec.!?) vec idx
-- | Make a sparse vector representing one document using this dict.
--
-- The length of the vector is the size of the vocabulary, plus one. Keep in
-- mind that the length is determined at runtime so pay attention that you do
-- not use vectors from different dictionaries together lest you cause
-- runtime errors. | 529 | true | true | 1 | 15 | 136 | 122 | 63 | 59 | null | null |
ml9951/ghc | libraries/pastm/Control/TL2/STM.hs | bsd-3-clause | writeTVar :: TVar a -> a -> STM ()
writeTVar (TVar tv) a = STM $ \s ->
case unsafeCoerce# writeTVar# tv a s of
(# s', tv #) -> (# s', () #) | 165 | writeTVar :: TVar a -> a -> STM ()
writeTVar (TVar tv) a = STM $ \s ->
case unsafeCoerce# writeTVar# tv a s of
(# s', tv #) -> (# s', () #) | 165 | writeTVar (TVar tv) a = STM $ \s ->
case unsafeCoerce# writeTVar# tv a s of
(# s', tv #) -> (# s', () #) | 130 | false | true | 0 | 11 | 59 | 78 | 39 | 39 | null | null |
juodaspaulius/clafer | src/Language/Clafer/Generator/Html.hs | mit | printCard (CardInterval _ nCard) = " " ++ printNCard nCard | 58 | printCard (CardInterval _ nCard) = " " ++ printNCard nCard | 58 | printCard (CardInterval _ nCard) = " " ++ printNCard nCard | 58 | false | false | 0 | 6 | 9 | 25 | 11 | 14 | null | null |
balez/ag-a-la-carte | Language/Grammars/AGalacarte/Examples/PrettyPrinting.hs | gpl-3.0 | text_fmts :: PW -> String -> Formats
text_fmts pw s | length s <= pw = [ s2fmt s ]
| otherwise = [] | 119 | text_fmts :: PW -> String -> Formats
text_fmts pw s | length s <= pw = [ s2fmt s ]
| otherwise = [] | 119 | text_fmts pw s | length s <= pw = [ s2fmt s ]
| otherwise = [] | 82 | false | true | 0 | 9 | 43 | 54 | 25 | 29 | null | null |
sordina/wai | wai-app-static/WaiAppStatic/Types.hs | bsd-2-clause | -- | Construct a @Piece@ without input validation.
unsafeToPiece :: Text -> Piece
unsafeToPiece = Piece | 103 | unsafeToPiece :: Text -> Piece
unsafeToPiece = Piece | 52 | unsafeToPiece = Piece | 21 | true | true | 0 | 5 | 15 | 16 | 9 | 7 | null | null |
23Skidoo/heist | src/Heist/Common.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | Mappends a doctype to the state.
addDoctype :: Monad m => [X.DocType] -> HeistT n m ()
addDoctype dt = do
modifyHS (\s -> s { _doctypes = _doctypes s `mappend` dt }) | 253 | addDoctype :: Monad m => [X.DocType] -> HeistT n m ()
addDoctype dt = do
modifyHS (\s -> s { _doctypes = _doctypes s `mappend` dt }) | 136 | addDoctype dt = do
modifyHS (\s -> s { _doctypes = _doctypes s `mappend` dt }) | 82 | true | true | 0 | 14 | 39 | 77 | 39 | 38 | null | null |
Jonplussed/iCalendar | src/Text/ICalendar/Parser/Validator.hs | bsd-3-clause | reqPropN :: Parser a -> String -> Validator [a]
reqPropN = many1Perm .: property | 80 | reqPropN :: Parser a -> String -> Validator [a]
reqPropN = many1Perm .: property | 80 | reqPropN = many1Perm .: property | 32 | false | true | 2 | 9 | 13 | 40 | 18 | 22 | null | null |
ShellShoccar-jpn/Open-usp-Tukubai | COMMANDS.HS/join2.hs | mit | readF f = BS.readFile f | 25 | readF f = BS.readFile f | 25 | readF f = BS.readFile f | 25 | false | false | 0 | 6 | 6 | 14 | 6 | 8 | null | null |
Fuuzetsu/lens | src/Control/Lens/Fold.hs | bsd-3-clause | -- | Right-associative fold of parts of a structure that are viewed through a 'Lens', 'Getter', 'Fold' or 'Traversal'.
--
-- @
-- 'Data.Foldable.foldr' ≡ 'foldrOf' 'folded'
-- @
--
-- @
-- 'foldrOf' :: 'Getter' s a -> (a -> r -> r) -> r -> s -> r
-- 'foldrOf' :: 'Fold' s a -> (a -> r -> r) -> r -> s -> r
-- 'foldrOf' :: 'Lens'' s a -> (a -> r -> r) -> r -> s -> r
-- 'foldrOf' :: 'Iso'' s a -> (a -> r -> r) -> r -> s -> r
-- 'foldrOf' :: 'Traversal'' s a -> (a -> r -> r) -> r -> s -> r
-- 'foldrOf' :: 'Prism'' s a -> (a -> r -> r) -> r -> s -> r
-- @
--
-- @
-- 'ifoldrOf' l ≡ 'foldrOf' l '.' 'Indexed'
-- @
--
-- @
-- 'foldrOf' :: 'Getting' ('Endo' r) s a -> (a -> r -> r) -> r -> s -> r
-- @
foldrOf :: Profunctor p => Accessing p (Endo r) s a -> p a (r -> r) -> r -> s -> r
foldrOf l f z = flip appEndo z `rmap` foldMapOf l (Endo #. f) | 868 | foldrOf :: Profunctor p => Accessing p (Endo r) s a -> p a (r -> r) -> r -> s -> r
foldrOf l f z = flip appEndo z `rmap` foldMapOf l (Endo #. f) | 144 | foldrOf l f z = flip appEndo z `rmap` foldMapOf l (Endo #. f) | 61 | true | true | 0 | 10 | 241 | 113 | 67 | 46 | null | null |
vluukkal/aspreify | txtrender.hs | mit | txtitem i accu =
case i of
Rule b l -> accu ++ L.head(txtbody' b []) ++ (if (L.null l) then ".\n\n" else " :- \n\t " ++
L.unwords(L.intersperse ",\n\t" (L.foldr txtbody' [] (L.reverse l))) ++
".\n\n")
Deny l -> accu ++ ":- \n\t " ++
L.unwords(L.intersperse ",\n\t" (L.foldr txtbody' [] (L.reverse l))) ++ ".\n\n"
Fact l -> accu ++
L.unwords(L.intersperse ",\n\t" (L.foldr txtbody' [] (L.reverse l))) ++ ".\n\n"
Hide l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("hide " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Show l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("show " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
GHide l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("#hide " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
GShow l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("#show " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Consts l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("const " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
External l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("external " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Function l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("function " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Minimize l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("minimize " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Maximize l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("maximize " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Computes n l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("compute " ++ unatom(n) ++ " " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
RComment s -> accu ++ ("% " ++ s ++ "\n")
Emptyset -> accu | 2,735 | txtitem i accu =
case i of
Rule b l -> accu ++ L.head(txtbody' b []) ++ (if (L.null l) then ".\n\n" else " :- \n\t " ++
L.unwords(L.intersperse ",\n\t" (L.foldr txtbody' [] (L.reverse l))) ++
".\n\n")
Deny l -> accu ++ ":- \n\t " ++
L.unwords(L.intersperse ",\n\t" (L.foldr txtbody' [] (L.reverse l))) ++ ".\n\n"
Fact l -> accu ++
L.unwords(L.intersperse ",\n\t" (L.foldr txtbody' [] (L.reverse l))) ++ ".\n\n"
Hide l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("hide " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Show l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("show " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
GHide l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("#hide " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
GShow l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("#show " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Consts l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("const " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
External l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("external " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Function l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("function " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Minimize l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("minimize " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Maximize l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("maximize " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Computes n l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("compute " ++ unatom(n) ++ " " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
RComment s -> accu ++ ("% " ++ s ++ "\n")
Emptyset -> accu | 2,735 | txtitem i accu =
case i of
Rule b l -> accu ++ L.head(txtbody' b []) ++ (if (L.null l) then ".\n\n" else " :- \n\t " ++
L.unwords(L.intersperse ",\n\t" (L.foldr txtbody' [] (L.reverse l))) ++
".\n\n")
Deny l -> accu ++ ":- \n\t " ++
L.unwords(L.intersperse ",\n\t" (L.foldr txtbody' [] (L.reverse l))) ++ ".\n\n"
Fact l -> accu ++
L.unwords(L.intersperse ",\n\t" (L.foldr txtbody' [] (L.reverse l))) ++ ".\n\n"
Hide l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("hide " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Show l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("show " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
GHide l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("#hide " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
GShow l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("#show " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Consts l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("const " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
External l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("external " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Function l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("function " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Minimize l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("minimize " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Maximize l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("maximize " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
Computes n l -> accu ++ L.unwords(L.intersperse ",\n"
(L.foldr (\x a -> ("compute " ++ unatom(n) ++ " " ++ x):a) []
(L.foldr txtbody' [] (L.reverse l)))) ++ ".\n\n"
RComment s -> accu ++ ("% " ++ s ++ "\n")
Emptyset -> accu | 2,735 | false | false | 0 | 23 | 1,156 | 1,162 | 583 | 579 | null | null |
alexbiehl/hoop | hadoop-protos/src/Hadoop/Protos/DatanodeProtocolProtos/DatanodeProtocolService.hs | mit | versionRequest :: VersionRequest
versionRequest = P'.Method | 59 | versionRequest :: VersionRequest
versionRequest = P'.Method | 59 | versionRequest = P'.Method | 26 | false | true | 0 | 6 | 5 | 20 | 8 | 12 | null | null |
dysinger/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs | mpl-2.0 | -- | Date and time when the command was acknowledged.
cAcknowledgedAt :: Lens' Command (Maybe Text)
cAcknowledgedAt = lens _cAcknowledgedAt (\s a -> s { _cAcknowledgedAt = a }) | 176 | cAcknowledgedAt :: Lens' Command (Maybe Text)
cAcknowledgedAt = lens _cAcknowledgedAt (\s a -> s { _cAcknowledgedAt = a }) | 122 | cAcknowledgedAt = lens _cAcknowledgedAt (\s a -> s { _cAcknowledgedAt = a }) | 76 | true | true | 0 | 9 | 28 | 46 | 25 | 21 | null | null |
fhaust/bitcoin | src/Crypto/Cipher/ECDSA/Util.hs | mit | padTo :: Integer -> BS.ByteString -> BS.ByteString
padTo n s = BS.append padding s
where
padding = BS.pack
(replicate (fromIntegral n - fromIntegral (BS.length s)) 0) | 183 | padTo :: Integer -> BS.ByteString -> BS.ByteString
padTo n s = BS.append padding s
where
padding = BS.pack
(replicate (fromIntegral n - fromIntegral (BS.length s)) 0) | 182 | padTo n s = BS.append padding s
where
padding = BS.pack
(replicate (fromIntegral n - fromIntegral (BS.length s)) 0) | 131 | false | true | 1 | 13 | 42 | 86 | 38 | 48 | null | null |
sthiele/hasple | SPVar.hs | gpl-3.0 | loop_nogood :: Atom -> [[Literal]] -> CClause
-- returns the loop nogood for an atom in an unfounded set(characterized by the external bodies)
loop_nogood a bodies = ([ALit a], bodies2vars bodies) | 196 | loop_nogood :: Atom -> [[Literal]] -> CClause
loop_nogood a bodies = ([ALit a], bodies2vars bodies) | 99 | loop_nogood a bodies = ([ALit a], bodies2vars bodies) | 53 | true | true | 0 | 8 | 30 | 46 | 25 | 21 | null | null |
mimi1vx/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkConstantIfs1 = verify checkConstantIfs "[[ foo != bar ]]" | 67 | prop_checkConstantIfs1 = verify checkConstantIfs "[[ foo != bar ]]" | 67 | prop_checkConstantIfs1 = verify checkConstantIfs "[[ foo != bar ]]" | 67 | false | false | 1 | 5 | 8 | 15 | 5 | 10 | null | null |
mrehayden1/lji | src/LJI/Args.hs | bsd-3-clause | rangeSwitch :: Parser OptionsParser
rangeSwitch = do
try (string "--range")
<|> try (string "-r")
spaces
return (setValidRange <$> rangeParser)
where
setValidRange :: Range -> Options -> Either String Options
setValidRange r@(a, b)
| (a < b) = \o -> Right $ o { optRange = r }
| otherwise = const . Left $ "first value in a range should be"
++ " less than the second" | 412 | rangeSwitch :: Parser OptionsParser
rangeSwitch = do
try (string "--range")
<|> try (string "-r")
spaces
return (setValidRange <$> rangeParser)
where
setValidRange :: Range -> Options -> Either String Options
setValidRange r@(a, b)
| (a < b) = \o -> Right $ o { optRange = r }
| otherwise = const . Left $ "first value in a range should be"
++ " less than the second" | 412 | rangeSwitch = do
try (string "--range")
<|> try (string "-r")
spaces
return (setValidRange <$> rangeParser)
where
setValidRange :: Range -> Options -> Either String Options
setValidRange r@(a, b)
| (a < b) = \o -> Right $ o { optRange = r }
| otherwise = const . Left $ "first value in a range should be"
++ " less than the second" | 376 | false | true | 3 | 10 | 111 | 159 | 74 | 85 | null | null |
chemouna/99Haskell | src/Problem14.hs | bsd-3-clause | -- Duplicate the elements of a list.
dupli :: [a] -> [a]
dupli [] = [] | 70 | dupli :: [a] -> [a]
dupli [] = [] | 33 | dupli [] = [] | 13 | true | true | 0 | 6 | 15 | 29 | 16 | 13 | null | null |
nevrenato/Hets_Fork | Comorphisms/Hs2HOLCF.hs | gpl-2.0 | transPatBindX :: Bool ->
Continuity -> ConstTab -> PrPat -> PrExp -> Maybe (IsaTerm,IsaTerm)
transPatBindX b a cs p e = do
x <- transMPatX b a cs p
y <- transMExp a cs e
return (x, y) | 229 | transPatBindX :: Bool ->
Continuity -> ConstTab -> PrPat -> PrExp -> Maybe (IsaTerm,IsaTerm)
transPatBindX b a cs p e = do
x <- transMPatX b a cs p
y <- transMExp a cs e
return (x, y) | 229 | transPatBindX b a cs p e = do
x <- transMPatX b a cs p
y <- transMExp a cs e
return (x, y) | 132 | false | true | 0 | 12 | 83 | 98 | 46 | 52 | null | null |
TomMD/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | translateOp dflags IntLtOp = Just (mo_wordSLt dflags) | 60 | translateOp dflags IntLtOp = Just (mo_wordSLt dflags) | 60 | translateOp dflags IntLtOp = Just (mo_wordSLt dflags) | 60 | false | false | 0 | 7 | 13 | 22 | 9 | 13 | null | null |
patperry/hs-linear-algebra | tests/Matrix.hs | bsd-3-clause | prop_scale t k x =
M.scale k x ~== M.map (k*) x
where
_ = typed t x | 77 | prop_scale t k x =
M.scale k x ~== M.map (k*) x
where
_ = typed t x | 77 | prop_scale t k x =
M.scale k x ~== M.map (k*) x
where
_ = typed t x | 77 | false | false | 3 | 6 | 27 | 61 | 25 | 36 | null | null |
iu-parfunc/containers | tests/intmap-strictness.hs | bsd-3-clause | pInsertWithKeyStrict :: (Int -> Int -> Int) -> Int -> IntMap Int -> Bool
pInsertWithKeyStrict f v m = isBottom $ M.insertWith f bottom v m | 138 | pInsertWithKeyStrict :: (Int -> Int -> Int) -> Int -> IntMap Int -> Bool
pInsertWithKeyStrict f v m = isBottom $ M.insertWith f bottom v m | 138 | pInsertWithKeyStrict f v m = isBottom $ M.insertWith f bottom v m | 65 | false | true | 0 | 8 | 25 | 59 | 29 | 30 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_150 (72#) = happyGoto action_207 | 39 | action_150 (72#) = happyGoto action_207 | 39 | action_150 (72#) = happyGoto action_207 | 39 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
wouwouwou/2017_module_8 | src/haskell/PP-project-2016/Grammar.hs | apache-2.0 | intType = SyntCat IntType | 29 | intType = SyntCat IntType | 29 | intType = SyntCat IntType | 29 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
copton/ocram | ocram/src/Ocram/Debug/Enriched.hs | gpl-2.0 | set_thread :: ThreadId -> ENodeInfo -> ENodeInfo -- {{{1
set_thread tid (EnBreakpoint _ r b f) = EnBreakpoint (Just tid) r b f | 126 | set_thread :: ThreadId -> ENodeInfo -> ENodeInfo
set_thread tid (EnBreakpoint _ r b f) = EnBreakpoint (Just tid) r b f | 118 | set_thread tid (EnBreakpoint _ r b f) = EnBreakpoint (Just tid) r b f | 69 | true | true | 0 | 10 | 22 | 61 | 27 | 34 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/Disks/SetLabels.hs | mpl-2.0 | -- | Name or id of the resource for this request.
dslResource :: Lens' DisksSetLabels Text
dslResource
= lens _dslResource (\ s a -> s{_dslResource = a}) | 155 | dslResource :: Lens' DisksSetLabels Text
dslResource
= lens _dslResource (\ s a -> s{_dslResource = a}) | 105 | dslResource
= lens _dslResource (\ s a -> s{_dslResource = a}) | 64 | true | true | 1 | 9 | 28 | 44 | 22 | 22 | null | null |
nevrenato/Hets_Fork | CSL/Keywords.hs | gpl-2.0 | whenS :: String
whenS = "when" | 30 | whenS :: String
whenS = "when" | 30 | whenS = "when" | 14 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
rueshyna/gogol | gogol-games/gen/Network/Google/Games/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'ApplicationCategory' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'acSecondary'
--
-- * 'acKind'
--
-- * 'acPrimary'
applicationCategory
:: ApplicationCategory
applicationCategory =
ApplicationCategory'
{ _acSecondary = Nothing
, _acKind = "games#applicationCategory"
, _acPrimary = Nothing
} | 429 | applicationCategory
:: ApplicationCategory
applicationCategory =
ApplicationCategory'
{ _acSecondary = Nothing
, _acKind = "games#applicationCategory"
, _acPrimary = Nothing
} | 199 | applicationCategory =
ApplicationCategory'
{ _acSecondary = Nothing
, _acKind = "games#applicationCategory"
, _acPrimary = Nothing
} | 152 | true | true | 1 | 7 | 84 | 47 | 29 | 18 | null | null |
zhensydow/ptrader | examples/example03.hs | gpl-3.0 | graphConfig :: GraphConfig
graphConfig = GraphConfig Nothing 30 | 63 | graphConfig :: GraphConfig
graphConfig = GraphConfig Nothing 30 | 63 | graphConfig = GraphConfig Nothing 30 | 36 | false | true | 0 | 6 | 7 | 23 | 9 | 14 | null | null |
DavidAlphaFox/ghc | utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-3-clause | isUndocdInstance :: DocInstance a -> Maybe (InstHead a)
isUndocdInstance (L _ i,Nothing) = Just i | 97 | isUndocdInstance :: DocInstance a -> Maybe (InstHead a)
isUndocdInstance (L _ i,Nothing) = Just i | 97 | isUndocdInstance (L _ i,Nothing) = Just i | 41 | false | true | 0 | 8 | 14 | 44 | 21 | 23 | null | null |
bitraten/hands | src/Main.hs | gpl-3.0 | main :: IO ()
main = do pool <- createSqlitePool "hands.db" 5
runNoLoggingT $ runSqlPool (runMigration (migratePost >> migrateUsers)) pool
spock 3000 sessCfg (PCConduitPool pool) () $ do
middleware (staticPolicy $ addBase "public")
blogHandlers
where
sessCfg = authSessCfg (AuthCfg (5 * 60 * 60) ()) | 365 | main :: IO ()
main = do pool <- createSqlitePool "hands.db" 5
runNoLoggingT $ runSqlPool (runMigration (migratePost >> migrateUsers)) pool
spock 3000 sessCfg (PCConduitPool pool) () $ do
middleware (staticPolicy $ addBase "public")
blogHandlers
where
sessCfg = authSessCfg (AuthCfg (5 * 60 * 60) ()) | 365 | main = do pool <- createSqlitePool "hands.db" 5
runNoLoggingT $ runSqlPool (runMigration (migratePost >> migrateUsers)) pool
spock 3000 sessCfg (PCConduitPool pool) () $ do
middleware (staticPolicy $ addBase "public")
blogHandlers
where
sessCfg = authSessCfg (AuthCfg (5 * 60 * 60) ()) | 351 | false | true | 1 | 13 | 110 | 136 | 61 | 75 | null | null |
sashabu/libcspm | src/Util/MonadicPrettyPrintInternal.hs | bsd-3-clause | -- ---------------------------------------------------------------------------
-- Values and Predicates on GDocs and TextDetails
-- | A document of height and width 1, containing a literal character.
char :: (Monad m, Applicative m) => Char -> m P.Doc
char c = return $ P.char c | 279 | char :: (Monad m, Applicative m) => Char -> m P.Doc
char c = return $ P.char c | 78 | char c = return $ P.char c | 26 | true | true | 2 | 9 | 41 | 55 | 27 | 28 | null | null |
GOGEN/rsa | app/CustomCodes.hs | bsd-3-clause | customChr 74 = 'ъ' | 18 | customChr 74 = 'ъ' | 18 | customChr 74 = 'ъ' | 18 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
tjakway/ghcjvm | compiler/cmm/CLabel.hs | bsd-3-clause | -- Constructing Code Coverage Labels
mkHpcTicksLabel :: Module -> CLabel
mkHpcTicksLabel = HpcTicksLabel | 119 | mkHpcTicksLabel :: Module -> CLabel
mkHpcTicksLabel = HpcTicksLabel | 82 | mkHpcTicksLabel = HpcTicksLabel | 46 | true | true | 0 | 5 | 27 | 16 | 9 | 7 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_9 x = happyTcHack x happyReduce_24 | 41 | action_9 x = happyTcHack x happyReduce_24 | 41 | action_9 x = happyTcHack x happyReduce_24 | 41 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
Southern-Exposure-Seed-Exchange/southernexposure.com | server/src/Routes/Checkout.hs | gpl-3.0 | -- | Create an Order and it's Line Items & Products, returning the ID, Total,
-- & Applied Store Credit.
--
-- TODO: Turn all the parameters into a `CreateOrderParams` data type so we
-- can pass them by field name.
createOrder
:: Entity Customer
-- ^ Customer placing the Order
-> CartId
-- ^ Cart ID that should be turned into an Order
-> Entity Address
-- ^ Shipping Address
-> Maybe AddressId
-- ^ Billing Address ID
-> Maybe Cents
-- ^ Store Credit
-> Bool
-- ^ Enable Priority Shipping
-> Maybe T.Text
-- ^ Coupon Code
-> T.Text
-- ^ Order Comment
-> UTCTime
-- ^ Current Time
-> AppSQL (Entity Order, Cents, Cents)
createOrder ce@(Entity customerId customer) cartId shippingEntity billingId maybeStoreCredit priorityShipping maybeCouponCode comment currentTime = do
items <- getCartItems $ \c -> c E.^. CartId E.==. E.val cartId
let order = Order
{ orderCustomerId = customerId
, orderStatus = OrderReceived
, orderBillingAddressId = billingId
, orderShippingAddressId = entityKey shippingEntity
, orderCustomerComment = comment
, orderAdminComments = []
, orderAvalaraTransactionCode = Nothing
, orderStripeChargeId = Nothing
, orderStripeLastFour = Nothing
, orderStripeIssuer = Nothing
, orderCouponId = Nothing
, orderCreatedAt = currentTime
}
orderId <- insert order
(lineTotal, maybeCouponId) <- createLineItems currentTime ce
shippingEntity items orderId priorityShipping maybeCouponCode
when (isJust maybeCouponId) $
update orderId [OrderCouponId =. maybeCouponId]
productTotals <- createProducts items orderId
let totalCharges = lineTotal + fromIntegral (fromCents $ sum productTotals)
orderEntity = Entity orderId order
if totalCharges < 0 then
-- TODO: Throw an error? This means credits > charges which shouldn't happen...
return (orderEntity, 0, 0)
else
let totalInCents = Cents $ fromIntegral totalCharges in
case maybeStoreCredit of
Nothing ->
return (orderEntity, totalInCents, 0)
Just c ->
if c > 0 && totalInCents > 0 then do
let storeCredit = min (customerStoreCredit customer) $ min totalInCents c
insert_ OrderLineItem
{ orderLineItemOrderId = orderId
, orderLineItemType = StoreCreditLine
, orderLineItemDescription = "Store Credit"
, orderLineItemAmount = storeCredit
}
return (orderEntity, totalInCents - storeCredit, storeCredit)
else
return (orderEntity, totalInCents, 0)
-- | Delete a Cart & all it's Items. | 2,939 | createOrder
:: Entity Customer
-- ^ Customer placing the Order
-> CartId
-- ^ Cart ID that should be turned into an Order
-> Entity Address
-- ^ Shipping Address
-> Maybe AddressId
-- ^ Billing Address ID
-> Maybe Cents
-- ^ Store Credit
-> Bool
-- ^ Enable Priority Shipping
-> Maybe T.Text
-- ^ Coupon Code
-> T.Text
-- ^ Order Comment
-> UTCTime
-- ^ Current Time
-> AppSQL (Entity Order, Cents, Cents)
createOrder ce@(Entity customerId customer) cartId shippingEntity billingId maybeStoreCredit priorityShipping maybeCouponCode comment currentTime = do
items <- getCartItems $ \c -> c E.^. CartId E.==. E.val cartId
let order = Order
{ orderCustomerId = customerId
, orderStatus = OrderReceived
, orderBillingAddressId = billingId
, orderShippingAddressId = entityKey shippingEntity
, orderCustomerComment = comment
, orderAdminComments = []
, orderAvalaraTransactionCode = Nothing
, orderStripeChargeId = Nothing
, orderStripeLastFour = Nothing
, orderStripeIssuer = Nothing
, orderCouponId = Nothing
, orderCreatedAt = currentTime
}
orderId <- insert order
(lineTotal, maybeCouponId) <- createLineItems currentTime ce
shippingEntity items orderId priorityShipping maybeCouponCode
when (isJust maybeCouponId) $
update orderId [OrderCouponId =. maybeCouponId]
productTotals <- createProducts items orderId
let totalCharges = lineTotal + fromIntegral (fromCents $ sum productTotals)
orderEntity = Entity orderId order
if totalCharges < 0 then
-- TODO: Throw an error? This means credits > charges which shouldn't happen...
return (orderEntity, 0, 0)
else
let totalInCents = Cents $ fromIntegral totalCharges in
case maybeStoreCredit of
Nothing ->
return (orderEntity, totalInCents, 0)
Just c ->
if c > 0 && totalInCents > 0 then do
let storeCredit = min (customerStoreCredit customer) $ min totalInCents c
insert_ OrderLineItem
{ orderLineItemOrderId = orderId
, orderLineItemType = StoreCreditLine
, orderLineItemDescription = "Store Credit"
, orderLineItemAmount = storeCredit
}
return (orderEntity, totalInCents - storeCredit, storeCredit)
else
return (orderEntity, totalInCents, 0)
-- | Delete a Cart & all it's Items. | 2,723 | createOrder ce@(Entity customerId customer) cartId shippingEntity billingId maybeStoreCredit priorityShipping maybeCouponCode comment currentTime = do
items <- getCartItems $ \c -> c E.^. CartId E.==. E.val cartId
let order = Order
{ orderCustomerId = customerId
, orderStatus = OrderReceived
, orderBillingAddressId = billingId
, orderShippingAddressId = entityKey shippingEntity
, orderCustomerComment = comment
, orderAdminComments = []
, orderAvalaraTransactionCode = Nothing
, orderStripeChargeId = Nothing
, orderStripeLastFour = Nothing
, orderStripeIssuer = Nothing
, orderCouponId = Nothing
, orderCreatedAt = currentTime
}
orderId <- insert order
(lineTotal, maybeCouponId) <- createLineItems currentTime ce
shippingEntity items orderId priorityShipping maybeCouponCode
when (isJust maybeCouponId) $
update orderId [OrderCouponId =. maybeCouponId]
productTotals <- createProducts items orderId
let totalCharges = lineTotal + fromIntegral (fromCents $ sum productTotals)
orderEntity = Entity orderId order
if totalCharges < 0 then
-- TODO: Throw an error? This means credits > charges which shouldn't happen...
return (orderEntity, 0, 0)
else
let totalInCents = Cents $ fromIntegral totalCharges in
case maybeStoreCredit of
Nothing ->
return (orderEntity, totalInCents, 0)
Just c ->
if c > 0 && totalInCents > 0 then do
let storeCredit = min (customerStoreCredit customer) $ min totalInCents c
insert_ OrderLineItem
{ orderLineItemOrderId = orderId
, orderLineItemType = StoreCreditLine
, orderLineItemDescription = "Store Credit"
, orderLineItemAmount = storeCredit
}
return (orderEntity, totalInCents - storeCredit, storeCredit)
else
return (orderEntity, totalInCents, 0)
-- | Delete a Cart & all it's Items. | 2,241 | true | true | 50 | 20 | 942 | 486 | 264 | 222 | null | null |
pauloborba/plc | src/InterpretacaoEAnaliseEstaticaComMonads.hs | cc0-1.0 | mg :: b -> Maybee b
mg b = Justt b | 34 | mg :: b -> Maybee b
mg b = Justt b | 34 | mg b = Justt b | 14 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
shlevy/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | le_RDR = varQual_RDR gHC_CLASSES (fsLit "<=") | 63 | le_RDR = varQual_RDR gHC_CLASSES (fsLit "<=") | 63 | le_RDR = varQual_RDR gHC_CLASSES (fsLit "<=") | 63 | false | false | 0 | 7 | 23 | 17 | 8 | 9 | null | null |
aburnett88/HSat | tests-src/Test/Writer.hs | mit | writeFolderTest1 :: TestTree
writeFolderTest1 =
testProperty "Write Folder test" $ monadicIO $ do
let folder = "writeFolderTest1"
file = "file"
problemExprs <- pick arbitrary
let problems = map (MkProblem mkStatic) problemExprs
fileNames <- run $ writeFolder plainProblemToFile problems folder file
test <- case compare (length fileNames) (length problems) of
EQ -> run $ do
returnProblems <- fromFolder (fromFile parserInstances) folder
removeDirectoryRecursive folder
let problemExprs' = map problemExpr returnProblems
return $ listsContainSame problemExprs' problemExprs
_ -> do
run $ removeDirectoryRecursive folder
return $ counterexample "Number of files generated not correct" False
stop test | 791 | writeFolderTest1 :: TestTree
writeFolderTest1 =
testProperty "Write Folder test" $ monadicIO $ do
let folder = "writeFolderTest1"
file = "file"
problemExprs <- pick arbitrary
let problems = map (MkProblem mkStatic) problemExprs
fileNames <- run $ writeFolder plainProblemToFile problems folder file
test <- case compare (length fileNames) (length problems) of
EQ -> run $ do
returnProblems <- fromFolder (fromFile parserInstances) folder
removeDirectoryRecursive folder
let problemExprs' = map problemExpr returnProblems
return $ listsContainSame problemExprs' problemExprs
_ -> do
run $ removeDirectoryRecursive folder
return $ counterexample "Number of files generated not correct" False
stop test | 791 | writeFolderTest1 =
testProperty "Write Folder test" $ monadicIO $ do
let folder = "writeFolderTest1"
file = "file"
problemExprs <- pick arbitrary
let problems = map (MkProblem mkStatic) problemExprs
fileNames <- run $ writeFolder plainProblemToFile problems folder file
test <- case compare (length fileNames) (length problems) of
EQ -> run $ do
returnProblems <- fromFolder (fromFile parserInstances) folder
removeDirectoryRecursive folder
let problemExprs' = map problemExpr returnProblems
return $ listsContainSame problemExprs' problemExprs
_ -> do
run $ removeDirectoryRecursive folder
return $ counterexample "Number of files generated not correct" False
stop test | 762 | false | true | 0 | 18 | 183 | 208 | 93 | 115 | null | null |
c00w/BitToll | haskell/PoolServer.hs | mit | route :: Map ByteString (ByteString -> IO ByteString) -> ByteString -> IO ByteString
route router request = case Data.Map.lookup (take 7 request) router of
Just a -> a (drop 7 request)
Nothing -> case Data.Map.lookup (take 8 request) router of
Just a -> a (drop 8 request)
Nothing -> return "Error" | 322 | route :: Map ByteString (ByteString -> IO ByteString) -> ByteString -> IO ByteString
route router request = case Data.Map.lookup (take 7 request) router of
Just a -> a (drop 7 request)
Nothing -> case Data.Map.lookup (take 8 request) router of
Just a -> a (drop 8 request)
Nothing -> return "Error" | 322 | route router request = case Data.Map.lookup (take 7 request) router of
Just a -> a (drop 7 request)
Nothing -> case Data.Map.lookup (take 8 request) router of
Just a -> a (drop 8 request)
Nothing -> return "Error" | 237 | false | true | 8 | 9 | 74 | 134 | 64 | 70 | null | null |
bitemyapp/persistent | persistent-sqlite/Database/Persist/Sqlite.hs | mit | sqlUnique :: UniqueDef -> Text
sqlUnique (UniqueDef _ cname cols _) = T.concat
[ ",CONSTRAINT "
, escape cname
, " UNIQUE ("
, T.intercalate "," $ map (escape . snd) cols
, ")"
] | 202 | sqlUnique :: UniqueDef -> Text
sqlUnique (UniqueDef _ cname cols _) = T.concat
[ ",CONSTRAINT "
, escape cname
, " UNIQUE ("
, T.intercalate "," $ map (escape . snd) cols
, ")"
] | 202 | sqlUnique (UniqueDef _ cname cols _) = T.concat
[ ",CONSTRAINT "
, escape cname
, " UNIQUE ("
, T.intercalate "," $ map (escape . snd) cols
, ")"
] | 171 | false | true | 0 | 9 | 58 | 74 | 38 | 36 | null | null |
schernichkin/BSPM | graphomania/src/Data/Graph/Shumov.hs | bsd-3-clause | readFile :: FilePath -> IO Shumov
readFile = fmap Shumov . BS.readFile | 70 | readFile :: FilePath -> IO Shumov
readFile = fmap Shumov . BS.readFile | 70 | readFile = fmap Shumov . BS.readFile | 36 | false | true | 0 | 6 | 11 | 27 | 13 | 14 | null | null |
nevrenato/HetsAlloy | Maude/Symbol.hs | gpl-2.0 | toTypeMaybe :: Symbol -> Maybe Type
toTypeMaybe symb = case symb of
Sort qid -> Just . TypeSort . SortId $ qid
Kind qid -> Just . TypeKind . KindId $ qid
_ -> Nothing
-- | Convert 'Symbol' to 'Type', if possible. | 225 | toTypeMaybe :: Symbol -> Maybe Type
toTypeMaybe symb = case symb of
Sort qid -> Just . TypeSort . SortId $ qid
Kind qid -> Just . TypeKind . KindId $ qid
_ -> Nothing
-- | Convert 'Symbol' to 'Type', if possible. | 225 | toTypeMaybe symb = case symb of
Sort qid -> Just . TypeSort . SortId $ qid
Kind qid -> Just . TypeKind . KindId $ qid
_ -> Nothing
-- | Convert 'Symbol' to 'Type', if possible. | 189 | false | true | 7 | 7 | 55 | 75 | 36 | 39 | null | null |
paulolieuthier/criterion | Criterion/Types.hs | bsd-2-clause | -- | Convert from a true value back to the packed representation used
-- for GC measurements.
toDouble :: Maybe Double -> Double
toDouble Nothing = -1/0 | 153 | toDouble :: Maybe Double -> Double
toDouble Nothing = -1/0 | 59 | toDouble Nothing = -1/0 | 24 | true | true | 2 | 7 | 27 | 36 | 16 | 20 | null | null |
ezyang/ghc | utils/genapply/Main.hs | bsd-3-clause | availableRegs Registerised =
( vanillaRegs MAX_REAL_VANILLA_REG,
floatRegs MAX_REAL_FLOAT_REG,
doubleRegs MAX_REAL_DOUBLE_REG,
longRegs MAX_REAL_LONG_REG
) | 177 | availableRegs Registerised =
( vanillaRegs MAX_REAL_VANILLA_REG,
floatRegs MAX_REAL_FLOAT_REG,
doubleRegs MAX_REAL_DOUBLE_REG,
longRegs MAX_REAL_LONG_REG
) | 177 | availableRegs Registerised =
( vanillaRegs MAX_REAL_VANILLA_REG,
floatRegs MAX_REAL_FLOAT_REG,
doubleRegs MAX_REAL_DOUBLE_REG,
longRegs MAX_REAL_LONG_REG
) | 177 | false | false | 0 | 6 | 34 | 34 | 16 | 18 | null | null |
SWP-Ubau-SoSe2014-Haskell/SWPSoSe14 | src/RailCompiler/FunctionDeclarations.hs | mit | -- |Function declaration for list cons.
listCons :: Definition
listCons = GlobalDefinition $ Global.functionDefaults {
Global.name = Name "gen_list_cons",
Global.returnType = VoidType,
Global.parameters = ([], False)
} | 224 | listCons :: Definition
listCons = GlobalDefinition $ Global.functionDefaults {
Global.name = Name "gen_list_cons",
Global.returnType = VoidType,
Global.parameters = ([], False)
} | 184 | listCons = GlobalDefinition $ Global.functionDefaults {
Global.name = Name "gen_list_cons",
Global.returnType = VoidType,
Global.parameters = ([], False)
} | 161 | true | true | 0 | 10 | 32 | 62 | 33 | 29 | null | null |
anton-dessiatov/stack | src/Stack/Types/NamedComponent.hs | bsd-3-clause | isCLib :: NamedComponent -> Bool
isCLib CLib{} = True | 53 | isCLib :: NamedComponent -> Bool
isCLib CLib{} = True | 53 | isCLib CLib{} = True | 20 | false | true | 0 | 6 | 8 | 22 | 11 | 11 | null | null |
isaiah/brainfree | src/Expr.hs | mit | ------------------------------------------------------------
-- 1. Parsing repetitions
------------------------------------------------------------
zeroOrMore :: Parser a -> Parser [a]
zeroOrMore p = oneOrMore p <|> pure [] | 225 | zeroOrMore :: Parser a -> Parser [a]
zeroOrMore p = oneOrMore p <|> pure [] | 75 | zeroOrMore p = oneOrMore p <|> pure [] | 38 | true | true | 0 | 7 | 22 | 42 | 21 | 21 | null | null |
martijnbastiaan/sprockell | src/DemoDebug.hs | mit | debug _ = "Not 5\n" | 19 | debug _ = "Not 5\n" | 19 | debug _ = "Not 5\n" | 19 | false | false | 0 | 4 | 4 | 10 | 4 | 6 | null | null |
NorfairKing/eden | src/Run.hs | gpl-2.0 | run :: Target -> EdenRun ()
run TargetAll = runAll | 62 | run :: Target -> EdenRun ()
run TargetAll = runAll | 62 | run TargetAll = runAll | 34 | false | true | 0 | 7 | 21 | 27 | 12 | 15 | null | null |
beni55/ghcjs | test/ghc/rts/t2047.hs | mit | size = 15 | 9 | size = 15 | 9 | size = 15 | 9 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
brendanhay/gogol | gogol-docs/gen/Network/Google/Docs/Types/Product.hs | mpl-2.0 | -- | The zero-base end index of this paragraph element, exclusive, in UTF-16
-- code units.
peEndIndex :: Lens' ParagraphElement (Maybe Int32)
peEndIndex
= lens _peEndIndex (\ s a -> s{_peEndIndex = a}) .
mapping _Coerce | 228 | peEndIndex :: Lens' ParagraphElement (Maybe Int32)
peEndIndex
= lens _peEndIndex (\ s a -> s{_peEndIndex = a}) .
mapping _Coerce | 136 | peEndIndex
= lens _peEndIndex (\ s a -> s{_peEndIndex = a}) .
mapping _Coerce | 85 | true | true | 0 | 10 | 43 | 56 | 29 | 27 | null | null |
keera-studios/hsQt | Qtc/ClassTypes/Gui.hs | bsd-2-clause | qCast_QStackedWidget :: Object a -> IO (QStackedWidget ())
qCast_QStackedWidget _qobj
= return (objectCast _qobj) | 115 | qCast_QStackedWidget :: Object a -> IO (QStackedWidget ())
qCast_QStackedWidget _qobj
= return (objectCast _qobj) | 115 | qCast_QStackedWidget _qobj
= return (objectCast _qobj) | 56 | false | true | 0 | 9 | 15 | 41 | 19 | 22 | null | null |
uuhan/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | process fn (LogCategory cs) = setLogCats cs | 43 | process fn (LogCategory cs) = setLogCats cs | 43 | process fn (LogCategory cs) = setLogCats cs | 43 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
oldmanmike/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | labelType (CmmLabel _ _ CmmRetInfo) = DataLabel | 59 | labelType (CmmLabel _ _ CmmRetInfo) = DataLabel | 59 | labelType (CmmLabel _ _ CmmRetInfo) = DataLabel | 59 | false | false | 0 | 7 | 18 | 19 | 9 | 10 | null | null |
ababkin/railoscopy | src/Haste/Perch/Client.hs | mit | attr tag (n, v)=Perch $ \e -> do
tag' <- build tag e
setAttr tag' n v
return tag' | 105 | attr tag (n, v)=Perch $ \e -> do
tag' <- build tag e
setAttr tag' n v
return tag' | 105 | attr tag (n, v)=Perch $ \e -> do
tag' <- build tag e
setAttr tag' n v
return tag' | 105 | false | false | 2 | 10 | 42 | 58 | 25 | 33 | null | null |
fushitarazu/bioparser | test/Test.hs | bsd-3-clause | main :: IO ()
main = hspec $ do
describe "Data.Bioparser.decodeFastq" $
it "can compose properly with encodeFastq" $ do
fq <- B.readFile "test/SP1.fq"
let d = decodeFastq fq
let e = decodeFastq . encodeFastq $ d
e `shouldBe` d
describe "Data.Bioparser.decodeFasta" $
it "can compose properly with encodeFasta" $ do
fs <- B.readFile "test/sample.fasta"
let d = decodeFasta fs
let e = decodeFasta . encodeFasta $ d
e `shouldBe` d | 547 | main :: IO ()
main = hspec $ do
describe "Data.Bioparser.decodeFastq" $
it "can compose properly with encodeFastq" $ do
fq <- B.readFile "test/SP1.fq"
let d = decodeFastq fq
let e = decodeFastq . encodeFastq $ d
e `shouldBe` d
describe "Data.Bioparser.decodeFasta" $
it "can compose properly with encodeFasta" $ do
fs <- B.readFile "test/sample.fasta"
let d = decodeFasta fs
let e = decodeFasta . encodeFasta $ d
e `shouldBe` d | 547 | main = hspec $ do
describe "Data.Bioparser.decodeFastq" $
it "can compose properly with encodeFastq" $ do
fq <- B.readFile "test/SP1.fq"
let d = decodeFastq fq
let e = decodeFastq . encodeFastq $ d
e `shouldBe` d
describe "Data.Bioparser.decodeFasta" $
it "can compose properly with encodeFasta" $ do
fs <- B.readFile "test/sample.fasta"
let d = decodeFasta fs
let e = decodeFasta . encodeFasta $ d
e `shouldBe` d | 533 | false | true | 0 | 15 | 190 | 154 | 70 | 84 | null | null |
christiaanb/clash | clash/CLasH/VHDL/Constants.hs | bsd-3-clause | gteqId :: String
gteqId = ">=" | 30 | gteqId :: String
gteqId = ">=" | 30 | gteqId = ">=" | 13 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
Alexander-Ignatyev/astro | test/Data/Astro/Time/SiderealTest.hs | bsd-3-clause | testLST msg eps expected actual = testDecimalHours msg eps (lstToDH expected) (lstToDH actual) | 94 | testLST msg eps expected actual = testDecimalHours msg eps (lstToDH expected) (lstToDH actual) | 94 | testLST msg eps expected actual = testDecimalHours msg eps (lstToDH expected) (lstToDH actual) | 94 | false | false | 0 | 7 | 12 | 36 | 17 | 19 | null | null |
sigrlami/servant-examples | servant-auth-basic/src/Auth.hs | mit | signin = undefined | 18 | signin = undefined | 18 | signin = undefined | 18 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
ssoudan/hsChess | src/Move.hs | apache-2.0 | makePawnLegalMoves :: PieceColor -- ^ The color of the pawn
-> Pos -- ^ The position of the pawn
-> Board -- ^ The board
-> [Pos] -- ^ Returns the list of possible positions for this pawn
makePawnLegalMoves color (Pos (px,py)) board = let otherPlayerPosition = colorPos (otherPlayer color) board
validMoves = case color of Black -> [Pos (px + a, py) | a <- [1,2], a /= 2 || px == 1]
White -> [Pos (px - a, py) | a <- [1,2], a /= 2 || px == 6]
optMoves = case color of Black -> [Pos (px + 1, py + 1), Pos (px + 1, py - 1)]
White -> [Pos (px - 1, py + 1), Pos (px - 1, py - 1)]
in [Pos (x,y) | (Pos (x,y)) <- (validMoves \\ otherPlayerPosition) ++ (optMoves `intersect` otherPlayerPosition), boardFilter (Pos (x, y))] | 1,097 | makePawnLegalMoves :: PieceColor -- ^ The color of the pawn
-> Pos -- ^ The position of the pawn
-> Board -- ^ The board
-> [Pos]
makePawnLegalMoves color (Pos (px,py)) board = let otherPlayerPosition = colorPos (otherPlayer color) board
validMoves = case color of Black -> [Pos (px + a, py) | a <- [1,2], a /= 2 || px == 1]
White -> [Pos (px - a, py) | a <- [1,2], a /= 2 || px == 6]
optMoves = case color of Black -> [Pos (px + 1, py + 1), Pos (px + 1, py - 1)]
White -> [Pos (px - 1, py + 1), Pos (px - 1, py - 1)]
in [Pos (x,y) | (Pos (x,y)) <- (validMoves \\ otherPlayerPosition) ++ (optMoves `intersect` otherPlayerPosition), boardFilter (Pos (x, y))] | 1,036 | makePawnLegalMoves color (Pos (px,py)) board = let otherPlayerPosition = colorPos (otherPlayer color) board
validMoves = case color of Black -> [Pos (px + a, py) | a <- [1,2], a /= 2 || px == 1]
White -> [Pos (px - a, py) | a <- [1,2], a /= 2 || px == 6]
optMoves = case color of Black -> [Pos (px + 1, py + 1), Pos (px + 1, py - 1)]
White -> [Pos (px - 1, py + 1), Pos (px - 1, py - 1)]
in [Pos (x,y) | (Pos (x,y)) <- (validMoves \\ otherPlayerPosition) ++ (optMoves `intersect` otherPlayerPosition), boardFilter (Pos (x, y))] | 831 | true | true | 0 | 16 | 528 | 356 | 194 | 162 | null | null |
Philonous/pontarius-xmpp-e2e | test/Xmpp.hs | apache-2.0 | thread1 :: Keystore -> IO ()
thread1 store = do
sem <- newEmptyMVar
keys <- getKey "keyfile4096-1.pem"
let globals = E2EG e2eDefaultParameters keys
(ctx, plugin) <- e2eInit globals policy (\_ -> return "abc")
( return . flip Map.lookup store )
Right sess <- Xmpp.session realm
(Just (\_ -> [Xmpp.scramSha1 username1 Nothing password]
, resource)) config{Xmpp.plugins = [plugin]}
forkIO . forever $ do
Right m <- Xmpp.pullMessage sess
infoM "Pontarius.Xmpp.E2E" $ "received message: " ++ show m
infoM "Pontarius.Xmpp.E2E" $ "Message was : " ++ (if wasEncrypted m then "" else "not " ) ++ "encrypted."
hFlush stdout
forever $ threadDelay 1000000
return () | 781 | thread1 :: Keystore -> IO ()
thread1 store = do
sem <- newEmptyMVar
keys <- getKey "keyfile4096-1.pem"
let globals = E2EG e2eDefaultParameters keys
(ctx, plugin) <- e2eInit globals policy (\_ -> return "abc")
( return . flip Map.lookup store )
Right sess <- Xmpp.session realm
(Just (\_ -> [Xmpp.scramSha1 username1 Nothing password]
, resource)) config{Xmpp.plugins = [plugin]}
forkIO . forever $ do
Right m <- Xmpp.pullMessage sess
infoM "Pontarius.Xmpp.E2E" $ "received message: " ++ show m
infoM "Pontarius.Xmpp.E2E" $ "Message was : " ++ (if wasEncrypted m then "" else "not " ) ++ "encrypted."
hFlush stdout
forever $ threadDelay 1000000
return () | 781 | thread1 store = do
sem <- newEmptyMVar
keys <- getKey "keyfile4096-1.pem"
let globals = E2EG e2eDefaultParameters keys
(ctx, plugin) <- e2eInit globals policy (\_ -> return "abc")
( return . flip Map.lookup store )
Right sess <- Xmpp.session realm
(Just (\_ -> [Xmpp.scramSha1 username1 Nothing password]
, resource)) config{Xmpp.plugins = [plugin]}
forkIO . forever $ do
Right m <- Xmpp.pullMessage sess
infoM "Pontarius.Xmpp.E2E" $ "received message: " ++ show m
infoM "Pontarius.Xmpp.E2E" $ "Message was : " ++ (if wasEncrypted m then "" else "not " ) ++ "encrypted."
hFlush stdout
forever $ threadDelay 1000000
return () | 752 | false | true | 0 | 15 | 230 | 261 | 123 | 138 | null | null |
jsnajder/genprog | src/GenProg.hs | bsd-3-clause | reproducePop :: (MonadRandom m) => Pop e -> m (Ind e)
reproducePop = selectInd | 78 | reproducePop :: (MonadRandom m) => Pop e -> m (Ind e)
reproducePop = selectInd | 78 | reproducePop = selectInd | 24 | false | true | 0 | 9 | 13 | 36 | 18 | 18 | null | null |
urbanslug/ghc | compiler/utils/Outputable.hs | bsd-3-clause | -- showSDocUnsafe is unsafe, because `unsafeGlobalDynFlags` might not be
-- initialised yet.
showSDocUnsafe :: SDoc -> String
showSDocUnsafe sdoc = showSDoc unsafeGlobalDynFlags sdoc | 182 | showSDocUnsafe :: SDoc -> String
showSDocUnsafe sdoc = showSDoc unsafeGlobalDynFlags sdoc | 89 | showSDocUnsafe sdoc = showSDoc unsafeGlobalDynFlags sdoc | 56 | true | true | 0 | 7 | 22 | 30 | 14 | 16 | null | null |
anttisalonen/freekick2 | src/Listings.hs | gpl-3.0 | showDivision 3 = "Third league" | 31 | showDivision 3 = "Third league" | 31 | showDivision 3 = "Third league" | 31 | false | false | 1 | 5 | 4 | 13 | 4 | 9 | null | null |
patrickherrmann/advent2016 | src/Day02.hs | bsd-3-clause | parseDay02 :: Text -> [[Direction]]
parseDay02 = map (map parseDir . Text.unpack) . Text.lines
where
parseDir = \case
'U' -> U
'D' -> D
'L' -> L
'R' -> R | 183 | parseDay02 :: Text -> [[Direction]]
parseDay02 = map (map parseDir . Text.unpack) . Text.lines
where
parseDir = \case
'U' -> U
'D' -> D
'L' -> L
'R' -> R | 183 | parseDay02 = map (map parseDir . Text.unpack) . Text.lines
where
parseDir = \case
'U' -> U
'D' -> D
'L' -> L
'R' -> R | 147 | false | true | 0 | 9 | 59 | 76 | 39 | 37 | null | null |
holmisen/glbrix | src/Primitive.hs | gpl-3.0 | renderBeam :: Double -> Double -> Double -> IO ()
renderBeam l w h = do
GL.renderPrimitive GL.Quads $ do
-- upper:
GL.vertex $ vx3d 0 0 h
GL.vertex $ vx3d w 0 h
GL.vertex $ vx3d w l h
GL.vertex $ vx3d 0 l h
-- lower:
GL.vertex $ vx3d 0 0 0
GL.vertex $ vx3d 0 l 0
GL.vertex $ vx3d w l 0
GL.vertex $ vx3d w 0 0
-- front:
GL.vertex $ vx3d 0 0 0
GL.vertex $ vx3d w 0 0
GL.vertex $ vx3d w 0 h
GL.vertex $ vx3d 0 0 h
-- back:
GL.vertex $ vx3d 0 l 0
GL.vertex $ vx3d 0 l h
GL.vertex $ vx3d w l h
GL.vertex $ vx3d w l 0
-- left:
GL.vertex $ vx3d 0 0 0
GL.vertex $ vx3d 0 0 h
GL.vertex $ vx3d 0 l h
GL.vertex $ vx3d 0 l 0
-- right:
GL.vertex $ vx3d w 0 0
GL.vertex $ vx3d w l 0
GL.vertex $ vx3d w l h
GL.vertex $ vx3d w 0 h
-------------------------------------------------------------------------------- | 979 | renderBeam :: Double -> Double -> Double -> IO ()
renderBeam l w h = do
GL.renderPrimitive GL.Quads $ do
-- upper:
GL.vertex $ vx3d 0 0 h
GL.vertex $ vx3d w 0 h
GL.vertex $ vx3d w l h
GL.vertex $ vx3d 0 l h
-- lower:
GL.vertex $ vx3d 0 0 0
GL.vertex $ vx3d 0 l 0
GL.vertex $ vx3d w l 0
GL.vertex $ vx3d w 0 0
-- front:
GL.vertex $ vx3d 0 0 0
GL.vertex $ vx3d w 0 0
GL.vertex $ vx3d w 0 h
GL.vertex $ vx3d 0 0 h
-- back:
GL.vertex $ vx3d 0 l 0
GL.vertex $ vx3d 0 l h
GL.vertex $ vx3d w l h
GL.vertex $ vx3d w l 0
-- left:
GL.vertex $ vx3d 0 0 0
GL.vertex $ vx3d 0 0 h
GL.vertex $ vx3d 0 l h
GL.vertex $ vx3d 0 l 0
-- right:
GL.vertex $ vx3d w 0 0
GL.vertex $ vx3d w l 0
GL.vertex $ vx3d w l h
GL.vertex $ vx3d w 0 h
-------------------------------------------------------------------------------- | 979 | renderBeam l w h = do
GL.renderPrimitive GL.Quads $ do
-- upper:
GL.vertex $ vx3d 0 0 h
GL.vertex $ vx3d w 0 h
GL.vertex $ vx3d w l h
GL.vertex $ vx3d 0 l h
-- lower:
GL.vertex $ vx3d 0 0 0
GL.vertex $ vx3d 0 l 0
GL.vertex $ vx3d w l 0
GL.vertex $ vx3d w 0 0
-- front:
GL.vertex $ vx3d 0 0 0
GL.vertex $ vx3d w 0 0
GL.vertex $ vx3d w 0 h
GL.vertex $ vx3d 0 0 h
-- back:
GL.vertex $ vx3d 0 l 0
GL.vertex $ vx3d 0 l h
GL.vertex $ vx3d w l h
GL.vertex $ vx3d w l 0
-- left:
GL.vertex $ vx3d 0 0 0
GL.vertex $ vx3d 0 0 h
GL.vertex $ vx3d 0 l h
GL.vertex $ vx3d 0 l 0
-- right:
GL.vertex $ vx3d w 0 0
GL.vertex $ vx3d w l 0
GL.vertex $ vx3d w l h
GL.vertex $ vx3d w 0 h
-------------------------------------------------------------------------------- | 929 | false | true | 0 | 11 | 360 | 440 | 198 | 242 | null | null |
Copilot-Language/sbv-for-copilot | Data/SBV/BitVectors/PrettyNum.hs | bsd-3-clause | smtRoundingMode RoundTowardZero = "roundTowardZero" | 58 | smtRoundingMode RoundTowardZero = "roundTowardZero" | 58 | smtRoundingMode RoundTowardZero = "roundTowardZero" | 58 | false | false | 0 | 5 | 10 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-androidmanagement/gen/Network/Google/Resource/AndroidManagement/Enterprises/WebApps/Patch.hs | mpl-2.0 | -- | V1 error format.
ewapXgafv :: Lens' EnterprisesWebAppsPatch (Maybe Xgafv)
ewapXgafv
= lens _ewapXgafv (\ s a -> s{_ewapXgafv = a}) | 137 | ewapXgafv :: Lens' EnterprisesWebAppsPatch (Maybe Xgafv)
ewapXgafv
= lens _ewapXgafv (\ s a -> s{_ewapXgafv = a}) | 115 | ewapXgafv
= lens _ewapXgafv (\ s a -> s{_ewapXgafv = a}) | 58 | true | true | 0 | 9 | 23 | 48 | 25 | 23 | null | null |
andorp/bead | src/Bead/View/Content/GroupRegistration/Page.hs | bsd-3-clause | groupRegistration = ViewModifyHandler groupRegistrationPage postGroupReg | 72 | groupRegistration = ViewModifyHandler groupRegistrationPage postGroupReg | 72 | groupRegistration = ViewModifyHandler groupRegistrationPage postGroupReg | 72 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | mkHsConApp :: DataCon -> [Type] -> [HsExpr Id] -> LHsExpr Id
-- Used for constructing dictionary terms etc, so no locations
mkHsConApp data_con tys args
= foldl mk_app (nlHsTyApp (dataConWrapId data_con) tys) args
where
mk_app f a = noLoc (HsApp f (noLoc a)) | 266 | mkHsConApp :: DataCon -> [Type] -> [HsExpr Id] -> LHsExpr Id
mkHsConApp data_con tys args
= foldl mk_app (nlHsTyApp (dataConWrapId data_con) tys) args
where
mk_app f a = noLoc (HsApp f (noLoc a)) | 203 | mkHsConApp data_con tys args
= foldl mk_app (nlHsTyApp (dataConWrapId data_con) tys) args
where
mk_app f a = noLoc (HsApp f (noLoc a)) | 142 | true | true | 0 | 9 | 50 | 93 | 46 | 47 | null | null |
fpco/schoolofhaskell | soh-client/src/View/PosMap.hs | mit | selectionToSpan :: State -> SnippetId -> Selection -> Maybe SourceSpan
selectionToSpan state sid =
rangeToSpan state sid . selectionToRange | 141 | selectionToSpan :: State -> SnippetId -> Selection -> Maybe SourceSpan
selectionToSpan state sid =
rangeToSpan state sid . selectionToRange | 141 | selectionToSpan state sid =
rangeToSpan state sid . selectionToRange | 70 | false | true | 0 | 8 | 20 | 40 | 19 | 21 | null | null |
tolysz/wai | warp/Network/Wai/Handler/Warp/Run.hs | mit | flushEntireBody :: IO ByteString -> IO ()
flushEntireBody src =
loop
where
loop = do
bs <- src
unless (S.null bs) loop | 144 | flushEntireBody :: IO ByteString -> IO ()
flushEntireBody src =
loop
where
loop = do
bs <- src
unless (S.null bs) loop | 144 | flushEntireBody src =
loop
where
loop = do
bs <- src
unless (S.null bs) loop | 102 | false | true | 1 | 11 | 47 | 65 | 27 | 38 | null | null |
edwardwas/dimensional-cellular-automata | src/Data/Coord.hs | isc | vectorCycle :: Vector (Succ n) a -> Vector (Succ n) a
vectorCycle a = vectorHead a `vectorAddToBack` vectorTail a | 113 | vectorCycle :: Vector (Succ n) a -> Vector (Succ n) a
vectorCycle a = vectorHead a `vectorAddToBack` vectorTail a | 113 | vectorCycle a = vectorHead a `vectorAddToBack` vectorTail a | 59 | false | true | 0 | 9 | 18 | 56 | 26 | 30 | null | null |
cawinkelmann/api-server | lib/Api/Routes.hs | mit | fallback :: ApiException -> ApiActionM s ()
fallback err = case err of
MissingAuthToken -> status status401 >> text "authorization header required"
UnauthorizedUser -> status status401 >> text "unauthorized"
NoQueryResults -> status status404 >> text "file not found"
NoResourceForUser -> status status404 >> text "user has no associated resource"
(MissingParam p) -> status status422 >> text (LT.concat ["missing parameter: ", p])
(MalformedParam p) -> status status422 >> text (LT.concat ["malformed parameter: ", p])
ServerError t -> status status500 >> text t | 593 | fallback :: ApiException -> ApiActionM s ()
fallback err = case err of
MissingAuthToken -> status status401 >> text "authorization header required"
UnauthorizedUser -> status status401 >> text "unauthorized"
NoQueryResults -> status status404 >> text "file not found"
NoResourceForUser -> status status404 >> text "user has no associated resource"
(MissingParam p) -> status status422 >> text (LT.concat ["missing parameter: ", p])
(MalformedParam p) -> status status422 >> text (LT.concat ["malformed parameter: ", p])
ServerError t -> status status500 >> text t | 593 | fallback err = case err of
MissingAuthToken -> status status401 >> text "authorization header required"
UnauthorizedUser -> status status401 >> text "unauthorized"
NoQueryResults -> status status404 >> text "file not found"
NoResourceForUser -> status status404 >> text "user has no associated resource"
(MissingParam p) -> status status422 >> text (LT.concat ["missing parameter: ", p])
(MalformedParam p) -> status status422 >> text (LT.concat ["malformed parameter: ", p])
ServerError t -> status status500 >> text t | 549 | false | true | 0 | 12 | 110 | 188 | 87 | 101 | null | null |
noteed/hblend | hblend.hs | bsd-3-clause | dump :: Cmd
dump = Dump
{ dumpFormat = Haskell
&= typ "FORMAT"
&= help "dump format"
&= explicit
&= name "f"
&= name "format"
, dumpFile = "" -- TODO mandatory
&= typ "BLEND"
&= help "blend filename"
&= explicit
&= name "b"
&= name "blend-file"
} &= help "Dump some information from a blend file." | 343 | dump :: Cmd
dump = Dump
{ dumpFormat = Haskell
&= typ "FORMAT"
&= help "dump format"
&= explicit
&= name "f"
&= name "format"
, dumpFile = "" -- TODO mandatory
&= typ "BLEND"
&= help "blend filename"
&= explicit
&= name "b"
&= name "blend-file"
} &= help "Dump some information from a blend file." | 343 | dump = Dump
{ dumpFormat = Haskell
&= typ "FORMAT"
&= help "dump format"
&= explicit
&= name "f"
&= name "format"
, dumpFile = "" -- TODO mandatory
&= typ "BLEND"
&= help "blend filename"
&= explicit
&= name "b"
&= name "blend-file"
} &= help "Dump some information from a blend file." | 331 | false | true | 2 | 12 | 102 | 109 | 50 | 59 | null | null |
kojiromike/Idris-dev | src/Idris/Unlit.hs | bsd-3-clause | -- The parser can deal with this, because /every/ (code) line is prefixed
-- with a '>'.
ulLine xs | all isSpace xs = (Blank, "")
-- make sure it's not a doc comment
| otherwise = (Comm, '-':'-':' ':'>':xs) | 269 | ulLine xs | all isSpace xs = (Blank, "")
-- make sure it's not a doc comment
| otherwise = (Comm, '-':'-':' ':'>':xs) | 132 | ulLine xs | all isSpace xs = (Blank, "")
-- make sure it's not a doc comment
| otherwise = (Comm, '-':'-':' ':'>':xs) | 132 | true | false | 2 | 10 | 102 | 58 | 31 | 27 | null | null |
input-output-hk/pos-haskell-prototype | wallet/src/Cardano/Wallet/Kernel/DB/TxMeta/Types.hs | mit | quadBuilder
:: (Buildable a, Buildable b, Buildable c, Buildable d)
=> (a, b, c, d) -> B.Builder
quadBuilder (a, b, c, d) = bprint ("(" % F.build % ", " % F.build % ", "
% F.build % ", " % F.build % ")") a b c d | 225 | quadBuilder
:: (Buildable a, Buildable b, Buildable c, Buildable d)
=> (a, b, c, d) -> B.Builder
quadBuilder (a, b, c, d) = bprint ("(" % F.build % ", " % F.build % ", "
% F.build % ", " % F.build % ")") a b c d | 225 | quadBuilder (a, b, c, d) = bprint ("(" % F.build % ", " % F.build % ", "
% F.build % ", " % F.build % ")") a b c d | 120 | false | true | 0 | 15 | 61 | 130 | 68 | 62 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.