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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
z0isch/reddit-dailyprogrammer | Challenge264/src/Hard.hs | mit | input2 = ["There once was a young lady named bright","Whose speed was much faster than light","She set out one day","In a relative way","And returned on the previous night."] | 174 | input2 = ["There once was a young lady named bright","Whose speed was much faster than light","She set out one day","In a relative way","And returned on the previous night."] | 174 | input2 = ["There once was a young lady named bright","Whose speed was much faster than light","She set out one day","In a relative way","And returned on the previous night."] | 174 | false | false | 0 | 5 | 27 | 21 | 13 | 8 | null | null |
brow/noise | src/Text/Noise/Parser/Token.hs | mit | symbol :: String -> Parser String
symbol = lexeme . string | 58 | symbol :: String -> Parser String
symbol = lexeme . string | 58 | symbol = lexeme . string | 24 | false | true | 1 | 7 | 10 | 29 | 12 | 17 | null | null |
oldmanmike/ghc | libraries/base/GHC/IO/Handle/Text.hs | bsd-3-clause | commitBuffer' :: RawCharBuffer -> Int -> Int -> Bool -> Bool -> Handle__
-> IO CharBuffer
commitBuffer' raw sz@(I# _) count@(I# _) flush release h_@Handle__{..}
= do
debugIO ("commitBuffer: sz=" ++ show sz ++ ", count=" ++ show count
++ ", flush=" ++ show flush ++ ", release=" ++ show... | 1,785 | commitBuffer' :: RawCharBuffer -> Int -> Int -> Bool -> Bool -> Handle__
-> IO CharBuffer
commitBuffer' raw sz@(I# _) count@(I# _) flush release h_@Handle__{..}
= do
debugIO ("commitBuffer: sz=" ++ show sz ++ ", count=" ++ show count
++ ", flush=" ++ show flush ++ ", release=" ++ show... | 1,785 | commitBuffer' raw sz@(I# _) count@(I# _) flush release h_@Handle__{..}
= do
debugIO ("commitBuffer: sz=" ++ show sz ++ ", count=" ++ show count
++ ", flush=" ++ show flush ++ ", release=" ++ show release)
let this_buf = Buffer{ bufRaw=raw, bufState=WriteBuffer,
b... | 1,681 | false | true | 0 | 16 | 418 | 291 | 152 | 139 | null | null |
dicomgrid/dicom-haskell-library | src/Data/DICOM/Dictionary.hs | gpl-3.0 | numberofviewsinstage :: Int -> Element
numberofviewsinstage = is $ tag (TagGroup 0x0008) (TagElement 0x212A) | 108 | numberofviewsinstage :: Int -> Element
numberofviewsinstage = is $ tag (TagGroup 0x0008) (TagElement 0x212A) | 108 | numberofviewsinstage = is $ tag (TagGroup 0x0008) (TagElement 0x212A) | 69 | false | true | 2 | 7 | 13 | 43 | 19 | 24 | null | null |
elliottt/rogue | src/Rogue/Types.hs | bsd-3-clause | splitGen :: State -> (State,StdGen)
splitGen s = (set sGen l s, r)
where
(l,r) = split (view sGen s) | 104 | splitGen :: State -> (State,StdGen)
splitGen s = (set sGen l s, r)
where
(l,r) = split (view sGen s) | 104 | splitGen s = (set sGen l s, r)
where
(l,r) = split (view sGen s) | 68 | false | true | 0 | 8 | 23 | 69 | 34 | 35 | null | null |
jamshidh/ethereum-vm | src/Blockchain/VM/Code.hs | bsd-3-clause | showCode lineNumber c@(Code rom) = showHex lineNumber "" ++ " " ++ format (B.pack $ op2OpCode op) ++ " " ++ show (pretty op) ++ "\n" ++ showCode (lineNumber + nextP) (Code (safeDrop nextP rom))
where
(op, nextP) = getOperationAt c 0 | 251 | showCode lineNumber c@(Code rom) = showHex lineNumber "" ++ " " ++ format (B.pack $ op2OpCode op) ++ " " ++ show (pretty op) ++ "\n" ++ showCode (lineNumber + nextP) (Code (safeDrop nextP rom))
where
(op, nextP) = getOperationAt c 0 | 251 | showCode lineNumber c@(Code rom) = showHex lineNumber "" ++ " " ++ format (B.pack $ op2OpCode op) ++ " " ++ show (pretty op) ++ "\n" ++ showCode (lineNumber + nextP) (Code (safeDrop nextP rom))
where
(op, nextP) = getOperationAt c 0 | 251 | false | false | 0 | 13 | 60 | 118 | 58 | 60 | null | null |
danr/hipspec | tfp1/tests/Subtraction.hs | gpl-3.0 | Z - _ = Z | 13 | Z - _ = Z | 13 | Z - _ = Z | 13 | false | false | 0 | 5 | 8 | 12 | 5 | 7 | null | null |
dterei/Scraps | haskell/datakinds/DK.hs | bsd-3-clause | z :: T2 'Tru Int
z = T2 Tru 1 | 29 | z :: T2 'Tru Int
z = T2 Tru 1 | 29 | z = T2 Tru 1 | 12 | false | true | 0 | 7 | 9 | 28 | 12 | 16 | null | null |
t3476/heukarya | src/AI/Heukarya/Test.hs | bsd-3-clause | testCrossed22 = testJungle2 >>= \z ->
crossJungle (mkStdGen 358112) 5 z 1 | 75 | testCrossed22 = testJungle2 >>= \z ->
crossJungle (mkStdGen 358112) 5 z 1 | 75 | testCrossed22 = testJungle2 >>= \z ->
crossJungle (mkStdGen 358112) 5 z 1 | 75 | false | false | 0 | 9 | 13 | 30 | 15 | 15 | null | null |
phischu/fragnix | tests/packages/scotty/Network.HTTP2.Types.hs | bsd-3-clause | fromErrorCodeId StreamClosed = 0x5 | 42 | fromErrorCodeId StreamClosed = 0x5 | 42 | fromErrorCodeId StreamClosed = 0x5 | 42 | false | false | 0 | 5 | 11 | 9 | 4 | 5 | null | null |
mikeizbicki/homoiconic | src/Homoiconic/Heterogeneous/Example.hs | bsd-3-clause | z :: Free (Sig Space) '[TFloo] (Int,Int)
z = Pure 2 | 51 | z :: Free (Sig Space) '[TFloo] (Int,Int)
z = Pure 2 | 51 | z = Pure 2 | 10 | false | true | 0 | 8 | 10 | 43 | 21 | 22 | null | null |
castaway/pandoc | src/Text/Pandoc/Pretty.hs | gpl-2.0 | renderList (CarriageReturn : xs) = do
st <- get
if newlines st > 0 || null xs
then renderList xs
else do
outp (-1) "\n"
renderList xs | 161 | renderList (CarriageReturn : xs) = do
st <- get
if newlines st > 0 || null xs
then renderList xs
else do
outp (-1) "\n"
renderList xs | 161 | renderList (CarriageReturn : xs) = do
st <- get
if newlines st > 0 || null xs
then renderList xs
else do
outp (-1) "\n"
renderList xs | 161 | false | false | 0 | 12 | 54 | 70 | 32 | 38 | null | null |
kirhgoff/haskell-sandbox | euler27/euler27.hs | mit | isPrime :: Int -> Bool
isPrime n
| n <= 1 = False
| n == 2 = True
| n `rem` 2 == 0 = False
| otherwise = null [x | x <- [3,5..limit], n `rem` x == 0]
where limit = floor . sqrt . fromIntegral $ n | 220 | isPrime :: Int -> Bool
isPrime n
| n <= 1 = False
| n == 2 = True
| n `rem` 2 == 0 = False
| otherwise = null [x | x <- [3,5..limit], n `rem` x == 0]
where limit = floor . sqrt . fromIntegral $ n | 220 | isPrime n
| n <= 1 = False
| n == 2 = True
| n `rem` 2 == 0 = False
| otherwise = null [x | x <- [3,5..limit], n `rem` x == 0]
where limit = floor . sqrt . fromIntegral $ n | 197 | false | true | 0 | 10 | 75 | 124 | 63 | 61 | null | null |
flyingleafe/itmo-ctd-se-coursework | src/Model.hs | bsd-3-clause | -- | Euclidian cosine function.
dist :: Point -> Point -> Double
dist a b = sqrt $ sum $ map (^2) $ zipWith (-) a b | 115 | dist :: Point -> Point -> Double
dist a b = sqrt $ sum $ map (^2) $ zipWith (-) a b | 83 | dist a b = sqrt $ sum $ map (^2) $ zipWith (-) a b | 50 | true | true | 0 | 8 | 26 | 53 | 28 | 25 | null | null |
sordina/Diagrams-AST | test/recursion.hs | bsd-3-clause | face = Modifier (Scale 0.3 0.3) $ Images $ Horizontal [pcirc, pcirc] | 72 | face = Modifier (Scale 0.3 0.3) $ Images $ Horizontal [pcirc, pcirc] | 72 | face = Modifier (Scale 0.3 0.3) $ Images $ Horizontal [pcirc, pcirc] | 72 | false | false | 0 | 9 | 15 | 34 | 17 | 17 | null | null |
Cortlandd/haskell-opencv | src/OpenCV/Internal/Core/Types/Mat.hs | bsd-3-clause | mkMat
:: ( ToShape shape
, ToChannels channels
, ToDepth depth
, ToScalar scalar
)
=> shape -- ^
-> channels -- ^
-> depth -- ^
-> scalar -- ^
-> CvExcept (Mat (ShapeT shape) (ChannelsT channels) (DepthT depth))
mkMat shape channels depth defValue =
... | 375 | mkMat
:: ( ToShape shape
, ToChannels channels
, ToDepth depth
, ToScalar scalar
)
=> shape -- ^
-> channels -- ^
-> depth -- ^
-> scalar -- ^
-> CvExcept (Mat (ShapeT shape) (ChannelsT channels) (DepthT depth))
mkMat shape channels depth defValue =
... | 375 | mkMat shape channels depth defValue =
unsafeCvExcept $ newMat shape channels depth defValue | 95 | false | true | 2 | 15 | 124 | 118 | 58 | 60 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT11.hs | gpl-3.0 | (<=) :: Nat -> Nat -> Bool
Z <= _ = True | 44 | (<=) :: Nat -> Nat -> Bool
Z <= _ = True | 44 | Z <= _ = True | 17 | false | true | 0 | 6 | 15 | 27 | 14 | 13 | null | null |
Daiver/HRandomForest | ML/DecisionTree.hs | mit | gini :: [Float] -> Float
gini fr = 1 - (sum . map (**2) $ fr) | 61 | gini :: [Float] -> Float
gini fr = 1 - (sum . map (**2) $ fr) | 61 | gini fr = 1 - (sum . map (**2) $ fr) | 36 | false | true | 0 | 10 | 15 | 43 | 23 | 20 | null | null |
aelve/hslibs | src/Guide/State.hs | bsd-3-clause | addPro
:: Uid Item -- ^ Item id
-> Uid Trait -- ^ New trait's id
-> Text
-> Acid.Update GlobalState (Edit, Trait)
addPro itemId traitId text' = do
let newTrait = Trait traitId (toMarkdownInline text')
itemById itemId . pros %= (++ [newTrait])
let edit = Edit'AddPro itemId traitId text'
return... | 337 | addPro
:: Uid Item -- ^ Item id
-> Uid Trait -- ^ New trait's id
-> Text
-> Acid.Update GlobalState (Edit, Trait)
addPro itemId traitId text' = do
let newTrait = Trait traitId (toMarkdownInline text')
itemById itemId . pros %= (++ [newTrait])
let edit = Edit'AddPro itemId traitId text'
return... | 337 | addPro itemId traitId text' = do
let newTrait = Trait traitId (toMarkdownInline text')
itemById itemId . pros %= (++ [newTrait])
let edit = Edit'AddPro itemId traitId text'
return (edit, newTrait) | 204 | false | true | 0 | 13 | 79 | 125 | 60 | 65 | null | null |
Fuuzetsu/yi-emacs-colours | src/Yi/Style/EmacsColours.hs | gpl-2.0 | -- | Names: @["PaleVioletRed","pale violet red"]@
--
-- R219 G112 B147, 0xdb7093
paleVioletRed :: Color
paleVioletRed = RGB 219 112 147 | 135 | paleVioletRed :: Color
paleVioletRed = RGB 219 112 147 | 54 | paleVioletRed = RGB 219 112 147 | 31 | true | true | 0 | 5 | 20 | 21 | 12 | 9 | null | null |
weissi/diplomarbeit | lib/Codec/LBS.hs | gpl-3.0 | execLBSProgram :: InputValues -- ^ The input values.
-> LBSProgram -- ^ The LBS program.
-> RegisterStateMonad ErrorList
execLBSProgram inputs p =
combine (DL.toList stmts) DL.empty
where stmts :: DList (ErrorList -> RegisterStateMonad ErrorList)
stmts = DL.map (execLB... | 661 | execLBSProgram :: InputValues -- ^ The input values.
-> LBSProgram -- ^ The LBS program.
-> RegisterStateMonad ErrorList
execLBSProgram inputs p =
combine (DL.toList stmts) DL.empty
where stmts :: DList (ErrorList -> RegisterStateMonad ErrorList)
stmts = DL.map (execLB... | 661 | execLBSProgram inputs p =
combine (DL.toList stmts) DL.empty
where stmts :: DList (ErrorList -> RegisterStateMonad ErrorList)
stmts = DL.map (execLBSStatement inputs) p
combine :: [ErrorList -> RegisterStateMonad ErrorList]
-> ErrorList
-> RegisterStateMon... | 507 | false | true | 0 | 9 | 228 | 159 | 78 | 81 | null | null |
spyked/writer-monkey | src/Markov/Process.hs | bsd-3-clause | next :: Ord a => Chain a -> a -> IO (Maybe a)
next c s = do
let accs = distribToAscList $ distribOf c s
rn <- randomRIO (0, sumProb accs)
return $ next' rn 0 accs
where
next' _ _ [] = Nothing
next' _ _ (sp : []) = Just $ fst sp
next' rn acc ((s, p) : sps) = -- sample
if rn <= acc + p... | 443 | next :: Ord a => Chain a -> a -> IO (Maybe a)
next c s = do
let accs = distribToAscList $ distribOf c s
rn <- randomRIO (0, sumProb accs)
return $ next' rn 0 accs
where
next' _ _ [] = Nothing
next' _ _ (sp : []) = Just $ fst sp
next' rn acc ((s, p) : sps) = -- sample
if rn <= acc + p... | 443 | next c s = do
let accs = distribToAscList $ distribOf c s
rn <- randomRIO (0, sumProb accs)
return $ next' rn 0 accs
where
next' _ _ [] = Nothing
next' _ _ (sp : []) = Just $ fst sp
next' rn acc ((s, p) : sps) = -- sample
if rn <= acc + p
then Just s
else next... | 397 | false | true | 0 | 11 | 153 | 199 | 98 | 101 | null | null |
chemouna/99Haskell | src/Problem1.hs | bsd-3-clause | myLast (_:xs) = myLast xs | 25 | myLast (_:xs) = myLast xs | 25 | myLast (_:xs) = myLast xs | 25 | false | false | 0 | 6 | 4 | 20 | 9 | 11 | null | null |
sdiehl/ghc | compiler/main/Packages.hs | bsd-3-clause | lookupModuleWithSuggestions :: DynFlags
-> ModuleName
-> Maybe FastString
-> LookupResult
lookupModuleWithSuggestions dflags
= lookupModuleWithSuggestions' dflags
(moduleNameProvidersMap (pkgState dflags)) | 299 | lookupModuleWithSuggestions :: DynFlags
-> ModuleName
-> Maybe FastString
-> LookupResult
lookupModuleWithSuggestions dflags
= lookupModuleWithSuggestions' dflags
(moduleNameProvidersMap (pkgState dflags)) | 299 | lookupModuleWithSuggestions dflags
= lookupModuleWithSuggestions' dflags
(moduleNameProvidersMap (pkgState dflags)) | 125 | false | true | 0 | 9 | 111 | 46 | 22 | 24 | null | null |
sapek/optparse-applicative | tests/Tests.hs | bsd-3-clause | case_cmd_header :: Assertion
case_cmd_header = do
let i = info (helper <*> Commands.sample) (header "foo")
checkHelpTextWith (ExitFailure 1) defaultPrefs
"commands_header" i ["-zzz"]
checkHelpTextWith (ExitFailure 1) (prefs showHelpOnError)
"commands_header_full" i ["-zzz"] | 320 | case_cmd_header :: Assertion
case_cmd_header = do
let i = info (helper <*> Commands.sample) (header "foo")
checkHelpTextWith (ExitFailure 1) defaultPrefs
"commands_header" i ["-zzz"]
checkHelpTextWith (ExitFailure 1) (prefs showHelpOnError)
"commands_header_full" i ["-zzz"] | 320 | case_cmd_header = do
let i = info (helper <*> Commands.sample) (header "foo")
checkHelpTextWith (ExitFailure 1) defaultPrefs
"commands_header" i ["-zzz"]
checkHelpTextWith (ExitFailure 1) (prefs showHelpOnError)
"commands_header_full" i ["-zzz"] | 291 | false | true | 0 | 14 | 75 | 99 | 46 | 53 | null | null |
NicolasT/nbd | bin/server.hs | lgpl-2.1 | main :: IO ()
main = runResourceT $ do
args <- liftIO getArgs
when (null args) $ liftIO $ do
progName <- getProgName
hPutStrLn stderr $ "Usage: " ++ progName ++ " exportFile1 (exportFile2 ...)"
exitFailure
exports <- forM args $ \fn -> do
let fn' = Text.pack fn
(_, ... | 2,983 | main :: IO ()
main = runResourceT $ do
args <- liftIO getArgs
when (null args) $ liftIO $ do
progName <- getProgName
hPutStrLn stderr $ "Usage: " ++ progName ++ " exportFile1 (exportFile2 ...)"
exitFailure
exports <- forM args $ \fn -> do
let fn' = Text.pack fn
(_, ... | 2,983 | main = runResourceT $ do
args <- liftIO getArgs
when (null args) $ liftIO $ do
progName <- getProgName
hPutStrLn stderr $ "Usage: " ++ progName ++ " exportFile1 (exportFile2 ...)"
exitFailure
exports <- forM args $ \fn -> do
let fn' = Text.pack fn
(_, fd) <- allocat... | 2,969 | false | true | 21 | 20 | 1,183 | 884 | 436 | 448 | null | null |
yxm4109/pandoc | tests/RunTests.hs | gpl-2.0 | readFile' :: FilePath -> IO String
readFile' f = do s <- readFile f
return $! (length s `seq` s) | 113 | readFile' :: FilePath -> IO String
readFile' f = do s <- readFile f
return $! (length s `seq` s) | 113 | readFile' f = do s <- readFile f
return $! (length s `seq` s) | 78 | false | true | 0 | 10 | 36 | 50 | 24 | 26 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/Codebase/FileCodebase/Common.hs | mit | putBranch :: MonadIO m => CodebasePath -> Branch m -> m ()
putBranch root b =
Branch.sync (hashExists root)
(serializeRawBranch root)
(serializeEdits root)
b | 201 | putBranch :: MonadIO m => CodebasePath -> Branch m -> m ()
putBranch root b =
Branch.sync (hashExists root)
(serializeRawBranch root)
(serializeEdits root)
b | 201 | putBranch root b =
Branch.sync (hashExists root)
(serializeRawBranch root)
(serializeEdits root)
b | 142 | false | true | 0 | 9 | 67 | 68 | 32 | 36 | null | null |
frantisekfarka/ghc-dsi | compiler/codeGen/StgCmmProf.hs | bsd-3-clause | enterCostCentreFun :: CostCentreStack -> CmmExpr -> FCode ()
enterCostCentreFun ccs closure =
ifProfiling $ do
if isCurrentCCS ccs
then do dflags <- getDynFlags
emitRtsCall rtsPackageId (fsLit "enterFunCCS")
[(CmmReg (CmmGlobal BaseReg), AddrHint),
(cos... | 423 | enterCostCentreFun :: CostCentreStack -> CmmExpr -> FCode ()
enterCostCentreFun ccs closure =
ifProfiling $ do
if isCurrentCCS ccs
then do dflags <- getDynFlags
emitRtsCall rtsPackageId (fsLit "enterFunCCS")
[(CmmReg (CmmGlobal BaseReg), AddrHint),
(cos... | 423 | enterCostCentreFun ccs closure =
ifProfiling $ do
if isCurrentCCS ccs
then do dflags <- getDynFlags
emitRtsCall rtsPackageId (fsLit "enterFunCCS")
[(CmmReg (CmmGlobal BaseReg), AddrHint),
(costCentreFrom dflags closure, AddrHint)] False
else retu... | 362 | false | true | 0 | 16 | 118 | 110 | 55 | 55 | null | null |
Brightgalrs/con-lang-gen | src/Out/Syllable.hs | mit | syllabifyWord lang (MorphemeP _ _ ps) = sylls where
groups = breakPhonemes lang ps []
sylls = map (makeSyllable lang) <$> groups | 132 | syllabifyWord lang (MorphemeP _ _ ps) = sylls where
groups = breakPhonemes lang ps []
sylls = map (makeSyllable lang) <$> groups | 132 | syllabifyWord lang (MorphemeP _ _ ps) = sylls where
groups = breakPhonemes lang ps []
sylls = map (makeSyllable lang) <$> groups | 132 | false | false | 0 | 10 | 25 | 57 | 27 | 30 | null | null |
thoughtpolice/hs-noise | src/Crypto/Network/Noise.hs | mit | -- | Accept a single incoming connection and use it.
--
-- The connection socket is closed when done or in case of exceptions.
accept :: (MonadIO m, C.MonadCatch m)
=> NS.Socket -- ^ Listening and bound socket
-> PipeConfig -- ^ Server configuration
-> ((Context, NS.SockAddr) -> m r) -- ^ Handle... | 686 | accept :: (MonadIO m, C.MonadCatch m)
=> NS.Socket -- ^ Listening and bound socket
-> PipeConfig -- ^ Server configuration
-> ((Context, NS.SockAddr) -> m r) -- ^ Handler for incoming connection.
-> m r
accept sock conf k = NS.accept sock $ \(socket, sockAddr) -> do
streams <- liftIO $ ... | 559 | accept sock conf k = NS.accept sock $ \(socket, sockAddr) -> do
streams <- liftIO $ (S.socketToStreams >=> pipeServerStream conf) socket
k ((Context socket streams), sockAddr)
-- | Accept a single incoming connection and use it in another thread.
--
-- The connection socket is closed when done or in case of except... | 325 | true | true | 0 | 14 | 147 | 145 | 78 | 67 | null | null |
rueshyna/gogol | gogol-autoscaler/gen/Network/Google/Resource/Autoscaler/ZoneOperations/Delete.hs | mpl-2.0 | zodOperation :: Lens' ZoneOperationsDelete Text
zodOperation
= lens _zodOperation (\ s a -> s{_zodOperation = a}) | 115 | zodOperation :: Lens' ZoneOperationsDelete Text
zodOperation
= lens _zodOperation (\ s a -> s{_zodOperation = a}) | 115 | zodOperation
= lens _zodOperation (\ s a -> s{_zodOperation = a}) | 67 | false | true | 1 | 9 | 17 | 45 | 21 | 24 | null | null |
modeswitch/barrelfish | hake/ARM11MP.hs | mit | -------------------------------------------------------------------------
--
-- Architecture specific definitions for ARM
--
-------------------------------------------------------------------------
arch = "arm11mp" | 222 | arch = "arm11mp" | 22 | arch = "arm11mp" | 22 | true | false | 1 | 5 | 19 | 15 | 8 | 7 | null | null |
fujiyan/toriaezuzakki | haskell/opengl/uniform-matrix/LoadShaders.hs | bsd-2-clause | checked :: (t -> IO ())
-> (t -> GettableStateVar Bool)
-> (t -> GettableStateVar String)
-> String
-> t
-> IO ()
checked action getStatus getInfoLog message object = do
action object
ok <- get (getStatus object)
unless ok $ do
infoLog <- get (getInfoLog object)
... | 361 | checked :: (t -> IO ())
-> (t -> GettableStateVar Bool)
-> (t -> GettableStateVar String)
-> String
-> t
-> IO ()
checked action getStatus getInfoLog message object = do
action object
ok <- get (getStatus object)
unless ok $ do
infoLog <- get (getInfoLog object)
... | 361 | checked action getStatus getInfoLog message object = do
action object
ok <- get (getStatus object)
unless ok $ do
infoLog <- get (getInfoLog object)
fail (message ++ " log: " ++ infoLog) | 207 | false | true | 0 | 13 | 115 | 144 | 67 | 77 | null | null |
jorenverspeurt/joren-assignments-haskell | bomen.hs | gpl-3.0 | mapIntTree f (IntNode t1 i t2) = IntNode (mapIntTree f t1) (f i) (mapIntTree f t2) | 82 | mapIntTree f (IntNode t1 i t2) = IntNode (mapIntTree f t1) (f i) (mapIntTree f t2) | 82 | mapIntTree f (IntNode t1 i t2) = IntNode (mapIntTree f t1) (f i) (mapIntTree f t2) | 82 | false | false | 0 | 7 | 15 | 51 | 24 | 27 | null | null |
qiuhw/sym | src/Sym/SyntaxTree.hs | bsd-3-clause | parens e = '(' : show e ++ ")" | 35 | parens e = '(' : show e ++ ")" | 35 | parens e = '(' : show e ++ ")" | 35 | false | false | 0 | 7 | 13 | 20 | 9 | 11 | null | null |
kmein/ciphers | src/Text/Cipher/Interactive.hs | mit | toFunction :: CiphersOptions -> String -> String
toFunction (CiphersOptions c d g) =
processGrouping g $
case (c, d) of
(Atbash , Encrypt) -> atbash
(Atbash , Decrypt) -> unatbash
(Autokey key , Encrypt) -> autokey key
(Autokey key , Decrypt) -> unautokey ke... | 977 | toFunction :: CiphersOptions -> String -> String
toFunction (CiphersOptions c d g) =
processGrouping g $
case (c, d) of
(Atbash , Encrypt) -> atbash
(Atbash , Decrypt) -> unatbash
(Autokey key , Encrypt) -> autokey key
(Autokey key , Decrypt) -> unautokey ke... | 977 | toFunction (CiphersOptions c d g) =
processGrouping g $
case (c, d) of
(Atbash , Encrypt) -> atbash
(Atbash , Decrypt) -> unatbash
(Autokey key , Encrypt) -> autokey key
(Autokey key , Decrypt) -> unautokey key
(Caesar shift , Encrypt) -> caesar sh... | 928 | false | true | 0 | 11 | 309 | 331 | 169 | 162 | null | null |
mhcurylo/scheme-haskell-tutorial | src/Evaluator.hs | bsd-3-clause | evalAllReturnLast env l@(_:_) = mapM (eval env) l >>= return . last | 67 | evalAllReturnLast env l@(_:_) = mapM (eval env) l >>= return . last | 67 | evalAllReturnLast env l@(_:_) = mapM (eval env) l >>= return . last | 67 | false | false | 0 | 9 | 11 | 40 | 20 | 20 | null | null |
shlevy/ghc | compiler/deSugar/DsUtils.hs | bsd-3-clause | wrapBinds :: [(Var,Var)] -> CoreExpr -> CoreExpr
wrapBinds [] e = e | 67 | wrapBinds :: [(Var,Var)] -> CoreExpr -> CoreExpr
wrapBinds [] e = e | 67 | wrapBinds [] e = e | 18 | false | true | 0 | 7 | 11 | 35 | 19 | 16 | null | null |
GaloisInc/saw-script | saw-core/src/Verifier/SAW/SharedTerm.hs | bsd-3-clause | scImport :: SharedContext -> Term -> IO Term
scImport sc t0 =
do cache <- newCache
go cache t0
where
go :: Cache IO TermIndex Term -> Term -> IO Term
go cache (Unshared tf) =
Unshared <$> traverse (go cache) tf
go cache (STApp{ stAppIndex = idx, stAppTermF = tf}) =
useCache ... | 651 | scImport :: SharedContext -> Term -> IO Term
scImport sc t0 =
do cache <- newCache
go cache t0
where
go :: Cache IO TermIndex Term -> Term -> IO Term
go cache (Unshared tf) =
Unshared <$> traverse (go cache) tf
go cache (STApp{ stAppIndex = idx, stAppTermF = tf}) =
useCache ... | 651 | scImport sc t0 =
do cache <- newCache
go cache t0
where
go :: Cache IO TermIndex Term -> Term -> IO Term
go cache (Unshared tf) =
Unshared <$> traverse (go cache) tf
go cache (STApp{ stAppIndex = idx, stAppTermF = tf}) =
useCache cache idx (scTermF sc =<< traverse (go cache)... | 606 | false | true | 0 | 10 | 145 | 165 | 81 | 84 | null | null |
mitochon/hexercise | src/haskellbook/ch18/ch18.hs | mit | flipType :: (Monad m) => [m a] -> m [a]
flipType = sequence | 59 | flipType :: (Monad m) => [m a] -> m [a]
flipType = sequence | 59 | flipType = sequence | 19 | false | true | 0 | 8 | 12 | 36 | 19 | 17 | null | null |
bergmark/hlint | src/Hint/Extensions.hs | bsd-3-clause | used DeriveFunctor = hasDerive ["Functor"] | 42 | used DeriveFunctor = hasDerive ["Functor"] | 42 | used DeriveFunctor = hasDerive ["Functor"] | 42 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
mainland/dph | dph-lifted-copy/Data/Array/Parallel/Lifted/Closure.hs | bsd-3-clause | closure fv fl e = Clo fv fl e | 29 | closure fv fl e = Clo fv fl e | 29 | closure fv fl e = Clo fv fl e | 29 | false | false | 1 | 5 | 8 | 28 | 9 | 19 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Aeson.TH.hs | bsd-3-clause | noStringFail :: String -> String -> Parser fail
noStringFail t o = fail $ printf "When parsing %s expected String but got %s." t o | 130 | noStringFail :: String -> String -> Parser fail
noStringFail t o = fail $ printf "When parsing %s expected String but got %s." t o | 130 | noStringFail t o = fail $ printf "When parsing %s expected String but got %s." t o | 82 | false | true | 0 | 8 | 24 | 42 | 19 | 23 | null | null |
xenog/haskoin | test/bitcoin/Network/Haskoin/Transaction/Tests.hs | unlicense | tests :: [Test]
tests =
[ testGroup
"Transaction tests"
[ testProperty "decode . encode Txid" $
forAll arbitraryTxHash $ \h -> hexToTxHash (txHashToHex h) == Just h
, testProperty "From string transaction id" $
forAll arbitraryTxHash $ \h -> fromString (cs $ txH... | 1,233 | tests :: [Test]
tests =
[ testGroup
"Transaction tests"
[ testProperty "decode . encode Txid" $
forAll arbitraryTxHash $ \h -> hexToTxHash (txHashToHex h) == Just h
, testProperty "From string transaction id" $
forAll arbitraryTxHash $ \h -> fromString (cs $ txH... | 1,233 | tests =
[ testGroup
"Transaction tests"
[ testProperty "decode . encode Txid" $
forAll arbitraryTxHash $ \h -> hexToTxHash (txHashToHex h) == Just h
, testProperty "From string transaction id" $
forAll arbitraryTxHash $ \h -> fromString (cs $ txHashToHex h) == h... | 1,217 | false | true | 0 | 15 | 387 | 242 | 114 | 128 | null | null |
leftaroundabout/cqtx | HsMacro/CodeGen/CXX/Code.hs | gpl-3.0 | rocCXXCode :: (CXXExpression->CXXExpression) -> CXXCode a -> CXXCode a
procCXXCode f = modifyCXXLines $ lines . f . init . unlines
| 131 | procCXXCode :: (CXXExpression->CXXExpression) -> CXXCode a -> CXXCode a
procCXXCode f = modifyCXXLines $ lines . f . init . unlines | 131 | procCXXCode f = modifyCXXLines $ lines . f . init . unlines | 59 | false | true | 0 | 8 | 21 | 51 | 25 | 26 | null | null |
brendanhay/gogol | gogol-ml/gen/Network/Google/Resource/Ml/Projects/Locations/Studies/Trials/Suggest.hs | mpl-2.0 | -- | JSONP
proCallback :: Lens' ProjectsLocationsStudiesTrialsSuggest (Maybe Text)
proCallback
= lens _proCallback (\ s a -> s{_proCallback = a}) | 147 | proCallback :: Lens' ProjectsLocationsStudiesTrialsSuggest (Maybe Text)
proCallback
= lens _proCallback (\ s a -> s{_proCallback = a}) | 136 | proCallback
= lens _proCallback (\ s a -> s{_proCallback = a}) | 64 | true | true | 1 | 9 | 21 | 50 | 25 | 25 | null | null |
krisajenkins/BellRinger | src/Messages.hs | epl-1.0 | process (IncSnd n) (a,b,c,d) = (a,b + n,c,d) | 44 | process (IncSnd n) (a,b,c,d) = (a,b + n,c,d) | 44 | process (IncSnd n) (a,b,c,d) = (a,b + n,c,d) | 44 | false | false | 0 | 7 | 7 | 45 | 26 | 19 | null | null |
li-zhirui/JSAnalyzer | JSEvaluator.hs | mit | eval _ (JSRowVal v) = return v | 32 | eval _ (JSRowVal v) = return v | 32 | eval _ (JSRowVal v) = return v | 32 | false | false | 1 | 6 | 8 | 23 | 9 | 14 | null | null |
edsko/hackage-server | Distribution/Server/Features/Distro/Distributions.hs | bsd-3-clause | emptyDistroVersions :: DistroVersions
emptyDistroVersions = DistroVersions Map.empty Map.empty | 94 | emptyDistroVersions :: DistroVersions
emptyDistroVersions = DistroVersions Map.empty Map.empty | 94 | emptyDistroVersions = DistroVersions Map.empty Map.empty | 56 | false | true | 0 | 6 | 7 | 20 | 10 | 10 | null | null |
conal/reification-rules | src/ReificationRules/HOS.hs | bsd-3-clause | t1 :: EP (Bool -> Bool)
t1 = constE' NotP | 41 | t1 :: EP (Bool -> Bool)
t1 = constE' NotP | 41 | t1 = constE' NotP | 17 | false | true | 1 | 7 | 9 | 27 | 12 | 15 | null | null |
geophf/1HaskellADay | exercises/HAD/Data/Matrix.hs | mit | -- redefine pprint so it works with this new type pretty-printing as before
pprint :: Show a => Matrix a -> IO ()
pprint (M arr) = -- pprintWith show
let ((_,_),(rows,cols)) = bounds arr in
putStrLn ("Matrix " ++ show rows ++ ('x':show cols)) >> showRows arr | 265 | pprint :: Show a => Matrix a -> IO ()
pprint (M arr) = -- pprintWith show
let ((_,_),(rows,cols)) = bounds arr in
putStrLn ("Matrix " ++ show rows ++ ('x':show cols)) >> showRows arr | 188 | pprint (M arr) = -- pprintWith show
let ((_,_),(rows,cols)) = bounds arr in
putStrLn ("Matrix " ++ show rows ++ ('x':show cols)) >> showRows arr | 150 | true | true | 0 | 10 | 54 | 112 | 55 | 57 | null | null |
brendanhay/gogol | gogol-admin-directory/gen/Network/Google/Resource/Directory/Roles/Update.hs | mpl-2.0 | -- | Creates a value of 'RolesUpdate' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ruXgafv'
--
-- * 'ruUploadProtocol'
--
-- * 'ruAccessToken'
--
-- * 'ruUploadType'
--
-- * 'ruPayload'
--
-- * 'ruRoleId'
--
-- * 'ruCustomer'
--
--... | 765 | rolesUpdate
:: Role -- ^ 'ruPayload'
-> Text -- ^ 'ruRoleId'
-> Text -- ^ 'ruCustomer'
-> RolesUpdate
rolesUpdate pRuPayload_ pRuRoleId_ pRuCustomer_ =
RolesUpdate'
{ _ruXgafv = Nothing
, _ruUploadProtocol = Nothing
, _ruAccessToken = Nothing
, _ruUploadType = Nothing
, _ruPayload ... | 429 | rolesUpdate pRuPayload_ pRuRoleId_ pRuCustomer_ =
RolesUpdate'
{ _ruXgafv = Nothing
, _ruUploadProtocol = Nothing
, _ruAccessToken = Nothing
, _ruUploadType = Nothing
, _ruPayload = pRuPayload_
, _ruRoleId = pRuRoleId_
, _ruCustomer = pRuCustomer_
, _ruCallback = Nothing
} | 311 | true | true | 0 | 7 | 172 | 102 | 70 | 32 | null | null |
michaelgwelch/bacnet | src/BACnet/Writer.hs | mit | -- | Writes a context specific encoded null value.
--
-- >>> runW $ writeNullCS 254
-- [248,254]
--
-- >>> [0xF8,0xFE] == [248,254]
-- True
writeNullCS :: TagNumber -> Writer
writeNullCS = writeNullCSTag | 203 | writeNullCS :: TagNumber -> Writer
writeNullCS = writeNullCSTag | 63 | writeNullCS = writeNullCSTag | 28 | true | true | 0 | 7 | 33 | 29 | 16 | 13 | null | null |
maruks/haskell-book | src/Chapter17_applicative.hs | gpl-3.0 | main = do
quickBatch $ applicative (undefined :: Validation String (String, String, String))
quickBatch $ applicative (undefined :: List (String, Int, Char))
quickBatch $ applicative (undefined :: ZipList' (String, Int, Char))
quickBatch $ applicative (undefined :: Three String String (Strin... | 768 | main = do
quickBatch $ applicative (undefined :: Validation String (String, String, String))
quickBatch $ applicative (undefined :: List (String, Int, Char))
quickBatch $ applicative (undefined :: ZipList' (String, Int, Char))
quickBatch $ applicative (undefined :: Three String String (Strin... | 768 | main = do
quickBatch $ applicative (undefined :: Validation String (String, String, String))
quickBatch $ applicative (undefined :: List (String, Int, Char))
quickBatch $ applicative (undefined :: ZipList' (String, Int, Char))
quickBatch $ applicative (undefined :: Three String String (Strin... | 768 | false | false | 0 | 11 | 155 | 276 | 147 | 129 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/WebKitCSSMatrix.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebKitCSSMatrix.m33 Mozilla WebKitCSSMatrix.m33 documentation>
setM33 :: (MonadDOM m) => WebKitCSSMatrix -> Double -> m ()
setM33 self val = liftDOM (self ^. jss "m33" (toJSVal val)) | 238 | setM33 :: (MonadDOM m) => WebKitCSSMatrix -> Double -> m ()
setM33 self val = liftDOM (self ^. jss "m33" (toJSVal val)) | 119 | setM33 self val = liftDOM (self ^. jss "m33" (toJSVal val)) | 59 | true | true | 0 | 10 | 28 | 64 | 31 | 33 | null | null |
damianfral/clay | src/Clay/Elements.hs | bsd-3-clause | h6 = "h6" | 9 | h6 = "h6" | 9 | h6 = "h6" | 9 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
lukexi/ghc-7.8-arm64 | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | emitPrimOp _ res IndexByteArrayOp_Int64 args = doIndexByteArrayOp Nothing b64 res args | 105 | emitPrimOp _ res IndexByteArrayOp_Int64 args = doIndexByteArrayOp Nothing b64 res args | 105 | emitPrimOp _ res IndexByteArrayOp_Int64 args = doIndexByteArrayOp Nothing b64 res args | 105 | false | false | 1 | 5 | 29 | 28 | 11 | 17 | null | null |
TOSPIO/yi | src/library/Yi/Buffer/HighLevel.hs | gpl-2.0 | -- | Delete to the end of line, excluding it.
deleteToEol :: BufferM ()
deleteToEol = deleteRegionB =<< regionOfPartB Line Forward | 130 | deleteToEol :: BufferM ()
deleteToEol = deleteRegionB =<< regionOfPartB Line Forward | 84 | deleteToEol = deleteRegionB =<< regionOfPartB Line Forward | 58 | true | true | 0 | 6 | 20 | 26 | 13 | 13 | null | null |
tjakway/ghcjvm | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprInstr (FNEG reg1 reg2) = pprUnary (sLit "fneg") reg1 reg2 | 60 | pprInstr (FNEG reg1 reg2) = pprUnary (sLit "fneg") reg1 reg2 | 60 | pprInstr (FNEG reg1 reg2) = pprUnary (sLit "fneg") reg1 reg2 | 60 | false | false | 0 | 7 | 9 | 31 | 14 | 17 | null | null |
toonn/wyah | src/CbNdInterpreter.hs | bsd-2-clause | main = undefined | 16 | main = undefined | 16 | main = undefined | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
anttisalonen/freekick | haskell/freekick_client/wxMenu/Main.hs | agpl-3.0 | guifriendly :: PlayerDB -> ClubDB -> StadiumDB -> IO ()
guifriendly playerDB clubDB stadiumDB = do
f <- frame [text := "Friendly game"]
let allclubnames = Data.Map.keys clubDB
c1 <- comboBox f [items := allclubnames]
c2 <- comboBox f [items := allclubnames]
bt <- button f [text := "Continue", on ... | 1,017 | guifriendly :: PlayerDB -> ClubDB -> StadiumDB -> IO ()
guifriendly playerDB clubDB stadiumDB = do
f <- frame [text := "Friendly game"]
let allclubnames = Data.Map.keys clubDB
c1 <- comboBox f [items := allclubnames]
c2 <- comboBox f [items := allclubnames]
bt <- button f [text := "Continue", on ... | 1,017 | guifriendly playerDB clubDB stadiumDB = do
f <- frame [text := "Friendly game"]
let allclubnames = Data.Map.keys clubDB
c1 <- comboBox f [items := allclubnames]
c2 <- comboBox f [items := allclubnames]
bt <- button f [text := "Continue", on command := preparelineups playerDB clubDB stadiumDB c1 c... | 961 | false | true | 0 | 12 | 486 | 230 | 109 | 121 | null | null |
olsner/ghc | testsuite/tests/perf/compiler/T10370.hs | bsd-3-clause | a576 :: IO (); a576 = forever $ putStrLn "a576" | 47 | a576 :: IO ()
a576 = forever $ putStrLn "a576" | 46 | a576 = forever $ putStrLn "a576" | 32 | false | true | 0 | 6 | 9 | 24 | 12 | 12 | null | null |
christiannolte/tip-toi-reveng | src/OneLineParser.hs | mit | lineParserErrorMessage :: String -> ParseError -> String
lineParserErrorMessage input err =
"In " ++ sourceName pos ++ " column " ++ show (sourceColumn pos) ++ ":\n" ++
input ++ "\n" ++
replicate (sourceColumn pos - 1) ' ' ++ "↑" ++
showErrorMessages "or" "unknown parse err" "expecting"
... | 422 | lineParserErrorMessage :: String -> ParseError -> String
lineParserErrorMessage input err =
"In " ++ sourceName pos ++ " column " ++ show (sourceColumn pos) ++ ":\n" ++
input ++ "\n" ++
replicate (sourceColumn pos - 1) ' ' ++ "↑" ++
showErrorMessages "or" "unknown parse err" "expecting"
... | 422 | lineParserErrorMessage input err =
"In " ++ sourceName pos ++ " column " ++ show (sourceColumn pos) ++ ":\n" ++
input ++ "\n" ++
replicate (sourceColumn pos - 1) ' ' ++ "↑" ++
showErrorMessages "or" "unknown parse err" "expecting"
"unexpected" "end of input"
(... | 365 | false | true | 0 | 14 | 119 | 117 | 56 | 61 | null | null |
hjwylde/werewolf | app/Game/Werewolf/Message/Command.hs | bsd-3-clause | gameEndedMessage :: Text -> Message
gameEndedMessage = publicMessage . gameEndedText | 84 | gameEndedMessage :: Text -> Message
gameEndedMessage = publicMessage . gameEndedText | 84 | gameEndedMessage = publicMessage . gameEndedText | 48 | false | true | 0 | 7 | 9 | 26 | 11 | 15 | null | null |
anttisalonen/freekick2 | src/SWOSShell.hs | gpl-3.0 | swosColorToColor Swos.Green = green | 35 | swosColorToColor Swos.Green = green | 35 | swosColorToColor Swos.Green = green | 35 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
bhamrick/wordpairs | Data/NFA.hs | bsd-3-clause | nfaTransition :: (Ord s, PropLike a p) => NFA s p -> a -> [s] -> [s]
nfaTransition n a = expandImmediates n . consume n a
where
consume :: (Ord s, PropLike a p) => NFA s p -> a -> [s] -> [s]
consume n a ss = ordNub $ do
s <- ss
case n ^. consumers . at s of
Nothing -> []
... | 370 | nfaTransition :: (Ord s, PropLike a p) => NFA s p -> a -> [s] -> [s]
nfaTransition n a = expandImmediates n . consume n a
where
consume :: (Ord s, PropLike a p) => NFA s p -> a -> [s] -> [s]
consume n a ss = ordNub $ do
s <- ss
case n ^. consumers . at s of
Nothing -> []
... | 370 | nfaTransition n a = expandImmediates n . consume n a
where
consume :: (Ord s, PropLike a p) => NFA s p -> a -> [s] -> [s]
consume n a ss = ordNub $ do
s <- ss
case n ^. consumers . at s of
Nothing -> []
Just ts -> ordNub [t | (t, p) <- ts, prop p a] | 301 | false | true | 0 | 15 | 131 | 203 | 101 | 102 | null | null |
spinda/liquidhaskell | src/Language/Haskell/Liquid/Pipeline/ACSS.hs | bsd-3-clause | renderErrAnnot Nothing s = s | 31 | renderErrAnnot Nothing s = s | 31 | renderErrAnnot Nothing s = s | 31 | false | false | 0 | 5 | 7 | 11 | 5 | 6 | null | null |
IreneKnapp/Faction | faction/Distribution/Client/IndexUtils.hs | bsd-3-clause | readRepoIndex :: Verbosity -> Repo
-> IO (PackageIndex SourcePackage, [Dependency])
readRepoIndex verbosity repo =
let indexFile = repoLocalDir repo </> "00-index.tar"
cacheFile = repoLocalDir repo </> "00-index.cache"
in handleNotFound $ do
warnIfIndexIsOld indexFile
whenCacheOutOfDate ... | 2,009 | readRepoIndex :: Verbosity -> Repo
-> IO (PackageIndex SourcePackage, [Dependency])
readRepoIndex verbosity repo =
let indexFile = repoLocalDir repo </> "00-index.tar"
cacheFile = repoLocalDir repo </> "00-index.cache"
in handleNotFound $ do
warnIfIndexIsOld indexFile
whenCacheOutOfDate ... | 2,009 | readRepoIndex verbosity repo =
let indexFile = repoLocalDir repo </> "00-index.tar"
cacheFile = repoLocalDir repo </> "00-index.cache"
in handleNotFound $ do
warnIfIndexIsOld indexFile
whenCacheOutOfDate indexFile cacheFile $ do
info verbosity $ "Updating the index cache file..."
updatePac... | 1,911 | false | true | 3 | 19 | 551 | 434 | 203 | 231 | null | null |
kadena-io/pact | src-ghc/Pact/GasModel/GasTests.hs | bsd-3-clause | keysAllTests :: NativeDefName -> GasUnitTests
keysAllTests = defGasUnitTests allExprs
where
keysAllExpr = defPactExpression [text|(keys-all 3 3)|]
allExprs = keysAllExpr :| [] | 185 | keysAllTests :: NativeDefName -> GasUnitTests
keysAllTests = defGasUnitTests allExprs
where
keysAllExpr = defPactExpression [text|(keys-all 3 3)|]
allExprs = keysAllExpr :| [] | 185 | keysAllTests = defGasUnitTests allExprs
where
keysAllExpr = defPactExpression [text|(keys-all 3 3)|]
allExprs = keysAllExpr :| [] | 139 | false | true | 1 | 6 | 30 | 45 | 24 | 21 | null | null |
ramirez7/configurator-applicative | src/Data/Configurator/Applicative/Print.hs | bsd-3-clause | checkTree (OrNode []) = Nothing | 36 | checkTree (OrNode []) = Nothing | 36 | checkTree (OrNode []) = Nothing | 36 | false | false | 0 | 7 | 9 | 18 | 8 | 10 | null | null |
alexander-at-github/eta | compiler/ETA/SimplCore/SAT.hs | bsd-3-clause | satExpr ty@(Type _) _ = do
return (ty, emptyIdSATInfo, Nothing) | 67 | satExpr ty@(Type _) _ = do
return (ty, emptyIdSATInfo, Nothing) | 67 | satExpr ty@(Type _) _ = do
return (ty, emptyIdSATInfo, Nothing) | 67 | false | false | 0 | 8 | 13 | 35 | 18 | 17 | null | null |
christiaanb/ghc | libraries/base/Control/Exception/Base.hs | bsd-3-clause | -- | A version of 'catchJust' with the arguments swapped around (see
-- 'handle').
handleJust :: Exception e => (e -> Maybe b) -> (b -> IO a) -> IO a -> IO a
handleJust p = flip (catchJust p) | 192 | handleJust :: Exception e => (e -> Maybe b) -> (b -> IO a) -> IO a -> IO a
handleJust p = flip (catchJust p) | 109 | handleJust p = flip (catchJust p) | 34 | true | true | 0 | 10 | 40 | 70 | 34 | 36 | null | null |
disnet/jscheck | src/HJS/Parser.hs | bsd-3-clause | lexFile flags name = do
input <- readFile name
putStrLn $ show $ lexProgram input | 125 | lexFile flags name = do
input <- readFile name
putStrLn $ show $ lexProgram input | 125 | lexFile flags name = do
input <- readFile name
putStrLn $ show $ lexProgram input | 125 | false | false | 3 | 8 | 58 | 40 | 15 | 25 | null | null |
input-output-hk/pos-haskell-prototype | chain/test/Test/Pos/Chain/Update/Example.hs | mit | exampleUpAttributes :: UpAttributes
exampleUpAttributes = exampleAttributes | 75 | exampleUpAttributes :: UpAttributes
exampleUpAttributes = exampleAttributes | 75 | exampleUpAttributes = exampleAttributes | 39 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
szatkus/haste-compiler | src/haste-boot.hs | bsd-3-clause | installHasteCabal :: Bool -> FilePath -> Shell ()
installHasteCabal portable tmpdir = do
echo "Downloading haste-cabal from GitHub"
f <- decompress `fmap` downloadFile hasteCabalUrl
if os == "linux"
then do
mkdir True hasteCabalRootDir
liftIO . unpack hasteCabalRootDir $ read f
... | 1,665 | installHasteCabal :: Bool -> FilePath -> Shell ()
installHasteCabal portable tmpdir = do
echo "Downloading haste-cabal from GitHub"
f <- decompress `fmap` downloadFile hasteCabalUrl
if os == "linux"
then do
mkdir True hasteCabalRootDir
liftIO . unpack hasteCabalRootDir $ read f
... | 1,665 | installHasteCabal portable tmpdir = do
echo "Downloading haste-cabal from GitHub"
f <- decompress `fmap` downloadFile hasteCabalUrl
if os == "linux"
then do
mkdir True hasteCabalRootDir
liftIO . unpack hasteCabalRootDir $ read f
liftIO $ copyPermissions
hast... | 1,615 | false | true | 0 | 13 | 480 | 327 | 161 | 166 | null | null |
AlainODea-haskell/junos-confparse | src/Lib.hs | bsd-3-clause | addressSetEntryAddressParser :: Parser AddressSetEntry
addressSetEntryAddressParser = do
_ <- string " address "
n <- takeTill isEndOfLine
return $ AddressReference (toLower n) | 182 | addressSetEntryAddressParser :: Parser AddressSetEntry
addressSetEntryAddressParser = do
_ <- string " address "
n <- takeTill isEndOfLine
return $ AddressReference (toLower n) | 182 | addressSetEntryAddressParser = do
_ <- string " address "
n <- takeTill isEndOfLine
return $ AddressReference (toLower n) | 127 | false | true | 0 | 10 | 27 | 50 | 22 | 28 | null | null |
unitb/logic-function-tables | app/Example.hs | bsd-3-clause | al_ft :: FunctionTable LaTeXLI
al_ft = makeTable [tex|\cAl|] $ do
cell [tex|\cMd \in \{ \off, \init \} |] [tex|\sOff|]
branch [tex|\cMd \in \{ \normal, \fail \} |] $ do
cell [tex|\problem|] [tex|... | 535 | al_ft :: FunctionTable LaTeXLI
al_ft = makeTable [tex|\cAl|] $ do
cell [tex|\cMd \in \{ \off, \init \} |] [tex|\sOff|]
branch [tex|\cMd \in \{ \normal, \fail \} |] $ do
cell [tex|\problem|] [tex|... | 535 | al_ft = makeTable [tex|\cAl|] $ do
cell [tex|\cMd \in \{ \off, \init \} |] [tex|\sOff|]
branch [tex|\cMd \in \{ \normal, \fail \} |] $ do
cell [tex|\problem|] [tex|\sOn|]
branch ... | 504 | false | true | 0 | 14 | 234 | 117 | 74 | 43 | null | null |
csabahruska/GFXDemo | BSPLoader.hs | bsd-3-clause | {-
Information: http://graphics.stanford.edu/~kekoa/q3/
Data types
Quake 3 BSP files contains only four basic data types. They are:
Type Description
ubyte unsigned byte
int 4-byte integer, little-endian
float 4-byte IEEE float, little-endian
string[n] string of n ASCII bytes, not necessa... | 493 | lumpEntities = 0 :: Int | 28 | lumpEntities = 0 :: Int | 28 | true | false | 0 | 4 | 103 | 11 | 7 | 4 | null | null |
ivan-m/paraphrase | src/Text/Paraphrase/Types.hs | bsd-3-clause | -- A variant of 'runP' where a new ParseLog is created solely for the
-- provided parser.
--
-- If dealing specially with commitment, then the Failure case needs
-- to make sure to put the values back on the stack.
runPStacked :: Parser e s a
-> ( forall r.
ParseState e s
... | 636 | runPStacked :: Parser e s a
-> ( forall r.
ParseState e s
-> (ParseLog e s -> Failure e s r)
-> (ParseLog e s -> Success e s a r)
-> Result e s r
)
runPStacked p pSt pfl psc =
let withLog pf pSt' = un... | 421 | runPStacked p pSt pfl psc =
let withLog pf pSt' = uncurry pf (getLog pSt')
in runP p (pSt { errLog = newTop (errLog pSt) }) (withLog pfl) (withLog psc) | 155 | true | true | 0 | 13 | 230 | 176 | 88 | 88 | null | null |
m-alvarez/jhc | src/Support/Unparse.hs | mit | unparse :: DocLike a => Unparse a -> a
unparse up = unparse' Unparsable { unparseGroup = parens, unparseCat = (<>) } up | 119 | unparse :: DocLike a => Unparse a -> a
unparse up = unparse' Unparsable { unparseGroup = parens, unparseCat = (<>) } up | 119 | unparse up = unparse' Unparsable { unparseGroup = parens, unparseCat = (<>) } up | 80 | false | true | 0 | 7 | 22 | 49 | 26 | 23 | null | null |
spechub/Hets | OWL2/MS2Ship.hs | gpl-2.0 | classListFrame2Boxes :: Concept -> Maybe AS.Relation -> ListFrameBit -> [TBox]
classListFrame2Boxes c mr lfb = case lfb of
ExpressionBit l -> let cs = map (ce2Concept . snd) l in case mr of
Just r -> case r of
AS.SubClass -> map (ConceptDecl c . ConceptRel Less) cs
AS.EDRelation ed -> map ((case ed of... | 420 | classListFrame2Boxes :: Concept -> Maybe AS.Relation -> ListFrameBit -> [TBox]
classListFrame2Boxes c mr lfb = case lfb of
ExpressionBit l -> let cs = map (ce2Concept . snd) l in case mr of
Just r -> case r of
AS.SubClass -> map (ConceptDecl c . ConceptRel Less) cs
AS.EDRelation ed -> map ((case ed of... | 420 | classListFrame2Boxes c mr lfb = case lfb of
ExpressionBit l -> let cs = map (ce2Concept . snd) l in case mr of
Just r -> case r of
AS.SubClass -> map (ConceptDecl c . ConceptRel Less) cs
AS.EDRelation ed -> map ((case ed of
AS.Disjoint -> disC
AS.Equivalent -> eqC) c) cs
_ -> []
... | 341 | false | true | 0 | 23 | 117 | 192 | 91 | 101 | null | null |
bitemyapp/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | ndsSsconf :: String
ndsSsconf = "ssconf" | 40 | ndsSsconf :: String
ndsSsconf = "ssconf" | 40 | ndsSsconf = "ssconf" | 20 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
brendanhay/gogol | gogol-accessapproval/gen/Network/Google/Resource/AccessApproval/Projects/DeleteAccessApprovalSettings.hs | mpl-2.0 | -- | V1 error format.
pdaasXgafv :: Lens' ProjectsDeleteAccessApprovalSettings (Maybe Xgafv)
pdaasXgafv
= lens _pdaasXgafv (\ s a -> s{_pdaasXgafv = a}) | 154 | pdaasXgafv :: Lens' ProjectsDeleteAccessApprovalSettings (Maybe Xgafv)
pdaasXgafv
= lens _pdaasXgafv (\ s a -> s{_pdaasXgafv = a}) | 132 | pdaasXgafv
= lens _pdaasXgafv (\ s a -> s{_pdaasXgafv = a}) | 61 | true | true | 1 | 9 | 23 | 50 | 25 | 25 | null | null |
green-haskell/ghc | compiler/basicTypes/Id.hs | bsd-3-clause | isDFunId id = case Var.idDetails id of
DFunId {} -> True
_ -> False | 123 | isDFunId id = case Var.idDetails id of
DFunId {} -> True
_ -> False | 123 | isDFunId id = case Var.idDetails id of
DFunId {} -> True
_ -> False | 123 | false | false | 0 | 8 | 69 | 34 | 16 | 18 | null | null |
gcampax/ghc | compiler/typecheck/FamInst.hs | bsd-3-clause | conflictInstErr :: FamInst -> [FamInstMatch] -> TcRn ()
conflictInstErr fam_inst conflictingMatch
| (FamInstMatch { fim_instance = confInst }) : _ <- conflictingMatch
= addFamInstsErr (ptext (sLit "Conflicting family instance declarations:"))
[fam_inst, confInst]
| otherwise
= panic "conflict... | 328 | conflictInstErr :: FamInst -> [FamInstMatch] -> TcRn ()
conflictInstErr fam_inst conflictingMatch
| (FamInstMatch { fim_instance = confInst }) : _ <- conflictingMatch
= addFamInstsErr (ptext (sLit "Conflicting family instance declarations:"))
[fam_inst, confInst]
| otherwise
= panic "conflict... | 328 | conflictInstErr fam_inst conflictingMatch
| (FamInstMatch { fim_instance = confInst }) : _ <- conflictingMatch
= addFamInstsErr (ptext (sLit "Conflicting family instance declarations:"))
[fam_inst, confInst]
| otherwise
= panic "conflictInstErr" | 272 | false | true | 0 | 13 | 63 | 99 | 47 | 52 | null | null |
urbanslug/ghc | testsuite/tests/perf/compiler/T783.hs | bsd-3-clause | foo x | x == 232 = 232 | 22 | foo x | x == 232 = 232 | 22 | foo x | x == 232 = 232 | 22 | false | false | 0 | 8 | 7 | 23 | 9 | 14 | null | null |
sdiehl/ghc | testsuite/tests/programs/andy_cherry/DataTypes.hs | bsd-3-clause | charToMoveTok 'd' = Just (FileTok 4) | 36 | charToMoveTok 'd' = Just (FileTok 4) | 36 | charToMoveTok 'd' = Just (FileTok 4) | 36 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
spaceships/RogueMonad | src/Main.hs | gpl-2.0 | emptySpaceGlyph = Glyph
{ _glyph = ' '
, _color = def_attr `with_fore_color` black
} | 97 | emptySpaceGlyph = Glyph
{ _glyph = ' '
, _color = def_attr `with_fore_color` black
} | 97 | emptySpaceGlyph = Glyph
{ _glyph = ' '
, _color = def_attr `with_fore_color` black
} | 97 | false | false | 0 | 8 | 27 | 30 | 17 | 13 | null | null |
bergmark/purescript | psci/Main.hs | mit | inputFiles :: Cmd.Term [FilePath]
inputFiles = Cmd.value $ Cmd.posAny [] $ Cmd.posInfo { Cmd.posName = "file(s)"
, Cmd.posDoc = "Optional .purs files to load on start" } | 222 | inputFiles :: Cmd.Term [FilePath]
inputFiles = Cmd.value $ Cmd.posAny [] $ Cmd.posInfo { Cmd.posName = "file(s)"
, Cmd.posDoc = "Optional .purs files to load on start" } | 222 | inputFiles = Cmd.value $ Cmd.posAny [] $ Cmd.posInfo { Cmd.posName = "file(s)"
, Cmd.posDoc = "Optional .purs files to load on start" } | 188 | false | true | 1 | 8 | 79 | 60 | 30 | 30 | null | null |
ghcjs/ghcjs | src/Compiler/Utils.hs | mit | generatePackageVersionMacros :: [PackageConfig] -> String
generatePackageVersionMacros pkgs = concat
-- Do not add any C-style comments. See Trac #3389.
[ generateMacros "" pkgname version
| pkg <- pkgs
, let version = packageVersion pkg
pkgname = map fixchar (packageNameString pkg)
] | 303 | generatePackageVersionMacros :: [PackageConfig] -> String
generatePackageVersionMacros pkgs = concat
-- Do not add any C-style comments. See Trac #3389.
[ generateMacros "" pkgname version
| pkg <- pkgs
, let version = packageVersion pkg
pkgname = map fixchar (packageNameString pkg)
] | 303 | generatePackageVersionMacros pkgs = concat
-- Do not add any C-style comments. See Trac #3389.
[ generateMacros "" pkgname version
| pkg <- pkgs
, let version = packageVersion pkg
pkgname = map fixchar (packageNameString pkg)
] | 245 | false | true | 0 | 12 | 58 | 72 | 36 | 36 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | airRange ZergNydusCanal = 0 | 27 | airRange ZergNydusCanal = 0 | 27 | airRange ZergNydusCanal = 0 | 27 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
kairne/repa-lts | Data/Rope/Operators/Zipping.hs | bsd-3-clause | zipWithLTS f rpA rpB =
go rpA rpB
where
go :: Rope a -> Rope b -> Par (Rope c)
go (Cat l d v w) (Cat ll dd vv ww) | (length v == length vv) && (length w == length ww) = do
iv' <- spawn $ go v vv
iw' <- spawn $ go w ww
v' <- get iv'
... | 3,833 | zipWithLTS f rpA rpB =
go rpA rpB
where
go :: Rope a -> Rope b -> Par (Rope c)
go (Cat l d v w) (Cat ll dd vv ww) | (length v == length vv) && (length w == length ww) = do
iv' <- spawn $ go v vv
iw' <- spawn $ go w ww
v' <- get iv'
... | 3,833 | zipWithLTS f rpA rpB =
go rpA rpB
where
go :: Rope a -> Rope b -> Par (Rope c)
go (Cat l d v w) (Cat ll dd vv ww) | (length v == length vv) && (length w == length ww) = do
iv' <- spawn $ go v vv
iw' <- spawn $ go w ww
v' <- get iv'
... | 3,833 | false | false | 4 | 18 | 2,155 | 687 | 336 | 351 | null | null |
xenog/json-rpc | examples/time-server.hs | unlicense | srv :: MonadLoggerIO m => JSONRPCT m ()
srv = do
$(logDebug) "listening for new request"
qM <- receiveBatchRequest
case qM of
Nothing -> do
$(logDebug) "closed request channel, exting"
return ()
Just (SingleRequest q) -> do
$(logDebug) "got request"
... | 621 | srv :: MonadLoggerIO m => JSONRPCT m ()
srv = do
$(logDebug) "listening for new request"
qM <- receiveBatchRequest
case qM of
Nothing -> do
$(logDebug) "closed request channel, exting"
return ()
Just (SingleRequest q) -> do
$(logDebug) "got request"
... | 621 | srv = do
$(logDebug) "listening for new request"
qM <- receiveBatchRequest
case qM of
Nothing -> do
$(logDebug) "closed request channel, exting"
return ()
Just (SingleRequest q) -> do
$(logDebug) "got request"
rM <- buildResponse respond q
... | 581 | false | true | 0 | 16 | 226 | 191 | 82 | 109 | null | null |
cnc-patch/disass | src/Language/Assembly/X86/Parse.hs | bsd-3-clause | parseMOVNTPS :: (Stream s m Word8, Monad m) => t -> ParsecT s PState m Instr
parseMOVNTPS = parseXmmWV MOVNTPS InvalidOpcode MOVNTPD InvalidOpcode | 146 | parseMOVNTPS :: (Stream s m Word8, Monad m) => t -> ParsecT s PState m Instr
parseMOVNTPS = parseXmmWV MOVNTPS InvalidOpcode MOVNTPD InvalidOpcode | 146 | parseMOVNTPS = parseXmmWV MOVNTPS InvalidOpcode MOVNTPD InvalidOpcode | 69 | false | true | 0 | 7 | 22 | 52 | 26 | 26 | null | null |
expipiplus1/vulkan | src/Vulkan/Extensions/VK_EXT_sample_locations.hs | bsd-3-clause | -- | vkCmdSetSampleLocationsEXT - Set sample locations dynamically for a
-- command buffer
--
-- = Description
--
-- This command sets the custom sample locations for subsequent drawing
-- commands when the graphics pipeline is created with
-- 'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT'
-- set... | 6,435 | cmdSetSampleLocationsEXT :: forall io
. (MonadIO io)
=> -- | @commandBuffer@ is the command buffer into which the command will be
-- recorded.
CommandBuffer
-> -- | @pSampleLocationsInfo@ ... | 1,167 | cmdSetSampleLocationsEXT commandBuffer sampleLocationsInfo = liftIO . evalContT $ do
let vkCmdSetSampleLocationsEXTPtr = pVkCmdSetSampleLocationsEXT (case commandBuffer of CommandBuffer{deviceCmds} -> deviceCmds)
lift $ unless (vkCmdSetSampleLocationsEXTPtr /= nullFunPtr) $
throwIO $ IOError Nothing InvalidArgu... | 724 | true | true | 0 | 17 | 1,425 | 266 | 169 | 97 | null | null |
cpennington/reviewhub | Handler/Review.hs | bsd-3-clause | trimContext :: D.Hunk -> [Hunk]
trimContext hunk = trim (D.rangeStartingLineNumber $ D.hunkSourceRange hunk) (D.rangeStartingLineNumber $ D.hunkDestRange hunk) groups
where
isContext = (D.Context ==) . D.lineAnnotation
groups = groupBy ((==) `on` isContext) $ D.hunkLines hunk
trim _ _ [] = [... | 851 | trimContext :: D.Hunk -> [Hunk]
trimContext hunk = trim (D.rangeStartingLineNumber $ D.hunkSourceRange hunk) (D.rangeStartingLineNumber $ D.hunkDestRange hunk) groups
where
isContext = (D.Context ==) . D.lineAnnotation
groups = groupBy ((==) `on` isContext) $ D.hunkLines hunk
trim _ _ [] = [... | 851 | trimContext hunk = trim (D.rangeStartingLineNumber $ D.hunkSourceRange hunk) (D.rangeStartingLineNumber $ D.hunkDestRange hunk) groups
where
isContext = (D.Context ==) . D.lineAnnotation
groups = groupBy ((==) `on` isContext) $ D.hunkLines hunk
trim _ _ [] = []
trim srcStart dstStart... | 819 | false | true | 0 | 13 | 260 | 317 | 164 | 153 | null | null |
futtetennista/IntroductionToFunctionalProgramming | itfp/src/Chapter4.hs | mit | height :: [Picture a] -> Int
height p =
length p | 50 | height :: [Picture a] -> Int
height p =
length p | 50 | height p =
length p | 21 | false | true | 0 | 7 | 12 | 27 | 13 | 14 | null | null |
spechub/Hets | Comorphisms/Hs2HOLCFaux.hs | gpl-2.0 | nameListE, nameListF, nameListH :: [String]
-- Special translation - operators
nameListA = ["&&", "||", "==", "/=", "<", "<=", ">", ">=", "+",
"*", "-", "^",
"^^", "++", "!!", "/", ".", "$", "$!", ">>=", ">>"] | 214 | nameListE, nameListF, nameListH :: [String]
nameListA = ["&&", "||", "==", "/=", "<", "<=", ">", ">=", "+",
"*", "-", "^",
"^^", "++", "!!", "/", ".", "$", "$!", ">>=", ">>"] | 178 | nameListA = ["&&", "||", "==", "/=", "<", "<=", ">", ">=", "+",
"*", "-", "^",
"^^", "++", "!!", "/", ".", "$", "$!", ">>=", ">>"] | 134 | true | true | 4 | 7 | 37 | 94 | 55 | 39 | null | null |
dec9ue/jhc_copygc | src/GenUtil.hs | gpl-2.0 | lookupEnv :: Monad m => String -> IO (m String)
lookupEnv s = catch (fmap return $ System.getEnv s) (\e -> if IO.isDoesNotExistError e then return (fail (show e)) else ioError e) | 178 | lookupEnv :: Monad m => String -> IO (m String)
lookupEnv s = catch (fmap return $ System.getEnv s) (\e -> if IO.isDoesNotExistError e then return (fail (show e)) else ioError e) | 178 | lookupEnv s = catch (fmap return $ System.getEnv s) (\e -> if IO.isDoesNotExistError e then return (fail (show e)) else ioError e) | 130 | false | true | 0 | 13 | 31 | 98 | 46 | 52 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.