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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wuerges/solutions_for_graph_problems | app/Prob1119.hs | bsd-3-clause | sortOn :: Ord b => (a -> b) -> [a] -> [a]
sortOn = L.sortBy . comparing | 71 | sortOn :: Ord b => (a -> b) -> [a] -> [a]
sortOn = L.sortBy . comparing | 71 | sortOn = L.sortBy . comparing | 29 | false | true | 0 | 8 | 16 | 45 | 24 | 21 | null | null |
input-output-hk/pos-haskell-prototype | infra/src/Pos/Infra/Network/Policy.hs | mit | defaultDequeuePolicyRelay :: DequeuePolicy
defaultDequeuePolicyRelay = go
where
go :: DequeuePolicy
go NodeCore = Dequeue (MaxMsgPerSec 3) (MaxInFlight 2)
go NodeRelay = Dequeue (MaxMsgPerSec 3) (MaxInFlight 2)
go NodeEdge = Dequeue (MaxMsgPerSec 1) (MaxInFlight 2)
-- | Dequeueing policy for standard behind-NAT edge nodes | 344 | defaultDequeuePolicyRelay :: DequeuePolicy
defaultDequeuePolicyRelay = go
where
go :: DequeuePolicy
go NodeCore = Dequeue (MaxMsgPerSec 3) (MaxInFlight 2)
go NodeRelay = Dequeue (MaxMsgPerSec 3) (MaxInFlight 2)
go NodeEdge = Dequeue (MaxMsgPerSec 1) (MaxInFlight 2)
-- | Dequeueing policy for standard behind-NAT edge nodes | 344 | defaultDequeuePolicyRelay = go
where
go :: DequeuePolicy
go NodeCore = Dequeue (MaxMsgPerSec 3) (MaxInFlight 2)
go NodeRelay = Dequeue (MaxMsgPerSec 3) (MaxInFlight 2)
go NodeEdge = Dequeue (MaxMsgPerSec 1) (MaxInFlight 2)
-- | Dequeueing policy for standard behind-NAT edge nodes | 301 | false | true | 3 | 7 | 63 | 93 | 47 | 46 | null | null |
continuouspi/cpiwb | CPi/Signals.hs | gpl-3.0 | disjSig :: Signal -> Signal -> Signal
disjSig s1 s2
| c == d = minCover (c, disjSig' is js)
| otherwise = error "CPi.Signals.disjSig: bad mcc"
where
((c,is),(d,js)) = mcc (s1,s2)
disjSig' [] js = js
disjSig' is [] = is
disjSig' (i:is) (j:js)
| j < i = j : disjSig' (i:is) js
| j > i = i : disjSig' is (j:js)
| otherwise = i : disjSig' is js
-- the Minkowski difference of two intervals | 456 | disjSig :: Signal -> Signal -> Signal
disjSig s1 s2
| c == d = minCover (c, disjSig' is js)
| otherwise = error "CPi.Signals.disjSig: bad mcc"
where
((c,is),(d,js)) = mcc (s1,s2)
disjSig' [] js = js
disjSig' is [] = is
disjSig' (i:is) (j:js)
| j < i = j : disjSig' (i:is) js
| j > i = i : disjSig' is (j:js)
| otherwise = i : disjSig' is js
-- the Minkowski difference of two intervals | 456 | disjSig s1 s2
| c == d = minCover (c, disjSig' is js)
| otherwise = error "CPi.Signals.disjSig: bad mcc"
where
((c,is),(d,js)) = mcc (s1,s2)
disjSig' [] js = js
disjSig' is [] = is
disjSig' (i:is) (j:js)
| j < i = j : disjSig' (i:is) js
| j > i = i : disjSig' is (j:js)
| otherwise = i : disjSig' is js
-- the Minkowski difference of two intervals | 418 | false | true | 8 | 12 | 150 | 215 | 109 | 106 | null | null |
athanclark/lucid-foundation | src/Lucid/Foundation/Structure/Utils.hs | bsd-3-clause | xxlarge_text_left_ :: T.Text
xxlarge_text_left_ = " xxlarge-text-left " | 71 | xxlarge_text_left_ :: T.Text
xxlarge_text_left_ = " xxlarge-text-left " | 71 | xxlarge_text_left_ = " xxlarge-text-left " | 42 | false | true | 0 | 5 | 7 | 13 | 7 | 6 | null | null |
suhailshergill/liboleg | Lambda/QHCFG.hs | bsd-3-clause | sen2_sem = sen2 :: Sem (P C) S | 30 | sen2_sem = sen2 :: Sem (P C) S | 30 | sen2_sem = sen2 :: Sem (P C) S | 30 | false | false | 2 | 6 | 7 | 27 | 10 | 17 | null | null |
caneroj1/HaskellDocs | Models/DocumentComponent.hs | mit | multiSQL :: Query
multiSQL = "insert into DocumentComponents (filename, docID) values (?, ?)" | 93 | multiSQL :: Query
multiSQL = "insert into DocumentComponents (filename, docID) values (?, ?)" | 93 | multiSQL = "insert into DocumentComponents (filename, docID) values (?, ?)" | 75 | false | true | 0 | 6 | 12 | 18 | 7 | 11 | null | null |
bravit/Idris-dev | src/Idris/Info.hs | bsd-3-clause | getIdrisFlagsEnv :: IO [String]
getIdrisFlagsEnv = S.getEnvFlags | 64 | getIdrisFlagsEnv :: IO [String]
getIdrisFlagsEnv = S.getEnvFlags | 64 | getIdrisFlagsEnv = S.getEnvFlags | 32 | false | true | 1 | 6 | 6 | 23 | 10 | 13 | null | null |
berdario/managemytime | src/ManageMyTime/Auth.hs | bsd-3-clause | validateClaims _ (_, Nothing) = return $ Left TokenCorrupted2 | 61 | validateClaims _ (_, Nothing) = return $ Left TokenCorrupted2 | 61 | validateClaims _ (_, Nothing) = return $ Left TokenCorrupted2 | 61 | false | false | 0 | 6 | 8 | 24 | 12 | 12 | null | null |
alexander-at-github/eta | compiler/ETA/BasicTypes/BasicTypes.hs | bsd-3-clause | flipSwap :: SwapFlag -> SwapFlag
flipSwap IsSwapped = NotSwapped | 65 | flipSwap :: SwapFlag -> SwapFlag
flipSwap IsSwapped = NotSwapped | 65 | flipSwap IsSwapped = NotSwapped | 32 | false | true | 0 | 5 | 9 | 22 | 10 | 12 | null | null |
brendanhay/gogol | gogol-admin-reports/gen/Network/Google/Reports/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'UsageReportsWarningsItemDataItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'urwidiValue'
--
-- * 'urwidiKey'
usageReportsWarningsItemDataItem
:: UsageReportsWarningsItemDataItem
usageReportsWarningsItemDataItem =
UsageReportsWarningsItemDataItem'
{_urwidiValue = Nothing, _urwidiKey = Nothing} | 420 | usageReportsWarningsItemDataItem
:: UsageReportsWarningsItemDataItem
usageReportsWarningsItemDataItem =
UsageReportsWarningsItemDataItem'
{_urwidiValue = Nothing, _urwidiKey = Nothing} | 194 | usageReportsWarningsItemDataItem =
UsageReportsWarningsItemDataItem'
{_urwidiValue = Nothing, _urwidiKey = Nothing} | 121 | true | true | 0 | 6 | 59 | 32 | 22 | 10 | null | null |
aztecrex/haskell-experiments-scratch | src/Conduit.hs | bsd-3-clause | cmult2 :: Conduit Int IO Int
cmult2 = CL.map (*2) | 49 | cmult2 :: Conduit Int IO Int
cmult2 = CL.map (*2) | 49 | cmult2 = CL.map (*2) | 20 | false | true | 0 | 6 | 9 | 27 | 14 | 13 | null | null |
bgold-cosmos/Tidal | tidal-listener/src/Sound/Tidal/Hint.hs | gpl-3.0 | hintLoop :: MonadInterpreter m => MVar String -> MVar Response -> m b
hintLoop mIn mOut = do s <- liftIO (readMVar mIn)
let munged = deltaMini s
t <- Hint.typeChecksWithDetails munged
interp t munged
hintLoop mIn mOut
where interp (Left errors) _ = do liftIO $ do putMVar mOut $ HintError $ "Didn't typecheck " ++ concatMap show errors
hPutStrLn stderr $ "error: " ++ concatMap show errors
takeMVar mIn
return ()
interp (Right t) s = do p <- Hint.interpret s (Hint.as :: ControlPattern)
liftIO $ putMVar mOut $ HintOK p
liftIO $ takeMVar mIn
return () | 981 | hintLoop :: MonadInterpreter m => MVar String -> MVar Response -> m b
hintLoop mIn mOut = do s <- liftIO (readMVar mIn)
let munged = deltaMini s
t <- Hint.typeChecksWithDetails munged
interp t munged
hintLoop mIn mOut
where interp (Left errors) _ = do liftIO $ do putMVar mOut $ HintError $ "Didn't typecheck " ++ concatMap show errors
hPutStrLn stderr $ "error: " ++ concatMap show errors
takeMVar mIn
return ()
interp (Right t) s = do p <- Hint.interpret s (Hint.as :: ControlPattern)
liftIO $ putMVar mOut $ HintOK p
liftIO $ takeMVar mIn
return () | 981 | hintLoop mIn mOut = do s <- liftIO (readMVar mIn)
let munged = deltaMini s
t <- Hint.typeChecksWithDetails munged
interp t munged
hintLoop mIn mOut
where interp (Left errors) _ = do liftIO $ do putMVar mOut $ HintError $ "Didn't typecheck " ++ concatMap show errors
hPutStrLn stderr $ "error: " ++ concatMap show errors
takeMVar mIn
return ()
interp (Right t) s = do p <- Hint.interpret s (Hint.as :: ControlPattern)
liftIO $ putMVar mOut $ HintOK p
liftIO $ takeMVar mIn
return () | 911 | false | true | 0 | 15 | 528 | 250 | 109 | 141 | null | null |
shockkolate/web-routes | Web/Routes/RouteT.hs | bsd-3-clause | liftRouteT :: m a -> RouteT url m a
liftRouteT m = RouteT (const m) | 67 | liftRouteT :: m a -> RouteT url m a
liftRouteT m = RouteT (const m) | 67 | liftRouteT m = RouteT (const m) | 31 | false | true | 0 | 7 | 14 | 37 | 17 | 20 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | Advertiser ID of this order document.
odAdvertiserId :: Lens' OrderDocument (Maybe Int64)
odAdvertiserId
= lens _odAdvertiserId
(\ s a -> s{_odAdvertiserId = a})
. mapping _Coerce | 198 | odAdvertiserId :: Lens' OrderDocument (Maybe Int64)
odAdvertiserId
= lens _odAdvertiserId
(\ s a -> s{_odAdvertiserId = a})
. mapping _Coerce | 155 | odAdvertiserId
= lens _odAdvertiserId
(\ s a -> s{_odAdvertiserId = a})
. mapping _Coerce | 103 | true | true | 0 | 10 | 41 | 53 | 28 | 25 | null | null |
martin-kolinek/some-board-game-rules | test/TestFramework.hs | mit | withAdventureProbability :: Int -> GeneratorProperties -> GeneratorProperties
withAdventureProbability probability props = props { interactionProbabilities = (interactionProbabilities props) { adventureProbability = probability}} | 229 | withAdventureProbability :: Int -> GeneratorProperties -> GeneratorProperties
withAdventureProbability probability props = props { interactionProbabilities = (interactionProbabilities props) { adventureProbability = probability}} | 229 | withAdventureProbability probability props = props { interactionProbabilities = (interactionProbabilities props) { adventureProbability = probability}} | 151 | false | true | 0 | 9 | 20 | 46 | 25 | 21 | null | null |
pparkkin/eta | compiler/ETA/Utils/Outputable.hs | bsd-3-clause | renderWithStyle :: DynFlags -> SDoc -> PprStyle -> String
renderWithStyle dflags sdoc sty
= Pretty.showDoc PageMode (pprCols dflags) $
runSDoc sdoc (initSDocContext dflags sty) | 182 | renderWithStyle :: DynFlags -> SDoc -> PprStyle -> String
renderWithStyle dflags sdoc sty
= Pretty.showDoc PageMode (pprCols dflags) $
runSDoc sdoc (initSDocContext dflags sty) | 182 | renderWithStyle dflags sdoc sty
= Pretty.showDoc PageMode (pprCols dflags) $
runSDoc sdoc (initSDocContext dflags sty) | 124 | false | true | 0 | 8 | 29 | 67 | 30 | 37 | null | null |
vigoo/stack | src/Stack/Types/Config.hs | bsd-3-clause | configMonoidSkipGHCCheckName :: Text
configMonoidSkipGHCCheckName = "skip-ghc-check" | 84 | configMonoidSkipGHCCheckName :: Text
configMonoidSkipGHCCheckName = "skip-ghc-check" | 84 | configMonoidSkipGHCCheckName = "skip-ghc-check" | 47 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
cdepillabout/coursera | algorithms1/week1/Percolation.hs | gpl-3.0 | actualIndexLowLevel :: Int -> Int -> Int -> (X, Y)
actualIndexLowLevel sideLength totalLength actualIndex
| actualIndex < 3 || actualIndex > totalLength =
error ("ActualIndex out of range: " ++ show actualIndex)
| otherwise = let actualIndexFromZero = actualIndex - 3
x = (actualIndexFromZero `div` sideLength) + 1
y = (actualIndexFromZero `mod` sideLength) + 1
in (X x, Y y) | 453 | actualIndexLowLevel :: Int -> Int -> Int -> (X, Y)
actualIndexLowLevel sideLength totalLength actualIndex
| actualIndex < 3 || actualIndex > totalLength =
error ("ActualIndex out of range: " ++ show actualIndex)
| otherwise = let actualIndexFromZero = actualIndex - 3
x = (actualIndexFromZero `div` sideLength) + 1
y = (actualIndexFromZero `mod` sideLength) + 1
in (X x, Y y) | 453 | actualIndexLowLevel sideLength totalLength actualIndex
| actualIndex < 3 || actualIndex > totalLength =
error ("ActualIndex out of range: " ++ show actualIndex)
| otherwise = let actualIndexFromZero = actualIndex - 3
x = (actualIndexFromZero `div` sideLength) + 1
y = (actualIndexFromZero `mod` sideLength) + 1
in (X x, Y y) | 402 | false | true | 0 | 12 | 137 | 139 | 72 | 67 | null | null |
bitemyapp/ghc | compiler/types/InstEnv.hs | bsd-3-clause | emptyInstEnv :: InstEnv
emptyInstEnv = emptyUFM | 47 | emptyInstEnv :: InstEnv
emptyInstEnv = emptyUFM | 47 | emptyInstEnv = emptyUFM | 23 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
DougBurke/swish | tests/GraphTest.hs | lgpl-2.1 | t50106 = arc v101 p5 v106 | 25 | t50106 = arc v101 p5 v106 | 25 | t50106 = arc v101 p5 v106 | 25 | false | false | 1 | 5 | 5 | 16 | 6 | 10 | null | null |
mstksg/auto | src/Control/Auto/Generate.hs | mit | _unfoldMF :: Monad m
=> (c -> m (Maybe (b, c)))
-> a
-> Maybe c
-> m (Maybe b, Maybe c)
_unfoldMF _ _ Nothing = return (Nothing, Nothing) | 178 | _unfoldMF :: Monad m
=> (c -> m (Maybe (b, c)))
-> a
-> Maybe c
-> m (Maybe b, Maybe c)
_unfoldMF _ _ Nothing = return (Nothing, Nothing) | 178 | _unfoldMF _ _ Nothing = return (Nothing, Nothing) | 50 | false | true | 0 | 13 | 70 | 90 | 44 | 46 | null | null |
ocharles/hackage-server | Distribution/Client/Mirror/Session.hs | bsd-3-clause | formatGetError (GetInvalidPackage theError) = Sec.pretty theError | 68 | formatGetError (GetInvalidPackage theError) = Sec.pretty theError | 68 | formatGetError (GetInvalidPackage theError) = Sec.pretty theError | 68 | false | false | 0 | 6 | 8 | 21 | 9 | 12 | null | null |
xyst/colour | Main.hs | gpl-3.0 | sgr :: Int -> String
sgr a = "\x1b[" ++ show a ++ "m" | 53 | sgr :: Int -> String
sgr a = "\x1b[" ++ show a ++ "m" | 53 | sgr a = "\x1b[" ++ show a ++ "m" | 32 | false | true | 4 | 7 | 13 | 37 | 15 | 22 | null | null |
tejon/diagrams-contrib | src/Diagrams/TwoD/Path/IteratedSubset.hs | bsd-3-clause | -- | Create a grid of 25 random iterated subset fractals. Impress
-- your friends!
--
-- <<diagrams/src_Diagrams_TwoD_Path_IteratedSubset_randIterGridEx.svg#diagram=randIterGridEx&width=500>>
randIterGrid :: (Renderable (Path V2 n) b, Random n, TypeableFloat n) =>
IO (QDiagram b V2 n Any)
randIterGrid = do
itcs <- evalRandIO (replicateM 25 randITC)
return (LG.gridCat . map drawITCScaled $ itcs)
-- > import Diagrams.TwoD.Path.IteratedSubset
-- > randIterGridEx = randIterGrid | 502 | randIterGrid :: (Renderable (Path V2 n) b, Random n, TypeableFloat n) =>
IO (QDiagram b V2 n Any)
randIterGrid = do
itcs <- evalRandIO (replicateM 25 randITC)
return (LG.gridCat . map drawITCScaled $ itcs)
-- > import Diagrams.TwoD.Path.IteratedSubset
-- > randIterGridEx = randIterGrid | 307 | randIterGrid = do
itcs <- evalRandIO (replicateM 25 randITC)
return (LG.gridCat . map drawITCScaled $ itcs)
-- > import Diagrams.TwoD.Path.IteratedSubset
-- > randIterGridEx = randIterGrid | 193 | true | true | 0 | 11 | 84 | 103 | 53 | 50 | null | null |
shlevy/hnix-store | hnix-store-remote/src/System/Nix/Store/Remote/Protocol.hs | mit | opNum AddTextToStore = 8 | 37 | opNum AddTextToStore = 8 | 37 | opNum AddTextToStore = 8 | 37 | false | false | 0 | 5 | 16 | 9 | 4 | 5 | null | null |
bgamari/text | src/Data/Text/Unsafe.hs | bsd-2-clause | -- | /O(1)/ Return the length of a 'Text' in units of 'Word16'. This
-- is useful for sizing a target array appropriately before using
-- 'unsafeCopyToPtr'.
lengthWord16 :: Text -> Int
lengthWord16 (Text _arr _off len) = len | 225 | lengthWord16 :: Text -> Int
lengthWord16 (Text _arr _off len) = len | 67 | lengthWord16 (Text _arr _off len) = len | 39 | true | true | 0 | 7 | 39 | 31 | 17 | 14 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_456 x = happyTcHack x happyReduce_264 | 44 | action_456 x = happyTcHack x happyReduce_264 | 44 | action_456 x = happyTcHack x happyReduce_264 | 44 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
ku-fpg/kansas-amber | tests/ExprTests/ExprInt8.hs | bsd-3-clause | prop_sign :: ArduinoConnection -> RemoteRef Int8 -> Int8 -> Property
prop_sign c r x = monadicIO $ do
let local = signum x
remote <- run $ send c $ do
writeRemoteRefE r $ signum (lit x)
v <- readRemoteRefE r
return v
assert (local == litEval8 remote) | 286 | prop_sign :: ArduinoConnection -> RemoteRef Int8 -> Int8 -> Property
prop_sign c r x = monadicIO $ do
let local = signum x
remote <- run $ send c $ do
writeRemoteRefE r $ signum (lit x)
v <- readRemoteRefE r
return v
assert (local == litEval8 remote) | 286 | prop_sign c r x = monadicIO $ do
let local = signum x
remote <- run $ send c $ do
writeRemoteRefE r $ signum (lit x)
v <- readRemoteRefE r
return v
assert (local == litEval8 remote) | 217 | false | true | 0 | 15 | 83 | 118 | 52 | 66 | null | null |
substance/letterpress | Pandoc/Filters/ParseHtml.hs | gpl-3.0 | parseInline x = [x] | 19 | parseInline x = [x] | 19 | parseInline x = [x] | 19 | false | false | 0 | 5 | 3 | 12 | 6 | 6 | null | null |
thielema/wxhaskell | wx/src/Graphics/UI/WX/Frame.hs | lgpl-2.1 | diChildFrame :: MDIParentFrame a -> [Prop (MDIChildFrame ())] -> IO (MDIChildFrame ())
mdiChildFrame parent props
= mdiChildFrameEx parent defaultStyle props
| 160 | mdiChildFrame :: MDIParentFrame a -> [Prop (MDIChildFrame ())] -> IO (MDIChildFrame ())
mdiChildFrame parent props
= mdiChildFrameEx parent defaultStyle props | 160 | mdiChildFrame parent props
= mdiChildFrameEx parent defaultStyle props | 72 | false | true | 0 | 11 | 22 | 63 | 29 | 34 | null | null |
StevenWInfo/haskell-soda | src/Soda.hs | mit | parseReturnVal "multiline" val = fmap RMultiLine ((parseJSON val) :: Parser MultiLine) | 89 | parseReturnVal "multiline" val = fmap RMultiLine ((parseJSON val) :: Parser MultiLine) | 89 | parseReturnVal "multiline" val = fmap RMultiLine ((parseJSON val) :: Parser MultiLine) | 89 | false | false | 1 | 8 | 13 | 33 | 15 | 18 | null | null |
mightymoose/liquidhaskell | benchmarks/bytestring-0.9.2.1/Data/ByteString/Char8.hs | bsd-3-clause | -- | 'zipWith' generalises 'zip' by zipping with the function given as
-- the first argument, instead of a tupling function. For example,
-- @'zipWith' (+)@ is applied to two ByteStrings to produce the list
-- of corresponding sums.
zipWith :: (Char -> Char -> a) -> ByteString -> ByteString -> [a]
zipWith f = B.zipWith ((. w2c) . f . w2c) | 341 | zipWith :: (Char -> Char -> a) -> ByteString -> ByteString -> [a]
zipWith f = B.zipWith ((. w2c) . f . w2c) | 107 | zipWith f = B.zipWith ((. w2c) . f . w2c) | 41 | true | true | 0 | 9 | 62 | 64 | 36 | 28 | null | null |
ryzhyk/cocoon | cocoon/Util.hs | apache-2.0 | log2 n
| n>1 = 1 + log2 (n `div` 2)
| otherwise = error "log2: negative argument" | 90 | log2 n
| n>1 = 1 + log2 (n `div` 2)
| otherwise = error "log2: negative argument" | 90 | log2 n
| n>1 = 1 + log2 (n `div` 2)
| otherwise = error "log2: negative argument" | 90 | false | false | 0 | 9 | 26 | 47 | 22 | 25 | null | null |
knrafto/bash-config | src/Bash/Config/Expand.hs | bsd-3-clause | braceExpand :: Word -> [Word]
braceExpand = map reinterpret . go
where
go w = case brace w of
Nothing -> [w]
Just ws -> ws
brace w = do
(preamble, w') <- breakOn (Char '{') w
(amble, postamble) <- breakOn (Char '}') w'
let as = expandAmble amble
bs = go postamble
return [preamble ++ a ++ b | a <- as, b <- bs]
expandAmble = concatAmble . map go . splitOn (Char ',')
concatAmble [] = ["{}"]
concatAmble [xs] = map (\s -> "{" ++ s ++ "}") xs
concatAmble xss = concat xss
reinterpret w = case parse word "" (toString w) of
Left _ -> w
Right w' -> w'
-- | Fail if a tilde expansion should be performed. | 719 | braceExpand :: Word -> [Word]
braceExpand = map reinterpret . go
where
go w = case brace w of
Nothing -> [w]
Just ws -> ws
brace w = do
(preamble, w') <- breakOn (Char '{') w
(amble, postamble) <- breakOn (Char '}') w'
let as = expandAmble amble
bs = go postamble
return [preamble ++ a ++ b | a <- as, b <- bs]
expandAmble = concatAmble . map go . splitOn (Char ',')
concatAmble [] = ["{}"]
concatAmble [xs] = map (\s -> "{" ++ s ++ "}") xs
concatAmble xss = concat xss
reinterpret w = case parse word "" (toString w) of
Left _ -> w
Right w' -> w'
-- | Fail if a tilde expansion should be performed. | 719 | braceExpand = map reinterpret . go
where
go w = case brace w of
Nothing -> [w]
Just ws -> ws
brace w = do
(preamble, w') <- breakOn (Char '{') w
(amble, postamble) <- breakOn (Char '}') w'
let as = expandAmble amble
bs = go postamble
return [preamble ++ a ++ b | a <- as, b <- bs]
expandAmble = concatAmble . map go . splitOn (Char ',')
concatAmble [] = ["{}"]
concatAmble [xs] = map (\s -> "{" ++ s ++ "}") xs
concatAmble xss = concat xss
reinterpret w = case parse word "" (toString w) of
Left _ -> w
Right w' -> w'
-- | Fail if a tilde expansion should be performed. | 689 | false | true | 0 | 10 | 244 | 295 | 145 | 150 | null | null |
Enzo-Liu/cis194 | src/TypeClass04.hs | bsd-3-clause | -- Exercise 1 -----------------------------------------
x :: Num a => Poly a
x = P [0,1] | 89 | x :: Num a => Poly a
x = P [0,1] | 32 | x = P [0,1] | 11 | true | true | 0 | 7 | 15 | 36 | 17 | 19 | null | null |
sleexyz/haskell-fun | LinearAlgebra.hs | bsd-3-clause | -- | This is isomorphic to the matrix representation
around' :: (Bool, Bool) -> Float
around' (i, j) = rot90 x i + rot90 y j
where
x True = 1
x False = 0
y True = 0
y False = 1 | 197 | around' :: (Bool, Bool) -> Float
around' (i, j) = rot90 x i + rot90 y j
where
x True = 1
x False = 0
y True = 0
y False = 1 | 144 | around' (i, j) = rot90 x i + rot90 y j
where
x True = 1
x False = 0
y True = 0
y False = 1 | 110 | true | true | 4 | 6 | 63 | 98 | 42 | 56 | null | null |
hlian/basilica | Main.hs | mit | main :: IO ()
main = do
conf <- Conf.load [Conf.Required "conf"]
port <- Conf.require conf "port"
origin <- Conf.lookup conf "client-origin"
mailer <- newMailer <$> Conf.require conf "mandrill-key"
clientUrl <- Conf.require conf "client-url"
db <- newDatabase =<< Conf.require conf "dbpath"
emailChan <- newChan
server <- Sockets.newServer (dbPostChan db)
api <- basilica origin db emailChan
forkIO $ getChanContents emailChan >>= mapM_ (sendCodeMail mailer clientUrl)
putStrLn $ "Running on port " ++ show port
Warp.run port (websocketsOr defaultConnectionOptions server api) | 600 | main :: IO ()
main = do
conf <- Conf.load [Conf.Required "conf"]
port <- Conf.require conf "port"
origin <- Conf.lookup conf "client-origin"
mailer <- newMailer <$> Conf.require conf "mandrill-key"
clientUrl <- Conf.require conf "client-url"
db <- newDatabase =<< Conf.require conf "dbpath"
emailChan <- newChan
server <- Sockets.newServer (dbPostChan db)
api <- basilica origin db emailChan
forkIO $ getChanContents emailChan >>= mapM_ (sendCodeMail mailer clientUrl)
putStrLn $ "Running on port " ++ show port
Warp.run port (websocketsOr defaultConnectionOptions server api) | 600 | main = do
conf <- Conf.load [Conf.Required "conf"]
port <- Conf.require conf "port"
origin <- Conf.lookup conf "client-origin"
mailer <- newMailer <$> Conf.require conf "mandrill-key"
clientUrl <- Conf.require conf "client-url"
db <- newDatabase =<< Conf.require conf "dbpath"
emailChan <- newChan
server <- Sockets.newServer (dbPostChan db)
api <- basilica origin db emailChan
forkIO $ getChanContents emailChan >>= mapM_ (sendCodeMail mailer clientUrl)
putStrLn $ "Running on port " ++ show port
Warp.run port (websocketsOr defaultConnectionOptions server api) | 586 | false | true | 0 | 11 | 102 | 212 | 94 | 118 | null | null |
kumasento/accelerate-cuda | Data/Array/Accelerate/CUDA/Context.hs | bsd-3-clause | fromDeviceContext :: CUDA.Device -> CUDA.Context -> IO Context
fromDeviceContext dev ctx = do
prp <- CUDA.props dev
weak <- mkWeakContext ctx $ do
message dump_gc $ "gc: finalise context #" ++ show (CUDA.useContext ctx)
CUDA.destroy ctx
message dump_gc $ "gc: initialise context #" ++ show (CUDA.useContext ctx)
return $! Context prp ctx weak
-- | Destroy the specified context. This will fail if the context is more than
-- single attachment.
--
| 484 | fromDeviceContext :: CUDA.Device -> CUDA.Context -> IO Context
fromDeviceContext dev ctx = do
prp <- CUDA.props dev
weak <- mkWeakContext ctx $ do
message dump_gc $ "gc: finalise context #" ++ show (CUDA.useContext ctx)
CUDA.destroy ctx
message dump_gc $ "gc: initialise context #" ++ show (CUDA.useContext ctx)
return $! Context prp ctx weak
-- | Destroy the specified context. This will fail if the context is more than
-- single attachment.
--
| 484 | fromDeviceContext dev ctx = do
prp <- CUDA.props dev
weak <- mkWeakContext ctx $ do
message dump_gc $ "gc: finalise context #" ++ show (CUDA.useContext ctx)
CUDA.destroy ctx
message dump_gc $ "gc: initialise context #" ++ show (CUDA.useContext ctx)
return $! Context prp ctx weak
-- | Destroy the specified context. This will fail if the context is more than
-- single attachment.
--
| 421 | false | true | 0 | 15 | 109 | 132 | 60 | 72 | null | null |
codeq/pyhint | src/PyHint/Context.hs | bsd-3-clause | pop (scope:ctx) =
mbdirty $ insertSymbols smap $ insertSubscopes subscopes $ insertBindings bindings ctx
where bindings = S.getUsedBindings scope
subscopes = S.getExternalSubscopes scope
smap = S.getExternalSymbolMap scope
mbdirty = if S.isDirty scope && S.isInline scope then dirty else id
-- | Marks the scope on the top of the context as dirty. | 384 | pop (scope:ctx) =
mbdirty $ insertSymbols smap $ insertSubscopes subscopes $ insertBindings bindings ctx
where bindings = S.getUsedBindings scope
subscopes = S.getExternalSubscopes scope
smap = S.getExternalSymbolMap scope
mbdirty = if S.isDirty scope && S.isInline scope then dirty else id
-- | Marks the scope on the top of the context as dirty. | 384 | pop (scope:ctx) =
mbdirty $ insertSymbols smap $ insertSubscopes subscopes $ insertBindings bindings ctx
where bindings = S.getUsedBindings scope
subscopes = S.getExternalSubscopes scope
smap = S.getExternalSymbolMap scope
mbdirty = if S.isDirty scope && S.isInline scope then dirty else id
-- | Marks the scope on the top of the context as dirty. | 384 | false | false | 2 | 8 | 88 | 103 | 49 | 54 | null | null |
ejlilley/AbstractMusic | MusicGraph.hs | gpl-3.0 | first _ [] = Nothing | 20 | first _ [] = Nothing | 20 | first _ [] = Nothing | 20 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
brendanhay/gogol | gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs | mpl-2.0 | -- | Elements of the list.
fplElements :: Lens' FloatingPointList [Double]
fplElements
= lens _fplElements (\ s a -> s{_fplElements = a}) .
_Default
. _Coerce | 172 | fplElements :: Lens' FloatingPointList [Double]
fplElements
= lens _fplElements (\ s a -> s{_fplElements = a}) .
_Default
. _Coerce | 145 | fplElements
= lens _fplElements (\ s a -> s{_fplElements = a}) .
_Default
. _Coerce | 97 | true | true | 0 | 11 | 39 | 53 | 28 | 25 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_MAX_PROGRAM_SUBROUTINE_NUM_NV :: GLenum
gl_MAX_PROGRAM_SUBROUTINE_NUM_NV = 0x8F45 | 84 | gl_MAX_PROGRAM_SUBROUTINE_NUM_NV :: GLenum
gl_MAX_PROGRAM_SUBROUTINE_NUM_NV = 0x8F45 | 84 | gl_MAX_PROGRAM_SUBROUTINE_NUM_NV = 0x8F45 | 41 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
ekmett/text | tests/Tests/Properties.hs | bsd-2-clause | shiftR_Word32 = shiftR :: Word32 -> Property | 44 | shiftR_Word32 = shiftR :: Word32 -> Property | 44 | shiftR_Word32 = shiftR :: Word32 -> Property | 44 | false | false | 0 | 5 | 6 | 13 | 7 | 6 | null | null |
mrak/stubby4hs | src/lib/Stubby/Settings.hs | apache-2.0 | locationOption :: Parser String
locationOption = strOption
( long "location"
<> short 'l'
<> metavar "ADDRESS"
<> help "Network address at which to bind stubby.")
<|> pure (getLocation defaultSettings) | 221 | locationOption :: Parser String
locationOption = strOption
( long "location"
<> short 'l'
<> metavar "ADDRESS"
<> help "Network address at which to bind stubby.")
<|> pure (getLocation defaultSettings) | 221 | locationOption = strOption
( long "location"
<> short 'l'
<> metavar "ADDRESS"
<> help "Network address at which to bind stubby.")
<|> pure (getLocation defaultSettings) | 189 | false | true | 3 | 10 | 48 | 60 | 28 | 32 | null | null |
brendanhay/gogol | gogol-redis/gen/Network/Google/Resource/Redis/Projects/Locations/Instances/RescheduleMaintenance.hs | mpl-2.0 | -- | JSONP
plirmCallback :: Lens' ProjectsLocationsInstancesRescheduleMaintenance (Maybe Text)
plirmCallback
= lens _plirmCallback
(\ s a -> s{_plirmCallback = a}) | 171 | plirmCallback :: Lens' ProjectsLocationsInstancesRescheduleMaintenance (Maybe Text)
plirmCallback
= lens _plirmCallback
(\ s a -> s{_plirmCallback = a}) | 160 | plirmCallback
= lens _plirmCallback
(\ s a -> s{_plirmCallback = a}) | 76 | true | true | 1 | 9 | 27 | 52 | 25 | 27 | null | null |
themoritz/cabal | cabal-install/Distribution/Client/FileMonitor.hs | bsd-3-clause | -- | Monitor a set of files (or directories) identified by a file glob.
-- The monitored glob is considered to have changed if the set of files
-- matching the glob changes (i.e. creations or deletions), or for files if the
-- modification time and content hash of any matching file has changed.
--
monitorFileGlob :: FilePathGlob -> MonitorFilePath
monitorFileGlob = MonitorFileGlob FileHashed DirExists | 404 | monitorFileGlob :: FilePathGlob -> MonitorFilePath
monitorFileGlob = MonitorFileGlob FileHashed DirExists | 105 | monitorFileGlob = MonitorFileGlob FileHashed DirExists | 54 | true | true | 0 | 5 | 64 | 25 | 15 | 10 | null | null |
wxzh/fcore | lib/SymbolicEvaluator.hs | bsd-2-clause | eval (App e1 e2) =
case eval e1 of
VFun f -> f (eval e2)
_ -> panic "e1 is not a function" | 106 | eval (App e1 e2) =
case eval e1 of
VFun f -> f (eval e2)
_ -> panic "e1 is not a function" | 106 | eval (App e1 e2) =
case eval e1 of
VFun f -> f (eval e2)
_ -> panic "e1 is not a function" | 106 | false | false | 0 | 10 | 38 | 52 | 23 | 29 | null | null |
allanderek/ipclib | Language/Hydra/Print.hs | gpl-2.0 | ipcActivePassiveFun :: String
ipcActivePassiveFun = "ipc_active_passive" | 72 | ipcActivePassiveFun :: String
ipcActivePassiveFun = "ipc_active_passive" | 72 | ipcActivePassiveFun = "ipc_active_passive" | 42 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
neglectedvalue/xmobar-freebsd | Plugins/Monitors/Batt.hs | bsd-3-clause | runBatt' :: [String] -> [String] -> Monitor String
runBatt' bfs _ = do
c <- io $ parseBATT (map file2batfile bfs)
case c of
Batt x -> do l <- formatBatt x
parseTemplate l
NA -> return "N/A" | 218 | runBatt' :: [String] -> [String] -> Monitor String
runBatt' bfs _ = do
c <- io $ parseBATT (map file2batfile bfs)
case c of
Batt x -> do l <- formatBatt x
parseTemplate l
NA -> return "N/A" | 218 | runBatt' bfs _ = do
c <- io $ parseBATT (map file2batfile bfs)
case c of
Batt x -> do l <- formatBatt x
parseTemplate l
NA -> return "N/A" | 167 | false | true | 0 | 13 | 66 | 96 | 44 | 52 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Latex.hs | gpl-2.0 | parseRules ("LaTeX","FancyLabel") =
(((pRegExpr regex_'5cs'2a'5c'7b'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FancyLabelParameter"))
<|>
((pRegExpr regex_'5cs'2a'5c'5b'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FancyLabelOption"))
<|>
((pRegExpr regex_'5cs'2a'5c'28'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FancyLabelRoundBrackets"))
<|>
((popContext) >> currentContext >>= parseRules)) | 466 | parseRules ("LaTeX","FancyLabel") =
(((pRegExpr regex_'5cs'2a'5c'7b'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FancyLabelParameter"))
<|>
((pRegExpr regex_'5cs'2a'5c'5b'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FancyLabelOption"))
<|>
((pRegExpr regex_'5cs'2a'5c'28'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FancyLabelRoundBrackets"))
<|>
((popContext) >> currentContext >>= parseRules)) | 466 | parseRules ("LaTeX","FancyLabel") =
(((pRegExpr regex_'5cs'2a'5c'7b'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FancyLabelParameter"))
<|>
((pRegExpr regex_'5cs'2a'5c'5b'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FancyLabelOption"))
<|>
((pRegExpr regex_'5cs'2a'5c'28'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FancyLabelRoundBrackets"))
<|>
((popContext) >> currentContext >>= parseRules)) | 466 | false | false | 0 | 13 | 54 | 131 | 69 | 62 | null | null |
eniac314/wizzard | src/Graphics.hs | gpl-3.0 | loadBMPColorKeyTexture :: Renderer -> String -> Color -> IO Texture
loadBMPColorKeyTexture renderer path (r,g,b,a) =
do loadedSurface <- loadBMP path
let key = V4 r g b a
SDL.surfaceColorKey loadedSurface $= Just key
texture <- createTextureFromSurface renderer loadedSurface
freeSurface loadedSurface
return texture | 344 | loadBMPColorKeyTexture :: Renderer -> String -> Color -> IO Texture
loadBMPColorKeyTexture renderer path (r,g,b,a) =
do loadedSurface <- loadBMP path
let key = V4 r g b a
SDL.surfaceColorKey loadedSurface $= Just key
texture <- createTextureFromSurface renderer loadedSurface
freeSurface loadedSurface
return texture | 344 | loadBMPColorKeyTexture renderer path (r,g,b,a) =
do loadedSurface <- loadBMP path
let key = V4 r g b a
SDL.surfaceColorKey loadedSurface $= Just key
texture <- createTextureFromSurface renderer loadedSurface
freeSurface loadedSurface
return texture | 276 | false | true | 0 | 11 | 69 | 117 | 52 | 65 | null | null |
alexander-b/thug-beginners | lessonA/A2List.hs | gpl-3.0 | -- Then we get to the interesting bit. If there is just one member, then
-- that's the last member, obviously. But if there are more, then we use
-- recursion. We try to figure out, what's the last member of the tail of that
-- list?
lastList (x `Cons` Nil) = Have x | 266 | lastList (x `Cons` Nil) = Have x | 32 | lastList (x `Cons` Nil) = Have x | 32 | true | false | 0 | 6 | 53 | 26 | 15 | 11 | null | null |
pgj/bead | src/Bead/Domain/Relationships.hs | bsd-3-clause | scoreKey f (ScoreKey x) = f x | 29 | scoreKey f (ScoreKey x) = f x | 29 | scoreKey f (ScoreKey x) = f x | 29 | false | false | 0 | 6 | 6 | 22 | 9 | 13 | null | null |
seL4/capDL-tool | CapDL/MakeModel.hs | bsd-2-clause | addIRQMappings :: ObjMap Word -> IRQMap -> [CapMapping] -> SlotState IRQMap
addIRQMappings objs irqNode =
foldl' (addIRQMapping objs) (return irqNode) | 154 | addIRQMappings :: ObjMap Word -> IRQMap -> [CapMapping] -> SlotState IRQMap
addIRQMappings objs irqNode =
foldl' (addIRQMapping objs) (return irqNode) | 154 | addIRQMappings objs irqNode =
foldl' (addIRQMapping objs) (return irqNode) | 78 | false | true | 0 | 9 | 23 | 60 | 27 | 33 | null | null |
GaloisInc/saw-script | saw-core/src/Verifier/SAW/Term/Functor.hs | bsd-3-clause | alistAllFields (fld:flds) alist
| Just val <- lookup fld alist =
(val :) <$> alistAllFields flds (deleteField fld alist)
where
deleteField _ [] = error "deleteField"
deleteField f ((f',_):rest) | f == f' = rest
deleteField f (x:rest) = x : deleteField f rest | 278 | alistAllFields (fld:flds) alist
| Just val <- lookup fld alist =
(val :) <$> alistAllFields flds (deleteField fld alist)
where
deleteField _ [] = error "deleteField"
deleteField f ((f',_):rest) | f == f' = rest
deleteField f (x:rest) = x : deleteField f rest | 278 | alistAllFields (fld:flds) alist
| Just val <- lookup fld alist =
(val :) <$> alistAllFields flds (deleteField fld alist)
where
deleteField _ [] = error "deleteField"
deleteField f ((f',_):rest) | f == f' = rest
deleteField f (x:rest) = x : deleteField f rest | 278 | false | false | 3 | 10 | 63 | 132 | 65 | 67 | null | null |
ntc2/cryptol | src/Cryptol/Parser/LexerUtils.hs | bsd-3-clause | -- Add separators computed from layout
layout :: Config -> [Located Token] -> [Located Token]
layout cfg ts0 = loop False implicitScope [] ts0
where
(_pos0,implicitScope) = case ts0 of
t : _ -> (from (srcRange t), cfgModuleScope cfg && tokenType (thing t) /= KW KW_module)
_ -> (start,False)
loop :: Bool -> Bool -> [Block] -> [Located Token] -> [Located Token]
loop afterDoc startBlock stack (t : ts)
| startsLayout ty = toks ++ loop False True stack' ts
| Sym ParenL <- ty = toks ++ loop False False (Explicit (Sym ParenR) : stack') ts
| Sym CurlyL <- ty = toks ++ loop False False (Explicit (Sym CurlyR) : stack') ts
| Sym BracketL <- ty = toks ++ loop False False (Explicit (Sym BracketR) : stack') ts
| EOF <- ty = toks
| White DocStr <- ty = toks ++ loop True False stack' ts
| otherwise = toks ++ loop False False stack' ts
where
ty = tokenType (thing t)
pos = srcRange t
(toks,offStack)
| afterDoc = ([t], stack)
| otherwise = offsides startToks t stack
-- add any block start tokens, and push a level on the stack
(startToks,stack')
| startBlock && ty == EOF = ( [ virt cfg (to pos) VCurlyR
, virt cfg (to pos) VCurlyL ]
, offStack )
| startBlock = ( [ virt cfg (to pos) VCurlyL ], Virtual (col (from pos)) : offStack )
| otherwise = ( [], offStack )
loop _ _ _ [] = panic "[Lexer] layout" ["Missing EOF token"]
offsides :: [Located Token] -> Located Token -> [Block] -> ([Located Token], [Block])
offsides startToks t = go startToks
where
go virts stack = case stack of
-- delimit or close a layout block
Virtual c : rest
-- commas only close to an explicit marker, so if there is none, the
-- comma doesn't close anything
| Sym Comma == ty ->
if any isExplicit rest
then go (virt cfg (to pos) VCurlyR : virts) rest
else done virts stack
| closingToken -> go (virt cfg (to pos) VCurlyR : virts) rest
| col (from pos) == c -> done (virt cfg (to pos) VSemi : virts) stack
| col (from pos) < c -> go (virt cfg (to pos) VCurlyR : virts) rest
-- close an explicit block
Explicit close : rest | close == ty -> done virts rest
| Sym Comma == ty -> done virts stack
_ -> done virts stack
ty = tokenType (thing t)
pos = srcRange t
done ts s = (reverse (t:ts), s)
closingToken = ty `elem` [ Sym ParenR, Sym BracketR, Sym CurlyR ] | 2,811 | layout :: Config -> [Located Token] -> [Located Token]
layout cfg ts0 = loop False implicitScope [] ts0
where
(_pos0,implicitScope) = case ts0 of
t : _ -> (from (srcRange t), cfgModuleScope cfg && tokenType (thing t) /= KW KW_module)
_ -> (start,False)
loop :: Bool -> Bool -> [Block] -> [Located Token] -> [Located Token]
loop afterDoc startBlock stack (t : ts)
| startsLayout ty = toks ++ loop False True stack' ts
| Sym ParenL <- ty = toks ++ loop False False (Explicit (Sym ParenR) : stack') ts
| Sym CurlyL <- ty = toks ++ loop False False (Explicit (Sym CurlyR) : stack') ts
| Sym BracketL <- ty = toks ++ loop False False (Explicit (Sym BracketR) : stack') ts
| EOF <- ty = toks
| White DocStr <- ty = toks ++ loop True False stack' ts
| otherwise = toks ++ loop False False stack' ts
where
ty = tokenType (thing t)
pos = srcRange t
(toks,offStack)
| afterDoc = ([t], stack)
| otherwise = offsides startToks t stack
-- add any block start tokens, and push a level on the stack
(startToks,stack')
| startBlock && ty == EOF = ( [ virt cfg (to pos) VCurlyR
, virt cfg (to pos) VCurlyL ]
, offStack )
| startBlock = ( [ virt cfg (to pos) VCurlyL ], Virtual (col (from pos)) : offStack )
| otherwise = ( [], offStack )
loop _ _ _ [] = panic "[Lexer] layout" ["Missing EOF token"]
offsides :: [Located Token] -> Located Token -> [Block] -> ([Located Token], [Block])
offsides startToks t = go startToks
where
go virts stack = case stack of
-- delimit or close a layout block
Virtual c : rest
-- commas only close to an explicit marker, so if there is none, the
-- comma doesn't close anything
| Sym Comma == ty ->
if any isExplicit rest
then go (virt cfg (to pos) VCurlyR : virts) rest
else done virts stack
| closingToken -> go (virt cfg (to pos) VCurlyR : virts) rest
| col (from pos) == c -> done (virt cfg (to pos) VSemi : virts) stack
| col (from pos) < c -> go (virt cfg (to pos) VCurlyR : virts) rest
-- close an explicit block
Explicit close : rest | close == ty -> done virts rest
| Sym Comma == ty -> done virts stack
_ -> done virts stack
ty = tokenType (thing t)
pos = srcRange t
done ts s = (reverse (t:ts), s)
closingToken = ty `elem` [ Sym ParenR, Sym BracketR, Sym CurlyR ] | 2,772 | layout cfg ts0 = loop False implicitScope [] ts0
where
(_pos0,implicitScope) = case ts0 of
t : _ -> (from (srcRange t), cfgModuleScope cfg && tokenType (thing t) /= KW KW_module)
_ -> (start,False)
loop :: Bool -> Bool -> [Block] -> [Located Token] -> [Located Token]
loop afterDoc startBlock stack (t : ts)
| startsLayout ty = toks ++ loop False True stack' ts
| Sym ParenL <- ty = toks ++ loop False False (Explicit (Sym ParenR) : stack') ts
| Sym CurlyL <- ty = toks ++ loop False False (Explicit (Sym CurlyR) : stack') ts
| Sym BracketL <- ty = toks ++ loop False False (Explicit (Sym BracketR) : stack') ts
| EOF <- ty = toks
| White DocStr <- ty = toks ++ loop True False stack' ts
| otherwise = toks ++ loop False False stack' ts
where
ty = tokenType (thing t)
pos = srcRange t
(toks,offStack)
| afterDoc = ([t], stack)
| otherwise = offsides startToks t stack
-- add any block start tokens, and push a level on the stack
(startToks,stack')
| startBlock && ty == EOF = ( [ virt cfg (to pos) VCurlyR
, virt cfg (to pos) VCurlyL ]
, offStack )
| startBlock = ( [ virt cfg (to pos) VCurlyL ], Virtual (col (from pos)) : offStack )
| otherwise = ( [], offStack )
loop _ _ _ [] = panic "[Lexer] layout" ["Missing EOF token"]
offsides :: [Located Token] -> Located Token -> [Block] -> ([Located Token], [Block])
offsides startToks t = go startToks
where
go virts stack = case stack of
-- delimit or close a layout block
Virtual c : rest
-- commas only close to an explicit marker, so if there is none, the
-- comma doesn't close anything
| Sym Comma == ty ->
if any isExplicit rest
then go (virt cfg (to pos) VCurlyR : virts) rest
else done virts stack
| closingToken -> go (virt cfg (to pos) VCurlyR : virts) rest
| col (from pos) == c -> done (virt cfg (to pos) VSemi : virts) stack
| col (from pos) < c -> go (virt cfg (to pos) VCurlyR : virts) rest
-- close an explicit block
Explicit close : rest | close == ty -> done virts rest
| Sym Comma == ty -> done virts stack
_ -> done virts stack
ty = tokenType (thing t)
pos = srcRange t
done ts s = (reverse (t:ts), s)
closingToken = ty `elem` [ Sym ParenR, Sym BracketR, Sym CurlyR ] | 2,717 | true | true | 40 | 18 | 1,023 | 1,002 | 503 | 499 | null | null |
robeverest/accelerate | Data/Array/Accelerate/Interpreter.hs | bsd-3-clause | evalOpenExp (IndexSlice sliceIndex slix sh) env aenv
= Sugar.toElt
$ restrict sliceIndex (Sugar.fromElt $ evalOpenExp slix env aenv)
(Sugar.fromElt $ evalOpenExp sh env aenv)
where
restrict :: SliceIndex slix sl co sh -> slix -> sh -> sl
restrict SliceNil () () = ()
restrict (SliceAll sliceIdx) (slx, ()) (sl, sz)
= let sl' = restrict sliceIdx slx sl
in (sl', sz)
restrict (SliceFixed sliceIdx) (slx, _i) (sl, _sz)
= restrict sliceIdx slx sl | 540 | evalOpenExp (IndexSlice sliceIndex slix sh) env aenv
= Sugar.toElt
$ restrict sliceIndex (Sugar.fromElt $ evalOpenExp slix env aenv)
(Sugar.fromElt $ evalOpenExp sh env aenv)
where
restrict :: SliceIndex slix sl co sh -> slix -> sh -> sl
restrict SliceNil () () = ()
restrict (SliceAll sliceIdx) (slx, ()) (sl, sz)
= let sl' = restrict sliceIdx slx sl
in (sl', sz)
restrict (SliceFixed sliceIdx) (slx, _i) (sl, _sz)
= restrict sliceIdx slx sl | 540 | evalOpenExp (IndexSlice sliceIndex slix sh) env aenv
= Sugar.toElt
$ restrict sliceIndex (Sugar.fromElt $ evalOpenExp slix env aenv)
(Sugar.fromElt $ evalOpenExp sh env aenv)
where
restrict :: SliceIndex slix sl co sh -> slix -> sh -> sl
restrict SliceNil () () = ()
restrict (SliceAll sliceIdx) (slx, ()) (sl, sz)
= let sl' = restrict sliceIdx slx sl
in (sl', sz)
restrict (SliceFixed sliceIdx) (slx, _i) (sl, _sz)
= restrict sliceIdx slx sl | 540 | false | false | 8 | 10 | 171 | 209 | 106 | 103 | null | null |
mietek/stack | src/Stack/Types/Version.hs | bsd-3-clause | -- | Check if a version is within a version range.
withinRange :: Version -> Cabal.VersionRange -> Bool
withinRange v r = toCabalVersion v `Cabal.withinRange` r | 160 | withinRange :: Version -> Cabal.VersionRange -> Bool
withinRange v r = toCabalVersion v `Cabal.withinRange` r | 109 | withinRange v r = toCabalVersion v `Cabal.withinRange` r | 56 | true | true | 0 | 7 | 25 | 38 | 20 | 18 | null | null |
emhoracek/explora | test-suite/HPC.hs | gpl-2.0 | expected :: Fractional a => a
expected = 90 | 43 | expected :: Fractional a => a
expected = 90 | 43 | expected = 90 | 13 | false | true | 0 | 7 | 8 | 25 | 10 | 15 | null | null |
YoEight/hk-coolc | src/Compiler/Semantic.hs | bsd-3-clause | typecheckClass ∷ (MonadError CompilerError m, MonadReader (ClassMap (Scoped String)) m, Applicative m)
⇒ (Class (Scoped String), MethodMap String)
→ m (Class (Scoped (String, Type)))
typecheckClass (c@(Class name parent attrs meths), meth_map) = do
class_map <- ask
attrs' <- runReaderT (traverse typecheckAttr attrs) (TCEnv c class_map meth_map)
meths' <- runReaderT (traverse typecheckMethod meths) (TCEnv c class_map meth_map)
return (Class name parent attrs' meths') | 520 | typecheckClass ∷ (MonadError CompilerError m, MonadReader (ClassMap (Scoped String)) m, Applicative m)
⇒ (Class (Scoped String), MethodMap String)
→ m (Class (Scoped (String, Type)))
typecheckClass (c@(Class name parent attrs meths), meth_map) = do
class_map <- ask
attrs' <- runReaderT (traverse typecheckAttr attrs) (TCEnv c class_map meth_map)
meths' <- runReaderT (traverse typecheckMethod meths) (TCEnv c class_map meth_map)
return (Class name parent attrs' meths') | 520 | typecheckClass (c@(Class name parent attrs meths), meth_map) = do
class_map <- ask
attrs' <- runReaderT (traverse typecheckAttr attrs) (TCEnv c class_map meth_map)
meths' <- runReaderT (traverse typecheckMethod meths) (TCEnv c class_map meth_map)
return (Class name parent attrs' meths') | 301 | false | true | 0 | 12 | 111 | 200 | 99 | 101 | null | null |
christiaanb/clash-compiler | clash-lib/src/CLaSH/Core/Pretty.hs | bsd-2-clause | isLexConSym :: String -> Bool
isLexConSym "->" = True | 53 | isLexConSym :: String -> Bool
isLexConSym "->" = True | 53 | isLexConSym "->" = True | 23 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
danil/dotfiles | .xmonad/xmonad.hs | gpl-3.0 | ------------------------------------------------------------------------
-- Now run xmonad with all the defaults we set up.
-- Run xmonad with the settings you specify. No need to modify this.
--
main = xmonad =<< xmobar defaults | 230 | main = xmonad =<< xmobar defaults | 33 | main = xmonad =<< xmobar defaults | 33 | true | false | 0 | 6 | 32 | 17 | 10 | 7 | null | null |
nushio3/ghc | compiler/main/DynFlags.hs | bsd-3-clause | pgm_L :: DynFlags -> String
pgm_L dflags = sPgm_L (settings dflags) | 83 | pgm_L :: DynFlags -> String
pgm_L dflags = sPgm_L (settings dflags) | 83 | pgm_L dflags = sPgm_L (settings dflags) | 39 | false | true | 0 | 7 | 26 | 27 | 13 | 14 | null | null |
sjakobi/stack | src/Data/Store/VersionTagged.hs | bsd-3-clause | taggedDecodeOrLoad :: (Store a, HasTypeHash a, Eq a, MonadIO m, MonadLogger m, MonadBaseControl IO m)
=> Path Abs File
-> m a
-> m a
taggedDecodeOrLoad fp mx = do
let fpt = T.pack (toFilePath fp)
$logDebug $ "Trying to decode " <> fpt
mres <- decodeFileMaybe fp
case mres of
Nothing -> do
$logDebug $ "Failure decoding " <> fpt
x <- mx
taggedEncodeFile fp x
return x
Just x -> do
$logDebug $ "Success decoding " <> fpt
return x | 588 | taggedDecodeOrLoad :: (Store a, HasTypeHash a, Eq a, MonadIO m, MonadLogger m, MonadBaseControl IO m)
=> Path Abs File
-> m a
-> m a
taggedDecodeOrLoad fp mx = do
let fpt = T.pack (toFilePath fp)
$logDebug $ "Trying to decode " <> fpt
mres <- decodeFileMaybe fp
case mres of
Nothing -> do
$logDebug $ "Failure decoding " <> fpt
x <- mx
taggedEncodeFile fp x
return x
Just x -> do
$logDebug $ "Success decoding " <> fpt
return x | 588 | taggedDecodeOrLoad fp mx = do
let fpt = T.pack (toFilePath fp)
$logDebug $ "Trying to decode " <> fpt
mres <- decodeFileMaybe fp
case mres of
Nothing -> do
$logDebug $ "Failure decoding " <> fpt
x <- mx
taggedEncodeFile fp x
return x
Just x -> do
$logDebug $ "Success decoding " <> fpt
return x | 398 | false | true | 0 | 14 | 242 | 191 | 85 | 106 | null | null |
KiNaudiz/bachelor | CN/Vector.hs | gpl-3.0 | fillVec :: Vector a -> [a]
fillVec = elems . vec | 48 | fillVec :: Vector a -> [a]
fillVec = elems . vec | 48 | fillVec = elems . vec | 21 | false | true | 0 | 8 | 10 | 32 | 14 | 18 | null | null |
michalkonecny/polypaver | src/PolyPaver/Input/TPTP.hs | bsd-3-clause | fof_quantified_formula :: Parser (Form ())
fof_quantified_formula =
traceRule ("fof_quantified_formula") $
do
m_reservedOp "!"
-- trace ("fof_quantified_formula: `!'") $ return ()
_vars <- m_brackets fof_variable_list
optional m_whiteSpace
m_reservedOp ":"
-- trace ("fof_quantified_formula: `:'") $ return ()
optional m_whiteSpace
f <- fof_unitary_formula_allow_quant
return $ f | 421 | fof_quantified_formula :: Parser (Form ())
fof_quantified_formula =
traceRule ("fof_quantified_formula") $
do
m_reservedOp "!"
-- trace ("fof_quantified_formula: `!'") $ return ()
_vars <- m_brackets fof_variable_list
optional m_whiteSpace
m_reservedOp ":"
-- trace ("fof_quantified_formula: `:'") $ return ()
optional m_whiteSpace
f <- fof_unitary_formula_allow_quant
return $ f | 421 | fof_quantified_formula =
traceRule ("fof_quantified_formula") $
do
m_reservedOp "!"
-- trace ("fof_quantified_formula: `!'") $ return ()
_vars <- m_brackets fof_variable_list
optional m_whiteSpace
m_reservedOp ":"
-- trace ("fof_quantified_formula: `:'") $ return ()
optional m_whiteSpace
f <- fof_unitary_formula_allow_quant
return $ f | 378 | false | true | 4 | 9 | 84 | 52 | 28 | 24 | null | null |
dehun/bce | src/Bce/DbFs.hs | mit | chainLength :: Db -> Hash -> IO Int
chainLength db blockHash
| blockHash == hash initialBlock = return 1
| otherwise = do
Just (VerifiedBlock block) <- loadBlockFromDisk db blockHash
let prevBlockHash = bhPrevBlockHeaderHash $ blockHeader block
(+1) <$> chainLength db prevBlockHash | 314 | chainLength :: Db -> Hash -> IO Int
chainLength db blockHash
| blockHash == hash initialBlock = return 1
| otherwise = do
Just (VerifiedBlock block) <- loadBlockFromDisk db blockHash
let prevBlockHash = bhPrevBlockHeaderHash $ blockHeader block
(+1) <$> chainLength db prevBlockHash | 314 | chainLength db blockHash
| blockHash == hash initialBlock = return 1
| otherwise = do
Just (VerifiedBlock block) <- loadBlockFromDisk db blockHash
let prevBlockHash = bhPrevBlockHeaderHash $ blockHeader block
(+1) <$> chainLength db prevBlockHash | 278 | false | true | 1 | 12 | 73 | 104 | 47 | 57 | null | null |
brendanhay/gogol | gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types/Product.hs | mpl-2.0 | -- | Output only. Time at which execution of the build was started.
bStartTime :: Lens' Build (Maybe UTCTime)
bStartTime
= lens _bStartTime (\ s a -> s{_bStartTime = a}) .
mapping _DateTime | 197 | bStartTime :: Lens' Build (Maybe UTCTime)
bStartTime
= lens _bStartTime (\ s a -> s{_bStartTime = a}) .
mapping _DateTime | 129 | bStartTime
= lens _bStartTime (\ s a -> s{_bStartTime = a}) .
mapping _DateTime | 87 | true | true | 0 | 10 | 40 | 55 | 28 | 27 | null | null |
rgaiacs/pandoc | src/Text/Pandoc/Writers/HTML.hs | gpl-2.0 | elementToListItem _ _ = return Nothing | 38 | elementToListItem _ _ = return Nothing | 38 | elementToListItem _ _ = return Nothing | 38 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
davidescobar/iex2 | app/Main.hs | bsd-3-clause | getSSLPaths :: String -> IO (Map.Map String String)
getSSLPaths iexDir = do
iexDirExists <- doesDirectoryExist iexDir
if iexDirExists
then do
let pathsYAMLFile = iexDir </> "config/paths.yml"
yamlLines <- readFile pathsYAMLFile >>= return . lines
let crtFileMap = case find (isInfixOf "crt:") yamlLines of
Just line -> Map.fromList [ ("crt", strip $ last $ split ":" line) ]
Nothing -> Map.empty
let keyFileMap = case find (isInfixOf "key:") yamlLines of
Just line -> Map.fromList [ ("key", strip $ last $ split ":" line) ]
Nothing -> Map.empty
return $ Map.union crtFileMap keyFileMap
else return Map.empty | 751 | getSSLPaths :: String -> IO (Map.Map String String)
getSSLPaths iexDir = do
iexDirExists <- doesDirectoryExist iexDir
if iexDirExists
then do
let pathsYAMLFile = iexDir </> "config/paths.yml"
yamlLines <- readFile pathsYAMLFile >>= return . lines
let crtFileMap = case find (isInfixOf "crt:") yamlLines of
Just line -> Map.fromList [ ("crt", strip $ last $ split ":" line) ]
Nothing -> Map.empty
let keyFileMap = case find (isInfixOf "key:") yamlLines of
Just line -> Map.fromList [ ("key", strip $ last $ split ":" line) ]
Nothing -> Map.empty
return $ Map.union crtFileMap keyFileMap
else return Map.empty | 751 | getSSLPaths iexDir = do
iexDirExists <- doesDirectoryExist iexDir
if iexDirExists
then do
let pathsYAMLFile = iexDir </> "config/paths.yml"
yamlLines <- readFile pathsYAMLFile >>= return . lines
let crtFileMap = case find (isInfixOf "crt:") yamlLines of
Just line -> Map.fromList [ ("crt", strip $ last $ split ":" line) ]
Nothing -> Map.empty
let keyFileMap = case find (isInfixOf "key:") yamlLines of
Just line -> Map.fromList [ ("key", strip $ last $ split ":" line) ]
Nothing -> Map.empty
return $ Map.union crtFileMap keyFileMap
else return Map.empty | 699 | false | true | 0 | 20 | 237 | 238 | 113 | 125 | null | null |
arnihermann/timedreb2erl | src/Language/Rebeca/Skelrebeca.hs | mit | transInstanceDecl :: InstanceDecl -> Result
transInstanceDecl x = case x of
InstanceDecl typedvardecl vardecls exps -> failure x | 131 | transInstanceDecl :: InstanceDecl -> Result
transInstanceDecl x = case x of
InstanceDecl typedvardecl vardecls exps -> failure x | 131 | transInstanceDecl x = case x of
InstanceDecl typedvardecl vardecls exps -> failure x | 87 | false | true | 0 | 8 | 20 | 43 | 19 | 24 | null | null |
srhb/quickcheck | examples/Set.hs | bsd-3-clause | insert :: Ord a => a -> Set a -> Set a
insert x s = s `union` unit x | 68 | insert :: Ord a => a -> Set a -> Set a
insert x s = s `union` unit x | 68 | insert x s = s `union` unit x | 29 | false | true | 0 | 8 | 19 | 46 | 22 | 24 | null | null |
thomie/vector | Data/Vector.hs | bsd-3-clause | scanr1' = G.scanr1' | 19 | scanr1' = G.scanr1' | 19 | scanr1' = G.scanr1' | 19 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
trygvis/hledger | hledger/Hledger/Cli/Options.hs | gpl-3.0 | optValuesForConstructor f opts = concatMap get opts
where get o = [v | f v == o] where v = value o | 102 | optValuesForConstructor f opts = concatMap get opts
where get o = [v | f v == o] where v = value o | 102 | optValuesForConstructor f opts = concatMap get opts
where get o = [v | f v == o] where v = value o | 102 | false | false | 0 | 10 | 25 | 50 | 24 | 26 | null | null |
pepeiborra/narradar | src/Narradar/Constraints/SAT/YicesFFICircuit.hs | bsd-3-clause | emptyYMaps = YMaps Bimap.empty mempty mempty mempty | 51 | emptyYMaps = YMaps Bimap.empty mempty mempty mempty | 51 | emptyYMaps = YMaps Bimap.empty mempty mempty mempty | 51 | false | false | 1 | 5 | 6 | 23 | 8 | 15 | null | null |
olsner/ghc | compiler/cmm/CmmCommonBlockElim.hs | bsd-3-clause | -- | Given a block map, ensure that all "target" blocks are covered by
-- the same ticks as the respective "source" blocks. This not only
-- means copying ticks, but also adjusting tick scopes where
-- necessary.
copyTicks :: LabelMap BlockId -> CmmGraph -> CmmGraph
copyTicks env g
| mapNull env = g
| otherwise = ofBlockMap (g_entry g) $ mapMap copyTo blockMap
where -- Reverse block merge map
blockMap = toBlockMap g
revEnv = mapFoldWithKey insertRev M.empty env
insertRev k x = M.insertWith (const (k:)) x [k]
-- Copy ticks and scopes into the given block
copyTo block = case M.lookup (entryLabel block) revEnv of
Nothing -> block
Just ls -> foldr copy block $ mapMaybe (flip mapLookup blockMap) ls
copy from to =
let ticks = blockTicks from
CmmEntry _ scp0 = firstNode from
(CmmEntry lbl scp1, code) = blockSplitHead to
in CmmEntry lbl (combineTickScopes scp0 scp1) `blockJoinHead`
foldr blockCons code (map CmmTick ticks)
-- Group by [Label] | 1,095 | copyTicks :: LabelMap BlockId -> CmmGraph -> CmmGraph
copyTicks env g
| mapNull env = g
| otherwise = ofBlockMap (g_entry g) $ mapMap copyTo blockMap
where -- Reverse block merge map
blockMap = toBlockMap g
revEnv = mapFoldWithKey insertRev M.empty env
insertRev k x = M.insertWith (const (k:)) x [k]
-- Copy ticks and scopes into the given block
copyTo block = case M.lookup (entryLabel block) revEnv of
Nothing -> block
Just ls -> foldr copy block $ mapMaybe (flip mapLookup blockMap) ls
copy from to =
let ticks = blockTicks from
CmmEntry _ scp0 = firstNode from
(CmmEntry lbl scp1, code) = blockSplitHead to
in CmmEntry lbl (combineTickScopes scp0 scp1) `blockJoinHead`
foldr blockCons code (map CmmTick ticks)
-- Group by [Label] | 882 | copyTicks env g
| mapNull env = g
| otherwise = ofBlockMap (g_entry g) $ mapMap copyTo blockMap
where -- Reverse block merge map
blockMap = toBlockMap g
revEnv = mapFoldWithKey insertRev M.empty env
insertRev k x = M.insertWith (const (k:)) x [k]
-- Copy ticks and scopes into the given block
copyTo block = case M.lookup (entryLabel block) revEnv of
Nothing -> block
Just ls -> foldr copy block $ mapMaybe (flip mapLookup blockMap) ls
copy from to =
let ticks = blockTicks from
CmmEntry _ scp0 = firstNode from
(CmmEntry lbl scp1, code) = blockSplitHead to
in CmmEntry lbl (combineTickScopes scp0 scp1) `blockJoinHead`
foldr blockCons code (map CmmTick ticks)
-- Group by [Label] | 828 | true | true | 4 | 11 | 308 | 303 | 139 | 164 | null | null |
bennofs/cabal2nix | src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs | bsd-3-clause | libNixName "taglib_c" = return "taglib" | 65 | libNixName "taglib_c" = return "taglib" | 65 | libNixName "taglib_c" = return "taglib" | 65 | false | false | 0 | 5 | 30 | 13 | 5 | 8 | null | null |
meiersi-11ce/stack | src/Stack/Init.hs | bsd-3-clause | ignoredDirs :: Set FilePath
ignoredDirs = Set.fromList
[ ".git"
, "dist"
, ".stack-work"
] | 106 | ignoredDirs :: Set FilePath
ignoredDirs = Set.fromList
[ ".git"
, "dist"
, ".stack-work"
] | 106 | ignoredDirs = Set.fromList
[ ".git"
, "dist"
, ".stack-work"
] | 78 | false | true | 0 | 6 | 29 | 33 | 16 | 17 | null | null |
iu-parfunc/containers | tests/set-properties.hs | bsd-3-clause | test_elemAt :: Assertion
test_elemAt = do
elemAt 0 (fromList [5,3]) @?= 3
elemAt 1 (fromList [5,3]) @?= 5 | 113 | test_elemAt :: Assertion
test_elemAt = do
elemAt 0 (fromList [5,3]) @?= 3
elemAt 1 (fromList [5,3]) @?= 5 | 113 | test_elemAt = do
elemAt 0 (fromList [5,3]) @?= 3
elemAt 1 (fromList [5,3]) @?= 5 | 88 | false | true | 0 | 11 | 25 | 59 | 30 | 29 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F13.hs | bsd-3-clause | -- glGetTransformFeedbackVaryingEXT --------------------------------------------
-- | This command is an alias for 'glGetTransformFeedbackVarying'.
glGetTransformFeedbackVaryingEXT
:: MonadIO m
=> GLuint -- ^ @program@.
-> GLuint -- ^ @index@.
-> GLsizei -- ^ @bufSize@.
-> Ptr GLsizei -- ^ @length@ pointing to @1@ element of type @GLsizei@.
-> Ptr GLsizei -- ^ @size@ pointing to @1@ element of type @GLsizei@.
-> Ptr GLenum -- ^ @type@ pointing to @1@ element of type [GlslTypeToken](Graphics-GL-Groups.html#GlslTypeToken).
-> Ptr GLchar -- ^ @name@ pointing to @bufSize@ elements of type @GLchar@.
-> m ()
glGetTransformFeedbackVaryingEXT v1 v2 v3 v4 v5 v6 v7 = liftIO $ dyn321 ptr_glGetTransformFeedbackVaryingEXT v1 v2 v3 v4 v5 v6 v7 | 758 | glGetTransformFeedbackVaryingEXT
:: MonadIO m
=> GLuint -- ^ @program@.
-> GLuint -- ^ @index@.
-> GLsizei -- ^ @bufSize@.
-> Ptr GLsizei -- ^ @length@ pointing to @1@ element of type @GLsizei@.
-> Ptr GLsizei -- ^ @size@ pointing to @1@ element of type @GLsizei@.
-> Ptr GLenum -- ^ @type@ pointing to @1@ element of type [GlslTypeToken](Graphics-GL-Groups.html#GlslTypeToken).
-> Ptr GLchar -- ^ @name@ pointing to @bufSize@ elements of type @GLchar@.
-> m ()
glGetTransformFeedbackVaryingEXT v1 v2 v3 v4 v5 v6 v7 = liftIO $ dyn321 ptr_glGetTransformFeedbackVaryingEXT v1 v2 v3 v4 v5 v6 v7 | 609 | glGetTransformFeedbackVaryingEXT v1 v2 v3 v4 v5 v6 v7 = liftIO $ dyn321 ptr_glGetTransformFeedbackVaryingEXT v1 v2 v3 v4 v5 v6 v7 | 129 | true | true | 0 | 15 | 124 | 112 | 56 | 56 | null | null |
glutamate/paskell | Paskell/Syntax/Haskell.hs | bsd-3-clause | module_ :: TopLevel () -> [D]
module_ = execWriter | 50 | module_ :: TopLevel () -> [D]
module_ = execWriter | 50 | module_ = execWriter | 20 | false | true | 0 | 8 | 8 | 30 | 13 | 17 | null | null |
nilenso/tronkell | src/Tronkell/Server/Server.hs | bsd-3-clause | clientsLoop :: Server -> M.Map UserID (TChan InMessage) -> IO ()
clientsLoop server@Server{..} userChans = do
let (networkInChan, _) = networkChans
msg <- readChan networkInChan
case msg of
PlayerJoined uId -> do
userChan <- atomically newTChan
let userChans' = M.insert uId userChan userChans -- check if uId already not there
void $ forkIO $ runClient uId userChan server -- remove useChan after runClient returns.
clientsLoop server userChans'
_ -> do
let uId = SUtils.getUserId msg
userChan = M.lookup uId userChans
maybe (return ()) (\c -> atomically $ writeTChan c msg) userChan
clientsLoop server userChans | 679 | clientsLoop :: Server -> M.Map UserID (TChan InMessage) -> IO ()
clientsLoop server@Server{..} userChans = do
let (networkInChan, _) = networkChans
msg <- readChan networkInChan
case msg of
PlayerJoined uId -> do
userChan <- atomically newTChan
let userChans' = M.insert uId userChan userChans -- check if uId already not there
void $ forkIO $ runClient uId userChan server -- remove useChan after runClient returns.
clientsLoop server userChans'
_ -> do
let uId = SUtils.getUserId msg
userChan = M.lookup uId userChans
maybe (return ()) (\c -> atomically $ writeTChan c msg) userChan
clientsLoop server userChans | 679 | clientsLoop server@Server{..} userChans = do
let (networkInChan, _) = networkChans
msg <- readChan networkInChan
case msg of
PlayerJoined uId -> do
userChan <- atomically newTChan
let userChans' = M.insert uId userChan userChans -- check if uId already not there
void $ forkIO $ runClient uId userChan server -- remove useChan after runClient returns.
clientsLoop server userChans'
_ -> do
let uId = SUtils.getUserId msg
userChan = M.lookup uId userChans
maybe (return ()) (\c -> atomically $ writeTChan c msg) userChan
clientsLoop server userChans | 614 | false | true | 0 | 16 | 159 | 224 | 104 | 120 | null | null |
josefs/sbv | Data/SBV/SMT/SMTLib.hs | bsd-3-clause | toIncSMTLib :: SMTConfig -> SMTLibIncConverter [String]
toIncSMTLib SMTConfig{smtLibVersion} = case smtLibVersion of
SMTLib2 -> toIncSMTLib2
-- | Convert to SMTLib-2 format | 214 | toIncSMTLib :: SMTConfig -> SMTLibIncConverter [String]
toIncSMTLib SMTConfig{smtLibVersion} = case smtLibVersion of
SMTLib2 -> toIncSMTLib2
-- | Convert to SMTLib-2 format | 214 | toIncSMTLib SMTConfig{smtLibVersion} = case smtLibVersion of
SMTLib2 -> toIncSMTLib2
-- | Convert to SMTLib-2 format | 158 | false | true | 1 | 9 | 62 | 51 | 23 | 28 | null | null |
vincenthz/cryptonite | Crypto/ECC/Simple/Types.hs | bsd-3-clause | paramSEC_t193r2 = CurveParameters
{ curveEccA = 0x0163f35a5137c2ce3ea6ed8667190b0bc43ecd69977702709b
, curveEccB = 0x00c9bb9e8927d4d64c377e2ab2856a5b16e3efb7f61d4316ae
, curveEccG = Point 0x00d9b67d192e0367c803f39e1a7e82ca14a651350aae617e8f
0x01ce94335607c304ac29e7defbd9ca01f596f927224cdecf6c
, curveEccN = 0x010000000000000000000000015aab561b005413ccd4ee99d5
, curveEccH = 2
} | 422 | paramSEC_t193r2 = CurveParameters
{ curveEccA = 0x0163f35a5137c2ce3ea6ed8667190b0bc43ecd69977702709b
, curveEccB = 0x00c9bb9e8927d4d64c377e2ab2856a5b16e3efb7f61d4316ae
, curveEccG = Point 0x00d9b67d192e0367c803f39e1a7e82ca14a651350aae617e8f
0x01ce94335607c304ac29e7defbd9ca01f596f927224cdecf6c
, curveEccN = 0x010000000000000000000000015aab561b005413ccd4ee99d5
, curveEccH = 2
} | 422 | paramSEC_t193r2 = CurveParameters
{ curveEccA = 0x0163f35a5137c2ce3ea6ed8667190b0bc43ecd69977702709b
, curveEccB = 0x00c9bb9e8927d4d64c377e2ab2856a5b16e3efb7f61d4316ae
, curveEccG = Point 0x00d9b67d192e0367c803f39e1a7e82ca14a651350aae617e8f
0x01ce94335607c304ac29e7defbd9ca01f596f927224cdecf6c
, curveEccN = 0x010000000000000000000000015aab561b005413ccd4ee99d5
, curveEccH = 2
} | 422 | false | false | 0 | 8 | 69 | 47 | 27 | 20 | null | null |
beni55/attoparsec | tests/QC/Common.hs | bsd-3-clause | parseT :: TL.Parser r -> TL.Text -> Maybe r
parseT p = TL.maybeResult . TL.parse p | 82 | parseT :: TL.Parser r -> TL.Text -> Maybe r
parseT p = TL.maybeResult . TL.parse p | 82 | parseT p = TL.maybeResult . TL.parse p | 38 | false | true | 0 | 7 | 15 | 43 | 20 | 23 | null | null |
romanb/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/RestoreFromClusterSnapshot.hs | mpl-2.0 | -- | If 'true', the cluster can be accessed from a public network.
rfcsPubliclyAccessible :: Lens' RestoreFromClusterSnapshot (Maybe Bool)
rfcsPubliclyAccessible =
lens _rfcsPubliclyAccessible (\s a -> s { _rfcsPubliclyAccessible = a }) | 240 | rfcsPubliclyAccessible :: Lens' RestoreFromClusterSnapshot (Maybe Bool)
rfcsPubliclyAccessible =
lens _rfcsPubliclyAccessible (\s a -> s { _rfcsPubliclyAccessible = a }) | 173 | rfcsPubliclyAccessible =
lens _rfcsPubliclyAccessible (\s a -> s { _rfcsPubliclyAccessible = a }) | 101 | true | true | 0 | 9 | 35 | 46 | 25 | 21 | null | null |
hsyl20/ViperVM | haskus-system/src/lib/Haskus/Arch/X86_64/ISA/Memory.hs | bsd-3-clause | -- | Indirect pointer: 16 bit selector + 16/32 offset
memFamPtr :: X86MemFamP
memFamPtr = MemFam
{ memFamAddr = Terminal Nothing
, memFamType = Terminal T_MemPtr
, memFamSize = NonTerminal
[ (pOverriddenOperationSize64 OpSize16, Terminal $ Just 16)
, (pOverriddenOperationSize64 OpSize32, Terminal $ Just 32)
, (pOverriddenOperationSize64 OpSize64, Terminal $ Just 64)
]
} | 408 | memFamPtr :: X86MemFamP
memFamPtr = MemFam
{ memFamAddr = Terminal Nothing
, memFamType = Terminal T_MemPtr
, memFamSize = NonTerminal
[ (pOverriddenOperationSize64 OpSize16, Terminal $ Just 16)
, (pOverriddenOperationSize64 OpSize32, Terminal $ Just 32)
, (pOverriddenOperationSize64 OpSize64, Terminal $ Just 64)
]
} | 354 | memFamPtr = MemFam
{ memFamAddr = Terminal Nothing
, memFamType = Terminal T_MemPtr
, memFamSize = NonTerminal
[ (pOverriddenOperationSize64 OpSize16, Terminal $ Just 16)
, (pOverriddenOperationSize64 OpSize32, Terminal $ Just 32)
, (pOverriddenOperationSize64 OpSize64, Terminal $ Just 64)
]
} | 330 | true | true | 0 | 12 | 88 | 108 | 55 | 53 | null | null |
nikita-volkov/postgresql-binary | library/PostgreSQL/Binary/Time.hs | mit | secsToUTC :: Double -> UTCTime
secsToUTC =
evalState $ do
d <- state $ flip divMod' $ 60 * 60 * 24
s <- get
return $
UTCTime (postgresJulianToDay d) (secsToDiffTime s)
| 189 | secsToUTC :: Double -> UTCTime
secsToUTC =
evalState $ do
d <- state $ flip divMod' $ 60 * 60 * 24
s <- get
return $
UTCTime (postgresJulianToDay d) (secsToDiffTime s)
| 189 | secsToUTC =
evalState $ do
d <- state $ flip divMod' $ 60 * 60 * 24
s <- get
return $
UTCTime (postgresJulianToDay d) (secsToDiffTime s)
| 158 | false | true | 0 | 13 | 53 | 76 | 36 | 40 | null | null |
alexander-at-github/eta | compiler/ETA/HsSyn/HsTypes.hs | bsd-3-clause | pprHsContextMaybe [L _ pred] = Just $ ppr_mono_ty FunPrec pred | 62 | pprHsContextMaybe [L _ pred] = Just $ ppr_mono_ty FunPrec pred | 62 | pprHsContextMaybe [L _ pred] = Just $ ppr_mono_ty FunPrec pred | 62 | false | false | 0 | 6 | 9 | 27 | 12 | 15 | null | null |
tittoassini/flat | benchmarks/PkgBE.hs | bsd-3-clause | encodeCtr2 n a b = beginListLen 3 <> encode (n :: Word) <> encode a <> encode b | 79 | encodeCtr2 n a b = beginListLen 3 <> encode (n :: Word) <> encode a <> encode b | 79 | encodeCtr2 n a b = beginListLen 3 <> encode (n :: Word) <> encode a <> encode b | 79 | false | false | 0 | 9 | 17 | 43 | 20 | 23 | null | null |
newhoggy/monadic-regions | src/Test/SafeHandlesTest.hs | bsd-3-clause | test4 h1 h2 = do
d1 <- shGetLine h1
shPutStrLn h2 d1
{-
Inferred type: region-polymorphic, as expected
test4
:: (MonadRaise m1 m, MonadRaise m2 m, SMonadIO m) =>
SHandle m1 -> SHandle m2 -> m ()
-}
-- Testing for problems in opening a file
-- We copy the contents of fname_in into fname_out.
-- If fname_in does not exist, write a message to fname_out to that effect.
-- Nothing bad happens if the file could not be opened as
-- no file reference (safe handle) is created in that case. | 503 | test4 h1 h2 = do
d1 <- shGetLine h1
shPutStrLn h2 d1
{-
Inferred type: region-polymorphic, as expected
test4
:: (MonadRaise m1 m, MonadRaise m2 m, SMonadIO m) =>
SHandle m1 -> SHandle m2 -> m ()
-}
-- Testing for problems in opening a file
-- We copy the contents of fname_in into fname_out.
-- If fname_in does not exist, write a message to fname_out to that effect.
-- Nothing bad happens if the file could not be opened as
-- no file reference (safe handle) is created in that case. | 503 | test4 h1 h2 = do
d1 <- shGetLine h1
shPutStrLn h2 d1
{-
Inferred type: region-polymorphic, as expected
test4
:: (MonadRaise m1 m, MonadRaise m2 m, SMonadIO m) =>
SHandle m1 -> SHandle m2 -> m ()
-}
-- Testing for problems in opening a file
-- We copy the contents of fname_in into fname_out.
-- If fname_in does not exist, write a message to fname_out to that effect.
-- Nothing bad happens if the file could not be opened as
-- no file reference (safe handle) is created in that case. | 503 | false | false | 1 | 9 | 109 | 40 | 18 | 22 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/EXT/FragmentLighting.hs | bsd-3-clause | gl_FRAGMENT_LIGHT0 :: GLenum
gl_FRAGMENT_LIGHT0 = 0x840C | 56 | gl_FRAGMENT_LIGHT0 :: GLenum
gl_FRAGMENT_LIGHT0 = 0x840C | 56 | gl_FRAGMENT_LIGHT0 = 0x840C | 27 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
alephcloud/hs-aws-configuration-tools | src/Configuration/Utils/Aws/Credentials.hs | apache-2.0 | validateCredentialConfigKey ∷ ConfigValidation CredentialConfigKey λ
validateCredentialConfigKey CredentialConfigKey{..} = do
validateNonEmpty "access_key_id" _credentialConfigKeyId
validateNonEmpty "access_key_secret" _credentialConfigKeySecret | 249 | validateCredentialConfigKey ∷ ConfigValidation CredentialConfigKey λ
validateCredentialConfigKey CredentialConfigKey{..} = do
validateNonEmpty "access_key_id" _credentialConfigKeyId
validateNonEmpty "access_key_secret" _credentialConfigKeySecret | 249 | validateCredentialConfigKey CredentialConfigKey{..} = do
validateNonEmpty "access_key_id" _credentialConfigKeyId
validateNonEmpty "access_key_secret" _credentialConfigKeySecret | 180 | false | true | 1 | 7 | 18 | 45 | 18 | 27 | null | null |
gspindles/rftg-cards | src/Game/RftG/Cards/RvI.hs | mit | smugglingWorld :: Card
smugglingWorld = Card
(World $ Production NoveltyGoods)
"SMUGGLING WORLD"
(Cost 1)
(VP 0)
Nothing
[]
[Explore, Settle, Produce] | 164 | smugglingWorld :: Card
smugglingWorld = Card
(World $ Production NoveltyGoods)
"SMUGGLING WORLD"
(Cost 1)
(VP 0)
Nothing
[]
[Explore, Settle, Produce] | 164 | smugglingWorld = Card
(World $ Production NoveltyGoods)
"SMUGGLING WORLD"
(Cost 1)
(VP 0)
Nothing
[]
[Explore, Settle, Produce] | 141 | false | true | 0 | 7 | 34 | 71 | 32 | 39 | null | null |
uduki/hsQt | Qtc/ClassTypes/Gui.hs | bsd-2-clause | qStyleOptionGraphicsItemAddFinalizer :: QStyleOptionGraphicsItem a -> IO ()
qStyleOptionGraphicsItemAddFinalizer (Object fp)
= addForeignPtrFinalizer qtc_QStyleOptionGraphicsItem_getFinalizer fp | 196 | qStyleOptionGraphicsItemAddFinalizer :: QStyleOptionGraphicsItem a -> IO ()
qStyleOptionGraphicsItemAddFinalizer (Object fp)
= addForeignPtrFinalizer qtc_QStyleOptionGraphicsItem_getFinalizer fp | 196 | qStyleOptionGraphicsItemAddFinalizer (Object fp)
= addForeignPtrFinalizer qtc_QStyleOptionGraphicsItem_getFinalizer fp | 120 | false | true | 0 | 7 | 15 | 37 | 17 | 20 | null | null |
Zankoku-Okuno/murex | Murex/Interpreter/Values.hs | gpl-3.0 | toValue (A.MurexRecord xs) = MurexRecord (fmap toValue <$> xs) | 62 | toValue (A.MurexRecord xs) = MurexRecord (fmap toValue <$> xs) | 62 | toValue (A.MurexRecord xs) = MurexRecord (fmap toValue <$> xs) | 62 | false | false | 0 | 8 | 8 | 30 | 14 | 16 | null | null |
mcmaniac/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | mkEntryLabel name c = IdLabel name c Entry | 56 | mkEntryLabel name c = IdLabel name c Entry | 56 | mkEntryLabel name c = IdLabel name c Entry | 56 | false | false | 0 | 5 | 21 | 18 | 8 | 10 | null | null |
IgorRodic/fp16-Pongout | dist/build/autogen/Paths_fp16_Pongout.hs | mit | splitFileName :: FilePath -> (String, String)
splitFileName p = (reverse (path2++drive), reverse fname)
where
(path,drive) = case p of
(c:':':p') -> (reverse p',[':',c])
_ -> (reverse p ,"")
(fname,path1) = break isPathSeparator path
path2 = case path1 of
[] -> "."
[_] -> path1 -- don't remove the trailing slash if
-- there is only one character
(c:path') | isPathSeparator c -> path'
_ -> path1 | 586 | splitFileName :: FilePath -> (String, String)
splitFileName p = (reverse (path2++drive), reverse fname)
where
(path,drive) = case p of
(c:':':p') -> (reverse p',[':',c])
_ -> (reverse p ,"")
(fname,path1) = break isPathSeparator path
path2 = case path1 of
[] -> "."
[_] -> path1 -- don't remove the trailing slash if
-- there is only one character
(c:path') | isPathSeparator c -> path'
_ -> path1 | 586 | splitFileName p = (reverse (path2++drive), reverse fname)
where
(path,drive) = case p of
(c:':':p') -> (reverse p',[':',c])
_ -> (reverse p ,"")
(fname,path1) = break isPathSeparator path
path2 = case path1 of
[] -> "."
[_] -> path1 -- don't remove the trailing slash if
-- there is only one character
(c:path') | isPathSeparator c -> path'
_ -> path1 | 540 | false | true | 0 | 11 | 254 | 188 | 98 | 90 | null | null |
oldmanmike/haskellSDL2Examples | src/lesson15.hs | gpl-2.0 | size :: ScreenSize
size = (640, 480) | 36 | size :: ScreenSize
size = (640, 480) | 36 | size = (640, 480) | 17 | false | true | 0 | 6 | 6 | 24 | 11 | 13 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxLANGUAGE_ENGLISH_NEW_ZEALAND :: Int
wxLANGUAGE_ENGLISH_NEW_ZEALAND = 67 | 73 | wxLANGUAGE_ENGLISH_NEW_ZEALAND :: Int
wxLANGUAGE_ENGLISH_NEW_ZEALAND = 67 | 73 | wxLANGUAGE_ENGLISH_NEW_ZEALAND = 67 | 35 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.