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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Advertisers/Insert.hs | mpl-2.0 | -- | User profile ID associated with this request.
aiiProFileId :: Lens' AdvertisersInsert Int64
aiiProFileId
= lens _aiiProFileId (\ s a -> s{_aiiProFileId = a})
. _Coerce | 180 | aiiProFileId :: Lens' AdvertisersInsert Int64
aiiProFileId
= lens _aiiProFileId (\ s a -> s{_aiiProFileId = a})
. _Coerce | 129 | aiiProFileId
= lens _aiiProFileId (\ s a -> s{_aiiProFileId = a})
. _Coerce | 83 | true | true | 1 | 9 | 34 | 48 | 24 | 24 | null | null |
meteogrid/sigym-core | src/SIGyM/Store/Registry.hs | bsd-3-clause | foldMaybes _ r [] = Just r | 26 | foldMaybes _ r [] = Just r | 26 | foldMaybes _ r [] = Just r | 26 | false | false | 0 | 6 | 6 | 18 | 8 | 10 | null | null |
allonsy/chirp | src/Channel.hs | bsd-3-clause | sendToChannelAsync :: [MVar U.User] -> MVar U.User -> String -> IO ()
sendToChannelAsync users origin msg = mapM_ sendToUser users
where
sendToUser use = if use == origin then return ()
else do
targetUser <- takeMVar use
sendSafe (U.handle targetUser) msg | 283 | sendToChannelAsync :: [MVar U.User] -> MVar U.User -> String -> IO ()
sendToChannelAsync users origin msg = mapM_ sendToUser users
where
sendToUser use = if use == origin then return ()
else do
targetUser <- takeMVar use
sendSafe (U.handle targetUser) msg | 283 | sendToChannelAsync users origin msg = mapM_ sendToUser users
where
sendToUser use = if use == origin then return ()
else do
targetUser <- takeMVar use
sendSafe (U.handle targetUser) msg | 213 | false | true | 0 | 11 | 68 | 107 | 50 | 57 | null | null |
paulkeene/FP101x | chapter05/Exercises.hs | bsd-3-clause | -- Exercise 1 --
myLength :: [a] -> Int
myLength [] = 0 | 56 | myLength :: [a] -> Int
myLength [] = 0 | 38 | myLength [] = 0 | 15 | true | true | 0 | 6 | 13 | 24 | 13 | 11 | null | null |
chrisdone/ace | src/ACE/Pretty.hs | bsd-3-clause | -- | Maybe pretty print if anything. Other side.
prettym :: Pretty a => Builder -> Maybe a -> Builder
prettym x = maybe "" ((<> x) . pretty) | 140 | prettym :: Pretty a => Builder -> Maybe a -> Builder
prettym x = maybe "" ((<> x) . pretty) | 91 | prettym x = maybe "" ((<> x) . pretty) | 38 | true | true | 0 | 9 | 28 | 56 | 26 | 30 | null | null |
mcjohnalds/jumpy | src/Player.hs | mit | playerHeight = 64 | 17 | playerHeight = 64 | 17 | playerHeight = 64 | 17 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
ezyang/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | emitPrimOp dflags res IndexOffAddrOp_Word16 args = doIndexOffAddrOp (Just (mo_u_16ToWord dflags)) b16 res args | 122 | emitPrimOp dflags res IndexOffAddrOp_Word16 args = doIndexOffAddrOp (Just (mo_u_16ToWord dflags)) b16 res args | 122 | emitPrimOp dflags res IndexOffAddrOp_Word16 args = doIndexOffAddrOp (Just (mo_u_16ToWord dflags)) b16 res args | 122 | false | false | 0 | 9 | 24 | 40 | 17 | 23 | null | null |
tjhunter/karps | haskell/src/Spark/Core/Internal/ColumnFunctions.hs | apache-2.0 | makeColOp1 :: T.Text -> SQLType y -> Column ref x -> Column ref y
makeColOp1 opName sqlt c =
let co = GenColFunction opName (V.fromList (colOp <$> [c]))
in ColumnData {
_cOrigin = _cOrigin c,
_cType = unSQLType sqlt,
_cOp = co,
_cReferingPath = Nothing } | 282 | makeColOp1 :: T.Text -> SQLType y -> Column ref x -> Column ref y
makeColOp1 opName sqlt c =
let co = GenColFunction opName (V.fromList (colOp <$> [c]))
in ColumnData {
_cOrigin = _cOrigin c,
_cType = unSQLType sqlt,
_cOp = co,
_cReferingPath = Nothing } | 282 | makeColOp1 opName sqlt c =
let co = GenColFunction opName (V.fromList (colOp <$> [c]))
in ColumnData {
_cOrigin = _cOrigin c,
_cType = unSQLType sqlt,
_cOp = co,
_cReferingPath = Nothing } | 216 | false | true | 0 | 14 | 73 | 111 | 57 | 54 | null | null |
acowley/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | gen_Newtype_binds :: SrcSpan
-> Class -- the class being derived
-> [TyVar] -- the tvs in the instance head
-> [Type] -- instance head parameters (incl. newtype)
-> Type -- the representation type (already eta-reduced)
-> LH... | 1,938 | gen_Newtype_binds :: SrcSpan
-> Class -- the class being derived
-> [TyVar] -- the tvs in the instance head
-> [Type] -- instance head parameters (incl. newtype)
-> Type -- the representation type (already eta-reduced)
-> LH... | 1,938 | gen_Newtype_binds loc cls inst_tvs cls_tys rhs_ty
= listToBag $ zipWith mk_bind
(classMethods cls)
(map (mkCoerceClassMethEqn cls inst_tvs cls_tys rhs_ty) (classMethods cls))
where
coerce_RDR = getRdrName coerceId
mk_bind :: Id -> Pair Type -> LHsBind RdrName
mk_bind id (Pair tau_ty user... | 1,603 | false | true | 1 | 10 | 610 | 299 | 149 | 150 | null | null |
nullref/haskell-hash-ed2k | Crypto/Hash/Ed2k.hs | bsd-2-clause | appendHash (SingleCtx b) d = MultiCtx $ MD4.update MD4.init $ (b `B.append` d) | 79 | appendHash (SingleCtx b) d = MultiCtx $ MD4.update MD4.init $ (b `B.append` d) | 79 | appendHash (SingleCtx b) d = MultiCtx $ MD4.update MD4.init $ (b `B.append` d) | 79 | false | false | 0 | 8 | 13 | 43 | 22 | 21 | null | null |
federicotdn/hvc | src/Checkout.hs | gpl-3.0 | restoreObject :: String -> (FilePath, String) -> IO ()
restoreObject dir (filepath, hash) = do
let targetPath = dir </> filepath
compressedContents <- Lazy.readFile (objectsDir dir </> hash)
createDirectoryIfMissing True (takeDirectory targetPath)
Lazy.writeFile targetPath (decompress compressedContents) | 313 | restoreObject :: String -> (FilePath, String) -> IO ()
restoreObject dir (filepath, hash) = do
let targetPath = dir </> filepath
compressedContents <- Lazy.readFile (objectsDir dir </> hash)
createDirectoryIfMissing True (takeDirectory targetPath)
Lazy.writeFile targetPath (decompress compressedContents) | 313 | restoreObject dir (filepath, hash) = do
let targetPath = dir </> filepath
compressedContents <- Lazy.readFile (objectsDir dir </> hash)
createDirectoryIfMissing True (takeDirectory targetPath)
Lazy.writeFile targetPath (decompress compressedContents) | 258 | false | true | 0 | 11 | 43 | 106 | 51 | 55 | null | null |
rolph-recto/liquid-fixpoint | src/Language/Fixpoint/SortCheck.hs | bsd-3-clause | unify1 θ t1 t2@(FAbs _ _) = do t2' <- generalize t2
unifyMany θ [t1] [t2'] | 133 | unify1 θ t1 t2@(FAbs _ _) = do t2' <- generalize t2
unifyMany θ [t1] [t2'] | 133 | unify1 θ t1 t2@(FAbs _ _) = do t2' <- generalize t2
unifyMany θ [t1] [t2'] | 133 | false | false | 1 | 9 | 74 | 57 | 24 | 33 | null | null |
Tr1p0d/WisRegister | src/Main.hs | gpl-3.0 | --no check certificate contex settings
settings :: IO SSLContext
settings = do
ctx <- baselineContextSSL
contextSetVerificationMode ctx VerifyNone
return ctx | 164 | settings :: IO SSLContext
settings = do
ctx <- baselineContextSSL
contextSetVerificationMode ctx VerifyNone
return ctx | 125 | settings = do
ctx <- baselineContextSSL
contextSetVerificationMode ctx VerifyNone
return ctx | 99 | true | true | 0 | 8 | 26 | 42 | 17 | 25 | null | null |
vmchale/EMD | src/listbmp.hs | bsd-3-clause | generateMatrix1 :: Int -> Array DIM2 RGBA32
generateMatrix1 a = A.fromList sh list :: Array DIM2 Word32
where sh = (Z:.a:.1)
list = Prelude.map (Prelude.fromIntegral) (Prelude.fst (testList a)) | 207 | generateMatrix1 :: Int -> Array DIM2 RGBA32
generateMatrix1 a = A.fromList sh list :: Array DIM2 Word32
where sh = (Z:.a:.1)
list = Prelude.map (Prelude.fromIntegral) (Prelude.fst (testList a)) | 207 | generateMatrix1 a = A.fromList sh list :: Array DIM2 Word32
where sh = (Z:.a:.1)
list = Prelude.map (Prelude.fromIntegral) (Prelude.fst (testList a)) | 163 | false | true | 1 | 9 | 41 | 89 | 44 | 45 | null | null |
hferreiro/replay | compiler/iface/BinIface.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- The symbol table
--
putSymbolTable :: BinHandle -> Int -> UniqFM (Int,Name) -> IO ()
putSymbolTable bh next_off symtab = do
put_ bh next_off
let names = elems (array (0,next_off-1) (eltsUFM symtab))
mapM_ (\n -> serialiseNa... | 341 | putSymbolTable :: BinHandle -> Int -> UniqFM (Int,Name) -> IO ()
putSymbolTable bh next_off symtab = do
put_ bh next_off
let names = elems (array (0,next_off-1) (eltsUFM symtab))
mapM_ (\n -> serialiseName bh n symtab) names | 236 | putSymbolTable bh next_off symtab = do
put_ bh next_off
let names = elems (array (0,next_off-1) (eltsUFM symtab))
mapM_ (\n -> serialiseName bh n symtab) names | 171 | true | true | 0 | 14 | 55 | 114 | 57 | 57 | null | null |
IgorRodic/fp16-Pongout | src/Level.hs | mit | brickY :: Brick -> Float
brickY (_, y, _) = y | 45 | brickY :: Brick -> Float
brickY (_, y, _) = y | 45 | brickY (_, y, _) = y | 20 | false | true | 0 | 8 | 10 | 33 | 16 | 17 | null | null |
AlexeyRaga/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | specTyConKey :: Unique
specTyConKey = mkPreludeTyConUnique 177 | 62 | specTyConKey :: Unique
specTyConKey = mkPreludeTyConUnique 177 | 62 | specTyConKey = mkPreludeTyConUnique 177 | 39 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
int-index/singletons | tests/compile-and-dump/Singletons/PatternMatching.hs | bsd-3-clause | test2 :: Proxy (Foo2 '(Int, Char)) -> Proxy Int
test2 = id | 58 | test2 :: Proxy (Foo2 '(Int, Char)) -> Proxy Int
test2 = id | 58 | test2 = id | 10 | false | true | 0 | 10 | 11 | 35 | 18 | 17 | null | null |
zhenyavinogradov/ml-labs | src/Lab5/Main.hs | gpl-3.0 | main :: IO ()
main = do
-- hSetEncoding stdout utf8
-- hSetEncoding stderr utf8
tuneAndPlot nwGauss "tmp/lab5/NWGauss.png" "Nadaraya Watson, Gauss kernel" gaussParams
tuneAndPlot
(\NonGaussParam {..} -> nwPredict rectangularKernel ngk)
"tmp/lab5/NWRectangular.png"
"Nadaraya Watson,... | 1,569 | main :: IO ()
main = do
-- hSetEncoding stdout utf8
-- hSetEncoding stderr utf8
tuneAndPlot nwGauss "tmp/lab5/NWGauss.png" "Nadaraya Watson, Gauss kernel" gaussParams
tuneAndPlot
(\NonGaussParam {..} -> nwPredict rectangularKernel ngk)
"tmp/lab5/NWRectangular.png"
"Nadaraya Watson,... | 1,569 | main = do
-- hSetEncoding stdout utf8
-- hSetEncoding stderr utf8
tuneAndPlot nwGauss "tmp/lab5/NWGauss.png" "Nadaraya Watson, Gauss kernel" gaussParams
tuneAndPlot
(\NonGaussParam {..} -> nwPredict rectangularKernel ngk)
"tmp/lab5/NWRectangular.png"
"Nadaraya Watson, Rectangular k... | 1,555 | false | true | 1 | 11 | 409 | 371 | 181 | 190 | null | null |
valderman/mcctl | src/MCCtl/DBus.hs | bsd-3-clause | dbusCallWith :: Client -> MemberName -> [Variant] -> IO MethodReturn
dbusCallWith client memb args = do
res <- call_ client $ dbusMeth memb args
return res | 159 | dbusCallWith :: Client -> MemberName -> [Variant] -> IO MethodReturn
dbusCallWith client memb args = do
res <- call_ client $ dbusMeth memb args
return res | 159 | dbusCallWith client memb args = do
res <- call_ client $ dbusMeth memb args
return res | 90 | false | true | 0 | 10 | 29 | 66 | 29 | 37 | null | null |
gnn/Hets | Syntax/Parse_AS_Library.hs | gpl-2.0 | metaP :: AParser st (FRAM, Token)
metaP = do
s <- asKey metaS
f <- framP
return (f, s) | 92 | metaP :: AParser st (FRAM, Token)
metaP = do
s <- asKey metaS
f <- framP
return (f, s) | 92 | metaP = do
s <- asKey metaS
f <- framP
return (f, s) | 58 | false | true | 0 | 8 | 24 | 51 | 25 | 26 | null | null |
iatorm/grime | Expression.hs | mit | orient Edge _ = Edge | 20 | orient Edge _ = Edge | 20 | orient Edge _ = Edge | 20 | false | false | 0 | 4 | 4 | 13 | 5 | 8 | null | null |
leepike/copilot-language | src/Copilot/Language/Operators/Boolean.hs | bsd-3-clause | (&&) :: Stream Bool -> Stream Bool -> Stream Bool
(Const False) && _ = false | 76 | (&&) :: Stream Bool -> Stream Bool -> Stream Bool
(Const False) && _ = false | 76 | (Const False) && _ = false | 26 | false | true | 0 | 7 | 15 | 42 | 20 | 22 | null | null |
ghcjs/ghcjs-base | test/Tests/Properties.hs | mit | j_toUpper_upper t = p (J.toUpper t) >= p t
where p = J.length . J.filter isUpper | 84 | j_toUpper_upper t = p (J.toUpper t) >= p t
where p = J.length . J.filter isUpper | 84 | j_toUpper_upper t = p (J.toUpper t) >= p t
where p = J.length . J.filter isUpper | 84 | false | false | 0 | 9 | 19 | 46 | 21 | 25 | null | null |
DanielWaterworth/Idris-dev | src/Idris/ParseData.hs | bsd-3-clause | dataOpts :: DataOpts -> IdrisParser DataOpts
dataOpts opts
= do reserved "%elim"; dataOpts (DefaultEliminator : opts)
<|> do reserved "%error_reverse"; dataOpts (DataErrRev : opts)
<|> return opts
<?> "data options" | 225 | dataOpts :: DataOpts -> IdrisParser DataOpts
dataOpts opts
= do reserved "%elim"; dataOpts (DefaultEliminator : opts)
<|> do reserved "%error_reverse"; dataOpts (DataErrRev : opts)
<|> return opts
<?> "data options" | 225 | dataOpts opts
= do reserved "%elim"; dataOpts (DefaultEliminator : opts)
<|> do reserved "%error_reverse"; dataOpts (DataErrRev : opts)
<|> return opts
<?> "data options" | 180 | false | true | 8 | 9 | 39 | 84 | 39 | 45 | null | null |
isomorphism/hackage2 | Distribution/Server/Util/NameIndex.hs | bsd-3-clause | lookupPrefix :: String -> NameIndex -> Set String
lookupPrefix caseName (NameIndex index _ _ _) =
let name = map toLower caseName
(_, mentry, startTree) = Map.splitLookup name index
-- the idea is, select all names in the range [name, mapLast succ name)
-- an alternate idea would just be to ... | 511 | lookupPrefix :: String -> NameIndex -> Set String
lookupPrefix caseName (NameIndex index _ _ _) =
let name = map toLower caseName
(_, mentry, startTree) = Map.splitLookup name index
-- the idea is, select all names in the range [name, mapLast succ name)
-- an alternate idea would just be to ... | 511 | lookupPrefix caseName (NameIndex index _ _ _) =
let name = map toLower caseName
(_, mentry, startTree) = Map.splitLookup name index
-- the idea is, select all names in the range [name, mapLast succ name)
-- an alternate idea would just be to takeWhile (`isPrefixOf` name)
(totalTree, ... | 461 | false | true | 0 | 11 | 120 | 136 | 67 | 69 | null | null |
wmarvel/haskellrogue | src/Level/LevelGen.hs | mit | randomGrid :: Coord -> Coord -> Int -> IO Grid
randomGrid gmin gmax cnt = do
rooms <- generateRooms gmin gmax grid cnt
maze <- mazify MazeOldest $ placeRooms grid rooms
linked <- linkGrid maze rooms
pure $ fillDeadEnds linked
where
grid = emptyUnlinkedGrid gmin gmax | 280 | randomGrid :: Coord -> Coord -> Int -> IO Grid
randomGrid gmin gmax cnt = do
rooms <- generateRooms gmin gmax grid cnt
maze <- mazify MazeOldest $ placeRooms grid rooms
linked <- linkGrid maze rooms
pure $ fillDeadEnds linked
where
grid = emptyUnlinkedGrid gmin gmax | 280 | randomGrid gmin gmax cnt = do
rooms <- generateRooms gmin gmax grid cnt
maze <- mazify MazeOldest $ placeRooms grid rooms
linked <- linkGrid maze rooms
pure $ fillDeadEnds linked
where
grid = emptyUnlinkedGrid gmin gmax | 233 | false | true | 1 | 9 | 59 | 112 | 47 | 65 | null | null |
ancientlanguage/haskell-analysis | prepare/src/Prepare/Decompose.hs | mit | decomposeChar '\x2F9DC' = "\x8DF0" | 34 | decomposeChar '\x2F9DC' = "\x8DF0" | 34 | decomposeChar '\x2F9DC' = "\x8DF0" | 34 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
ku-fpg/kansas-amber | legacy/Shallow/SevenSegment.hs | bsd-3-clause | -- | Connections for the Texas Instruments 74HC595 shift-register. Datasheet: <http://www.ti.com/lit/ds/symlink/sn74hc595.pdf>.
-- In our circuit, we merely use pins 8 thru 12 on the Arduino to control the 'serial', 'enable', 'rClock', 'sClock', and 'nClear'
-- lines, respectively. Since we do not need to read the outp... | 608 | sr :: SR_74HC595
sr = SR_74HC595 { serial = 8
, nEnable = 9
, rClock = 10
, sClock = 11
, nClear = 12
, mbBits = Nothing
} | 223 | sr = SR_74HC595 { serial = 8
, nEnable = 9
, rClock = 10
, sClock = 11
, nClear = 12
, mbBits = Nothing
} | 206 | true | true | 0 | 7 | 186 | 62 | 36 | 26 | null | null |
jeffreyrosenbluth/Sheet | src/Sheet.hs | bsd-3-clause | reconcile :: Entry -> [Payment]
reconcile e = if M.size e >= 2
then
case pairOff e of
Nothing -> error "THE SKY IS FALLING, TRIED TO PAIR OFF AN EMPTY MAP."
Just (p, e') -> p : reconcile e'
else [] | 217 | reconcile :: Entry -> [Payment]
reconcile e = if M.size e >= 2
then
case pairOff e of
Nothing -> error "THE SKY IS FALLING, TRIED TO PAIR OFF AN EMPTY MAP."
Just (p, e') -> p : reconcile e'
else [] | 217 | reconcile e = if M.size e >= 2
then
case pairOff e of
Nothing -> error "THE SKY IS FALLING, TRIED TO PAIR OFF AN EMPTY MAP."
Just (p, e') -> p : reconcile e'
else [] | 185 | false | true | 0 | 10 | 61 | 78 | 39 | 39 | null | null |
aurapm/haskell-versions | Data/Versions.hs | bsd-3-clause | mchunkText (MRev _ t) = t | 27 | mchunkText (MRev _ t) = t | 27 | mchunkText (MRev _ t) = t | 27 | false | false | 0 | 7 | 7 | 17 | 8 | 9 | null | null |
Slava/6.035-decaf-compiler | src/LLIR.hs | mit | -- get all uses that this instruction is used by (ie all things this function is depended on)
getUses :: VInstruction -> VFunction -> [Use]
getUses inst func =
let instM = (functionInstructions func)
isValid :: (Use -> Maybe Use) = \mval -> do
val <- getUseValue func mval
ninst <- case val o... | 536 | getUses :: VInstruction -> VFunction -> [Use]
getUses inst func =
let instM = (functionInstructions func)
isValid :: (Use -> Maybe Use) = \mval -> do
val <- getUseValue func mval
ninst <- case val of
InstRef a -> HashMap.lookup a instM
_ -> Nothing
if inst =... | 442 | getUses inst func =
let instM = (functionInstructions func)
isValid :: (Use -> Maybe Use) = \mval -> do
val <- getUseValue func mval
ninst <- case val of
InstRef a -> HashMap.lookup a instM
_ -> Nothing
if inst == ninst then Just mval else Nothing
in c... | 396 | true | true | 0 | 17 | 152 | 168 | 82 | 86 | null | null |
ekmett/multipass | Data/Pass/Robust.hs | bsd-3-clause | tercile :: (Robust l, Fractional a, Ord a) => Rational -> l a a
tercile n = quantile (n/3) | 90 | tercile :: (Robust l, Fractional a, Ord a) => Rational -> l a a
tercile n = quantile (n/3) | 90 | tercile n = quantile (n/3) | 26 | false | true | 0 | 7 | 18 | 54 | 27 | 27 | null | null |
dsj36/dropray | src/Core/Primitive.hs | gpl-3.0 | worldBound :: Aggregate -> BBox
worldBound = undefined | 54 | worldBound :: Aggregate -> BBox
worldBound = undefined | 54 | worldBound = undefined | 22 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
lynnard/cocos2d-hs | src/Graphics/UI/Cocos2d/Event.hs | bsd-3-clause | eventTouchVectorIterator_new :: HoppyP.IO EventTouchVectorIterator
eventTouchVectorIterator_new =
HoppyP.fmap EventTouchVectorIterator
(eventTouchVectorIterator_new') | 171 | eventTouchVectorIterator_new :: HoppyP.IO EventTouchVectorIterator
eventTouchVectorIterator_new =
HoppyP.fmap EventTouchVectorIterator
(eventTouchVectorIterator_new') | 171 | eventTouchVectorIterator_new =
HoppyP.fmap EventTouchVectorIterator
(eventTouchVectorIterator_new') | 103 | false | true | 0 | 6 | 13 | 27 | 13 | 14 | null | null |
aslatter/smallstring | Data/SmallString.hs | bsd-3-clause | compareSmallString :: SmallString -> SmallString -> Ordering
compareSmallString (SmallString lhsAry) (SmallString rhsAry)
= compare lhsAry rhsAry | 149 | compareSmallString :: SmallString -> SmallString -> Ordering
compareSmallString (SmallString lhsAry) (SmallString rhsAry)
= compare lhsAry rhsAry | 149 | compareSmallString (SmallString lhsAry) (SmallString rhsAry)
= compare lhsAry rhsAry | 88 | false | true | 0 | 7 | 19 | 41 | 20 | 21 | null | null |
gridaphobe/cabal2nix | cabal2nix/src/Main.hs | bsd-3-clause | main :: IO ()
main = bracket (return ()) (\() -> hFlush stdout >> hFlush stderr) $ \() -> do
Options {..} <- execParser pinfo
pkg <- getPackage optHackageDb $ Source optUrl (fromMaybe "" optRevision) (maybe UnknownHash Guess optSha256)
let deriv :: Derivation
deriv = fromGenericPackageDescription (const T... | 2,296 | main :: IO ()
main = bracket (return ()) (\() -> hFlush stdout >> hFlush stderr) $ \() -> do
Options {..} <- execParser pinfo
pkg <- getPackage optHackageDb $ Source optUrl (fromMaybe "" optRevision) (maybe UnknownHash Guess optSha256)
let deriv :: Derivation
deriv = fromGenericPackageDescription (const T... | 2,296 | main = bracket (return ()) (\() -> hFlush stdout >> hFlush stderr) $ \() -> do
Options {..} <- execParser pinfo
pkg <- getPackage optHackageDb $ Source optUrl (fromMaybe "" optRevision) (maybe UnknownHash Guess optSha256)
let deriv :: Derivation
deriv = fromGenericPackageDescription (const True)
... | 2,282 | false | true | 0 | 39 | 970 | 488 | 243 | 245 | null | null |
ideas-edu/ideas | src/Ideas/Common/Strategy/Location.hs | apache-2.0 | strategyLocations :: LabeledStrategy a -> [([Int], Id)]
strategyLocations s = ([], getId s) : make s
where
make = nrs . fold alg . toStrategyTree . unlabel
alg = monoidAlg
{ fLeaf = \a -> [(getId a, [])]
, fLabel = \l x -> [(l, nrs x)]
}
nrs = concat . zipWith f [0..]
f i ... | 372 | strategyLocations :: LabeledStrategy a -> [([Int], Id)]
strategyLocations s = ([], getId s) : make s
where
make = nrs . fold alg . toStrategyTree . unlabel
alg = monoidAlg
{ fLeaf = \a -> [(getId a, [])]
, fLabel = \l x -> [(l, nrs x)]
}
nrs = concat . zipWith f [0..]
f i (... | 371 | strategyLocations s = ([], getId s) : make s
where
make = nrs . fold alg . toStrategyTree . unlabel
alg = monoidAlg
{ fLeaf = \a -> [(getId a, [])]
, fLabel = \l x -> [(l, nrs x)]
}
nrs = concat . zipWith f [0..]
f i (l, xs) = ([i], l) : [ (i:is, l2) | (is, l2) <- xs ] | 315 | false | true | 0 | 10 | 118 | 209 | 115 | 94 | null | null |
jamesdarcy/DicomH | src/Data/Dicom.hs | bsd-3-clause | getDicomSSValue :: Int -> Get DicomValue
getDicomSSValue length
| length == 2 = do
ss <- getWord16le -- Fix!!! Assumes LE
return (DicomSS (fromIntegral ss))
| length `mod` 2 == 0 = do
ssList <- getDicomSSList length
return (DicomSSList ssList)
| otherwise = fail $ "Non-integral VM for SS. Length="... | 335 | getDicomSSValue :: Int -> Get DicomValue
getDicomSSValue length
| length == 2 = do
ss <- getWord16le -- Fix!!! Assumes LE
return (DicomSS (fromIntegral ss))
| length `mod` 2 == 0 = do
ssList <- getDicomSSList length
return (DicomSSList ssList)
| otherwise = fail $ "Non-integral VM for SS. Length="... | 335 | getDicomSSValue length
| length == 2 = do
ss <- getWord16le -- Fix!!! Assumes LE
return (DicomSS (fromIntegral ss))
| length `mod` 2 == 0 = do
ssList <- getDicomSSList length
return (DicomSSList ssList)
| otherwise = fail $ "Non-integral VM for SS. Length=" ++ show length | 294 | false | true | 1 | 13 | 74 | 120 | 55 | 65 | null | null |
emwap/feldspar-language | src/Feldspar/Repa.hs | bsd-3-clause | tVec2 :: Patch a a -> Patch (Vector DIM2 (Data a)) (Vector DIM2 (Data a))
tVec2 _ = id | 86 | tVec2 :: Patch a a -> Patch (Vector DIM2 (Data a)) (Vector DIM2 (Data a))
tVec2 _ = id | 86 | tVec2 _ = id | 12 | false | true | 0 | 11 | 18 | 61 | 28 | 33 | null | null |
santolucito/ives | tests/music2.hs | mit | myN = Note 4 c' | 15 | myN = Note 4 c' | 15 | myN = Note 4 c' | 15 | false | false | 1 | 5 | 4 | 14 | 5 | 9 | null | null |
hirokai/PaperServer | Model/PaperMongo.hs | bsd-2-clause | --
-- BSON <=> Paper data types conversion.
--
bsonFromPaper :: PaperId -> Paper -> Bson.Document
bsonFromPaper
pid
(Paper doi url orig abs mainh mcit refs figs res toc tags note misc pinfo supp mavail email time)
= undefined | 232 | bsonFromPaper :: PaperId -> Paper -> Bson.Document
bsonFromPaper
pid
(Paper doi url orig abs mainh mcit refs figs res toc tags note misc pinfo supp mavail email time)
= undefined | 184 | bsonFromPaper
pid
(Paper doi url orig abs mainh mcit refs figs res toc tags note misc pinfo supp mavail email time)
= undefined | 133 | true | true | 0 | 7 | 45 | 71 | 36 | 35 | null | null |
mettekou/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprCtOrigin (DerivOriginDC dc n)
= hang (ctoHerald <+> text "the" <+> speakNth n
<+> text "field of" <+> quotes (ppr dc))
2 (parens (text "type" <+> quotes (ppr ty)))
where
ty = dataConOrigArgTys dc !! (n-1) | 232 | pprCtOrigin (DerivOriginDC dc n)
= hang (ctoHerald <+> text "the" <+> speakNth n
<+> text "field of" <+> quotes (ppr dc))
2 (parens (text "type" <+> quotes (ppr ty)))
where
ty = dataConOrigArgTys dc !! (n-1) | 232 | pprCtOrigin (DerivOriginDC dc n)
= hang (ctoHerald <+> text "the" <+> speakNth n
<+> text "field of" <+> quotes (ppr dc))
2 (parens (text "type" <+> quotes (ppr ty)))
where
ty = dataConOrigArgTys dc !! (n-1) | 232 | false | false | 1 | 11 | 60 | 115 | 51 | 64 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Protocol.hs | bsd-3-clause | parseQueryResult (IterateIL8E _ _ _) (IterateL8Reply r) = Just $ lit r | 70 | parseQueryResult (IterateIL8E _ _ _) (IterateL8Reply r) = Just $ lit r | 70 | parseQueryResult (IterateIL8E _ _ _) (IterateL8Reply r) = Just $ lit r | 70 | false | false | 0 | 7 | 11 | 34 | 16 | 18 | null | null |
christiaanb/clash-tryout | src/CLaSH/Util/Pretty.hs | bsd-3-clause | encode_as_unicode_char :: Char -> EncodedString
encode_as_unicode_char c = 'z' : if isDigit (head hex_str) then hex_str
else '0':hex_str
where hex_str = showHex (ord c) "U" | 233 | encode_as_unicode_char :: Char -> EncodedString
encode_as_unicode_char c = 'z' : if isDigit (head hex_str) then hex_str
else '0':hex_str
where hex_str = showHex (ord c) "U" | 233 | encode_as_unicode_char c = 'z' : if isDigit (head hex_str) then hex_str
else '0':hex_str
where hex_str = showHex (ord c) "U" | 185 | false | true | 0 | 9 | 85 | 62 | 31 | 31 | null | null |
TomMD/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | word32PrimTyConKey = mkPreludeTyConUnique 62 | 65 | word32PrimTyConKey = mkPreludeTyConUnique 62 | 65 | word32PrimTyConKey = mkPreludeTyConUnique 62 | 65 | false | false | 0 | 5 | 24 | 9 | 4 | 5 | null | null |
sdiehl/ghc | compiler/typecheck/TcEvidence.hs | bsd-3-clause | mkTcTyConAppCo = mkTyConAppCo | 37 | mkTcTyConAppCo = mkTyConAppCo | 37 | mkTcTyConAppCo = mkTyConAppCo | 37 | false | false | 1 | 5 | 10 | 10 | 3 | 7 | null | null |
tdietert/nanocoin | src/Nanocoin/Block.hs | apache-2.0 | -- | Verify a block's ECDSA signature
verifyBlockSignature
:: Block
-> Either InvalidBlock ()
verifyBlockSignature b = do
let originKey = origin $ header b
case S.decode (signature b) of
Left err -> Left $ InvalidBlockSignature (toS err)
Right sig -> do
let validSig = Key.verify originKey sig (S.e... | 504 | verifyBlockSignature
:: Block
-> Either InvalidBlock ()
verifyBlockSignature b = do
let originKey = origin $ header b
case S.decode (signature b) of
Left err -> Left $ InvalidBlockSignature (toS err)
Right sig -> do
let validSig = Key.verify originKey sig (S.encode $ header b)
unless validSi... | 466 | verifyBlockSignature b = do
let originKey = origin $ header b
case S.decode (signature b) of
Left err -> Left $ InvalidBlockSignature (toS err)
Right sig -> do
let validSig = Key.verify originKey sig (S.encode $ header b)
unless validSig $
Left $ InvalidBlockSignature "Could not verify b... | 406 | true | true | 0 | 20 | 113 | 145 | 65 | 80 | null | null |
mortberg/AlgTop | Algebra/SNF_Bezout.hs | bsd-3-clause | -- | Compute the Smith normal form of a matrix.
smith :: (BezoutDomain a, Eq a) => Mat a -> Mat a
smith Empty = Empty | 132 | smith :: (BezoutDomain a, Eq a) => Mat a -> Mat a
smith Empty = Empty | 82 | smith Empty = Empty | 32 | true | true | 0 | 7 | 40 | 44 | 21 | 23 | null | null |
GaloisInc/galua | lib/macho/src/Data/Macho.hs | mit | mach_cpusubtype CPU_TYPE_POWERPC64 10 = CPU_SUBTYPE_POWERPC_7400 | 65 | mach_cpusubtype CPU_TYPE_POWERPC64 10 = CPU_SUBTYPE_POWERPC_7400 | 65 | mach_cpusubtype CPU_TYPE_POWERPC64 10 = CPU_SUBTYPE_POWERPC_7400 | 65 | false | false | 0 | 5 | 5 | 13 | 5 | 8 | null | null |
gbataille/pandoc | src/Text/Pandoc/Readers/CommonMark.hs | gpl-2.0 | addInline (Node _ (INLINE_HTML t) _) =
(RawInline (Format "html") (unpack t) :) | 81 | addInline (Node _ (INLINE_HTML t) _) =
(RawInline (Format "html") (unpack t) :) | 81 | addInline (Node _ (INLINE_HTML t) _) =
(RawInline (Format "html") (unpack t) :) | 81 | false | false | 0 | 9 | 14 | 46 | 23 | 23 | null | null |
plow-technologies/persistent | persistent/Database/Persist/Sql/Class.hs | mit | to7 :: ((a,b),(c,d),(e,f),g) -> (a,b,c,d,e,f,g)
to7 ((a,b),(c,d),(e,f),g) = (a,b,c,d,e,f,g) | 91 | to7 :: ((a,b),(c,d),(e,f),g) -> (a,b,c,d,e,f,g)
to7 ((a,b),(c,d),(e,f),g) = (a,b,c,d,e,f,g) | 91 | to7 ((a,b),(c,d),(e,f),g) = (a,b,c,d,e,f,g) | 43 | false | true | 0 | 7 | 8 | 120 | 77 | 43 | null | null |
tsbattman/havro | src/Data/Avro/Schema.hs | apache-2.0 | doubleSchema = PrimitiveSchema DoubleSchema | 43 | doubleSchema = PrimitiveSchema DoubleSchema | 43 | doubleSchema = PrimitiveSchema DoubleSchema | 43 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
yesodweb/persistent | persistent-mysql/Database/Persist/MySQL.hs | mit | migrate' :: MySQL.ConnectInfo
-> [EntityDef]
-> (Text -> IO Statement)
-> EntityDef
-> IO (Either [Text] [(Bool, Text)])
migrate' connectInfo allDefs getter val = do
let name = getEntityDBName val
let (newcols, udefs, fdefs) = mysqlMkColumns allDefs val
old <- getColumns ... | 3,834 | migrate' :: MySQL.ConnectInfo
-> [EntityDef]
-> (Text -> IO Statement)
-> EntityDef
-> IO (Either [Text] [(Bool, Text)])
migrate' connectInfo allDefs getter val = do
let name = getEntityDBName val
let (newcols, udefs, fdefs) = mysqlMkColumns allDefs val
old <- getColumns ... | 3,834 | migrate' connectInfo allDefs getter val = do
let name = getEntityDBName val
let (newcols, udefs, fdefs) = mysqlMkColumns allDefs val
old <- getColumns connectInfo getter val newcols
let udspair = map udToPair udefs
case ([], old, partitionEithers old) of
-- Nothing found, create everything
... | 3,677 | false | true | 20 | 31 | 2,121 | 828 | 421 | 407 | null | null |
CindyLinz/Haskell.js | trans/src/Desugar/Tuple.hs | mit | deTupleAsst (EqualP l type1 type2) = EqualP (id l) (deTupleType type1) (deTupleType type2) | 90 | deTupleAsst (EqualP l type1 type2) = EqualP (id l) (deTupleType type1) (deTupleType type2) | 90 | deTupleAsst (EqualP l type1 type2) = EqualP (id l) (deTupleType type1) (deTupleType type2) | 90 | false | false | 0 | 7 | 12 | 45 | 21 | 24 | null | null |
hbrouwer/pdrt-sandbox | tutorials/PDRSTutorial.hs | apache-2.0 | -- | "A man believes he loves a woman."
examplePDRS5 = PDRS 1 [] [PRef 1 (PDRSRef "x"),PRef 1 (PDRSRef "p")]
[PCon 1 (Rel (PDRSRel "man") [PDRSRef "x"])
,PCon 1 (Rel (PDRSRel "believes") [PDRSRef "x",PDRSRef "p"])
,PCon 1 (Prop (PDRSRef "p")
(PD... | 507 | examplePDRS5 = PDRS 1 [] [PRef 1 (PDRSRef "x"),PRef 1 (PDRSRef "p")]
[PCon 1 (Rel (PDRSRel "man") [PDRSRef "x"])
,PCon 1 (Rel (PDRSRel "believes") [PDRSRef "x",PDRSRef "p"])
,PCon 1 (Prop (PDRSRef "p")
(PDRS 2 [(2,3)] [PRef 3 (PDRSRef "y")]
... | 467 | examplePDRS5 = PDRS 1 [] [PRef 1 (PDRSRef "x"),PRef 1 (PDRSRef "p")]
[PCon 1 (Rel (PDRSRel "man") [PDRSRef "x"])
,PCon 1 (Rel (PDRSRel "believes") [PDRSRef "x",PDRSRef "p"])
,PCon 1 (Prop (PDRSRef "p")
(PDRS 2 [(2,3)] [PRef 3 (PDRSRef "y")]
... | 467 | true | false | 0 | 17 | 181 | 227 | 115 | 112 | null | null |
supki/meep | src/Data/Meep.hs | bsd-2-clause | -- | /O(1)/. Return all values from the 'Meep'
--
-- >>> elems (singleton 4 "foo")
-- Just "foo"
--
-- >>> elems empty
-- Nothing
elems :: Meep k a -> Maybe a
elems Empty = Nothing | 185 | elems :: Meep k a -> Maybe a
elems Empty = Nothing | 55 | elems Empty = Nothing | 26 | true | true | 0 | 6 | 42 | 33 | 19 | 14 | null | null |
mattias-lundell/timber-llvm | src/Desugar2.hs | bsd-3-clause | dsQualPred (TQual t ps) = checkQual (dsSubOrClassPred t) (map dsQual ps) | 80 | dsQualPred (TQual t ps) = checkQual (dsSubOrClassPred t) (map dsQual ps) | 80 | dsQualPred (TQual t ps) = checkQual (dsSubOrClassPred t) (map dsQual ps) | 80 | false | false | 0 | 7 | 18 | 36 | 17 | 19 | null | null |
fferreira/hnh | TypeUtils.hs | gpl-3.0 | getConstType :: [DataType] -> Name -> Maybe Type
getConstType dts n =
find isData dts >>= return . fst
where
isData (_, cons) = case find isCon cons of Just _ -> True
Nothing -> False
isCon (ConDcl n' _) = n == n' | 280 | getConstType :: [DataType] -> Name -> Maybe Type
getConstType dts n =
find isData dts >>= return . fst
where
isData (_, cons) = case find isCon cons of Just _ -> True
Nothing -> False
isCon (ConDcl n' _) = n == n' | 280 | getConstType dts n =
find isData dts >>= return . fst
where
isData (_, cons) = case find isCon cons of Just _ -> True
Nothing -> False
isCon (ConDcl n' _) = n == n' | 231 | false | true | 2 | 8 | 110 | 114 | 53 | 61 | null | null |
plow-technologies/dom-gnats | src/FRP/TimeFlies/DOM.hs | mit | runWidget :: Widget WidgetStop (SVEvent a) (SVEvent (IO a)) -> IO ()
runWidget widget = do
root <- mkRoot
vmount <- mount root $ text ""
renderer <- mkRenderer
timeNow <- epochSecondsNow
widgetStateMVar <- newEmptyMVar
putMVar widgetStateMVar $ initSFEval
(signalHandler (\gnat ->
let pushDomEvent... | 978 | runWidget :: Widget WidgetStop (SVEvent a) (SVEvent (IO a)) -> IO ()
runWidget widget = do
root <- mkRoot
vmount <- mount root $ text ""
renderer <- mkRenderer
timeNow <- epochSecondsNow
widgetStateMVar <- newEmptyMVar
putMVar widgetStateMVar $ initSFEval
(signalHandler (\gnat ->
let pushDomEvent... | 978 | runWidget widget = do
root <- mkRoot
vmount <- mount root $ text ""
renderer <- mkRenderer
timeNow <- epochSecondsNow
widgetStateMVar <- newEmptyMVar
putMVar widgetStateMVar $ initSFEval
(signalHandler (\gnat ->
let pushDomEvent = (\domEvt -> do
evalState <- takeMVar widgetStateMVar
... | 909 | false | true | 0 | 27 | 242 | 319 | 151 | 168 | null | null |
cartazio/scoutess | Scoutess/Core.hs | bsd-3-clause | findIn :: [PackageIdentifier] -> Set VersionInfo -> [VersionInfo]
findIn pkgIdens vis = mapMaybe (\pkgIden -> fst <$> S.maxView (S.filter ((pkgIden ==) . viPackageIden) vis)) pkgIdens | 183 | findIn :: [PackageIdentifier] -> Set VersionInfo -> [VersionInfo]
findIn pkgIdens vis = mapMaybe (\pkgIden -> fst <$> S.maxView (S.filter ((pkgIden ==) . viPackageIden) vis)) pkgIdens | 183 | findIn pkgIdens vis = mapMaybe (\pkgIden -> fst <$> S.maxView (S.filter ((pkgIden ==) . viPackageIden) vis)) pkgIdens | 117 | false | true | 0 | 14 | 24 | 76 | 40 | 36 | null | null |
cyruscousins/HarmLang | src/HarmLang/Parser.hs | mit | strToChordSpecial :: String -> Chord
strToChordSpecial "_" = Other "REST" | 73 | strToChordSpecial :: String -> Chord
strToChordSpecial "_" = Other "REST" | 73 | strToChordSpecial "_" = Other "REST" | 36 | false | true | 0 | 7 | 9 | 26 | 11 | 15 | null | null |
fmapfmapfmap/amazonka | amazonka-datapipeline/test/Test/AWS/Gen/DataPipeline.hs | mpl-2.0 | testSetStatus :: SetStatus -> TestTree
testSetStatus = req
"SetStatus"
"fixture/SetStatus.yaml" | 103 | testSetStatus :: SetStatus -> TestTree
testSetStatus = req
"SetStatus"
"fixture/SetStatus.yaml" | 103 | testSetStatus = req
"SetStatus"
"fixture/SetStatus.yaml" | 64 | false | true | 0 | 7 | 17 | 28 | 11 | 17 | null | null |
brendanhay/gogol | gogol-storage/gen/Network/Google/Resource/Storage/Buckets/Insert.hs | mpl-2.0 | -- | A valid API project identifier.
biProject :: Lens' BucketsInsert Text
biProject
= lens _biProject (\ s a -> s{_biProject = a}) | 133 | biProject :: Lens' BucketsInsert Text
biProject
= lens _biProject (\ s a -> s{_biProject = a}) | 96 | biProject
= lens _biProject (\ s a -> s{_biProject = a}) | 58 | true | true | 0 | 9 | 24 | 42 | 22 | 20 | null | null |
sopvop/cabal | Cabal/Distribution/PackageDescription/PrettyPrint.hs | bsd-3-clause | ppCondExecutables :: [(String, CondTree ConfVar [Dependency] Executable)] -> Doc
ppCondExecutables exes =
vcat [emptyLine $ text ("executable " ++ n)
$+$ nest indentWith (ppCondTree condTree Nothing ppExe)| (n,condTree) <- exes]
where
ppExe (Executable _ modulePath' buildIn... | 923 | ppCondExecutables :: [(String, CondTree ConfVar [Dependency] Executable)] -> Doc
ppCondExecutables exes =
vcat [emptyLine $ text ("executable " ++ n)
$+$ nest indentWith (ppCondTree condTree Nothing ppExe)| (n,condTree) <- exes]
where
ppExe (Executable _ modulePath' buildIn... | 923 | ppCondExecutables exes =
vcat [emptyLine $ text ("executable " ++ n)
$+$ nest indentWith (ppCondTree condTree Nothing ppExe)| (n,condTree) <- exes]
where
ppExe (Executable _ modulePath' buildInfo') Nothing =
(if modulePath' == "" then mempty else text "main-is:" <+>... | 842 | false | true | 0 | 11 | 241 | 255 | 128 | 127 | null | null |
tjakway/ghcjvm | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | bsd-3-clause | pprPat i (TildeP p) = parensIf (i > noPrec) $ char '~' <> pprPat appPrec p | 76 | pprPat i (TildeP p) = parensIf (i > noPrec) $ char '~' <> pprPat appPrec p | 76 | pprPat i (TildeP p) = parensIf (i > noPrec) $ char '~' <> pprPat appPrec p | 76 | false | false | 0 | 9 | 17 | 43 | 20 | 23 | null | null |
edsko/cabal | Cabal/src/Distribution/ParseUtils.hs | bsd-3-clause | parseBuildTool :: ReadP r Dependency
parseBuildTool = do name <- parseBuildToolNameQ
ver <- betweenSpaces $
parseVersionRangeQ <++ return anyVersion
return $ Dependency name ver | 244 | parseBuildTool :: ReadP r Dependency
parseBuildTool = do name <- parseBuildToolNameQ
ver <- betweenSpaces $
parseVersionRangeQ <++ return anyVersion
return $ Dependency name ver | 244 | parseBuildTool = do name <- parseBuildToolNameQ
ver <- betweenSpaces $
parseVersionRangeQ <++ return anyVersion
return $ Dependency name ver | 207 | false | true | 0 | 9 | 90 | 53 | 24 | 29 | null | null |
bionikspoon/playing-with-haskell---learnyouahaskell | functions.hs | mit | initials :: String -> String -> String
initials firstname lastname = [f] ++ ". " ++ [l] ++ "."
where (f:_) = firstname
(l:_) = lastname | 149 | initials :: String -> String -> String
initials firstname lastname = [f] ++ ". " ++ [l] ++ "."
where (f:_) = firstname
(l:_) = lastname | 149 | initials firstname lastname = [f] ++ ". " ++ [l] ++ "."
where (f:_) = firstname
(l:_) = lastname | 110 | false | true | 0 | 8 | 39 | 77 | 38 | 39 | null | null |
valderman/selda | selda-postgresql/src/Database/Selda/PostgreSQL.hs | mit | -- | Add the given username and password to the given connection information:
--
-- > withPostgreSQL ("my_db" `on` "example.com" `auth` ("user", "pass")) $ do
-- > ...
--
-- For more precise control over the connection options, you should modify
-- the 'PGConnectInfo' directly.
auth :: PGConnectInfo -> (T.Text, T... | 427 | auth :: PGConnectInfo -> (T.Text, T.Text) -> PGConnectInfo
auth ci (user, pass) = ci
{ pgUsername = Just user
, pgPassword = Just pass
} | 142 | auth ci (user, pass) = ci
{ pgUsername = Just user
, pgPassword = Just pass
} | 83 | true | true | 0 | 8 | 81 | 71 | 41 | 30 | null | null |
taojang/haskell-programming-book-exercise | src/ch10/LiveCoding.hs | bsd-3-clause | myOr :: [Bool] -> Bool
myOr = foldr (||) False | 46 | myOr :: [Bool] -> Bool
myOr = foldr (||) False | 46 | myOr = foldr (||) False | 23 | false | true | 0 | 7 | 9 | 31 | 15 | 16 | null | null |
izgzhen/hadrian | src/Rules/Generate.hs | mit | ghcSplitSource :: FilePath
ghcSplitSource = "driver/split/ghc-split.pl" | 71 | ghcSplitSource :: FilePath
ghcSplitSource = "driver/split/ghc-split.pl" | 71 | ghcSplitSource = "driver/split/ghc-split.pl" | 44 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
haskell-streaming/streaming | benchmarks/old/benchmarks.hs | bsd-3-clause | goo :: Int -> Int
goo = runIdentity . sum . take 1000 . forever . yield | 71 | goo :: Int -> Int
goo = runIdentity . sum . take 1000 . forever . yield | 71 | goo = runIdentity . sum . take 1000 . forever . yield | 53 | false | true | 0 | 8 | 16 | 41 | 18 | 23 | null | null |
wuzzeb/hs-webdriver | src/Test/WebDriver/Session.hs | bsd-3-clause | -- |No session history is saved.
noHistory :: SessionHistoryConfig
noHistory _ _ = [] | 85 | noHistory :: SessionHistoryConfig
noHistory _ _ = [] | 52 | noHistory _ _ = [] | 18 | true | true | 0 | 6 | 13 | 25 | 11 | 14 | null | null |
andyarvanitis/Idris-dev | src/Idris/IdeSlave.hs | bsd-3-clause | sexpToCommand (SexpList [SymbolAtom "refine", IntegerAtom line, StringAtom name, StringAtom hint]) = Just (ProofSearch False (fromInteger line) name [hint] Nothing) | 164 | sexpToCommand (SexpList [SymbolAtom "refine", IntegerAtom line, StringAtom name, StringAtom hint]) = Just (ProofSearch False (fromInteger line) name [hint] Nothing) | 164 | sexpToCommand (SexpList [SymbolAtom "refine", IntegerAtom line, StringAtom name, StringAtom hint]) = Just (ProofSearch False (fromInteger line) name [hint] Nothing) | 164 | false | false | 0 | 9 | 18 | 65 | 32 | 33 | null | null |
rrnewton/stack | src/Stack/Package.hs | bsd-3-clause | -- | Generic a @ResolveConditions@ using sensible defaults.
mkResolveConditions :: CompilerVersion -- ^ Compiler version
-> Platform -- ^ installation target platform
-> Map FlagName Bool -- ^ enabled flags
-> ResolveConditions
mkResolveConditions compilerVers... | 474 | mkResolveConditions :: CompilerVersion -- ^ Compiler version
-> Platform -- ^ installation target platform
-> Map FlagName Bool -- ^ enabled flags
-> ResolveConditions
mkResolveConditions compilerVersion (Platform arch os) flags = ResolveConditions
{ rcFla... | 414 | mkResolveConditions compilerVersion (Platform arch os) flags = ResolveConditions
{ rcFlags = flags
, rcCompilerVersion = compilerVersion
, rcOS = os
, rcArch = arch
} | 186 | true | true | 0 | 8 | 136 | 77 | 43 | 34 | null | null |
jozefg/cooked-pi | src/LambdaPi/HOAS.hs | mit | inferType (C s) = asks (M.lookup s . constants) >>= maybe mzero return | 70 | inferType (C s) = asks (M.lookup s . constants) >>= maybe mzero return | 70 | inferType (C s) = asks (M.lookup s . constants) >>= maybe mzero return | 70 | false | false | 0 | 10 | 12 | 40 | 18 | 22 | null | null |
jaspervdj/what-morphism | src/WhatMorphism/Inliner.hs | bsd-3-clause | --------------------------------------------------------------------------------
newInlinerState :: IO InlinerState
newInlinerState = InlinerState <$> newIORef M.empty | 167 | newInlinerState :: IO InlinerState
newInlinerState = InlinerState <$> newIORef M.empty | 86 | newInlinerState = InlinerState <$> newIORef M.empty | 51 | true | true | 0 | 7 | 10 | 24 | 12 | 12 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/Codebase/Metadata.hs | mit | starToR4 :: (Ord r, Ord n) => Star r n -> Relation4 r n Type Value
starToR4 = R4.fromList . fmap (\(r,n,_,(t,v)) -> (r,n,t,v)) . Star3.toList | 141 | starToR4 :: (Ord r, Ord n) => Star r n -> Relation4 r n Type Value
starToR4 = R4.fromList . fmap (\(r,n,_,(t,v)) -> (r,n,t,v)) . Star3.toList | 141 | starToR4 = R4.fromList . fmap (\(r,n,_,(t,v)) -> (r,n,t,v)) . Star3.toList | 74 | false | true | 0 | 11 | 25 | 97 | 54 | 43 | null | null |
jff/TeLLer | src/Term.hs | gpl-3.0 | deWith x = [x] | 14 | deWith x = [x] | 14 | deWith x = [x] | 14 | false | false | 1 | 5 | 3 | 15 | 6 | 9 | null | null |
SaneApp/webmachine | src/Network/Webmachine/DecisionCore.hs | bsd-3-clause | h11 :: (DecisionGraph m r) => ByteString -> Context r m Response
h11 h = case convertRequestDate h of
Nothing -> i12
Just t -> h12 t | 136 | h11 :: (DecisionGraph m r) => ByteString -> Context r m Response
h11 h = case convertRequestDate h of
Nothing -> i12
Just t -> h12 t | 136 | h11 h = case convertRequestDate h of
Nothing -> i12
Just t -> h12 t | 71 | false | true | 0 | 8 | 30 | 64 | 30 | 34 | null | null |
mdsteele/fallback | src/Fallback/State/Resources.hs | gpl-3.0 | fontSpec FontChancery18 = ("chancery.ttf", 18) | 46 | fontSpec FontChancery18 = ("chancery.ttf", 18) | 46 | fontSpec FontChancery18 = ("chancery.ttf", 18) | 46 | false | false | 1 | 5 | 4 | 18 | 8 | 10 | null | null |
sgillespie/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprMatchContextNoun LambdaExpr = text "lambda abstraction" | 63 | pprMatchContextNoun LambdaExpr = text "lambda abstraction" | 63 | pprMatchContextNoun LambdaExpr = text "lambda abstraction" | 63 | false | false | 0 | 5 | 10 | 12 | 5 | 7 | null | null |
PPitson/Deque | test/unit/HUnitTests.hs | bsd-3-clause | test18 = TestCase (assertEqual "first of non-empty deque" (Just 5) (firstDEQ $ fromListDEQ [5, 2, 6, 3, 1]) ) | 109 | test18 = TestCase (assertEqual "first of non-empty deque" (Just 5) (firstDEQ $ fromListDEQ [5, 2, 6, 3, 1]) ) | 109 | test18 = TestCase (assertEqual "first of non-empty deque" (Just 5) (firstDEQ $ fromListDEQ [5, 2, 6, 3, 1]) ) | 109 | false | false | 0 | 11 | 18 | 50 | 27 | 23 | null | null |
fmapfmapfmap/amazonka | amazonka-autoscaling/gen/Network/AWS/AutoScaling/Types/Product.hs | mpl-2.0 | -- | The device name exposed to the EC2 instance (for example, '\/dev\/sdh'
-- or 'xvdh').
bdmDeviceName :: Lens' BlockDeviceMapping Text
bdmDeviceName = lens _bdmDeviceName (\ s a -> s{_bdmDeviceName = a}) | 206 | bdmDeviceName :: Lens' BlockDeviceMapping Text
bdmDeviceName = lens _bdmDeviceName (\ s a -> s{_bdmDeviceName = a}) | 115 | bdmDeviceName = lens _bdmDeviceName (\ s a -> s{_bdmDeviceName = a}) | 68 | true | true | 1 | 9 | 31 | 46 | 23 | 23 | null | null |
bezirg/hlogo | src/Language/Logo/Prim.hs | bsd-3-clause | black :: Double
black = 0 | 25 | black :: Double
black = 0 | 25 | black = 0 | 9 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
brendanhay/gogol | gogol-consumersurveys/gen/Network/Google/ConsumerSurveys/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'FieldMask' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'fmId'
--
-- * 'fmFields'
fieldMask
:: FieldMask
fieldMask = FieldMask' {_fmId = Nothing, _fmFields = Nothing} | 283 | fieldMask
:: FieldMask
fieldMask = FieldMask' {_fmId = Nothing, _fmFields = Nothing} | 88 | fieldMask = FieldMask' {_fmId = Nothing, _fmFields = Nothing} | 61 | true | true | 1 | 7 | 53 | 36 | 22 | 14 | null | null |
imalsogreg/hl | src/Data/Conduit/List/TakeDrop.hs | bsd-3-clause | dropWhile :: Monad m => (a -> Bool) -> Conduit a m a
dropWhile p =
do m <- await
case m of
Nothing -> return ()
Just x | p x -> dropWhile p
| otherwise -> awaitForever yield | 208 | dropWhile :: Monad m => (a -> Bool) -> Conduit a m a
dropWhile p =
do m <- await
case m of
Nothing -> return ()
Just x | p x -> dropWhile p
| otherwise -> awaitForever yield | 208 | dropWhile p =
do m <- await
case m of
Nothing -> return ()
Just x | p x -> dropWhile p
| otherwise -> awaitForever yield | 155 | false | true | 0 | 13 | 74 | 97 | 43 | 54 | null | null |
ciderpunx/57-exercises-for-programmers | src/P42Parsing.hs | gpl-3.0 | salary :: [String] -> String
salary = (!!2) | 43 | salary :: [String] -> String
salary = (!!2) | 43 | salary = (!!2) | 14 | false | true | 0 | 6 | 7 | 22 | 13 | 9 | null | null |
osa1/Idris-dev | src/Idris/Core/ProofState.hs | bsd-3-clause | patvar n ctxt env tm = fail $ "Can't add pattern var at " ++ show tm | 68 | patvar n ctxt env tm = fail $ "Can't add pattern var at " ++ show tm | 68 | patvar n ctxt env tm = fail $ "Can't add pattern var at " ++ show tm | 68 | false | false | 1 | 6 | 16 | 32 | 12 | 20 | null | null |
PiffNP/HaskellProject | src/WhileParser.hs | bsd-3-clause | arrayEntryExpr :: Parser Expr
arrayEntryExpr =
do reserved "vector-ref"
var <- identifier
index <- expression
return $ ArrayEntry var index | 156 | arrayEntryExpr :: Parser Expr
arrayEntryExpr =
do reserved "vector-ref"
var <- identifier
index <- expression
return $ ArrayEntry var index | 156 | arrayEntryExpr =
do reserved "vector-ref"
var <- identifier
index <- expression
return $ ArrayEntry var index | 126 | false | true | 0 | 8 | 36 | 46 | 20 | 26 | null | null |
lukexi/rumpus | pristine/Lobby/Door.hs | bsd-3-clause | dW, dH :: Num a => a
dH = 2 | 28 | dW, dH :: Num a => a
dH = 2 | 27 | dH = 2 | 6 | false | true | 2 | 7 | 10 | 31 | 12 | 19 | null | null |
eddywestbrook/hobbits | archival/NuElim.hs | bsd-3-clause | mkNuElimData :: Q [Dec] -> Q [Dec]
mkNuElimData declsQ =
do decls <- declsQ
(cxt, cType, tName, constrs, tyvars) <- getNuElimInfo decls
fName <- newName "f"
x1Name <- newName "x1"
x2Name <- newName "x2"
clauses <- mapM (getClause (tName, fName, x1Name, x2Name)) constrs
mapN... | 4,730 | mkNuElimData :: Q [Dec] -> Q [Dec]
mkNuElimData declsQ =
do decls <- declsQ
(cxt, cType, tName, constrs, tyvars) <- getNuElimInfo decls
fName <- newName "f"
x1Name <- newName "x1"
x2Name <- newName "x2"
clauses <- mapM (getClause (tName, fName, x1Name, x2Name)) constrs
mapN... | 4,730 | mkNuElimData declsQ =
do decls <- declsQ
(cxt, cType, tName, constrs, tyvars) <- getNuElimInfo decls
fName <- newName "f"
x1Name <- newName "x1"
x2Name <- newName "x2"
clauses <- mapM (getClause (tName, fName, x1Name, x2Name)) constrs
mapNamesT <- mapNamesType (return cType... | 4,695 | false | true | 0 | 19 | 1,915 | 1,375 | 722 | 653 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DescribeBundleTasks.hs | mpl-2.0 | -- | One or more filters.
--
-- 'bundle-id' - The ID of the bundle task.
--
-- 'error-code' - If the task failed, the error code returned.
--
-- 'error-message' - If the task failed, the error message returned.
--
-- 'instance-id' - The ID of the instance.
--
-- 'progress' - The level of task completion, as a percentag... | 881 | dbtFilters :: Lens' DescribeBundleTasks [Filter]
dbtFilters = lens _dbtFilters (\s a -> s { _dbtFilters = a }) . _List | 118 | dbtFilters = lens _dbtFilters (\s a -> s { _dbtFilters = a }) . _List | 69 | true | true | 0 | 10 | 157 | 71 | 50 | 21 | null | null |
IxpertaSolutions/freer-effects | src/Control/Monad/Freer/Internal.hs | bsd-3-clause | replaceRelayS
:: s
-> (s -> a -> Eff (v ': effs) w)
-> (forall x. s -> t x -> (s -> Arr (v ': effs) x w) -> Eff (v ': effs) w)
-> Eff (t ': effs) a
-> Eff (v ': effs) w
replaceRelayS s' pure' bind = loop s'
where
loop s (Val x) = pure' s x
loop s (E u' q) = case decomp u' of
Right... | 709 | replaceRelayS
:: s
-> (s -> a -> Eff (v ': effs) w)
-> (forall x. s -> t x -> (s -> Arr (v ': effs) x w) -> Eff (v ': effs) w)
-> Eff (t ': effs) a
-> Eff (v ': effs) w
replaceRelayS s' pure' bind = loop s'
where
loop s (Val x) = pure' s x
loop s (E u' q) = case decomp u' of
Right... | 709 | replaceRelayS s' pure' bind = loop s'
where
loop s (Val x) = pure' s x
loop s (E u' q) = case decomp u' of
Right x -> bind s x k
Left u -> E (weaken u) (tsingleton (k s))
where
k s'' x = loop s'' $ qApp q x
-- | Interpret an effect by transforming it into another effect on top... | 520 | false | true | 0 | 18 | 208 | 279 | 137 | 142 | null | null |
quakehead/haskell-scheme | Types.hs | gpl-3.0 | showVal (Number n) = show n | 27 | showVal (Number n) = show n | 27 | showVal (Number n) = show n | 27 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
snoyberg/ghc | testsuite/tests/indexed-types/should_compile/NonLinearLHS.hs | bsd-3-clause | goo :: F Int Int -> F Bool Bool
goo (MkF xs) = MkF $ map odd xs | 63 | goo :: F Int Int -> F Bool Bool
goo (MkF xs) = MkF $ map odd xs | 63 | goo (MkF xs) = MkF $ map odd xs | 31 | false | true | 0 | 7 | 17 | 43 | 20 | 23 | null | null |
mpickering/ghc-exactprint | tests/examples/ghc8/T4170.hs | bsd-3-clause | lol :: Q [Dec]
lol = [d|
instance LOL Int
|] | 52 | lol :: Q [Dec]
lol = [d|
instance LOL Int
|] | 52 | lol = [d|
instance LOL Int
|] | 37 | false | true | 0 | 6 | 18 | 21 | 13 | 8 | null | null |
Motions/motions | src/Bio/Motions/PDB/Write.hs | apache-2.0 | space :: Builder
space = word8 . toEnum . fromEnum $ ' ' | 56 | space :: Builder
space = word8 . toEnum . fromEnum $ ' ' | 56 | space = word8 . toEnum . fromEnum $ ' ' | 39 | false | true | 0 | 7 | 12 | 23 | 12 | 11 | null | null |
cuklev/huseless-pastebin | src/Handler/Edit.hs | mit | getEditR :: Text -> Handler Html
getEditR p = do
pastes <- runDB $ selectList [ PasteEditId ==. p ] [ LimitTo 1 ]
case pastes of
[x] -> do
let paste = entityVal x
(pasteW, enctype) <- generateFormPost $ pasteForm $ Just paste
defaultLayout $ do
setTitl... | 416 | getEditR :: Text -> Handler Html
getEditR p = do
pastes <- runDB $ selectList [ PasteEditId ==. p ] [ LimitTo 1 ]
case pastes of
[x] -> do
let paste = entityVal x
(pasteW, enctype) <- generateFormPost $ pasteForm $ Just paste
defaultLayout $ do
setTitl... | 416 | getEditR p = do
pastes <- runDB $ selectList [ PasteEditId ==. p ] [ LimitTo 1 ]
case pastes of
[x] -> do
let paste = entityVal x
(pasteW, enctype) <- generateFormPost $ pasteForm $ Just paste
defaultLayout $ do
setTitle "Pastebin"
$(wh... | 383 | false | true | 0 | 17 | 146 | 134 | 62 | 72 | null | null |
kosmoskatten/ghost-lang | ghost-lang/src/GhostLang/Compiler.hs | mit | -- | Compile and link a set of modules from file. The file pointed out is the
-- module implementing "Main". From its dependencies the reading is
-- continued. If any fail occurs the result will be an error message,
-- otherwise the set of parsed modules.
compileAndLink :: FilePath -> IO (Either String (Program Intrins... | 687 | compileAndLink :: FilePath -> IO (Either String (Program IntrinsicSet))
compileAndLink root = do
mods <- fromFiles root
let maybeProgram = mods >>= linkProgram
return maybeProgram
-- | Read a set of modules from files. The file pointed out is the
-- module implementing "Main". From its dependencies the reading i... | 431 | compileAndLink root = do
mods <- fromFiles root
let maybeProgram = mods >>= linkProgram
return maybeProgram
-- | Read a set of modules from files. The file pointed out is the
-- module implementing "Main". From its dependencies the reading is
-- continued. If any fail occurs the result will be an error message,
... | 359 | true | true | 0 | 11 | 123 | 76 | 38 | 38 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.