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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
chrisdone/freenect | examples/src/GlutBoundary.hs | bsd-3-clause | main :: IO ()
main = do
depthGrid <- newIORef Nothing
_ <- getDepthThread depthGrid
glThread depthGrid | 108 | main :: IO ()
main = do
depthGrid <- newIORef Nothing
_ <- getDepthThread depthGrid
glThread depthGrid | 108 | main = do
depthGrid <- newIORef Nothing
_ <- getDepthThread depthGrid
glThread depthGrid | 94 | false | true | 0 | 8 | 22 | 42 | 18 | 24 | null | null |
conal/shady-examples | src/SurfaceExamples.hs | agpl-3.0 | blackHoleH :: Floating s => HeightField s
blackHoleH = recip . magnitude | 72 | blackHoleH :: Floating s => HeightField s
blackHoleH = recip . magnitude | 72 | blackHoleH = recip . magnitude | 30 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
bvdelft/parac2 | simpletestsuite/Test.hs | bsd-3-clause | main = do
args <- getArgs
let header = "Usage: ./Test [OPTIONS]"
case getOpt RequireOrder options args of
(o,[],[]) -> testParagon (JavaC `elem` o)
(_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options)) | 238 | main = do
args <- getArgs
let header = "Usage: ./Test [OPTIONS]"
case getOpt RequireOrder options args of
(o,[],[]) -> testParagon (JavaC `elem` o)
(_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options)) | 238 | main = do
args <- getArgs
let header = "Usage: ./Test [OPTIONS]"
case getOpt RequireOrder options args of
(o,[],[]) -> testParagon (JavaC `elem` o)
(_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options)) | 238 | false | false | 1 | 16 | 48 | 110 | 54 | 56 | null | null |
hpacheco/HAAP | examples/plab/oracle/OracleT1.hs | mit | --------------
-- == T1: Solução
--------------
--mexe :: (Int,Int) -> Orientacao -> (Int,Int)
--mexe (x,y) Este = (x+1,y)
--mexe (x,y) Sul = (x,y+1)
--mexe (x,y) Oeste = (x-1,y)
--mexe (x,y) Norte = (x,y-1)
--
--roda :: Orientacao -> Bool -> Orientacao
--roda Este True = Sul
--roda Sul True = Oeste
--roda Oeste True = Norte
--roda Norte True = Este
--roda d False = roda (roda (roda d True) True) True
theFloorIsLava :: Dimensao -> [[Peca]]
theFloorIsLava (n,m) = replicate m (replicate n (Peca Lava altLava)) | 520 | theFloorIsLava :: Dimensao -> [[Peca]]
theFloorIsLava (n,m) = replicate m (replicate n (Peca Lava altLava)) | 107 | theFloorIsLava (n,m) = replicate m (replicate n (Peca Lava altLava)) | 68 | true | true | 0 | 9 | 94 | 66 | 42 | 24 | null | null |
wavewave/gnuplot | src/Graphics/Gnuplot/Simple.hs | bsd-3-clause | inclPlot ::
FilePath
-> ([Attribute] -> IO ()) {-^ Drawing function that expects some gnuplot attributes. -}
-> IO String
inclPlot filename plot =
do epspdfPlot filename plot
return ("\\includegraphics{"++filename++"}")
-- * Internal functions | 268 | inclPlot ::
FilePath
-> ([Attribute] -> IO ()) {-^ Drawing function that expects some gnuplot attributes. -}
-> IO String
inclPlot filename plot =
do epspdfPlot filename plot
return ("\\includegraphics{"++filename++"}")
-- * Internal functions | 268 | inclPlot filename plot =
do epspdfPlot filename plot
return ("\\includegraphics{"++filename++"}")
-- * Internal functions | 133 | false | true | 0 | 11 | 58 | 74 | 35 | 39 | null | null |
capital-match/bake | src/Development/Bake/Server/Database.hs | bsd-3-clause | ptState = column ptTable "state" :: Column StateId | 50 | ptState = column ptTable "state" :: Column StateId | 50 | ptState = column ptTable "state" :: Column StateId | 50 | false | false | 0 | 5 | 7 | 20 | 9 | 11 | null | null |
sol/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | _ `closes` "html" = False | 25 | _ `closes` "html" = False | 25 | _ `closes` "html" = False | 25 | false | false | 0 | 5 | 4 | 14 | 7 | 7 | null | null |
abingham/rosalind | haskell/translate_rna/TranslateRNA.hs | mit | rnaCodon (RNA_G, RNA_C, RNA_U) = A | 34 | rnaCodon (RNA_G, RNA_C, RNA_U) = A | 34 | rnaCodon (RNA_G, RNA_C, RNA_U) = A | 34 | false | false | 0 | 6 | 5 | 18 | 10 | 8 | null | null |
castaway/pandoc | src/Text/Pandoc/Readers/Markdown.hs | gpl-2.0 | inlineParsers :: [GenParser Char ParserState Inline]
inlineParsers = [ whitespace
, str
, endline
, code
, fours
, strong
, emph
, note
, link
, cite
, image
, math
, strikeout
, superscript
, subscript
, inlineNote -- after superscript because of ^[link](/foo)^
, autoLink
, rawHtmlInline
, escapedChar
, rawLaTeXInline'
, exampleRef
, smartPunctuation inline
, charRef
, symbol
, ltSign ] | 775 | inlineParsers :: [GenParser Char ParserState Inline]
inlineParsers = [ whitespace
, str
, endline
, code
, fours
, strong
, emph
, note
, link
, cite
, image
, math
, strikeout
, superscript
, subscript
, inlineNote -- after superscript because of ^[link](/foo)^
, autoLink
, rawHtmlInline
, escapedChar
, rawLaTeXInline'
, exampleRef
, smartPunctuation inline
, charRef
, symbol
, ltSign ] | 775 | inlineParsers = [ whitespace
, str
, endline
, code
, fours
, strong
, emph
, note
, link
, cite
, image
, math
, strikeout
, superscript
, subscript
, inlineNote -- after superscript because of ^[link](/foo)^
, autoLink
, rawHtmlInline
, escapedChar
, rawLaTeXInline'
, exampleRef
, smartPunctuation inline
, charRef
, symbol
, ltSign ] | 722 | false | true | 0 | 6 | 450 | 100 | 63 | 37 | null | null |
sebastiaanvisser/islay | src/Container/FingerTree/Functions.hs | bsd-3-clause | (<|) :: Node a c -> Spine a c -> Spine a c
a <| (HIn (Deep ( HIn (Digit1 b )) m sf)) = deep (digit2 a b ) m sf | 139 | (<|) :: Node a c -> Spine a c -> Spine a c
a <| (HIn (Deep ( HIn (Digit1 b )) m sf)) = deep (digit2 a b ) m sf | 139 | a <| (HIn (Deep ( HIn (Digit1 b )) m sf)) = deep (digit2 a b ) m sf | 96 | false | true | 0 | 16 | 60 | 85 | 41 | 44 | null | null |
xrchz/ot | OpenTheory/Term.hs | gpl-3.0 | typeOf (AbsTerm (Var (_,x)) t) = x --> (typeOf t) | 49 | typeOf (AbsTerm (Var (_,x)) t) = x --> (typeOf t) | 49 | typeOf (AbsTerm (Var (_,x)) t) = x --> (typeOf t) | 49 | false | false | 0 | 10 | 9 | 39 | 20 | 19 | null | null |
tjakway/ghcjvm | compiler/cmm/CmmMachOp.hs | bsd-3-clause | mo_u_32ToWord dflags = MO_UU_Conv W32 (wordWidth dflags) | 58 | mo_u_32ToWord dflags = MO_UU_Conv W32 (wordWidth dflags) | 58 | mo_u_32ToWord dflags = MO_UU_Conv W32 (wordWidth dflags) | 58 | false | false | 0 | 7 | 8 | 20 | 9 | 11 | null | null |
schell/odin | odin-engine/src/Odin/Engine/Tiled.hs | mit | imageOfTileset :: Tileset -> Maybe Image
imageOfTileset ts = case tsImages ts of
img:_ -> Just img
[] -> Nothing | 119 | imageOfTileset :: Tileset -> Maybe Image
imageOfTileset ts = case tsImages ts of
img:_ -> Just img
[] -> Nothing | 119 | imageOfTileset ts = case tsImages ts of
img:_ -> Just img
[] -> Nothing | 78 | false | true | 4 | 6 | 26 | 44 | 22 | 22 | null | null |
dmalikov/lambdabot | Plugin/Spell.hs | mit | -- no header for some reason
--
-- Parse rest of aspell output.
--
-- Grammar is:
-- OK ::= *
-- Suggestions ::= & <original> <count> <offset>: <miss>, <miss>, ...
-- None ::= # <original> <offset>
--
clean' :: [String] -> Maybe [String]
clean' (('*':_):_) = Nothing | 302 | clean' :: [String] -> Maybe [String]
clean' (('*':_):_) = Nothing | 68 | clean' (('*':_):_) = Nothing | 31 | true | true | 0 | 11 | 83 | 55 | 32 | 23 | null | null |
spaceships/garbled-circuits | src/Crypto/GarbledCircuits/Eval.hs | apache-2.0 | getResult :: Ref GarbledGate -> Eval Wirelabel
getResult ref = fromMaybe (err "getResult" "no ref") <$> (M.lookup ref <$> gets snd) | 131 | getResult :: Ref GarbledGate -> Eval Wirelabel
getResult ref = fromMaybe (err "getResult" "no ref") <$> (M.lookup ref <$> gets snd) | 131 | getResult ref = fromMaybe (err "getResult" "no ref") <$> (M.lookup ref <$> gets snd) | 84 | false | true | 0 | 9 | 20 | 54 | 25 | 29 | null | null |
nevrenato/Hets_Fork | SoftFOL/DFGParser.hs | gpl-2.0 | assocList :: Parser SPAssocList
assocList = fmap Map.fromList $ squares $ commaSep
$ pair getKey $ symbolT ":" >> getValue | 124 | assocList :: Parser SPAssocList
assocList = fmap Map.fromList $ squares $ commaSep
$ pair getKey $ symbolT ":" >> getValue | 124 | assocList = fmap Map.fromList $ squares $ commaSep
$ pair getKey $ symbolT ":" >> getValue | 92 | false | true | 2 | 8 | 21 | 47 | 21 | 26 | null | null |
Javran/Project-Euler | src/ProjectEuler/Problem48.hs | mit | result :: I
result =
foldl (\acc x -> lim (acc + powerMod x x)) 0 [1..1000] | 77 | result :: I
result =
foldl (\acc x -> lim (acc + powerMod x x)) 0 [1..1000] | 77 | result =
foldl (\acc x -> lim (acc + powerMod x x)) 0 [1..1000] | 65 | false | true | 0 | 11 | 18 | 48 | 25 | 23 | null | null |
mettekou/ghc | compiler/utils/Outputable.hs | bsd-3-clause | assertPprPanic :: HasCallStack => String -> Int -> SDoc -> a
assertPprPanic _file _line msg
= pprPanic "ASSERT failed!" doc
where
doc = sep [ msg, callStackDoc ] | 169 | assertPprPanic :: HasCallStack => String -> Int -> SDoc -> a
assertPprPanic _file _line msg
= pprPanic "ASSERT failed!" doc
where
doc = sep [ msg, callStackDoc ] | 169 | assertPprPanic _file _line msg
= pprPanic "ASSERT failed!" doc
where
doc = sep [ msg, callStackDoc ] | 108 | false | true | 0 | 8 | 35 | 57 | 28 | 29 | null | null |
keithodulaigh/Hets | Syntax/AS_Library.der.hs | gpl-2.0 | getSpecDef :: LIB_ITEM -> [SPEC]
getSpecDef li = case li of
Spec_defn _ _ as _ -> [item as]
View_defn _ _ (View_type s1 s2 _) _ _ -> [item s1, item s2]
Entail_defn _ (Entail_type s1 s2 _) _ -> getOms s1 ++ getOms s2
Equiv_defn _ (Equiv_type s1 s2 _) as _ ->
getOms s1 ++ getOms s2 ++ getOms as
Align_defn _ _ (View_type s1 s2 _) _ _ _ -> [item s1, item s2]
Module_defn _ (Module_type s1 s2 _) _ _ -> [item s1, item s2]
_ -> [] | 444 | getSpecDef :: LIB_ITEM -> [SPEC]
getSpecDef li = case li of
Spec_defn _ _ as _ -> [item as]
View_defn _ _ (View_type s1 s2 _) _ _ -> [item s1, item s2]
Entail_defn _ (Entail_type s1 s2 _) _ -> getOms s1 ++ getOms s2
Equiv_defn _ (Equiv_type s1 s2 _) as _ ->
getOms s1 ++ getOms s2 ++ getOms as
Align_defn _ _ (View_type s1 s2 _) _ _ _ -> [item s1, item s2]
Module_defn _ (Module_type s1 s2 _) _ _ -> [item s1, item s2]
_ -> [] | 444 | getSpecDef li = case li of
Spec_defn _ _ as _ -> [item as]
View_defn _ _ (View_type s1 s2 _) _ _ -> [item s1, item s2]
Entail_defn _ (Entail_type s1 s2 _) _ -> getOms s1 ++ getOms s2
Equiv_defn _ (Equiv_type s1 s2 _) as _ ->
getOms s1 ++ getOms s2 ++ getOms as
Align_defn _ _ (View_type s1 s2 _) _ _ _ -> [item s1, item s2]
Module_defn _ (Module_type s1 s2 _) _ _ -> [item s1, item s2]
_ -> [] | 411 | false | true | 0 | 10 | 111 | 252 | 119 | 133 | null | null |
kylc/torrent | src/BitTorrent/Bencode.hs | bsd-3-clause | parseBencodeFile :: String -> IO Bencode
parseBencodeFile f = Streams.withFileAsInput f (Streams.parseFromStream bencode) | 121 | parseBencodeFile :: String -> IO Bencode
parseBencodeFile f = Streams.withFileAsInput f (Streams.parseFromStream bencode) | 121 | parseBencodeFile f = Streams.withFileAsInput f (Streams.parseFromStream bencode) | 80 | false | true | 0 | 8 | 12 | 36 | 17 | 19 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/cabal-install/Distribution/Client/PlanIndex.hs | bsd-3-clause | -- | Variant of `depends` which accepts a `FakeMap`
--
-- Analogous to `fakeInstalledDepends`. See Note [FakeMap].
fakeDepends :: PackageFixedDeps pkg => FakeMap -> pkg -> ComponentDeps [UnitId]
fakeDepends fakeMap = fmap (map resolveFakeId) . depends
where
resolveFakeId :: UnitId -> UnitId
resolveFakeId ipid = Map.findWithDefault ipid ipid fakeMap
--- | Variant of 'lookupUnitId' which accepts a 'FakeMap'. See Note
--- [FakeMap]. | 445 | fakeDepends :: PackageFixedDeps pkg => FakeMap -> pkg -> ComponentDeps [UnitId]
fakeDepends fakeMap = fmap (map resolveFakeId) . depends
where
resolveFakeId :: UnitId -> UnitId
resolveFakeId ipid = Map.findWithDefault ipid ipid fakeMap
--- | Variant of 'lookupUnitId' which accepts a 'FakeMap'. See Note
--- [FakeMap]. | 330 | fakeDepends fakeMap = fmap (map resolveFakeId) . depends
where
resolveFakeId :: UnitId -> UnitId
resolveFakeId ipid = Map.findWithDefault ipid ipid fakeMap
--- | Variant of 'lookupUnitId' which accepts a 'FakeMap'. See Note
--- [FakeMap]. | 250 | true | true | 0 | 9 | 73 | 82 | 42 | 40 | null | null |
tkonolige/haskell-cci | test/Worker.hs | bsd-3-clause | -- | Fails with an error if the connection is not in the map.
getConn' :: WordPtr -> ConnMap -> IO Connection
getConn' w rcm = getConn w rcm >>= maybe (do
sendResponse (Error$ "unknown connection: "++show w)
ioError$ userError$ "unknown connection: "++show w
) return | 376 | getConn' :: WordPtr -> ConnMap -> IO Connection
getConn' w rcm = getConn w rcm >>= maybe (do
sendResponse (Error$ "unknown connection: "++show w)
ioError$ userError$ "unknown connection: "++show w
) return | 314 | getConn' w rcm = getConn w rcm >>= maybe (do
sendResponse (Error$ "unknown connection: "++show w)
ioError$ userError$ "unknown connection: "++show w
) return | 266 | true | true | 2 | 12 | 154 | 92 | 41 | 51 | null | null |
alanz/htelehash | src/Network/TeleHash/Old/Switch.hs | bsd-3-clause | onesec :: Int
onesec = 1000000 | 30 | onesec :: Int
onesec = 1000000 | 30 | onesec = 1000000 | 16 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
karianna/jdk8_tl | jdk/src/macosx/native/jobjc/src/core/PrimitiveCoder.hs | gpl-2.0 | sizeof FLOAT = 4 | 17 | sizeof FLOAT = 4 | 17 | sizeof FLOAT = 4 | 17 | false | false | 0 | 4 | 4 | 10 | 4 | 6 | null | null |
ublubu/tile-rider | src/SDL/Draw.hs | mit | withBlankScreen :: SDL.T.Renderer -> IO () -> IO ()
withBlankScreen r operation = do
clearScreen r
operation
SDL.V.renderPresent r | 136 | withBlankScreen :: SDL.T.Renderer -> IO () -> IO ()
withBlankScreen r operation = do
clearScreen r
operation
SDL.V.renderPresent r | 136 | withBlankScreen r operation = do
clearScreen r
operation
SDL.V.renderPresent r | 84 | false | true | 0 | 9 | 24 | 60 | 26 | 34 | null | null |
imalsogreg/tetrode-ephys | lib/Data/Ephys/OldMWL/ParsePFile.hs | gpl-3.0 | parsePRecord :: Binary.Get MWLPos
parsePRecord = do
recTs <- getWord32le
recXf <- getWord16le
recYf <- getWord16le
recXb <- getWord16le
recYb <- getWord16le
return $ MWLPos (decodeTime recTs)
(fI recXf) (fI recYf) (fI recXb) (fI recYb) | 280 | parsePRecord :: Binary.Get MWLPos
parsePRecord = do
recTs <- getWord32le
recXf <- getWord16le
recYf <- getWord16le
recXb <- getWord16le
recYb <- getWord16le
return $ MWLPos (decodeTime recTs)
(fI recXf) (fI recYf) (fI recXb) (fI recYb) | 280 | parsePRecord = do
recTs <- getWord32le
recXf <- getWord16le
recYf <- getWord16le
recXb <- getWord16le
recYb <- getWord16le
return $ MWLPos (decodeTime recTs)
(fI recXf) (fI recYf) (fI recXb) (fI recYb) | 246 | false | true | 0 | 10 | 79 | 99 | 46 | 53 | null | null |
DaMSL/K3 | src/Language/K3/Interpreter/Data/Instances.hs | apache-2.0 | pSimple :: PrintConfig -> Bool
pSimple = not . printComplex | 59 | pSimple :: PrintConfig -> Bool
pSimple = not . printComplex | 59 | pSimple = not . printComplex | 28 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
mettekou/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | gfoldl_RDR, gunfold_RDR, toConstr_RDR, dataTypeOf_RDR, mkConstr_RDR,
mkDataType_RDR, conIndex_RDR, prefix_RDR, infix_RDR,
dataCast1_RDR, dataCast2_RDR, gcast1_RDR, gcast2_RDR,
constr_RDR, dataType_RDR,
eqChar_RDR , ltChar_RDR , geChar_RDR , gtChar_RDR , leChar_RDR ,
eqInt_RDR , ltInt_RDR , geInt_RDR , gtInt_RDR , leInt_RDR ,
eqWord_RDR , ltWord_RDR , geWord_RDR , gtWord_RDR , leWord_RDR ,
eqAddr_RDR , ltAddr_RDR , geAddr_RDR , gtAddr_RDR , leAddr_RDR ,
eqFloat_RDR , ltFloat_RDR , geFloat_RDR , gtFloat_RDR , leFloat_RDR ,
eqDouble_RDR, ltDouble_RDR, geDouble_RDR, gtDouble_RDR, leDouble_RDR :: RdrName
gfoldl_RDR = varQual_RDR gENERICS (fsLit "gfoldl") | 723 | gfoldl_RDR, gunfold_RDR, toConstr_RDR, dataTypeOf_RDR, mkConstr_RDR,
mkDataType_RDR, conIndex_RDR, prefix_RDR, infix_RDR,
dataCast1_RDR, dataCast2_RDR, gcast1_RDR, gcast2_RDR,
constr_RDR, dataType_RDR,
eqChar_RDR , ltChar_RDR , geChar_RDR , gtChar_RDR , leChar_RDR ,
eqInt_RDR , ltInt_RDR , geInt_RDR , gtInt_RDR , leInt_RDR ,
eqWord_RDR , ltWord_RDR , geWord_RDR , gtWord_RDR , leWord_RDR ,
eqAddr_RDR , ltAddr_RDR , geAddr_RDR , gtAddr_RDR , leAddr_RDR ,
eqFloat_RDR , ltFloat_RDR , geFloat_RDR , gtFloat_RDR , leFloat_RDR ,
eqDouble_RDR, ltDouble_RDR, geDouble_RDR, gtDouble_RDR, leDouble_RDR :: RdrName
gfoldl_RDR = varQual_RDR gENERICS (fsLit "gfoldl") | 723 | gfoldl_RDR = varQual_RDR gENERICS (fsLit "gfoldl") | 55 | false | true | 0 | 7 | 143 | 110 | 99 | 11 | null | null |
NatureShade/happstack-session | src/Happstack/Server/Session.hs | mit | getSession :: (MonadPlus m, MonadIO m, FilterMonad Response m, HasRqData m, Read a) => (SessionHandler a b) -> m (Maybe b)
getSession sessionHandler@(SessionHandler sessionConfig getSession' _ _ _) = msum
[ do
sid' <- lookCookieValue "SID"
let sid = sessionAuthDecrypt sessionConfig sid'
session <- maybe (return Nothing) (liftIO . getSession') sid
timeNow <- liftIO $ fmap (floor) getPOSIXTime
if ( fromMaybe False $ (< timeNow) . sessionExpire <$> session ) then do
deleteSession sessionHandler
return Nothing
else
return $ sessionData <$> session
, do
return Nothing
] | 675 | getSession :: (MonadPlus m, MonadIO m, FilterMonad Response m, HasRqData m, Read a) => (SessionHandler a b) -> m (Maybe b)
getSession sessionHandler@(SessionHandler sessionConfig getSession' _ _ _) = msum
[ do
sid' <- lookCookieValue "SID"
let sid = sessionAuthDecrypt sessionConfig sid'
session <- maybe (return Nothing) (liftIO . getSession') sid
timeNow <- liftIO $ fmap (floor) getPOSIXTime
if ( fromMaybe False $ (< timeNow) . sessionExpire <$> session ) then do
deleteSession sessionHandler
return Nothing
else
return $ sessionData <$> session
, do
return Nothing
] | 675 | getSession sessionHandler@(SessionHandler sessionConfig getSession' _ _ _) = msum
[ do
sid' <- lookCookieValue "SID"
let sid = sessionAuthDecrypt sessionConfig sid'
session <- maybe (return Nothing) (liftIO . getSession') sid
timeNow <- liftIO $ fmap (floor) getPOSIXTime
if ( fromMaybe False $ (< timeNow) . sessionExpire <$> session ) then do
deleteSession sessionHandler
return Nothing
else
return $ sessionData <$> session
, do
return Nothing
] | 552 | false | true | 1 | 14 | 190 | 234 | 110 | 124 | null | null |
unisonweb/platform | codebase2/codebase-sqlite/U/Codebase/Sqlite/Patch/Full.hs | mit | trimap ::
(Ord t', Ord h', Ord o') =>
(t -> t') ->
(h -> h') ->
(o -> o') ->
Patch' t h o ->
Patch' t' h' o'
trimap ft fh fo (Patch tms tps) =
Patch
(Map.bimap (bimap (bimap ft fh) (bimap ft fh)) (Set.map (bimap ft fo)) tms)
(Map.bimap (bimap ft fh) (Set.map (bimap ft fo)) tps) | 300 | trimap ::
(Ord t', Ord h', Ord o') =>
(t -> t') ->
(h -> h') ->
(o -> o') ->
Patch' t h o ->
Patch' t' h' o'
trimap ft fh fo (Patch tms tps) =
Patch
(Map.bimap (bimap (bimap ft fh) (bimap ft fh)) (Set.map (bimap ft fo)) tms)
(Map.bimap (bimap ft fh) (Set.map (bimap ft fo)) tps) | 300 | trimap ft fh fo (Patch tms tps) =
Patch
(Map.bimap (bimap (bimap ft fh) (bimap ft fh)) (Set.map (bimap ft fo)) tms)
(Map.bimap (bimap ft fh) (Set.map (bimap ft fo)) tps) | 179 | false | true | 0 | 11 | 82 | 199 | 98 | 101 | null | null |
fmapfmapfmap/amazonka | amazonka-codepipeline/gen/Network/AWS/CodePipeline/GetPipelineState.hs | mpl-2.0 | -- | Creates a value of 'GetPipelineStateResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpsrsPipelineName'
--
-- * 'gpsrsCreated'
--
-- * 'gpsrsStageStates'
--
-- * 'gpsrsPipelineVersion'
--
-- * 'gpsrsUpdated'
--
-- * 'gpsrsResponseStatus'
getPipelineStateResponse
:: Int -- ^ 'gpsrsResponseStatus'
-> GetPipelineStateResponse
getPipelineStateResponse pResponseStatus_ =
GetPipelineStateResponse'
{ _gpsrsPipelineName = Nothing
, _gpsrsCreated = Nothing
, _gpsrsStageStates = Nothing
, _gpsrsPipelineVersion = Nothing
, _gpsrsUpdated = Nothing
, _gpsrsResponseStatus = pResponseStatus_
} | 725 | getPipelineStateResponse
:: Int -- ^ 'gpsrsResponseStatus'
-> GetPipelineStateResponse
getPipelineStateResponse pResponseStatus_ =
GetPipelineStateResponse'
{ _gpsrsPipelineName = Nothing
, _gpsrsCreated = Nothing
, _gpsrsStageStates = Nothing
, _gpsrsPipelineVersion = Nothing
, _gpsrsUpdated = Nothing
, _gpsrsResponseStatus = pResponseStatus_
} | 387 | getPipelineStateResponse pResponseStatus_ =
GetPipelineStateResponse'
{ _gpsrsPipelineName = Nothing
, _gpsrsCreated = Nothing
, _gpsrsStageStates = Nothing
, _gpsrsPipelineVersion = Nothing
, _gpsrsUpdated = Nothing
, _gpsrsResponseStatus = pResponseStatus_
} | 292 | true | true | 0 | 7 | 130 | 81 | 52 | 29 | null | null |
AlexanderPankiv/ghc | compiler/cmm/PprC.hs | bsd-3-clause | te_Target :: ForeignTarget -> TE ()
te_Target (ForeignTarget e _) = te_Expr e | 82 | te_Target :: ForeignTarget -> TE ()
te_Target (ForeignTarget e _) = te_Expr e | 82 | te_Target (ForeignTarget e _) = te_Expr e | 46 | false | true | 0 | 9 | 17 | 38 | 17 | 21 | null | null |
brendanhay/gogol | gogol-manufacturers/gen/Network/Google/Manufacturers/Types/Product.hs | mpl-2.0 | -- | Rich product content. For more information, see
-- https:\/\/support.google.com\/manufacturers\/answer\/9389865
aRichProductContent :: Lens' Attributes [Text]
aRichProductContent
= lens _aRichProductContent
(\ s a -> s{_aRichProductContent = a})
. _Default
. _Coerce | 291 | aRichProductContent :: Lens' Attributes [Text]
aRichProductContent
= lens _aRichProductContent
(\ s a -> s{_aRichProductContent = a})
. _Default
. _Coerce | 174 | aRichProductContent
= lens _aRichProductContent
(\ s a -> s{_aRichProductContent = a})
. _Default
. _Coerce | 127 | true | true | 3 | 8 | 50 | 59 | 29 | 30 | null | null |
jutaro/rdf4h | testsuite/tests/Data/RDF/Graph/TriplesList_Test.hs | bsd-3-clause | empty' :: TriplesList
empty' = empty | 36 | empty' :: TriplesList
empty' = empty | 36 | empty' = empty | 14 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
UCSD-PL/nano-js | Language/Nano/Typecheck/Parse.hs | bsd-3-clause | bareAllP
= do reserved "forall"
as <- many1 tvarP
dot
t <- bareTypeP
return $ foldr TAll t as | 125 | bareAllP
= do reserved "forall"
as <- many1 tvarP
dot
t <- bareTypeP
return $ foldr TAll t as | 125 | bareAllP
= do reserved "forall"
as <- many1 tvarP
dot
t <- bareTypeP
return $ foldr TAll t as | 125 | false | false | 1 | 9 | 50 | 50 | 19 | 31 | null | null |
gbataille/pandoc | src/Text/Pandoc/Writers/Custom.hs | gpl-2.0 | inlineToCustom lua (Strong lst) = callfunc lua "Strong" lst | 59 | inlineToCustom lua (Strong lst) = callfunc lua "Strong" lst | 59 | inlineToCustom lua (Strong lst) = callfunc lua "Strong" lst | 59 | false | false | 0 | 7 | 8 | 24 | 11 | 13 | null | null |
madebyjeffrey/HerbiePlugin | test/Tests.hs | bsd-3-clause | example18 x = (x + 0.1)-x | 25 | example18 x = (x + 0.1)-x | 25 | example18 x = (x + 0.1)-x | 25 | false | false | 0 | 7 | 5 | 20 | 10 | 10 | null | null |
tolysz/dsp | DSP/Covariance.hs | gpl-2.0 | cxy_u :: (Ix a, Integral a, RealFloat b) => Array a (Complex b) -- ^ x
-> Array a (Complex b) -- ^ y
-> a -- ^ k
-> Complex b -- ^ C_xy[k] \/ (N-k)
cxy_u x y k = cxy x y k / fromIntegral (n - abs k)
where n = snd (bounds x) + 1
-- | biased auto-covariance | 388 | cxy_u :: (Ix a, Integral a, RealFloat b) => Array a (Complex b) -- ^ x
-> Array a (Complex b) -- ^ y
-> a -- ^ k
-> Complex b
cxy_u x y k = cxy x y k / fromIntegral (n - abs k)
where n = snd (bounds x) + 1
-- | biased auto-covariance | 355 | cxy_u x y k = cxy x y k / fromIntegral (n - abs k)
where n = snd (bounds x) + 1
-- | biased auto-covariance | 112 | true | true | 0 | 10 | 196 | 125 | 63 | 62 | null | null |
brendanhay/gogol | gogol-spanner/gen/Network/Google/Resource/Spanner/Projects/Instances/Operations/Delete.hs | mpl-2.0 | -- | JSONP
piodCallback :: Lens' ProjectsInstancesOperationsDelete (Maybe Text)
piodCallback
= lens _piodCallback (\ s a -> s{_piodCallback = a}) | 147 | piodCallback :: Lens' ProjectsInstancesOperationsDelete (Maybe Text)
piodCallback
= lens _piodCallback (\ s a -> s{_piodCallback = a}) | 136 | piodCallback
= lens _piodCallback (\ s a -> s{_piodCallback = a}) | 67 | true | true | 0 | 9 | 21 | 48 | 25 | 23 | null | null |
osa1/sequent-core | src/Language/SequentCore/OccurAnal.hs | bsd-3-clause | occAnalArgs :: OccEnv -> [SeqCoreTerm] -> [OneShots] -> (UsageDetails, [SeqCoreTerm])
occAnalArgs _ [] _
= (emptyDetails, []) | 128 | occAnalArgs :: OccEnv -> [SeqCoreTerm] -> [OneShots] -> (UsageDetails, [SeqCoreTerm])
occAnalArgs _ [] _
= (emptyDetails, []) | 128 | occAnalArgs _ [] _
= (emptyDetails, []) | 42 | false | true | 0 | 9 | 19 | 55 | 31 | 24 | null | null |
nilcons/PrefetchFS | misc/IdentityFS.hs | gpl-3.0 | cacheRelease _ fd = closeFd fd | 30 | cacheRelease _ fd = closeFd fd | 30 | cacheRelease _ fd = closeFd fd | 30 | false | false | 1 | 5 | 5 | 14 | 6 | 8 | null | null |
stiell/phec | Haskeleton.hs | gpl-3.0 | split :: (Eq a) => a -> [a] -> [[a]]
split x xs = fmap (dropWhile (== x)) (groupBy (const (x /=)) xs) | 101 | split :: (Eq a) => a -> [a] -> [[a]]
split x xs = fmap (dropWhile (== x)) (groupBy (const (x /=)) xs) | 101 | split x xs = fmap (dropWhile (== x)) (groupBy (const (x /=)) xs) | 64 | false | true | 0 | 10 | 22 | 79 | 42 | 37 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/enumFromThen_3.hs | mit | ltEsMyInt :: MyInt -> MyInt -> MyBool
ltEsMyInt x y = fsEsOrdering (compareMyInt x y) GT | 92 | ltEsMyInt :: MyInt -> MyInt -> MyBool
ltEsMyInt x y = fsEsOrdering (compareMyInt x y) GT | 92 | ltEsMyInt x y = fsEsOrdering (compareMyInt x y) GT | 50 | false | true | 0 | 7 | 19 | 37 | 18 | 19 | null | null |
ezyang/ghc | compiler/hsSyn/HsPat.hs | bsd-3-clause | {-
% Collect all EvVars from all constructor patterns
-}
-- May need to add more cases
collectEvVarsPats :: [Pat p] -> Bag EvVar
collectEvVarsPats = unionManyBags . map collectEvVarsPat | 186 | collectEvVarsPats :: [Pat p] -> Bag EvVar
collectEvVarsPats = unionManyBags . map collectEvVarsPat | 98 | collectEvVarsPats = unionManyBags . map collectEvVarsPat | 56 | true | true | 0 | 7 | 30 | 33 | 17 | 16 | null | null |
anton-dessiatov/stack | src/Stack/Dot.hs | bsd-3-clause | printLocalNodes :: (F.Foldable t, MonadIO m)
=> DotOpts
-> t PackageName
-> m ()
printLocalNodes dotOpts locals = liftIO $ Text.putStrLn (Text.intercalate "\n" lpNodes)
where applyStyle :: Text -> Text
applyStyle n = if dotIncludeExternal dotOpts
then n <> " [style=dashed];"
else n <> " [style=solid];"
lpNodes :: [Text]
lpNodes = map (applyStyle . nodeName) (F.toList locals)
-- | Print nodes without dependencies | 540 | printLocalNodes :: (F.Foldable t, MonadIO m)
=> DotOpts
-> t PackageName
-> m ()
printLocalNodes dotOpts locals = liftIO $ Text.putStrLn (Text.intercalate "\n" lpNodes)
where applyStyle :: Text -> Text
applyStyle n = if dotIncludeExternal dotOpts
then n <> " [style=dashed];"
else n <> " [style=solid];"
lpNodes :: [Text]
lpNodes = map (applyStyle . nodeName) (F.toList locals)
-- | Print nodes without dependencies | 540 | printLocalNodes dotOpts locals = liftIO $ Text.putStrLn (Text.intercalate "\n" lpNodes)
where applyStyle :: Text -> Text
applyStyle n = if dotIncludeExternal dotOpts
then n <> " [style=dashed];"
else n <> " [style=solid];"
lpNodes :: [Text]
lpNodes = map (applyStyle . nodeName) (F.toList locals)
-- | Print nodes without dependencies | 411 | false | true | 4 | 9 | 187 | 143 | 72 | 71 | null | null |
phischu/fragnix | tests/packages/scotty/Data.ByteString.Builder.Prim.Internal.hs | bsd-3-clause | fixedPrim :: Int -> (a -> Ptr Word8 -> IO ()) -> FixedPrim a
fixedPrim = FP | 75 | fixedPrim :: Int -> (a -> Ptr Word8 -> IO ()) -> FixedPrim a
fixedPrim = FP | 75 | fixedPrim = FP | 14 | false | true | 0 | 12 | 16 | 47 | 21 | 26 | null | null |
s9gf4ult/yesod | yesod-core/Yesod/Core/Handler.hs | mit | -- | Return a 404 not found page. Also denotes no handler available.
notFound :: MonadHandler m => m a
notFound = hcError NotFound | 130 | notFound :: MonadHandler m => m a
notFound = hcError NotFound | 61 | notFound = hcError NotFound | 27 | true | true | 0 | 6 | 23 | 25 | 12 | 13 | null | null |
keni7385/hmlf | src/LinearReg.hs | lgpl-3.0 | - |Dot product for lists of Doubles, used as hypothesis for linear regressions
dotProduct :: [Double] -> [Double] -> Double
dotProduct ds ds' = sum $ prdLists ds ds'
| 166 | dotProduct :: [Double] -> [Double] -> Double
dotProduct ds ds' = sum $ prdLists ds ds' | 86 | dotProduct ds ds' = sum $ prdLists ds ds' | 41 | true | true | 2 | 8 | 29 | 75 | 36 | 39 | null | null |
k0001/haskell-money | safe-money-cereal/test/Main.hs | bsd-3-clause | rawXr0 :: Money.ExchangeRate "USD" "BTC"
Just rawXr0 = Money.exchangeRate (3%2) | 79 | rawXr0 :: Money.ExchangeRate "USD" "BTC"
Just rawXr0 = Money.exchangeRate (3%2) | 79 | Just rawXr0 = Money.exchangeRate (3%2) | 38 | false | true | 0 | 7 | 9 | 34 | 16 | 18 | null | null |
batterseapower/supercompilation-by-evaluation | Core/Parser.hs | bsd-3-clause | expCore (LHE.App e1 e2) = expCore e2 >>= \e2 -> e2 `nameIt` \x2 -> fmap (`app` x2) $ expCore e1 | 95 | expCore (LHE.App e1 e2) = expCore e2 >>= \e2 -> e2 `nameIt` \x2 -> fmap (`app` x2) $ expCore e1 | 95 | expCore (LHE.App e1 e2) = expCore e2 >>= \e2 -> e2 `nameIt` \x2 -> fmap (`app` x2) $ expCore e1 | 95 | false | false | 0 | 11 | 19 | 58 | 31 | 27 | null | null |
ezyang/ghc | libraries/base/Foreign/C/Error.hs | bsd-3-clause | -- throw current "errno" value
-- ---------------------------
-- | Throw an 'IOError' corresponding to the current value of 'getErrno'.
--
throwErrno :: String -- ^ textual description of the error location
-> IO a
throwErrno loc =
do
errno <- getErrno
ioError (errnoToIOError loc errno Nothing Nothing)
-- guards for IO operations that may fail
-- --------------------------------------
-- | Throw an 'IOError' corresponding to the current value of 'getErrno'
-- if the result value of the 'IO' action meets the given predicate.
-- | 573 | throwErrno :: String -- ^ textual description of the error location
-> IO a
throwErrno loc =
do
errno <- getErrno
ioError (errnoToIOError loc errno Nothing Nothing)
-- guards for IO operations that may fail
-- --------------------------------------
-- | Throw an 'IOError' corresponding to the current value of 'getErrno'
-- if the result value of the 'IO' action meets the given predicate.
-- | 433 | throwErrno loc =
do
errno <- getErrno
ioError (errnoToIOError loc errno Nothing Nothing)
-- guards for IO operations that may fail
-- --------------------------------------
-- | Throw an 'IOError' corresponding to the current value of 'getErrno'
-- if the result value of the 'IO' action meets the given predicate.
-- | 331 | true | true | 0 | 9 | 123 | 56 | 31 | 25 | null | null |
xwysp/codeworld | codeworld-base/src/Internal/Prelude.hs | apache-2.0 | first :: [a] -> a
first = P.head | 32 | first :: [a] -> a
first = P.head | 32 | first = P.head | 14 | false | true | 0 | 7 | 7 | 27 | 12 | 15 | null | null |
christiaanb/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | ppr_expr (ExprWithTySigOut expr sig)
= hang (nest 2 (ppr_lexpr expr) <+> dcolon)
4 (ppr sig) | 103 | ppr_expr (ExprWithTySigOut expr sig)
= hang (nest 2 (ppr_lexpr expr) <+> dcolon)
4 (ppr sig) | 103 | ppr_expr (ExprWithTySigOut expr sig)
= hang (nest 2 (ppr_lexpr expr) <+> dcolon)
4 (ppr sig) | 103 | false | false | 0 | 9 | 25 | 51 | 23 | 28 | null | null |
fmapfmapfmap/amazonka | amazonka-cloudfront/gen/Network/AWS/CloudFront/UpdateDistribution.hs | mpl-2.0 | -- | Creates a value of 'UpdateDistributionResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'udrsETag'
--
-- * 'udrsDistribution'
--
-- * 'udrsResponseStatus'
updateDistributionResponse
:: Int -- ^ 'udrsResponseStatus'
-> UpdateDistributionResponse
updateDistributionResponse pResponseStatus_ =
UpdateDistributionResponse'
{ _udrsETag = Nothing
, _udrsDistribution = Nothing
, _udrsResponseStatus = pResponseStatus_
} | 539 | updateDistributionResponse
:: Int -- ^ 'udrsResponseStatus'
-> UpdateDistributionResponse
updateDistributionResponse pResponseStatus_ =
UpdateDistributionResponse'
{ _udrsETag = Nothing
, _udrsDistribution = Nothing
, _udrsResponseStatus = pResponseStatus_
} | 286 | updateDistributionResponse pResponseStatus_ =
UpdateDistributionResponse'
{ _udrsETag = Nothing
, _udrsDistribution = Nothing
, _udrsResponseStatus = pResponseStatus_
} | 188 | true | true | 0 | 7 | 94 | 57 | 34 | 23 | null | null |
sushantmahajan/programs | haskell-work/haskell/parser_.hs | cc0-1.0 | (<:*>)::Parser s a->Parser s [a]->Parser s [a]
p1 <:*> p2 = p1 <*> p2 <@ listify | 80 | (<:*>)::Parser s a->Parser s [a]->Parser s [a]
p1 <:*> p2 = p1 <*> p2 <@ listify | 80 | p1 <:*> p2 = p1 <*> p2 <@ listify | 33 | false | true | 3 | 10 | 15 | 63 | 31 | 32 | null | null |
dysinger/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/UpdateStack.hs | mpl-2.0 | -- | 'UpdateStack' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'usAttributes' @::@ 'HashMap' 'StackAttributesKeys' 'Text'
--
-- * 'usChefConfiguration' @::@ 'Maybe' 'ChefConfiguration'
--
-- * 'usConfigurationManager' @::@ 'Maybe' 'StackConfigurationManager'
--
-- * 'usCustomCookbooksSource' @::@ 'Maybe' 'Source'
--
-- * 'usCustomJson' @::@ 'Maybe' 'Text'
--
-- * 'usDefaultAvailabilityZone' @::@ 'Maybe' 'Text'
--
-- * 'usDefaultInstanceProfileArn' @::@ 'Maybe' 'Text'
--
-- * 'usDefaultOs' @::@ 'Maybe' 'Text'
--
-- * 'usDefaultRootDeviceType' @::@ 'Maybe' 'RootDeviceType'
--
-- * 'usDefaultSshKeyName' @::@ 'Maybe' 'Text'
--
-- * 'usDefaultSubnetId' @::@ 'Maybe' 'Text'
--
-- * 'usHostnameTheme' @::@ 'Maybe' 'Text'
--
-- * 'usName' @::@ 'Maybe' 'Text'
--
-- * 'usServiceRoleArn' @::@ 'Maybe' 'Text'
--
-- * 'usStackId' @::@ 'Text'
--
-- * 'usUseCustomCookbooks' @::@ 'Maybe' 'Bool'
--
-- * 'usUseOpsworksSecurityGroups' @::@ 'Maybe' 'Bool'
--
updateStack :: Text -- ^ 'usStackId'
-> UpdateStack
updateStack p1 = UpdateStack
{ _usStackId = p1
, _usName = Nothing
, _usAttributes = mempty
, _usServiceRoleArn = Nothing
, _usDefaultInstanceProfileArn = Nothing
, _usDefaultOs = Nothing
, _usHostnameTheme = Nothing
, _usDefaultAvailabilityZone = Nothing
, _usDefaultSubnetId = Nothing
, _usCustomJson = Nothing
, _usConfigurationManager = Nothing
, _usChefConfiguration = Nothing
, _usUseCustomCookbooks = Nothing
, _usCustomCookbooksSource = Nothing
, _usDefaultSshKeyName = Nothing
, _usDefaultRootDeviceType = Nothing
, _usUseOpsworksSecurityGroups = Nothing
} | 1,846 | updateStack :: Text -- ^ 'usStackId'
-> UpdateStack
updateStack p1 = UpdateStack
{ _usStackId = p1
, _usName = Nothing
, _usAttributes = mempty
, _usServiceRoleArn = Nothing
, _usDefaultInstanceProfileArn = Nothing
, _usDefaultOs = Nothing
, _usHostnameTheme = Nothing
, _usDefaultAvailabilityZone = Nothing
, _usDefaultSubnetId = Nothing
, _usCustomJson = Nothing
, _usConfigurationManager = Nothing
, _usChefConfiguration = Nothing
, _usUseCustomCookbooks = Nothing
, _usCustomCookbooksSource = Nothing
, _usDefaultSshKeyName = Nothing
, _usDefaultRootDeviceType = Nothing
, _usUseOpsworksSecurityGroups = Nothing
} | 857 | updateStack p1 = UpdateStack
{ _usStackId = p1
, _usName = Nothing
, _usAttributes = mempty
, _usServiceRoleArn = Nothing
, _usDefaultInstanceProfileArn = Nothing
, _usDefaultOs = Nothing
, _usHostnameTheme = Nothing
, _usDefaultAvailabilityZone = Nothing
, _usDefaultSubnetId = Nothing
, _usCustomJson = Nothing
, _usConfigurationManager = Nothing
, _usChefConfiguration = Nothing
, _usUseCustomCookbooks = Nothing
, _usCustomCookbooksSource = Nothing
, _usDefaultSshKeyName = Nothing
, _usDefaultRootDeviceType = Nothing
, _usUseOpsworksSecurityGroups = Nothing
} | 793 | true | true | 0 | 7 | 453 | 165 | 118 | 47 | null | null |
VirtualForgeGmbH/hascar | src/Codec/Archive/SAPCAR.hs | gpl-2.0 | writeToFile :: (MonadIO m, MonadMask m, MonadThrow m) => CarEntry s -> Path b File -> SapCar s m ()
writeToFile entry path = bracket open close w
where
open = liftIO $ openBinaryFile (toFilePath path) WriteMode
close = liftIO . hClose
w = sourceEntry entry . writer
-- | Write a SapCar entry to the specified handle. | 356 | writeToFile :: (MonadIO m, MonadMask m, MonadThrow m) => CarEntry s -> Path b File -> SapCar s m ()
writeToFile entry path = bracket open close w
where
open = liftIO $ openBinaryFile (toFilePath path) WriteMode
close = liftIO . hClose
w = sourceEntry entry . writer
-- | Write a SapCar entry to the specified handle. | 356 | writeToFile entry path = bracket open close w
where
open = liftIO $ openBinaryFile (toFilePath path) WriteMode
close = liftIO . hClose
w = sourceEntry entry . writer
-- | Write a SapCar entry to the specified handle. | 256 | false | true | 2 | 10 | 97 | 116 | 56 | 60 | null | null |
5outh/textlunky | src/Data/Direction.hs | mit | randNSEW, randUD, randUDM, randDir :: (MonadRandom m) => m Direction
randNSEW = uniform [N, S, E, W] | 101 | randNSEW, randUD, randUDM, randDir :: (MonadRandom m) => m Direction
randNSEW = uniform [N, S, E, W] | 101 | randNSEW = uniform [N, S, E, W] | 32 | false | true | 0 | 6 | 17 | 44 | 27 | 17 | null | null |
denibertovic/haskell | kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs | bsd-3-clause | -- * V1StatusCause
-- | 'v1StatusCauseField' Lens
v1StatusCauseFieldL :: Lens_' V1StatusCause (Maybe Text)
v1StatusCauseFieldL f V1StatusCause{..} = (\v1StatusCauseField -> V1StatusCause { v1StatusCauseField, ..} ) <$> f v1StatusCauseField | 240 | v1StatusCauseFieldL :: Lens_' V1StatusCause (Maybe Text)
v1StatusCauseFieldL f V1StatusCause{..} = (\v1StatusCauseField -> V1StatusCause { v1StatusCauseField, ..} ) <$> f v1StatusCauseField | 189 | v1StatusCauseFieldL f V1StatusCause{..} = (\v1StatusCauseField -> V1StatusCause { v1StatusCauseField, ..} ) <$> f v1StatusCauseField | 132 | true | true | 1 | 8 | 27 | 63 | 31 | 32 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | ndSpindleCount :: String
ndSpindleCount = "spindle_count" | 57 | ndSpindleCount :: String
ndSpindleCount = "spindle_count" | 57 | ndSpindleCount = "spindle_count" | 32 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
vlastachu/haskell-ccg | app/Main.hs | bsd-3-clause | parse_iter rules chart = parse_iter rules (put_cell chart)
where -- put cell until there is two cell under new
put_cell (Cell val _ End _) = End
-- put cell with: one last at down, one new at right and one last on diagonal
put_cell chart@(Cell _ _ right _) = Cell (cellData chart) chart (put_cell right) right
cellData chart@(Cell _ _ right _) = applyRulesToDerivations (getColumn chart) (reverse $ getDiagonal right)
applyRulesToDerivations downList diagList
= catMaybes $ concat (zipWith applyRules downList diagList) -- unique
applyRules lefts rights =
[(\x -> CellData x name (ParsePath ldata rdata)) <$> (rule left right) |
ldata@(CellData left _ _) <- lefts,
rdata@(CellData right _ _) <- rights,
(rule, name) <- rules] | 828 | parse_iter rules chart = parse_iter rules (put_cell chart)
where -- put cell until there is two cell under new
put_cell (Cell val _ End _) = End
-- put cell with: one last at down, one new at right and one last on diagonal
put_cell chart@(Cell _ _ right _) = Cell (cellData chart) chart (put_cell right) right
cellData chart@(Cell _ _ right _) = applyRulesToDerivations (getColumn chart) (reverse $ getDiagonal right)
applyRulesToDerivations downList diagList
= catMaybes $ concat (zipWith applyRules downList diagList) -- unique
applyRules lefts rights =
[(\x -> CellData x name (ParsePath ldata rdata)) <$> (rule left right) |
ldata@(CellData left _ _) <- lefts,
rdata@(CellData right _ _) <- rights,
(rule, name) <- rules] | 828 | parse_iter rules chart = parse_iter rules (put_cell chart)
where -- put cell until there is two cell under new
put_cell (Cell val _ End _) = End
-- put cell with: one last at down, one new at right and one last on diagonal
put_cell chart@(Cell _ _ right _) = Cell (cellData chart) chart (put_cell right) right
cellData chart@(Cell _ _ right _) = applyRulesToDerivations (getColumn chart) (reverse $ getDiagonal right)
applyRulesToDerivations downList diagList
= catMaybes $ concat (zipWith applyRules downList diagList) -- unique
applyRules lefts rights =
[(\x -> CellData x name (ParsePath ldata rdata)) <$> (rule left right) |
ldata@(CellData left _ _) <- lefts,
rdata@(CellData right _ _) <- rights,
(rule, name) <- rules] | 828 | false | false | 4 | 13 | 220 | 267 | 136 | 131 | null | null |
mariefarrell/Hets | SoftFOL/Morphism.hs | gpl-2.0 | toOpSymb :: (SPIdentifier, Set.Set ([SPIdentifier], SPIdentifier))
-> Set.Set SFSymbol
toOpSymb (ident, ts) = Set.map toSymb ts
where toSymb (args, res) =
SFSymbol { sym_ident = ident
, sym_type = SFOpType args res} | 263 | toOpSymb :: (SPIdentifier, Set.Set ([SPIdentifier], SPIdentifier))
-> Set.Set SFSymbol
toOpSymb (ident, ts) = Set.map toSymb ts
where toSymb (args, res) =
SFSymbol { sym_ident = ident
, sym_type = SFOpType args res} | 263 | toOpSymb (ident, ts) = Set.map toSymb ts
where toSymb (args, res) =
SFSymbol { sym_ident = ident
, sym_type = SFOpType args res} | 167 | false | true | 2 | 8 | 79 | 98 | 50 | 48 | null | null |
genos/online_problems | advent_of_code_2016/day8/src/Main.hs | mit | move :: Screen -> Move -> Screen
move s (Rect rs cs) = rect rs cs s | 67 | move :: Screen -> Move -> Screen
move s (Rect rs cs) = rect rs cs s | 67 | move s (Rect rs cs) = rect rs cs s | 34 | false | true | 0 | 7 | 16 | 39 | 19 | 20 | null | null |
apunktbau/co4 | test/CO4/Example/LPOStandalone.hs | gpl-3.0 | ord :: Precedence -> Symbol -> Symbol -> Order
ord precedence a b =
let pa = lookup eqSymbol a precedence
pb = lookup eqSymbol b precedence
in
ordNat pa pb | 172 | ord :: Precedence -> Symbol -> Symbol -> Order
ord precedence a b =
let pa = lookup eqSymbol a precedence
pb = lookup eqSymbol b precedence
in
ordNat pa pb | 172 | ord precedence a b =
let pa = lookup eqSymbol a precedence
pb = lookup eqSymbol b precedence
in
ordNat pa pb | 125 | false | true | 0 | 9 | 47 | 72 | 32 | 40 | null | null |
ctford/Idris-Elba-dev | src/Idris/Core/ProofState.hs | bsd-3-clause | intro n ctxt env _ = fail "Can't introduce here." | 49 | intro n ctxt env _ = fail "Can't introduce here." | 49 | intro n ctxt env _ = fail "Can't introduce here." | 49 | false | false | 0 | 4 | 9 | 22 | 8 | 14 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/index_3.hs | mit | primCmpInt (Pos x) (Pos y) = primCmpNat x y | 43 | primCmpInt (Pos x) (Pos y) = primCmpNat x y | 43 | primCmpInt (Pos x) (Pos y) = primCmpNat x y | 43 | false | false | 1 | 7 | 8 | 30 | 13 | 17 | null | null |
nevrenato/HetsAlloy | Common/Lib/State.hs | gpl-2.0 | evalState :: State s a -> s -> a
evalState m = fst . runState m | 63 | evalState :: State s a -> s -> a
evalState m = fst . runState m | 63 | evalState m = fst . runState m | 30 | false | true | 0 | 8 | 15 | 39 | 17 | 22 | null | null |
danr/hipspec | testsuite/prod/zeno_version/ZenoVersion.hs | gpl-3.0 | prop_T03 :: [a] -> [a] -> Prop
prop_T03 x y = prove (length (x ++ y ) :=: length (y ) + length x) | 97 | prop_T03 :: [a] -> [a] -> Prop
prop_T03 x y = prove (length (x ++ y ) :=: length (y ) + length x) | 97 | prop_T03 x y = prove (length (x ++ y ) :=: length (y ) + length x) | 66 | false | true | 0 | 11 | 23 | 63 | 32 | 31 | null | null |
mstksg/auto | src/Control/Auto/Generate.hs | mit | -- | Analogous to 'unfoldr' from "Prelude". Creates an 'Interval'
-- (that ignores its input) by maintaining an internal accumulator of type
-- @c@ and, at every step, applying to the unfolding function to the
-- accumulator. If the result is 'Nothing', then the 'Interval' will turn
-- "off" forever (output 'Nothing' forever); if the result is @'Just' (y,
-- acc)@, then it will output @y@ and store @acc@ as the new accumulator.
--
-- Given an initial accumulator.
--
-- >>> let countFromTil n m = flip unfold n $ \i -> if i <= m
-- then Just (i, i+1)
-- else Nothing
-- >>> take 8 . streamAuto' (countFromTil 5 10) $ repeat ()
-- [Just 5, Just 6, Just 7, Just 8, Just 9, Just 10, Nothing, Nothing]
--
-- @'unfold' f c0@ behaves like @'overList' ('unfoldr' f c0)@.
--
unfold :: Serialize c
=> (c -> Maybe (b, c)) -- ^ unfolding function
-> c -- ^ initial accumulator
-> Interval m a b
unfold f = mkState (_unfoldF f) . Just | 1,077 | unfold :: Serialize c
=> (c -> Maybe (b, c)) -- ^ unfolding function
-> c -- ^ initial accumulator
-> Interval m a b
unfold f = mkState (_unfoldF f) . Just | 202 | unfold f = mkState (_unfoldF f) . Just | 38 | true | true | 1 | 11 | 327 | 90 | 52 | 38 | null | null |
GaloisInc/mistral | src/Mistral/TypeCheck/Unify.hs | bsd-3-clause | -- | Generate a sigleton substitution with one free-variable binding.
freeBind :: TParam -> Type -> Subst
freeBind p ty = mempty { substFree = Map.singleton (tpIndex p) ty } | 173 | freeBind :: TParam -> Type -> Subst
freeBind p ty = mempty { substFree = Map.singleton (tpIndex p) ty } | 103 | freeBind p ty = mempty { substFree = Map.singleton (tpIndex p) ty } | 67 | true | true | 0 | 10 | 29 | 52 | 25 | 27 | null | null |
abbradar/crc-brute | src/CRCBrute.hs | bsd-3-clause | mkTable :: [[Char]] -> ([Ptr CUTF8Char] -> IO a) -> IO a
mkTable table func = with [] table
where -- there's surely a name for a monadic recursion like this
with vecs [] = func $ reverse vecs
with vecs (vec:t) = withPtr (map CUTF8Char vec) $ \p -> with (p:vecs) t | 281 | mkTable :: [[Char]] -> ([Ptr CUTF8Char] -> IO a) -> IO a
mkTable table func = with [] table
where -- there's surely a name for a monadic recursion like this
with vecs [] = func $ reverse vecs
with vecs (vec:t) = withPtr (map CUTF8Char vec) $ \p -> with (p:vecs) t | 281 | mkTable table func = with [] table
where -- there's surely a name for a monadic recursion like this
with vecs [] = func $ reverse vecs
with vecs (vec:t) = withPtr (map CUTF8Char vec) $ \p -> with (p:vecs) t | 224 | false | true | 0 | 10 | 70 | 132 | 65 | 67 | null | null |
ihc/futhark | src/Futhark/Analysis/SymbolTable.hs | isc | insertArrayLParam :: Attributes lore =>
LParam lore -> Maybe VName -> SymbolTable lore
-> SymbolTable lore
insertArrayLParam param (Just array) vtable =
-- We now know that the outer size of 'array' is at least one, and
-- that the inner sizes are at least zero, since they are array
-- sizes.
let vtable' = insertLParamWithRange param (lookupRange array vtable) (const Nothing) vtable
in case arrayDims <$> lookupType array vtable of
Just (Var v:_) -> (v `isAtLeast` 1) vtable'
_ -> vtable' | 561 | insertArrayLParam :: Attributes lore =>
LParam lore -> Maybe VName -> SymbolTable lore
-> SymbolTable lore
insertArrayLParam param (Just array) vtable =
-- We now know that the outer size of 'array' is at least one, and
-- that the inner sizes are at least zero, since they are array
-- sizes.
let vtable' = insertLParamWithRange param (lookupRange array vtable) (const Nothing) vtable
in case arrayDims <$> lookupType array vtable of
Just (Var v:_) -> (v `isAtLeast` 1) vtable'
_ -> vtable' | 561 | insertArrayLParam param (Just array) vtable =
-- We now know that the outer size of 'array' is at least one, and
-- that the inner sizes are at least zero, since they are array
-- sizes.
let vtable' = insertLParamWithRange param (lookupRange array vtable) (const Nothing) vtable
in case arrayDims <$> lookupType array vtable of
Just (Var v:_) -> (v `isAtLeast` 1) vtable'
_ -> vtable' | 415 | false | true | 0 | 13 | 151 | 142 | 69 | 73 | null | null |
oldmanmike/ghc | compiler/parser/ApiAnnotation.hs | bsd-3-clause | unicodeAnn AnnLarrow = AnnLarrowU | 37 | unicodeAnn AnnLarrow = AnnLarrowU | 37 | unicodeAnn AnnLarrow = AnnLarrowU | 37 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
rootzlevel/sansa | src/Sansa/Commands/AddFromFile.hs | bsd-2-clause | affOpts :: Parser (CmdAction ())
affOpts = affAction
<$> commonDlOpts
<*> argument str (metavar "FILE") | 107 | affOpts :: Parser (CmdAction ())
affOpts = affAction
<$> commonDlOpts
<*> argument str (metavar "FILE") | 107 | affOpts = affAction
<$> commonDlOpts
<*> argument str (metavar "FILE") | 74 | false | true | 5 | 9 | 18 | 52 | 23 | 29 | null | null |
jsavatgy/hatupist | code/timing-02.hs | gpl-2.0 | defaultSettings = Settings {
lineLen = 40, startLine = 0,
textfile = "morse.txt"
} | 86 | defaultSettings = Settings {
lineLen = 40, startLine = 0,
textfile = "morse.txt"
} | 86 | defaultSettings = Settings {
lineLen = 40, startLine = 0,
textfile = "morse.txt"
} | 86 | false | false | 0 | 6 | 17 | 26 | 16 | 10 | null | null |
SneakingCat/proper-play-gen | src/ErlangWriter.hs | gpl-3.0 | functionData :: ModuleDef -> (String, [Param])
functionData (MethodDecl f ps) = (f, ps) | 89 | functionData :: ModuleDef -> (String, [Param])
functionData (MethodDecl f ps) = (f, ps) | 89 | functionData (MethodDecl f ps) = (f, ps) | 42 | false | true | 0 | 7 | 14 | 41 | 23 | 18 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_SCALAR_EXT :: GLenum
gl_SCALAR_EXT = 0x87BE | 46 | gl_SCALAR_EXT :: GLenum
gl_SCALAR_EXT = 0x87BE | 46 | gl_SCALAR_EXT = 0x87BE | 22 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
jgm/citeproc | src/Citeproc/Types.hs | bsd-2-clause | fromVariable :: Variable -> Text
fromVariable (Variable x) = CI.original x | 74 | fromVariable :: Variable -> Text
fromVariable (Variable x) = CI.original x | 74 | fromVariable (Variable x) = CI.original x | 41 | false | true | 0 | 7 | 10 | 29 | 14 | 15 | null | null |
olorin/amazonka | amazonka-sts/gen/Network/AWS/STS/AssumeRoleWithSAML.hs | mpl-2.0 | -- | The duration, in seconds, of the role session. The value can range from
-- 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value
-- is set to 3600 seconds. An expiration can also be specified in the SAML
-- authentication response\'s 'SessionNotOnOrAfter' value. The actual
-- expiration time is whichever value is shorter.
--
-- The maximum duration for a session is 1 hour, and the minimum duration
-- is 15 minutes, even if values outside this range are specified.
arwsamlDurationSeconds :: Lens' AssumeRoleWithSAML (Maybe Natural)
arwsamlDurationSeconds = lens _arwsamlDurationSeconds (\ s a -> s{_arwsamlDurationSeconds = a}) . mapping _Nat | 669 | arwsamlDurationSeconds :: Lens' AssumeRoleWithSAML (Maybe Natural)
arwsamlDurationSeconds = lens _arwsamlDurationSeconds (\ s a -> s{_arwsamlDurationSeconds = a}) . mapping _Nat | 177 | arwsamlDurationSeconds = lens _arwsamlDurationSeconds (\ s a -> s{_arwsamlDurationSeconds = a}) . mapping _Nat | 110 | true | true | 0 | 10 | 105 | 60 | 35 | 25 | null | null |
aniketd/learn.haskell | haskellbook/maximus.hs | unlicense | myMaximumBy _ [x] = x | 21 | myMaximumBy _ [x] = x | 21 | myMaximumBy _ [x] = x | 21 | false | false | 0 | 6 | 4 | 14 | 7 | 7 | null | null |
duplode/dohaskell | src/Handler/Utils.hs | bsd-3-clause | deny :: Handler ()
deny = permissionDenied "You don't have permission to view this page." | 89 | deny :: Handler ()
deny = permissionDenied "You don't have permission to view this page." | 89 | deny = permissionDenied "You don't have permission to view this page." | 70 | false | true | 1 | 6 | 14 | 22 | 9 | 13 | null | null |
aloiscochard/thinkgear | src/Codec/Binary/ThinkGear.hs | apache-2.0 | putASIC ASIC96 = putWord16be 1 | 33 | putASIC ASIC96 = putWord16be 1 | 33 | putASIC ASIC96 = putWord16be 1 | 33 | false | false | 0 | 5 | 7 | 12 | 5 | 7 | null | null |
ublubu/euler | Euler5/Euler5.hs | mit | poweredPrimes :: Integer -> [Integer]
poweredPrimes max = map (\r -> powerify r max) $ primesUntil max | 102 | poweredPrimes :: Integer -> [Integer]
poweredPrimes max = map (\r -> powerify r max) $ primesUntil max | 102 | poweredPrimes max = map (\r -> powerify r max) $ primesUntil max | 64 | false | true | 0 | 8 | 16 | 49 | 23 | 26 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/cabal-install/Distribution/Client/Setup.hs | bsd-3-clause | relevantConfigValuesText :: [String] -> String
relevantConfigValuesText vs =
"Relevant global configuration keys:\n"
++ concat [" " ++ v ++ "\n" |v <- vs] | 162 | relevantConfigValuesText :: [String] -> String
relevantConfigValuesText vs =
"Relevant global configuration keys:\n"
++ concat [" " ++ v ++ "\n" |v <- vs] | 162 | relevantConfigValuesText vs =
"Relevant global configuration keys:\n"
++ concat [" " ++ v ++ "\n" |v <- vs] | 115 | false | true | 2 | 8 | 30 | 54 | 25 | 29 | null | null |
brendanhay/gogol | gogol-spanner/gen/Network/Google/Spanner/Types/Product.hs | mpl-2.0 | -- | The error result of the operation in case of failure or cancellation.
oError :: Lens' Operation (Maybe Status)
oError = lens _oError (\ s a -> s{_oError = a}) | 163 | oError :: Lens' Operation (Maybe Status)
oError = lens _oError (\ s a -> s{_oError = a}) | 88 | oError = lens _oError (\ s a -> s{_oError = a}) | 47 | true | true | 1 | 9 | 30 | 52 | 25 | 27 | null | null |
uduki/hsQt | Qtc/ClassTypes/Core.hs | bsd-2-clause | qCastList_QTimer x = qcl_QTimer [] x | 36 | qCastList_QTimer x = qcl_QTimer [] x | 36 | qCastList_QTimer x = qcl_QTimer [] x | 36 | false | false | 0 | 6 | 5 | 16 | 7 | 9 | null | null |
smurphy8/shakespeare-dynamic | shakespeare-dynamic-opheilia/src/Shakespeare/Dynamic/Opheilia/Parser.hs | mit | compressDoc (DocCase d cs:rest) =
DocCase d (map (second compressDoc) cs) : compressDoc rest | 96 | compressDoc (DocCase d cs:rest) =
DocCase d (map (second compressDoc) cs) : compressDoc rest | 96 | compressDoc (DocCase d cs:rest) =
DocCase d (map (second compressDoc) cs) : compressDoc rest | 96 | false | false | 0 | 10 | 17 | 47 | 22 | 25 | null | null |
Altech/haScm | src/Scheme/Evaluator.hs | gpl-3.0 | quasiquote env [form] = unquote form 1
where -- [TODO] support dotted list
unquote (List [Symbol "unquote", form']) 1 = eval env form'
unquote (List [Symbol "unquote", form']) n | n > 1 = (\form'' -> List [Symbol "unquote", form'']) <$> unquote form' (n-1)
unquote (List [Symbol "unquote-splicing", form']) n | n > 1 = (\form'' -> List [Symbol "unquote-splicing", form'']) <$> unquote form' (n-1)
unquote (List [Symbol "quasiquote", form']) n = (\form'' -> List [Symbol "quasiquote", form'']) <$> unquote form' (n+1)
unquote (List list) n = unquoteSplicing list n >>= mapM (\v -> unquote v n) >>= return . List
unquote simpleDatum _ = return simpleDatum
unquoteSplicing list n | n > 1 = return list
unquoteSplicing [] 1 = return []
unquoteSplicing (hd:tl) 1 = case hd of -- [TODO] handle invalid cases
List [Symbol "unquote-splicing", form'] -> (++) <$> destructList (eval env form') <*> unquoteSplicing tl 1
_ -> (:) <$> pure hd <*> unquoteSplicing tl 1
destructList action = (\val -> case val of List ls -> ls) <$> action | 1,204 | quasiquote env [form] = unquote form 1
where -- [TODO] support dotted list
unquote (List [Symbol "unquote", form']) 1 = eval env form'
unquote (List [Symbol "unquote", form']) n | n > 1 = (\form'' -> List [Symbol "unquote", form'']) <$> unquote form' (n-1)
unquote (List [Symbol "unquote-splicing", form']) n | n > 1 = (\form'' -> List [Symbol "unquote-splicing", form'']) <$> unquote form' (n-1)
unquote (List [Symbol "quasiquote", form']) n = (\form'' -> List [Symbol "quasiquote", form'']) <$> unquote form' (n+1)
unquote (List list) n = unquoteSplicing list n >>= mapM (\v -> unquote v n) >>= return . List
unquote simpleDatum _ = return simpleDatum
unquoteSplicing list n | n > 1 = return list
unquoteSplicing [] 1 = return []
unquoteSplicing (hd:tl) 1 = case hd of -- [TODO] handle invalid cases
List [Symbol "unquote-splicing", form'] -> (++) <$> destructList (eval env form') <*> unquoteSplicing tl 1
_ -> (:) <$> pure hd <*> unquoteSplicing tl 1
destructList action = (\val -> case val of List ls -> ls) <$> action | 1,204 | quasiquote env [form] = unquote form 1
where -- [TODO] support dotted list
unquote (List [Symbol "unquote", form']) 1 = eval env form'
unquote (List [Symbol "unquote", form']) n | n > 1 = (\form'' -> List [Symbol "unquote", form'']) <$> unquote form' (n-1)
unquote (List [Symbol "unquote-splicing", form']) n | n > 1 = (\form'' -> List [Symbol "unquote-splicing", form'']) <$> unquote form' (n-1)
unquote (List [Symbol "quasiquote", form']) n = (\form'' -> List [Symbol "quasiquote", form'']) <$> unquote form' (n+1)
unquote (List list) n = unquoteSplicing list n >>= mapM (\v -> unquote v n) >>= return . List
unquote simpleDatum _ = return simpleDatum
unquoteSplicing list n | n > 1 = return list
unquoteSplicing [] 1 = return []
unquoteSplicing (hd:tl) 1 = case hd of -- [TODO] handle invalid cases
List [Symbol "unquote-splicing", form'] -> (++) <$> destructList (eval env form') <*> unquoteSplicing tl 1
_ -> (:) <$> pure hd <*> unquoteSplicing tl 1
destructList action = (\val -> case val of List ls -> ls) <$> action | 1,204 | false | false | 10 | 13 | 354 | 508 | 241 | 267 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/coreSyn/CoreUtils.hs | bsd-3-clause | eqTickish :: RnEnv2 -> Tickish Id -> Tickish Id -> Bool
eqTickish env (Breakpoint lid lids) (Breakpoint rid rids)
= lid == rid && map (rnOccL env) lids == map (rnOccR env) rids | 184 | eqTickish :: RnEnv2 -> Tickish Id -> Tickish Id -> Bool
eqTickish env (Breakpoint lid lids) (Breakpoint rid rids)
= lid == rid && map (rnOccL env) lids == map (rnOccR env) rids | 184 | eqTickish env (Breakpoint lid lids) (Breakpoint rid rids)
= lid == rid && map (rnOccL env) lids == map (rnOccR env) rids | 128 | false | true | 0 | 9 | 40 | 86 | 41 | 45 | null | null |
kmate/imperative-edsl | examples/Demo.hs | bsd-3-clause | run_sumInput = runCompiled sumInput | 35 | run_sumInput = runCompiled sumInput | 35 | run_sumInput = runCompiled sumInput | 35 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
tphyahoo/happs-tutorial | src/AppStateGraphBased.hs | bsd-3-clause | askUsersGraph = do
s <- askDatastore
return . socialgraph $ s | 65 | askUsersGraph = do
s <- askDatastore
return . socialgraph $ s | 65 | askUsersGraph = do
s <- askDatastore
return . socialgraph $ s | 65 | false | false | 0 | 8 | 14 | 24 | 11 | 13 | null | null |
keera-studios/gtk-helpers | gtk2/examples/peg-solitaire/BoardMain.hs | bsd-3-clause | main :: IO ()
main = do
-- View
-- Initialise Gtk
_ <- initGUI
-- Create interface
window <- windowNew
-- vbox <- vBoxNew False 2
bgBin <- backgroundContainerNewWithPicture "Free-Background-3.jpg"
align <- alignmentNew 0.5 0.5 0 0
game <- gtkGame
board <- attachGameRules game
containerAdd align board
containerAdd bgBin align
containerAdd window bgBin
widgetSetSizeRequest window 400 300
-- Close program if window is closed
_ <- window `on` deleteEvent $ liftIO mainQuit >> return False
-- Launch program with the main window
widgetShowAll window
mainGUI
-- We do not need to give any feedback, so dragging is always allowed | 685 | main :: IO ()
main = do
-- View
-- Initialise Gtk
_ <- initGUI
-- Create interface
window <- windowNew
-- vbox <- vBoxNew False 2
bgBin <- backgroundContainerNewWithPicture "Free-Background-3.jpg"
align <- alignmentNew 0.5 0.5 0 0
game <- gtkGame
board <- attachGameRules game
containerAdd align board
containerAdd bgBin align
containerAdd window bgBin
widgetSetSizeRequest window 400 300
-- Close program if window is closed
_ <- window `on` deleteEvent $ liftIO mainQuit >> return False
-- Launch program with the main window
widgetShowAll window
mainGUI
-- We do not need to give any feedback, so dragging is always allowed | 685 | main = do
-- View
-- Initialise Gtk
_ <- initGUI
-- Create interface
window <- windowNew
-- vbox <- vBoxNew False 2
bgBin <- backgroundContainerNewWithPicture "Free-Background-3.jpg"
align <- alignmentNew 0.5 0.5 0 0
game <- gtkGame
board <- attachGameRules game
containerAdd align board
containerAdd bgBin align
containerAdd window bgBin
widgetSetSizeRequest window 400 300
-- Close program if window is closed
_ <- window `on` deleteEvent $ liftIO mainQuit >> return False
-- Launch program with the main window
widgetShowAll window
mainGUI
-- We do not need to give any feedback, so dragging is always allowed | 671 | false | true | 1 | 10 | 158 | 154 | 68 | 86 | null | null |
AjayRamanathan/plots | src/Plots.hs | bsd-3-clause | -- | Set no major or minor grid lines for given axes.
noGridLine :: E v -> AxisState b v n
noGridLine e = noMajorGridLine e >> noMinorGridLine e | 144 | noGridLine :: E v -> AxisState b v n
noGridLine e = noMajorGridLine e >> noMinorGridLine e | 90 | noGridLine e = noMajorGridLine e >> noMinorGridLine e | 53 | true | true | 0 | 6 | 28 | 39 | 18 | 21 | null | null |
infotroph/pandoc | src/Text/Pandoc/Writers/Docbook.hs | gpl-2.0 | -- title beginning with fig: indicates that the image is a figure
blockToDocbook opts (Para [Image attr txt (src,'f':'i':'g':':':_)]) =
let alt = inlinesToDocbook opts txt
capt = if null txt
then empty
else inTagsSimple "title" alt
in inTagsIndented "figure" $
capt $$
(inTagsIndented "mediaobject" $
(inTagsIndented "imageobject"
(imageToDocbook opts attr src)) $$
inTagsSimple "textobject" (inTagsSimple "phrase" alt)) | 515 | blockToDocbook opts (Para [Image attr txt (src,'f':'i':'g':':':_)]) =
let alt = inlinesToDocbook opts txt
capt = if null txt
then empty
else inTagsSimple "title" alt
in inTagsIndented "figure" $
capt $$
(inTagsIndented "mediaobject" $
(inTagsIndented "imageobject"
(imageToDocbook opts attr src)) $$
inTagsSimple "textobject" (inTagsSimple "phrase" alt)) | 449 | blockToDocbook opts (Para [Image attr txt (src,'f':'i':'g':':':_)]) =
let alt = inlinesToDocbook opts txt
capt = if null txt
then empty
else inTagsSimple "title" alt
in inTagsIndented "figure" $
capt $$
(inTagsIndented "mediaobject" $
(inTagsIndented "imageobject"
(imageToDocbook opts attr src)) $$
inTagsSimple "textobject" (inTagsSimple "phrase" alt)) | 449 | true | false | 0 | 14 | 152 | 143 | 71 | 72 | null | null |
xmonad/xmonad-contrib | tests/Selective.hs | bsd-3-clause | prop_select_master sel (stk :: Stack Int) =
take (nMaster sel) (integrate stk) == take (nMaster sel) (integrate $ select sel stk) | 133 | prop_select_master sel (stk :: Stack Int) =
take (nMaster sel) (integrate stk) == take (nMaster sel) (integrate $ select sel stk) | 133 | prop_select_master sel (stk :: Stack Int) =
take (nMaster sel) (integrate stk) == take (nMaster sel) (integrate $ select sel stk) | 133 | false | false | 0 | 9 | 24 | 65 | 31 | 34 | null | null |
fredcy/elm-format | parser/src/Parse/Helpers.hs | bsd-3-clause | padded :: IParser a -> IParser (Comments, a, Comments)
padded p =
do (_, pre) <- whitespace
out <- p
(_, post) <- whitespace
return (pre, out, post) | 169 | padded :: IParser a -> IParser (Comments, a, Comments)
padded p =
do (_, pre) <- whitespace
out <- p
(_, post) <- whitespace
return (pre, out, post) | 169 | padded p =
do (_, pre) <- whitespace
out <- p
(_, post) <- whitespace
return (pre, out, post) | 114 | false | true | 0 | 8 | 48 | 81 | 42 | 39 | null | null |
nkaretnikov/ghc | compiler/utils/Outputable.hs | bsd-3-clause | speakN 3 = ptext (sLit "three") | 31 | speakN 3 = ptext (sLit "three") | 31 | speakN 3 = ptext (sLit "three") | 31 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
AubreyEAnderson/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | readBackTicked = called "backtick expansion" $ do
id <- getNextId
startPos <- getPosition
backtick
subStart <- getPosition
subString <- readGenericLiteral "`´"
endPos <- getPosition
backtick
optional $ do
c <- try . lookAhead $ suspectCharAfterQuotes
when ('\n' `elem` subString && not ("\n" `isPrefixOf` subString)) $
suggestForgotClosingQuote startPos endPos "backtick expansion"
-- Result positions may be off due to escapes
result <- subParse subStart subParser (unEscape subString)
return $ T_Backticked id result
where
unEscape [] = []
unEscape ('\\':x:rest) | x `elem` "$`\\" = x : unEscape rest
unEscape ('\\':'\n':rest) = unEscape rest
unEscape (c:rest) = c : unEscape rest
subParser = do
cmds <- readCompoundListOrEmpty
verifyEof
return cmds
backtick =
disregard (char '`') <|> do
pos <- getPosition
char '´'
parseProblemAt pos ErrorC 1077
"For command expansion, the tick should slant left (` vs ´). Use $(..) instead." | 1,099 | readBackTicked = called "backtick expansion" $ do
id <- getNextId
startPos <- getPosition
backtick
subStart <- getPosition
subString <- readGenericLiteral "`´"
endPos <- getPosition
backtick
optional $ do
c <- try . lookAhead $ suspectCharAfterQuotes
when ('\n' `elem` subString && not ("\n" `isPrefixOf` subString)) $
suggestForgotClosingQuote startPos endPos "backtick expansion"
-- Result positions may be off due to escapes
result <- subParse subStart subParser (unEscape subString)
return $ T_Backticked id result
where
unEscape [] = []
unEscape ('\\':x:rest) | x `elem` "$`\\" = x : unEscape rest
unEscape ('\\':'\n':rest) = unEscape rest
unEscape (c:rest) = c : unEscape rest
subParser = do
cmds <- readCompoundListOrEmpty
verifyEof
return cmds
backtick =
disregard (char '`') <|> do
pos <- getPosition
char '´'
parseProblemAt pos ErrorC 1077
"For command expansion, the tick should slant left (` vs ´). Use $(..) instead." | 1,099 | readBackTicked = called "backtick expansion" $ do
id <- getNextId
startPos <- getPosition
backtick
subStart <- getPosition
subString <- readGenericLiteral "`´"
endPos <- getPosition
backtick
optional $ do
c <- try . lookAhead $ suspectCharAfterQuotes
when ('\n' `elem` subString && not ("\n" `isPrefixOf` subString)) $
suggestForgotClosingQuote startPos endPos "backtick expansion"
-- Result positions may be off due to escapes
result <- subParse subStart subParser (unEscape subString)
return $ T_Backticked id result
where
unEscape [] = []
unEscape ('\\':x:rest) | x `elem` "$`\\" = x : unEscape rest
unEscape ('\\':'\n':rest) = unEscape rest
unEscape (c:rest) = c : unEscape rest
subParser = do
cmds <- readCompoundListOrEmpty
verifyEof
return cmds
backtick =
disregard (char '`') <|> do
pos <- getPosition
char '´'
parseProblemAt pos ErrorC 1077
"For command expansion, the tick should slant left (` vs ´). Use $(..) instead." | 1,099 | false | false | 0 | 17 | 306 | 311 | 145 | 166 | null | null |
ArlequinWild/Lenguajes-de-programaci-n | Practica0.hs | gpl-3.0 | --Nos da los elementos que aparecen una sola vez.
unaVez::Eq a=>[a]->[a]
unaVez [] = [] | 87 | unaVez::Eq a=>[a]->[a]
unaVez [] = [] | 37 | unaVez [] = [] | 14 | true | true | 0 | 7 | 14 | 36 | 19 | 17 | null | null |
chrisjpn/CPIB_ILMCompiler | src/VM/VirtualMachineIO.hs | bsd-3-clause | execInstr (Input (IntTy 64) loc indicator) (pc, fp, IntVmVal addr : stack) =
do putStr ("? " ++ indicator ++ " : " ++ show (IntTy 64) ++ " = ");
hFlush stdout
inputString <- getLine
case readInteger inputString of
Nothing ->
return (Left (ErrorMsg ([loc], "input: not an integer literal")))
Just i ->
case fromIntegerToInt64 i of
Left Overflow ->
return (Left (ErrorMsg ([loc], "input: overflow of 64 bit")))
Right result ->
let stack' = updateS stack (addr, Int64VmVal result)
in return2 (pc + 1, fp, stack') | 619 | execInstr (Input (IntTy 64) loc indicator) (pc, fp, IntVmVal addr : stack) =
do putStr ("? " ++ indicator ++ " : " ++ show (IntTy 64) ++ " = ");
hFlush stdout
inputString <- getLine
case readInteger inputString of
Nothing ->
return (Left (ErrorMsg ([loc], "input: not an integer literal")))
Just i ->
case fromIntegerToInt64 i of
Left Overflow ->
return (Left (ErrorMsg ([loc], "input: overflow of 64 bit")))
Right result ->
let stack' = updateS stack (addr, Int64VmVal result)
in return2 (pc + 1, fp, stack') | 619 | execInstr (Input (IntTy 64) loc indicator) (pc, fp, IntVmVal addr : stack) =
do putStr ("? " ++ indicator ++ " : " ++ show (IntTy 64) ++ " = ");
hFlush stdout
inputString <- getLine
case readInteger inputString of
Nothing ->
return (Left (ErrorMsg ([loc], "input: not an integer literal")))
Just i ->
case fromIntegerToInt64 i of
Left Overflow ->
return (Left (ErrorMsg ([loc], "input: overflow of 64 bit")))
Right result ->
let stack' = updateS stack (addr, Int64VmVal result)
in return2 (pc + 1, fp, stack') | 619 | false | false | 0 | 19 | 197 | 230 | 113 | 117 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.