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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ddssff/lens | src/Control/Lens/Lens.hs | bsd-3-clause | --------------------------
-- Constructing Lenses
--------------------------
-- | Build a 'Lens' from a getter and a setter.
--
-- @
-- 'lens' :: 'Functor' f => (s -> a) -> (s -> b -> t) -> (a -> f b) -> s -> f t
-- @
--
-- >>> s ^. lens getter setter
-- getter s
--
-- >>> s & lens getter setter .~ b
-- setter s b
--
... | 539 | lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b
lens sa sbt afb s = sbt s <$> afb (sa s) | 90 | lens sa sbt afb s = sbt s <$> afb (sa s) | 40 | true | true | 0 | 9 | 137 | 92 | 56 | 36 | null | null |
amar47shah/summer-2015-haskell-class | Lisp/Parser.hs | mit | loadSExps :: String -> IO (Either String [SExp])
loadSExps filename = do
result <- parseFromFile parseSExps filename
case result of
Right sexps -> return $ Right sexps
Left anError -> return $ Left (show anError) | 227 | loadSExps :: String -> IO (Either String [SExp])
loadSExps filename = do
result <- parseFromFile parseSExps filename
case result of
Right sexps -> return $ Right sexps
Left anError -> return $ Left (show anError) | 227 | loadSExps filename = do
result <- parseFromFile parseSExps filename
case result of
Right sexps -> return $ Right sexps
Left anError -> return $ Left (show anError) | 178 | false | true | 0 | 13 | 49 | 89 | 41 | 48 | null | null |
TGOlson/blockchain | lib/Data/Blockchain/Types/Hex.hs | bsd-3-clause | hex256LeadingZeros :: Word.Word -> Hex256
hex256LeadingZeros n = maxBound `div` Hex256 (16 ^ n) | 95 | hex256LeadingZeros :: Word.Word -> Hex256
hex256LeadingZeros n = maxBound `div` Hex256 (16 ^ n) | 95 | hex256LeadingZeros n = maxBound `div` Hex256 (16 ^ n) | 53 | false | true | 0 | 8 | 13 | 44 | 21 | 23 | null | null |
aisamanra/matterhorn | src/Draw/Main.hs | bsd-3-clause | renderChannelSelectPrompt :: ChatState -> Widget Name
renderChannelSelectPrompt st =
let cstr = st^.csChannelSelectState.channelSelectInput
in withDefAttr channelSelectPromptAttr $
(txt "Switch to channel [use ^ and $ to anchor]: ") <+>
(showCursor ChannelSelectString (Location (T.length cstr, 0)... | 404 | renderChannelSelectPrompt :: ChatState -> Widget Name
renderChannelSelectPrompt st =
let cstr = st^.csChannelSelectState.channelSelectInput
in withDefAttr channelSelectPromptAttr $
(txt "Switch to channel [use ^ and $ to anchor]: ") <+>
(showCursor ChannelSelectString (Location (T.length cstr, 0)... | 404 | renderChannelSelectPrompt st =
let cstr = st^.csChannelSelectState.channelSelectInput
in withDefAttr channelSelectPromptAttr $
(txt "Switch to channel [use ^ and $ to anchor]: ") <+>
(showCursor ChannelSelectString (Location (T.length cstr, 0)) $
txt $
(if T.null cstr
... | 350 | false | true | 0 | 15 | 106 | 108 | 53 | 55 | null | null |
rfranek/duckling | Duckling/Ordinal/TR/Corpus.hs | bsd-3-clause | corpus :: Corpus
corpus = (testContext {lang = TR}, allExamples) | 64 | corpus :: Corpus
corpus = (testContext {lang = TR}, allExamples) | 64 | corpus = (testContext {lang = TR}, allExamples) | 47 | false | true | 0 | 7 | 9 | 25 | 15 | 10 | null | null |
sarahn/ganeti | test/hs/Test/Ganeti/HTools/Graph.hs | gpl-2.0 | case_emptyVertColorMapNull :: Assertion
case_emptyVertColorMapNull = assertBool "" $ IntMap.null emptyVertColorMap | 114 | case_emptyVertColorMapNull :: Assertion
case_emptyVertColorMapNull = assertBool "" $ IntMap.null emptyVertColorMap | 114 | case_emptyVertColorMapNull = assertBool "" $ IntMap.null emptyVertColorMap | 74 | false | true | 0 | 7 | 9 | 23 | 11 | 12 | null | null |
Taeradan/hahp | tests/Tasty/Sandbox.hs | gpl-3.0 | genericUnitTests = testGroup "Generic Unit tests"
[ testCase "List comparison (different length)" $
[1, 2, 3] `compare` [1,2] @?= GT
-- the following test does not hold
, testCase "List comparison (same length)" $
[1, 2, 3] `compare` [1,2,2] @?= LT
] | 271 | genericUnitTests = testGroup "Generic Unit tests"
[ testCase "List comparison (different length)" $
[1, 2, 3] `compare` [1,2] @?= GT
-- the following test does not hold
, testCase "List comparison (same length)" $
[1, 2, 3] `compare` [1,2,2] @?= LT
] | 271 | genericUnitTests = testGroup "Generic Unit tests"
[ testCase "List comparison (different length)" $
[1, 2, 3] `compare` [1,2] @?= GT
-- the following test does not hold
, testCase "List comparison (same length)" $
[1, 2, 3] `compare` [1,2,2] @?= LT
] | 271 | false | false | 0 | 9 | 62 | 86 | 50 | 36 | null | null |
angerman/HInvoice | ListUtils.hs | bsd-3-clause | -- | Removes the selected item from a list
dropSelected :: Widget (List a b) -- ^ the list
-> IO ()
dropSelected l = getSelected l >>= dropItem l | 161 | dropSelected :: Widget (List a b) -- ^ the list
-> IO ()
dropSelected l = getSelected l >>= dropItem l | 118 | dropSelected l = getSelected l >>= dropItem l | 45 | true | true | 0 | 8 | 45 | 46 | 22 | 24 | null | null |
rpeszek/GraphPlay | src/PolyGraph/Buildable.hs | bsd-3-clause | fromVertexList :: forall g v e t . (BuildableGraphDataSet g v e t ) => [v] -> g
fromVertexList [] = emptyGraph | 110 | fromVertexList :: forall g v e t . (BuildableGraphDataSet g v e t ) => [v] -> g
fromVertexList [] = emptyGraph | 110 | fromVertexList [] = emptyGraph | 30 | false | true | 0 | 10 | 21 | 52 | 27 | 25 | null | null |
Cordite-Studios/solar | solar-wind/Solar/Caster/Time.hs | mit | applyTick :: ()
=> UTCTime
-> DCTicker
-> STM ()
applyTick time tk' = do
let tk = content tk'
k <- readTVar $ tick tk
let totalticks = ticks k
newk = k {ticks = totalticks + 1, tickedLast = time}
writeTVar (tick tk) newk | 284 | applyTick :: ()
=> UTCTime
-> DCTicker
-> STM ()
applyTick time tk' = do
let tk = content tk'
k <- readTVar $ tick tk
let totalticks = ticks k
newk = k {ticks = totalticks + 1, tickedLast = time}
writeTVar (tick tk) newk | 284 | applyTick time tk' = do
let tk = content tk'
k <- readTVar $ tick tk
let totalticks = ticks k
newk = k {ticks = totalticks + 1, tickedLast = time}
writeTVar (tick tk) newk | 197 | false | true | 0 | 13 | 109 | 113 | 54 | 59 | null | null |
aburnett88/HSat | src/HSat/Make/Instances/Common/Clause.hs | mit | makeClauseUndefined n c = do
l <- getRandomLiteral
makeClauseUndefined (n-1) (clauseAddLiteral c l) | 103 | makeClauseUndefined n c = do
l <- getRandomLiteral
makeClauseUndefined (n-1) (clauseAddLiteral c l) | 103 | makeClauseUndefined n c = do
l <- getRandomLiteral
makeClauseUndefined (n-1) (clauseAddLiteral c l) | 103 | false | false | 1 | 10 | 16 | 46 | 19 | 27 | null | null |
kumasento/accelerate-cuda | Data/Array/Accelerate/CUDA/Analysis/Launch.hs | bsd-3-clause | sharedMem _ (Scanl' _ x _) blockDim = sizeOf (delayedExpType x) * blockDim | 79 | sharedMem _ (Scanl' _ x _) blockDim = sizeOf (delayedExpType x) * blockDim | 79 | sharedMem _ (Scanl' _ x _) blockDim = sizeOf (delayedExpType x) * blockDim | 79 | false | false | 1 | 8 | 17 | 38 | 17 | 21 | null | null |
ancientlanguage/haskell-analysis | greek-script/src/Grammar/Greek/Script/Stage.hs | mit | forgetHasWordPunctuation
:: [ctx :* [a] :* HasWordPunctuation]
-> [ctx :* [a]]
forgetHasWordPunctuation = over (traverse . _2) fst | 134 | forgetHasWordPunctuation
:: [ctx :* [a] :* HasWordPunctuation]
-> [ctx :* [a]]
forgetHasWordPunctuation = over (traverse . _2) fst | 134 | forgetHasWordPunctuation = over (traverse . _2) fst | 51 | false | true | 0 | 10 | 21 | 57 | 29 | 28 | null | null |
emanuelcasco/tp-paradigmas-funcional | src/NightClub.hs | mit | tomarSoda :: Int -> Trago
tomarSoda fuerza cliente = agregarTrago (tomarSoda fuerza) $ modificarNombre nuevoNombre cliente
where nuevoNombre = "e" ++ replicate fuerza 'r' ++ "p" ++ nombre cliente | 197 | tomarSoda :: Int -> Trago
tomarSoda fuerza cliente = agregarTrago (tomarSoda fuerza) $ modificarNombre nuevoNombre cliente
where nuevoNombre = "e" ++ replicate fuerza 'r' ++ "p" ++ nombre cliente | 197 | tomarSoda fuerza cliente = agregarTrago (tomarSoda fuerza) $ modificarNombre nuevoNombre cliente
where nuevoNombre = "e" ++ replicate fuerza 'r' ++ "p" ++ nombre cliente | 171 | false | true | 0 | 8 | 30 | 66 | 31 | 35 | null | null |
rfranek/duckling | Duckling/Ordinal/FR/Corpus.hs | bsd-3-clause | corpus :: Corpus
corpus = (testContext {lang = FR}, allExamples) | 64 | corpus :: Corpus
corpus = (testContext {lang = FR}, allExamples) | 64 | corpus = (testContext {lang = FR}, allExamples) | 47 | false | true | 0 | 7 | 9 | 25 | 15 | 10 | null | null |
tomberek/rulestesting | src/Control/Arrow/CCA/AExp.hs | bsd-3-clause | eqM (f :*** g) (h :*** i) = (&&) <$> eqM f h <*> eqM g i | 56 | eqM (f :*** g) (h :*** i) = (&&) <$> eqM f h <*> eqM g i | 56 | eqM (f :*** g) (h :*** i) = (&&) <$> eqM f h <*> eqM g i | 56 | false | false | 1 | 9 | 16 | 48 | 23 | 25 | null | null |
thasenpusch/scheme | parser.hs | isc | lexAbbreviation :: Lexer Abbreviation
lexAbbreviation = do
a <- lexAbbrevPrefix
b <- lexDatum
pure $ Abbreviation a b | 129 | lexAbbreviation :: Lexer Abbreviation
lexAbbreviation = do
a <- lexAbbrevPrefix
b <- lexDatum
pure $ Abbreviation a b | 129 | lexAbbreviation = do
a <- lexAbbrevPrefix
b <- lexDatum
pure $ Abbreviation a b | 91 | false | true | 0 | 9 | 29 | 46 | 19 | 27 | null | null |
Concomitant/LambdaHack | Game/LambdaHack/Common/Flavour.hs | bsd-3-clause | colorToPlainName BrCyan = "aquamarine" | 41 | colorToPlainName BrCyan = "aquamarine" | 41 | colorToPlainName BrCyan = "aquamarine" | 41 | false | false | 0 | 5 | 6 | 9 | 4 | 5 | null | null |
akhileshs/stack | src/Stack/Setup.hs | bsd-3-clause | parseDownloadInfoFromObject :: Yaml.Object -> Yaml.Parser DownloadInfo
parseDownloadInfoFromObject o = do
url <- o .: "url"
contentLength <- o .: "content-length"
sha1TextMay <- o .:? "sha1"
return DownloadInfo
{ downloadInfoUrl = url
, downloadInfoContentLength = contentLeng... | 391 | parseDownloadInfoFromObject :: Yaml.Object -> Yaml.Parser DownloadInfo
parseDownloadInfoFromObject o = do
url <- o .: "url"
contentLength <- o .: "content-length"
sha1TextMay <- o .:? "sha1"
return DownloadInfo
{ downloadInfoUrl = url
, downloadInfoContentLength = contentLeng... | 391 | parseDownloadInfoFromObject o = do
url <- o .: "url"
contentLength <- o .: "content-length"
sha1TextMay <- o .:? "sha1"
return DownloadInfo
{ downloadInfoUrl = url
, downloadInfoContentLength = contentLength
, downloadInfoSha1 = fmap T.encodeUtf8 sha1TextMay
} | 320 | false | true | 0 | 11 | 101 | 91 | 45 | 46 | null | null |
shockkolate/lambdircd | src/IRCD/Numeric.hs | apache-2.0 | numRPL_MOTDSTART = Numeric 375 | 41 | numRPL_MOTDSTART = Numeric 375 | 41 | numRPL_MOTDSTART = Numeric 375 | 41 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
spinda/liquidhaskell | tests/gsoc15/unknown/pos/absref-crash.hs | bsd-3-clause | foo :: b -> L a
foo x = C $ foo x | 33 | foo :: b -> L a
foo x = C $ foo x | 33 | foo x = C $ foo x | 17 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
jorgen/send-email | src/SendMail/SendMail.hs | bsd-3-clause | sendMail :: MailTypes.EmailSender -> MailTypes.Email -> IO (Either MailTypes.ErrorMessage MailTypes.OkMessage)
sendMail (MailTypes.EmailSender sender) email = sender email | 171 | sendMail :: MailTypes.EmailSender -> MailTypes.Email -> IO (Either MailTypes.ErrorMessage MailTypes.OkMessage)
sendMail (MailTypes.EmailSender sender) email = sender email | 171 | sendMail (MailTypes.EmailSender sender) email = sender email | 60 | false | true | 0 | 10 | 16 | 54 | 26 | 28 | null | null |
rleshchinskiy/vector | Data/Vector/Unboxed.hs | bsd-3-clause | span = G.span | 13 | span = G.span | 13 | span = G.span | 13 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
tfausak/phong | library/Phong.hs | mit | renderWorld :: World -> Gloss.Picture
renderWorld world = Gloss.pictures
[ Gloss.circle ballRadius
|> uncurry Gloss.translate (ballPosition world)
|> Gloss.color Gloss.white
, Gloss.rectangleWire paddleWidth paddleHeight
|> Gloss.translate (-worldWidth / 2 + paddleWidth / 2) (paddleOffse... | 511 | renderWorld :: World -> Gloss.Picture
renderWorld world = Gloss.pictures
[ Gloss.circle ballRadius
|> uncurry Gloss.translate (ballPosition world)
|> Gloss.color Gloss.white
, Gloss.rectangleWire paddleWidth paddleHeight
|> Gloss.translate (-worldWidth / 2 + paddleWidth / 2) (paddleOffse... | 511 | renderWorld world = Gloss.pictures
[ Gloss.circle ballRadius
|> uncurry Gloss.translate (ballPosition world)
|> Gloss.color Gloss.white
, Gloss.rectangleWire paddleWidth paddleHeight
|> Gloss.translate (-worldWidth / 2 + paddleWidth / 2) (paddleOffset world)
|> Gloss.color Gloss.... | 473 | false | true | 0 | 13 | 130 | 156 | 75 | 81 | null | null |
heathweiss/Tricad | src/CornerPoints/CornerPoints.hs | gpl-2.0 | (F4 f4) +++ (B4 b4) =
(BottomRightLine b4 f4) | 49 | (F4 f4) +++ (B4 b4) =
(BottomRightLine b4 f4) | 49 | (F4 f4) +++ (B4 b4) =
(BottomRightLine b4 f4) | 49 | false | false | 0 | 7 | 12 | 32 | 15 | 17 | null | null |
facebookincubator/duckling | Duckling/Time/Computed.hs | bsd-3-clause | roshHashana :: TimeData
roshHashana = computedDays roshHashana' | 63 | roshHashana :: TimeData
roshHashana = computedDays roshHashana' | 63 | roshHashana = computedDays roshHashana' | 39 | false | true | 0 | 6 | 6 | 21 | 8 | 13 | null | null |
shlevy/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | isCDictCan_Maybe :: Ct -> Maybe Class
isCDictCan_Maybe (CDictCan {cc_class = cls }) = Just cls | 95 | isCDictCan_Maybe :: Ct -> Maybe Class
isCDictCan_Maybe (CDictCan {cc_class = cls }) = Just cls | 95 | isCDictCan_Maybe (CDictCan {cc_class = cls }) = Just cls | 57 | false | true | 3 | 7 | 15 | 43 | 19 | 24 | null | null |
rvion/lamdu | bottlelib/Control/Lens/Utils.hs | gpl-3.0 | addTuple2Contexts :: Lens.Context (z, a) (z, b) t -> (z, Lens.Context a b t)
addTuple2Contexts (Lens.Context fromBTuple (z, a)) =
(z, Lens.Context chg a)
where
chg b = fromBTuple (z, b) | 201 | addTuple2Contexts :: Lens.Context (z, a) (z, b) t -> (z, Lens.Context a b t)
addTuple2Contexts (Lens.Context fromBTuple (z, a)) =
(z, Lens.Context chg a)
where
chg b = fromBTuple (z, b) | 201 | addTuple2Contexts (Lens.Context fromBTuple (z, a)) =
(z, Lens.Context chg a)
where
chg b = fromBTuple (z, b) | 124 | false | true | 1 | 8 | 46 | 110 | 56 | 54 | null | null |
cliffano/swaggy-jenkins | clients/haskell-http-client/generated/lib/SwaggyJenkins/ModelLens.hs | mit | -- | 'pipelineStepImplResult' Lens
pipelineStepImplResultL :: Lens_' PipelineStepImpl (Maybe Text)
pipelineStepImplResultL f PipelineStepImpl{..} = (\pipelineStepImplResult -> PipelineStepImpl { pipelineStepImplResult, ..} ) <$> f pipelineStepImplResult | 253 | pipelineStepImplResultL :: Lens_' PipelineStepImpl (Maybe Text)
pipelineStepImplResultL f PipelineStepImpl{..} = (\pipelineStepImplResult -> PipelineStepImpl { pipelineStepImplResult, ..} ) <$> f pipelineStepImplResult | 218 | pipelineStepImplResultL f PipelineStepImpl{..} = (\pipelineStepImplResult -> PipelineStepImpl { pipelineStepImplResult, ..} ) <$> f pipelineStepImplResult | 154 | true | true | 1 | 8 | 23 | 61 | 30 | 31 | null | null |
Philonous/d-bus | src/DBus/Auth.hs | mit | expectOK :: SASL BS.ByteString
expectOK = do
r <- saslRecv
case r of
SMOK x -> return x
e -> throwError $ "Expected OK but got " ++ show e | 162 | expectOK :: SASL BS.ByteString
expectOK = do
r <- saslRecv
case r of
SMOK x -> return x
e -> throwError $ "Expected OK but got " ++ show e | 162 | expectOK = do
r <- saslRecv
case r of
SMOK x -> return x
e -> throwError $ "Expected OK but got " ++ show e | 131 | false | true | 0 | 11 | 53 | 59 | 27 | 32 | null | null |
nlim/haskell-playground | src/Zippers.hs | mit | freeTree :: Tree Char
freeTree = Node 'P'
(Node 'O'
(Node 'L'
(Node 'N' Empty Empty)
(Node 'T' Empty Empty)
)
(Node 'Y'
(Node 'S' Empty Empty)
... | 778 | freeTree :: Tree Char
freeTree = Node 'P'
(Node 'O'
(Node 'L'
(Node 'N' Empty Empty)
(Node 'T' Empty Empty)
)
(Node 'Y'
(Node 'S' Empty Empty)
... | 778 | freeTree = Node 'P'
(Node 'O'
(Node 'L'
(Node 'N' Empty Empty)
(Node 'T' Empty Empty)
)
(Node 'Y'
(Node 'S' Empty Empty)
(N... | 756 | false | true | 0 | 10 | 538 | 168 | 81 | 87 | null | null |
wavewave/hxournal | lib/Application/HXournal/GUI/Menu.hs | bsd-2-clause | assignPenMode :: IORef (Await MyEvent (Iteratee MyEvent XournalStateIO ()))
-> IORef HXournalState -> RadioAction -> IO ()
assignPenMode tref sref a = do
v <- radioActionGetCurrentValue a
let t = int2PenType v
st <- readIORef sref
case t of
Left pm -> do
let stNew = se... | 596 | assignPenMode :: IORef (Await MyEvent (Iteratee MyEvent XournalStateIO ()))
-> IORef HXournalState -> RadioAction -> IO ()
assignPenMode tref sref a = do
v <- radioActionGetCurrentValue a
let t = int2PenType v
st <- readIORef sref
case t of
Left pm -> do
let stNew = se... | 596 | assignPenMode tref sref a = do
v <- radioActionGetCurrentValue a
let t = int2PenType v
st <- readIORef sref
case t of
Left pm -> do
let stNew = set (penType.penInfo) pm st
writeIORef sref stNew
bouncecallback tref sref ToViewAppendMode
Right sm -> do
le... | 456 | false | true | 0 | 17 | 188 | 197 | 88 | 109 | null | null |
EricYT/real-world | src/chapter-13/DList.hs | apache-2.0 | safeHead :: DList a -> Maybe a
safeHead xs = case toList xs of
[] -> Nothing
(x:_) -> Just x | 127 | safeHead :: DList a -> Maybe a
safeHead xs = case toList xs of
[] -> Nothing
(x:_) -> Just x | 127 | safeHead xs = case toList xs of
[] -> Nothing
(x:_) -> Just x | 96 | false | true | 0 | 9 | 55 | 59 | 27 | 32 | null | null |
alokpndy/haskell-learn | src/extensions/gadt&typeclass.hs | mit | eval (Equ e1 e2) = eval e1 == eval e2 | 38 | eval (Equ e1 e2) = eval e1 == eval e2 | 38 | eval (Equ e1 e2) = eval e1 == eval e2 | 38 | false | false | 0 | 6 | 10 | 28 | 12 | 16 | null | null |
olsner/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprSplice (HsTypedSplice NoParens n e)
= ppr_splice (text "$$") n e empty | 75 | pprSplice (HsTypedSplice NoParens n e)
= ppr_splice (text "$$") n e empty | 75 | pprSplice (HsTypedSplice NoParens n e)
= ppr_splice (text "$$") n e empty | 75 | false | false | 0 | 7 | 13 | 34 | 16 | 18 | null | null |
selectel/mongoDB-haskell | Database/MongoDB/Query.hs | apache-2.0 | slaveOk :: AccessMode
-- ^ Same as 'ReadStaleOk'
slaveOk = ReadStaleOk | 70 | slaveOk :: AccessMode
slaveOk = ReadStaleOk | 43 | slaveOk = ReadStaleOk | 21 | true | true | 0 | 6 | 10 | 19 | 8 | 11 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxDOT_DASH :: Int
wxDOT_DASH = 104 | 34 | wxDOT_DASH :: Int
wxDOT_DASH = 104 | 34 | wxDOT_DASH = 104 | 16 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
kawu/crf-chain1 | src/Data/CRF/Chain1/Train.hs | bsd-2-clause | gradOn :: Model -> SGD.Para -> (Xs, Ys) -> SGD.Grad
gradOn crf para (xs, ys) = SGD.fromLogList $
[ (featToInt curr feat, L.fromPos val)
| (feat, val) <- featuresIn xs ys ] ++
[ (ix, L.fromNeg val)
| (FeatIx ix, val) <- expectedFeaturesIn curr xs ]
where
curr = crf { values = para } | 304 | gradOn :: Model -> SGD.Para -> (Xs, Ys) -> SGD.Grad
gradOn crf para (xs, ys) = SGD.fromLogList $
[ (featToInt curr feat, L.fromPos val)
| (feat, val) <- featuresIn xs ys ] ++
[ (ix, L.fromNeg val)
| (FeatIx ix, val) <- expectedFeaturesIn curr xs ]
where
curr = crf { values = para } | 304 | gradOn crf para (xs, ys) = SGD.fromLogList $
[ (featToInt curr feat, L.fromPos val)
| (feat, val) <- featuresIn xs ys ] ++
[ (ix, L.fromNeg val)
| (FeatIx ix, val) <- expectedFeaturesIn curr xs ]
where
curr = crf { values = para } | 252 | false | true | 0 | 10 | 76 | 151 | 79 | 72 | null | null |
wdanilo/functor-utils | src/Data/Functor/Utils.hs | apache-2.0 | (.::::) = dot8 | 15 | (.::::) = dot8 | 15 | (.::::) = dot8 | 15 | false | false | 0 | 4 | 3 | 8 | 5 | 3 | null | null |
m0ar/safe-streaming | benchmarks/StreamingTest.hs | bsd-3-clause | iostreams_basic :: IO Int
iostreams_basic = do
s0 <- IOS.fromList [1..1000000]
s1 <- IOS.filter even s0
s2 <- IOS.map (+1) s1
s3 <- IOS.drop 1000 s2
s4 <- IOS.map (+1) s3
s5 <- IOS.filter (\x -> x `mod` 2 == 0) s4
xs <- IOS.toList s5
assert (Prelude.length xs == 499000) $
return (Prelude.length (x... | 332 | iostreams_basic :: IO Int
iostreams_basic = do
s0 <- IOS.fromList [1..1000000]
s1 <- IOS.filter even s0
s2 <- IOS.map (+1) s1
s3 <- IOS.drop 1000 s2
s4 <- IOS.map (+1) s3
s5 <- IOS.filter (\x -> x `mod` 2 == 0) s4
xs <- IOS.toList s5
assert (Prelude.length xs == 499000) $
return (Prelude.length (x... | 332 | iostreams_basic = do
s0 <- IOS.fromList [1..1000000]
s1 <- IOS.filter even s0
s2 <- IOS.map (+1) s1
s3 <- IOS.drop 1000 s2
s4 <- IOS.map (+1) s3
s5 <- IOS.filter (\x -> x `mod` 2 == 0) s4
xs <- IOS.toList s5
assert (Prelude.length xs == 499000) $
return (Prelude.length (xs :: [Int])) | 306 | false | true | 0 | 12 | 78 | 181 | 88 | 93 | null | null |
ben-schulz/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | bcc i (FOREIGNCALL l rty (FStr fn) (x:xs)) | fn == "%wrapper"
= indent i ++
c_irts (toFType rty) (creg l ++ " = ")
("_idris_get_wrapper(" ++ creg (snd x) ++ ")") ++ ";\n" | 196 | bcc i (FOREIGNCALL l rty (FStr fn) (x:xs)) | fn == "%wrapper"
= indent i ++
c_irts (toFType rty) (creg l ++ " = ")
("_idris_get_wrapper(" ++ creg (snd x) ++ ")") ++ ";\n" | 196 | bcc i (FOREIGNCALL l rty (FStr fn) (x:xs)) | fn == "%wrapper"
= indent i ++
c_irts (toFType rty) (creg l ++ " = ")
("_idris_get_wrapper(" ++ creg (snd x) ++ ")") ++ ";\n" | 196 | false | false | 2 | 11 | 59 | 106 | 48 | 58 | null | null |
purcell/icfpc2015 | src/GamePlay.hs | gpl-3.0 | applyRawCommand (Turn AntiClockwise) = unitRotateAntiClockwise | 62 | applyRawCommand (Turn AntiClockwise) = unitRotateAntiClockwise | 62 | applyRawCommand (Turn AntiClockwise) = unitRotateAntiClockwise | 62 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
uduki/hsQt | Qtc/Gui/QComboBox.hs | bsd-2-clause | minimumContentsLength :: QComboBox a -> (()) -> IO (Int)
minimumContentsLength x0 ()
= withIntResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QComboBox_minimumContentsLength cobj_x0 | 187 | minimumContentsLength :: QComboBox a -> (()) -> IO (Int)
minimumContentsLength x0 ()
= withIntResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QComboBox_minimumContentsLength cobj_x0 | 187 | minimumContentsLength x0 ()
= withIntResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QComboBox_minimumContentsLength cobj_x0 | 130 | false | true | 4 | 8 | 31 | 65 | 30 | 35 | null | null |
haskell-streaming/streaming | src/Streaming/Prelude.hs | bsd-3-clause | -- ---------------
-- iterate
-- ---------------
{-| Iterate a pure function from a seed value, streaming the results forever
-}
iterate :: Monad m => (a -> a) -> a -> Stream (Of a) m r
iterate f = loop where
loop a' = Effect (return (Step (a' :> loop (f a'))))
| 268 | iterate :: Monad m => (a -> a) -> a -> Stream (Of a) m r
iterate f = loop where
loop a' = Effect (return (Step (a' :> loop (f a'))))
| 135 | iterate f = loop where
loop a' = Effect (return (Step (a' :> loop (f a'))))
| 78 | true | true | 0 | 14 | 58 | 93 | 48 | 45 | null | null |
brodyberg/Notes | MorseCode/src/ArbitraryMain.hs | mit | -- well jesus, this is "from the library"
-- of course it conflicts
-- instance Arbitrary a =>
-- Arbitrary (Maybe a) where
-- arbitrary =
-- frequency [(1, return Nothing),
-- (3, liftM Just arbitrary)]
sumGenFirstPls :: (Arbitrary a,
Arbitrary b) =>
... | 476 | sumGenFirstPls :: (Arbitrary a,
Arbitrary b) =>
Gen (Sum a b)
sumGenFirstPls = do
a <- arbitrary
b <- arbitrary
frequency [(10, return $ First a),
(1, return $ Second b)] | 230 | sumGenFirstPls = do
a <- arbitrary
b <- arbitrary
frequency [(10, return $ First a),
(1, return $ Second b)] | 129 | true | true | 0 | 12 | 168 | 102 | 53 | 49 | null | null |
green-haskell/ghc | compiler/nativeGen/PPC/Regs.hs | bsd-3-clause | -- narrow to the width: a CmmInt might be out of
-- range, but we assume that ImmInteger only contains
-- in-range values. A signed value should be fine here.
litToImm (CmmFloat f W32) = ImmFloat f | 233 | litToImm (CmmFloat f W32) = ImmFloat f | 41 | litToImm (CmmFloat f W32) = ImmFloat f | 41 | true | false | 0 | 7 | 72 | 23 | 12 | 11 | null | null |
ezyang/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | emitPrimOp _ res IndexByteArrayOp_Double args = doIndexByteArrayOp Nothing f64 res args | 104 | emitPrimOp _ res IndexByteArrayOp_Double args = doIndexByteArrayOp Nothing f64 res args | 104 | emitPrimOp _ res IndexByteArrayOp_Double args = doIndexByteArrayOp Nothing f64 res args | 104 | false | false | 1 | 5 | 27 | 28 | 11 | 17 | null | null |
danr/dotfiles | xmonad/xmonad.hs | unlicense | myModMask = mod4Mask | 26 | myModMask = mod4Mask | 26 | myModMask = mod4Mask | 26 | false | false | 0 | 4 | 8 | 6 | 3 | 3 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/Syntax/AST/Sing.hs | bsd-3-clause | sing_PrimOp RealPow = (sing `Cons1` sing `Cons1` Nil1, sing) | 65 | sing_PrimOp RealPow = (sing `Cons1` sing `Cons1` Nil1, sing) | 65 | sing_PrimOp RealPow = (sing `Cons1` sing `Cons1` Nil1, sing) | 65 | false | false | 0 | 7 | 13 | 28 | 16 | 12 | null | null |
dcreager/cabal | Distribution/Simple/Utils.hs | bsd-3-clause | matchFileGlob :: FilePath -> IO [FilePath]
matchFileGlob = matchDirFileGlob "." | 79 | matchFileGlob :: FilePath -> IO [FilePath]
matchFileGlob = matchDirFileGlob "." | 79 | matchFileGlob = matchDirFileGlob "." | 36 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
tomasmcz/discrete-opt | src-main/Main/Plot.hs | bsd-3-clause | plotScore :: FilePath -> Int -> [Double] -> IO ()
plotScore f r ls = toFile def f $ do
--layout_title .= "Amplitude Modulation"
plot $ line "Score" [zip [r, 2 * r..] ls] | 177 | plotScore :: FilePath -> Int -> [Double] -> IO ()
plotScore f r ls = toFile def f $ do
--layout_title .= "Amplitude Modulation"
plot $ line "Score" [zip [r, 2 * r..] ls] | 177 | plotScore f r ls = toFile def f $ do
--layout_title .= "Amplitude Modulation"
plot $ line "Score" [zip [r, 2 * r..] ls] | 127 | false | true | 0 | 13 | 41 | 78 | 39 | 39 | null | null |
ghc-android/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | collectStmtBinders (RecStmt { recS_stmts = ss }) = collectLStmtsBinders ss | 78 | collectStmtBinders (RecStmt { recS_stmts = ss }) = collectLStmtsBinders ss | 78 | collectStmtBinders (RecStmt { recS_stmts = ss }) = collectLStmtsBinders ss | 78 | false | false | 0 | 8 | 13 | 25 | 12 | 13 | null | null |
osa1/language-lua | src/Text/PrettyPrint/Leijen.hs | bsd-3-clause | -- | The document @space@ contains a single space, \" \".
--
-- > x <+> y = x <> space <> y
space :: Doc
space = char ' ' | 133 | space :: Doc
space = char ' ' | 39 | space = char ' ' | 26 | true | true | 1 | 5 | 42 | 20 | 10 | 10 | null | null |
akerber47/train | Main.hs | bsd-3-clause | isoVertex :: SG.Edge -> SG.Vertex -> GraphMap -> GraphMap
isoVertex e@(SG.Edge ue d) v g@(GraphMap sg vm em)
= GraphMap sg newvm newem
where SG.VData ies _ = sg !. v
SG.EData v1 v2 _ = sg !- e
-- Vertex (which mapped to v1) now maps to v2
newvm = assert (v1 == (g $. v)) $
... | 1,078 | isoVertex :: SG.Edge -> SG.Vertex -> GraphMap -> GraphMap
isoVertex e@(SG.Edge ue d) v g@(GraphMap sg vm em)
= GraphMap sg newvm newem
where SG.VData ies _ = sg !. v
SG.EData v1 v2 _ = sg !- e
-- Vertex (which mapped to v1) now maps to v2
newvm = assert (v1 == (g $. v)) $
... | 1,078 | isoVertex e@(SG.Edge ue d) v g@(GraphMap sg vm em)
= GraphMap sg newvm newem
where SG.VData ies _ = sg !. v
SG.EData v1 v2 _ = sg !- e
-- Vertex (which mapped to v1) now maps to v2
newvm = assert (v1 == (g $. v)) $
M.insert v v2 vm
-- Each incident edge ma... | 1,020 | false | true | 0 | 14 | 336 | 278 | 145 | 133 | null | null |
ku-fpg/hermit | src/HERMIT/Shell/Externals.hs | bsd-2-clause | ----------------------------------------------------------------------------------
shell_externals :: [External]
shell_externals = map (.+ Shell)
[ external "resume" Resume -- HERMIT Kernel Exit
[ "stops HERMIT; resumes compile" ]
, external "abort" Abort -- UNIX Exit
... | 9,774 | shell_externals :: [External]
shell_externals = map (.+ Shell)
[ external "resume" Resume -- HERMIT Kernel Exit
[ "stops HERMIT; resumes compile" ]
, external "abort" Abort -- UNIX Exit
[ "hard UNIX-style exit; does not return to GHC; does not save" ]
, external "co... | 9,690 | shell_externals = map (.+ Shell)
[ external "resume" Resume -- HERMIT Kernel Exit
[ "stops HERMIT; resumes compile" ]
, external "abort" Abort -- UNIX Exit
[ "hard UNIX-style exit; does not return to GHC; does not save" ]
, external "continue" Continue -- Sh... | 9,660 | true | true | 0 | 22 | 2,859 | 1,820 | 965 | 855 | null | null |
gspindles/mj-score-eval | src/Game/Mahjong/Static/Melds.hs | mit | bambooPairs :: [Meld]
bambooPairs = [b11, b22, b33, b44, b55, b66, b77, b88, b99] | 82 | bambooPairs :: [Meld]
bambooPairs = [b11, b22, b33, b44, b55, b66, b77, b88, b99] | 81 | bambooPairs = [b11, b22, b33, b44, b55, b66, b77, b88, b99] | 59 | false | true | 0 | 7 | 14 | 48 | 27 | 21 | null | null |
bergmark/transliterate | src/Translit/Hangeul.hs | bsd-3-clause | fromMaybes :: [Maybe a] -> [a]
fromMaybes [] = [] | 53 | fromMaybes :: [Maybe a] -> [a]
fromMaybes [] = [] | 53 | fromMaybes [] = [] | 22 | false | true | 0 | 8 | 13 | 37 | 17 | 20 | null | null |
keithodulaigh/Hets | THF/ParseTHF.hs | gpl-2.0 | {- THF:
<function_term> ::= <plain_term> | <defined_term> | <system_term> -}
functionTerm :: CharParser st FunctionTerm
functionTerm = fmap FT_System_Term systemTerm
<|> fmap FT_Defined_Term definedTerm
<|> fmap FT_Plain_Term plainTerm | 239 | functionTerm :: CharParser st FunctionTerm
functionTerm = fmap FT_System_Term systemTerm
<|> fmap FT_Defined_Term definedTerm
<|> fmap FT_Plain_Term plainTerm | 162 | functionTerm = fmap FT_System_Term systemTerm
<|> fmap FT_Defined_Term definedTerm
<|> fmap FT_Plain_Term plainTerm | 119 | true | true | 3 | 6 | 31 | 36 | 18 | 18 | null | null |
randen/cabal | Cabal/Distribution/Simple/Program/Builtin.hs | bsd-3-clause | ldProgram :: Program
ldProgram = simpleProgram "ld" | 51 | ldProgram :: Program
ldProgram = simpleProgram "ld" | 51 | ldProgram = simpleProgram "ld" | 30 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
shnarazk/mios | MultiConflict/SAT/Mios/Solver.hs | gpl-3.0 | percolateUp :: Solver -> Int -> IO ()
percolateUp Solver{..} start = do
let VarHeap to at = order
v <- getNth to start
ac <- getNth activities v
let
loop :: Int -> IO ()
loop i = do
let iP = div i 2 -- parent
if iP == 0
then setNth to i v >> setNth at v i -- end
else... | 574 | percolateUp :: Solver -> Int -> IO ()
percolateUp Solver{..} start = do
let VarHeap to at = order
v <- getNth to start
ac <- getNth activities v
let
loop :: Int -> IO ()
loop i = do
let iP = div i 2 -- parent
if iP == 0
then setNth to i v >> setNth at v i -- end
else... | 574 | percolateUp Solver{..} start = do
let VarHeap to at = order
v <- getNth to start
ac <- getNth activities v
let
loop :: Int -> IO ()
loop i = do
let iP = div i 2 -- parent
if iP == 0
then setNth to i v >> setNth at v i -- end
else do
v' <- getNth to iP
... | 536 | false | true | 0 | 18 | 242 | 239 | 110 | 129 | null | null |
GaloisInc/mistral | src/Mistral/TypeCheck/Monad.hs | bsd-3-clause | -- | Unify two types, logging errors and using mzero on a failure. The
-- left-hand side is the user-expected type, the right-hand-side is the inferred
-- type. NOTE: the arguments are somewhat backwards from the way they work in
-- `mgu`, this is just an accident.
unify :: Type -> Type -> TC ()
unify l r =
do skol... | 713 | unify :: Type -> Type -> TC ()
unify l r =
do skolems <- getSkolems
u <- getSubst
case mgu skolems (apply u r) (apply u l) of
Right u' -> TC $ do rw <- get
set $! rw { rwSubst = u' `mappend` u }
Left err -> do tcErr (pp err)
mzero
-- En... | 445 | unify l r =
do skolems <- getSkolems
u <- getSubst
case mgu skolems (apply u r) (apply u l) of
Right u' -> TC $ do rw <- get
set $! rw { rwSubst = u' `mappend` u }
Left err -> do tcErr (pp err)
mzero
-- Environment Interaction ---------... | 414 | true | true | 0 | 16 | 202 | 144 | 71 | 73 | null | null |
nikita-volkov/newtype-deriving | library/NewtypeDeriving/Reification.hs | mit | reifyNewtype :: Name -> Q (Either String Newtype)
reifyNewtype =
fmap parseInfo . reify
where
parseInfo =
\case
TyConI (NewtypeD _ typeName _ con derivations) -> do
(conName, innerType) <-
case con of
NormalC n [(_, t)] -> Right (n, t)
RecC n [(_, ... | 670 | reifyNewtype :: Name -> Q (Either String Newtype)
reifyNewtype =
fmap parseInfo . reify
where
parseInfo =
\case
TyConI (NewtypeD _ typeName _ con derivations) -> do
(conName, innerType) <-
case con of
NormalC n [(_, t)] -> Right (n, t)
RecC n [(_, ... | 670 | reifyNewtype =
fmap parseInfo . reify
where
parseInfo =
\case
TyConI (NewtypeD _ typeName _ con derivations) -> do
(conName, innerType) <-
case con of
NormalC n [(_, t)] -> Right (n, t)
RecC n [(_, _, t)] -> Right (n, t)
_ -> Left $ "... | 620 | false | true | 2 | 16 | 225 | 199 | 99 | 100 | null | null |
AlexanderPankiv/ghc | compiler/types/TypeRep.hs | bsd-3-clause | tidyFreeTyVars :: TidyEnv -> TyVarSet -> TidyEnv
-- ^ Add the free 'TyVar's to the env in tidy form,
-- so that we can tidy the type they are free in
tidyFreeTyVars (full_occ_env, var_env) tyvars
= fst (tidyOpenTyVars (full_occ_env, var_env) (varSetElems tyvars)) | 265 | tidyFreeTyVars :: TidyEnv -> TyVarSet -> TidyEnv
tidyFreeTyVars (full_occ_env, var_env) tyvars
= fst (tidyOpenTyVars (full_occ_env, var_env) (varSetElems tyvars)) | 164 | tidyFreeTyVars (full_occ_env, var_env) tyvars
= fst (tidyOpenTyVars (full_occ_env, var_env) (varSetElems tyvars)) | 115 | true | true | 0 | 9 | 43 | 55 | 30 | 25 | null | null |
mydaum/cabal | Cabal/Distribution/Utils/Generic.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- Helper functions
-- | Wraps text to the default line width. Existing newlines are preserved.
wrapText :: String -> String
wrapText = unlines
. map (intercalate "\n"
. map unwords
. wrapLine 79
... | 354 | wrapText :: String -> String
wrapText = unlines
. map (intercalate "\n"
. map unwords
. wrapLine 79
. words)
. lines | 176 | wrapText = unlines
. map (intercalate "\n"
. map unwords
. wrapLine 79
. words)
. lines | 147 | true | true | 0 | 12 | 100 | 53 | 27 | 26 | null | null |
adituv/qbscript | src/Compiler/QbScript/CodeGen.hs | bsd-3-clause | putElseIfs :: [(Expr, [Instruction])] -> StateT BranchState Packing ()
putElseIfs = mapM_ putElseIf
where
putElseIf :: (Expr, [Instruction]) -> StateT BranchState Packing ()
putElseIf (cond, body) = do
BranchState nh _ <- get
(nh',lh') <- lift $ do
putWord8 0x01
fillOffsetHole nh
... | 509 | putElseIfs :: [(Expr, [Instruction])] -> StateT BranchState Packing ()
putElseIfs = mapM_ putElseIf
where
putElseIf :: (Expr, [Instruction]) -> StateT BranchState Packing ()
putElseIf (cond, body) = do
BranchState nh _ <- get
(nh',lh') <- lift $ do
putWord8 0x01
fillOffsetHole nh
... | 509 | putElseIfs = mapM_ putElseIf
where
putElseIf :: (Expr, [Instruction]) -> StateT BranchState Packing ()
putElseIf (cond, body) = do
BranchState nh _ <- get
(nh',lh') <- lift $ do
putWord8 0x01
fillOffsetHole nh
putWord8 0x27
nh' <- putOffsetHole
lh' <- putOff... | 438 | false | true | 2 | 12 | 155 | 181 | 87 | 94 | null | null |
laurencer/confluence-sync | vendor/http-streams/lib/Network/Http/Inconvenience.hs | bsd-3-clause | splitURI :: URI -> URL -> URL
splitURI old new' =
let
new = S.unpack new'
in
if isAbsoluteURI new
then
new'
else
let
rel = parseRelativeReference new
in
case rel of
Nothing -> new'
Just x -> S.pack $ uriToSt... | 617 | splitURI :: URI -> URL -> URL
splitURI old new' =
let
new = S.unpack new'
in
if isAbsoluteURI new
then
new'
else
let
rel = parseRelativeReference new
in
case rel of
Nothing -> new'
Just x -> S.pack $ uriToSt... | 617 | splitURI old new' =
let
new = S.unpack new'
in
if isAbsoluteURI new
then
new'
else
let
rel = parseRelativeReference new
in
case rel of
Nothing -> new'
Just x -> S.pack $ uriToString id old {
... | 587 | false | true | 0 | 17 | 377 | 126 | 62 | 64 | null | null |
mithrandi/lambdacircus | Settings.hs | mit | -- The rest of this file contains settings which rarely need changing by a
-- user.
widgetFile :: String -> Q Exp
widgetFile = (if appReloadTemplates compileTimeAppSettings
then widgetFileReload
else widgetFileNoReload)
widgetFileSettings | 285 | widgetFile :: String -> Q Exp
widgetFile = (if appReloadTemplates compileTimeAppSettings
then widgetFileReload
else widgetFileNoReload)
widgetFileSettings | 200 | widgetFile = (if appReloadTemplates compileTimeAppSettings
then widgetFileReload
else widgetFileNoReload)
widgetFileSettings | 170 | true | true | 0 | 7 | 78 | 43 | 21 | 22 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB :: GLenum
gl_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F | 104 | gl_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB :: GLenum
gl_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F | 104 | gl_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F | 51 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
nomeata/darcs-mirror-arbtt | src/LeftFold.hs | gpl-2.0 | lfLast :: LeftFold x (Maybe x)
lfLast = getLast <$> monoidFold `mapElems` (Last . Just) | 87 | lfLast :: LeftFold x (Maybe x)
lfLast = getLast <$> monoidFold `mapElems` (Last . Just) | 87 | lfLast = getLast <$> monoidFold `mapElems` (Last . Just) | 56 | false | true | 2 | 8 | 14 | 46 | 22 | 24 | null | null |
vikraman/ghc | compiler/coreSyn/CoreFVs.hs | bsd-3-clause | exprFreeIdsList :: CoreExpr -> [Id] -- Find all locally-defined free Ids
exprFreeIdsList = exprSomeFreeVarsList isLocalId | 121 | exprFreeIdsList :: CoreExpr -> [Id]
exprFreeIdsList = exprSomeFreeVarsList isLocalId | 84 | exprFreeIdsList = exprSomeFreeVarsList isLocalId | 48 | true | true | 0 | 6 | 14 | 22 | 12 | 10 | null | null |
Munksgaard/SFOT | Asm/AST.hs | mit | ldyOpcode (LdyA w16) = 0xAC : encodeWord16 w16 | 48 | ldyOpcode (LdyA w16) = 0xAC : encodeWord16 w16 | 48 | ldyOpcode (LdyA w16) = 0xAC : encodeWord16 w16 | 48 | false | false | 0 | 7 | 9 | 22 | 10 | 12 | null | null |
ben-schulz/Idris-dev | src/Idris/Core/Evaluate.hs | bsd-3-clause | mapDefCtxt :: (Def -> Def) -> Context -> Context
mapDefCtxt f (MkContext t !defs) = MkContext t (mapCtxt f' defs)
where f' (!d, i, a, t, m) = f' (f d, i, a, t, m)
-- | Get the definitions from a context | 206 | mapDefCtxt :: (Def -> Def) -> Context -> Context
mapDefCtxt f (MkContext t !defs) = MkContext t (mapCtxt f' defs)
where f' (!d, i, a, t, m) = f' (f d, i, a, t, m)
-- | Get the definitions from a context | 206 | mapDefCtxt f (MkContext t !defs) = MkContext t (mapCtxt f' defs)
where f' (!d, i, a, t, m) = f' (f d, i, a, t, m)
-- | Get the definitions from a context | 157 | false | true | 0 | 9 | 46 | 101 | 54 | 47 | null | null |
mydaum/cabal | cabal-install/Distribution/Solver/Modular/ConflictSet.hs | bsd-3-clause | showCSWithFrequency :: ConflictMap -> ConflictSet -> String
showCSWithFrequency = showCS True | 93 | showCSWithFrequency :: ConflictMap -> ConflictSet -> String
showCSWithFrequency = showCS True | 93 | showCSWithFrequency = showCS True | 33 | false | true | 0 | 6 | 10 | 22 | 11 | 11 | null | null |
kim/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/Types.hs | mpl-2.0 | -- | The pending or in-progress change of the cluster's node type.
pmvNodeType :: Lens' PendingModifiedValues (Maybe Text)
pmvNodeType = lens _pmvNodeType (\s a -> s { _pmvNodeType = a }) | 187 | pmvNodeType :: Lens' PendingModifiedValues (Maybe Text)
pmvNodeType = lens _pmvNodeType (\s a -> s { _pmvNodeType = a }) | 120 | pmvNodeType = lens _pmvNodeType (\s a -> s { _pmvNodeType = a }) | 64 | true | true | 0 | 9 | 30 | 46 | 25 | 21 | null | null |
wouwouwou/2017_module_8 | src/haskell/PP-project-2017/lib/sprockell-2017/src/Sprockell/Simulation.hs | apache-2.0 | systemSim (dbg,dbgSt) instrss s (t:ts) | sysHalted = return ()
| otherwise = do
let curInstrs = zipWith (!) instrss (map pc $ sprStates s)
s' <- deepseq s $ system instrss s t
... | 783 | systemSim (dbg,dbgSt) instrss s (t:ts) | sysHalted = return ()
| otherwise = do
let curInstrs = zipWith (!) instrss (map pc $ sprStates s)
s' <- deepseq s $ system instrss s t
... | 783 | systemSim (dbg,dbgSt) instrss s (t:ts) | sysHalted = return ()
| otherwise = do
let curInstrs = zipWith (!) instrss (map pc $ sprStates s)
s' <- deepseq s $ system instrss s t
... | 783 | false | false | 0 | 15 | 364 | 292 | 147 | 145 | null | null |
rueshyna/gogol | gogol-books/gen/Network/Google/Books/Types/Product.hs | mpl-2.0 | -- | A list of offline dictionary metadata.
mItems :: Lens' Metadata [MetadataItemsItem]
mItems
= lens _mItems (\ s a -> s{_mItems = a}) . _Default .
_Coerce | 165 | mItems :: Lens' Metadata [MetadataItemsItem]
mItems
= lens _mItems (\ s a -> s{_mItems = a}) . _Default .
_Coerce | 121 | mItems
= lens _mItems (\ s a -> s{_mItems = a}) . _Default .
_Coerce | 76 | true | true | 1 | 10 | 35 | 57 | 28 | 29 | null | null |
gergoerdi/kansas-lava-papilio | src/Language/KansasLava/Signal/Utils.hs | bsd-3-clause | toUnsigned :: (sig ~ Signal c, Size ix) => Matrix ix (sig Bool) -> sig (Unsigned ix)
toUnsigned = coerce Unsigned.fromMatrix . pack | 131 | toUnsigned :: (sig ~ Signal c, Size ix) => Matrix ix (sig Bool) -> sig (Unsigned ix)
toUnsigned = coerce Unsigned.fromMatrix . pack | 131 | toUnsigned = coerce Unsigned.fromMatrix . pack | 46 | false | true | 0 | 9 | 22 | 64 | 31 | 33 | null | null |
dmcclean/HaTeX | Text/LaTeX/Packages/AMSMath.hs | bsd-3-clause | -- | Ξ symbol.
xiu :: LaTeXC l => l
xiu = comm0 "Xi" | 52 | xiu :: LaTeXC l => l
xiu = comm0 "Xi" | 37 | xiu = comm0 "Xi" | 16 | true | true | 0 | 7 | 13 | 29 | 12 | 17 | null | null |
ywata/dynamodb | test/ItemTests.hs | bsd-3-clause | scanWith cfg ddbcfg a b c d e f g h i = do
rsp <- withManager $ \mgr -> Aws.pureAws cfg ddbcfg mgr $
D.scan a b c d e f g h i
return rsp | 171 | scanWith cfg ddbcfg a b c d e f g h i = do
rsp <- withManager $ \mgr -> Aws.pureAws cfg ddbcfg mgr $
D.scan a b c d e f g h i
return rsp | 171 | scanWith cfg ddbcfg a b c d e f g h i = do
rsp <- withManager $ \mgr -> Aws.pureAws cfg ddbcfg mgr $
D.scan a b c d e f g h i
return rsp | 171 | false | false | 0 | 12 | 71 | 85 | 40 | 45 | null | null |
Lateks/malacoda | Main.hs | mit | wrapNum :: Int -> Int
wrapNum n = (n + 1) `mod` numericMax | 58 | wrapNum :: Int -> Int
wrapNum n = (n + 1) `mod` numericMax | 58 | wrapNum n = (n + 1) `mod` numericMax | 36 | false | true | 0 | 7 | 12 | 39 | 19 | 20 | null | null |
brendanhay/gogol | gogol-bigquery/gen/Network/Google/BigQuery/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'TableDataInsertAllResponseInsertErrorsItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tdiarieiErrors'
--
-- * 'tdiarieiIndex'
tableDataInsertAllResponseInsertErrorsItem
:: TableDataInsertAllResponseI... | 484 | tableDataInsertAllResponseInsertErrorsItem
:: TableDataInsertAllResponseInsertErrorsItem
tableDataInsertAllResponseInsertErrorsItem =
TableDataInsertAllResponseInsertErrorsItem'
{_tdiarieiErrors = Nothing, _tdiarieiIndex = Nothing} | 241 | tableDataInsertAllResponseInsertErrorsItem =
TableDataInsertAllResponseInsertErrorsItem'
{_tdiarieiErrors = Nothing, _tdiarieiIndex = Nothing} | 148 | true | true | 1 | 7 | 59 | 39 | 23 | 16 | null | null |
bch29/cassandra-th | src/Cassandra/Schema.hs | bsd-3-clause | braces = P.braces lexer | 31 | braces = P.braces lexer | 31 | braces = P.braces lexer | 31 | false | false | 0 | 6 | 11 | 11 | 5 | 6 | null | null |
rahulmutt/ghcvm | compiler/Eta/SimplCore/SimplEnv.hs | bsd-3-clause | substTy :: SimplEnv -> Type -> Type
substTy env ty = Type.substTy (getTvSubst env) ty | 85 | substTy :: SimplEnv -> Type -> Type
substTy env ty = Type.substTy (getTvSubst env) ty | 85 | substTy env ty = Type.substTy (getTvSubst env) ty | 49 | false | true | 0 | 7 | 14 | 37 | 18 | 19 | null | null |
cyruscousins/HarmLang | src/HarmLang/IO.hs | mit | granularity = 24 | 16 | granularity = 24 | 16 | granularity = 24 | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
glutamate/probably | Math/Probably/Visualise.hs | bsd-3-clause | idDouble :: Double -> Double
idDouble = id | 42 | idDouble :: Double -> Double
idDouble = id | 42 | idDouble = id | 13 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
aminb/blog | src/Template.hs | gpl-3.0 | -- Applies the template (fragments) with given context until an end fragment is
-- encountered, at which point the current string and the remaining fragments
-- are returned.
applyBlock :: [Fragment] -> Context -> (String, [Fragment])
applyBlock fragments context = next fragments ""
where expand variable = case M.loo... | 1,870 | applyBlock :: [Fragment] -> Context -> (String, [Fragment])
applyBlock fragments context = next fragments ""
where expand variable = case M.lookup variable context of
Just (StringValue str) -> str
Just _ -> variable ++ " is not a string"
Nothing -> "undefin... | 1,695 | applyBlock fragments context = next fragments ""
where expand variable = case M.lookup variable context of
Just (StringValue str) -> str
Just _ -> variable ++ " is not a string"
Nothing -> "undefined"
include name = case M.lookup name context of
... | 1,635 | true | true | 8 | 17 | 650 | 534 | 268 | 266 | null | null |
dinkelk/job-server | JobServer.hs | mit | exampleJob :: String -> IO (Int)
exampleJob n = do putStrLn $ ".... Running job: " ++ n
threadDelay 1000000
putStrLn $ ".... Finishing job: " ++ n
return 1 | 209 | exampleJob :: String -> IO (Int)
exampleJob n = do putStrLn $ ".... Running job: " ++ n
threadDelay 1000000
putStrLn $ ".... Finishing job: " ++ n
return 1 | 209 | exampleJob n = do putStrLn $ ".... Running job: " ++ n
threadDelay 1000000
putStrLn $ ".... Finishing job: " ++ n
return 1 | 176 | false | true | 0 | 9 | 83 | 63 | 27 | 36 | null | null |
edwardwas/loveletter | src/LoveLetter.hs | mit | runLoveLetter :: [Card -> Player] -> IO ()
runLoveLetter cs = createGameState cs startDeck >>= gameTurn | 103 | runLoveLetter :: [Card -> Player] -> IO ()
runLoveLetter cs = createGameState cs startDeck >>= gameTurn | 103 | runLoveLetter cs = createGameState cs startDeck >>= gameTurn | 60 | false | true | 0 | 7 | 15 | 43 | 20 | 23 | null | null |
badp/ganeti | src/Ganeti/JQueue.hs | gpl-2.0 | archiveSomeJobsUntil replicateFn qDir endt cutt arch torepl (jid:jids) = do
let archiveMore = archiveSomeJobsUntil replicateFn qDir endt cutt
continue = archiveMore arch torepl jids
jidname = show $ fromJobId jid
time <- getClockTime
if time >= endt
then do
_ <- forkIO $ replicateFn torepl
... | 1,535 | archiveSomeJobsUntil replicateFn qDir endt cutt arch torepl (jid:jids) = do
let archiveMore = archiveSomeJobsUntil replicateFn qDir endt cutt
continue = archiveMore arch torepl jids
jidname = show $ fromJobId jid
time <- getClockTime
if time >= endt
then do
_ <- forkIO $ replicateFn torepl
... | 1,535 | archiveSomeJobsUntil replicateFn qDir endt cutt arch torepl (jid:jids) = do
let archiveMore = archiveSomeJobsUntil replicateFn qDir endt cutt
continue = archiveMore arch torepl jids
jidname = show $ fromJobId jid
time <- getClockTime
if time >= endt
then do
_ <- forkIO $ replicateFn torepl
... | 1,535 | false | false | 0 | 27 | 644 | 377 | 179 | 198 | null | null |
google/hs-fin-vec | finite-table/test/Main.hs | apache-2.0 | testToFrom :: forall a. (Eq a, Show a, Finite a, Bounded a, Enum a) => Property
testToFrom = forAll arbitraryBoundedEnum $ \x -> x === fromFin (toFin @a x) | 155 | testToFrom :: forall a. (Eq a, Show a, Finite a, Bounded a, Enum a) => Property
testToFrom = forAll arbitraryBoundedEnum $ \x -> x === fromFin (toFin @a x) | 155 | testToFrom = forAll arbitraryBoundedEnum $ \x -> x === fromFin (toFin @a x) | 75 | false | true | 0 | 11 | 28 | 78 | 40 | 38 | null | null |
zaxtax/hakaru | haskell/Language/Hakaru/Syntax/AST/Sing.hs | bsd-3-clause | sing_NaryOp Iff = sing | 33 | sing_NaryOp Iff = sing | 33 | sing_NaryOp Iff = sing | 33 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
orangeduck/PyMark | parsers/PyMark.hs | bsd-2-clause | -- Packs a PyMarkObject
pyMarkPackObject :: PyMarkObject -> Put
pyMarkPackObject obj = do
putWord8 $ fromIntegral (typeId obj)
pyMarkPackType (typeId obj) obj
-- Packs a PyMarkObject into a file | 204 | pyMarkPackObject :: PyMarkObject -> Put
pyMarkPackObject obj = do
putWord8 $ fromIntegral (typeId obj)
pyMarkPackType (typeId obj) obj
-- Packs a PyMarkObject into a file | 180 | pyMarkPackObject obj = do
putWord8 $ fromIntegral (typeId obj)
pyMarkPackType (typeId obj) obj
-- Packs a PyMarkObject into a file | 140 | true | true | 0 | 10 | 38 | 50 | 24 | 26 | null | null |
manugunther/sat | Sat/Parser.hs | gpl-3.0 | existsExpresion :: T.Text
existsExpresion = T.concat [ quantInit
, existsSymbol, " "
, quantSep, " "
, quantSep, " "
, quantEnd, " "
] | 269 | existsExpresion :: T.Text
existsExpresion = T.concat [ quantInit
, existsSymbol, " "
, quantSep, " "
, quantSep, " "
, quantEnd, " "
] | 269 | existsExpresion = T.concat [ quantInit
, existsSymbol, " "
, quantSep, " "
, quantSep, " "
, quantEnd, " "
] | 243 | false | true | 0 | 7 | 159 | 51 | 28 | 23 | null | null |
tomahawkins/trs | attic/PIC/Output.hs | bsd-3-clause | instructionCode :: Configuration -> Instruction -> String
instructionCode config instr = case instr of
ADDLW k -> "111110" ++ bin kw k
ADDWF f W -> "000111" ++ "0" ++ bin fw f
ADDWF f F -> "000111" ++ "1" ++ bin fw f
ANDLW k -> "111001" ++ bin kw k
ANDWF f W -> "000101" ++ "0" ++ bin fw f
... | 2,393 | instructionCode :: Configuration -> Instruction -> String
instructionCode config instr = case instr of
ADDLW k -> "111110" ++ bin kw k
ADDWF f W -> "000111" ++ "0" ++ bin fw f
ADDWF f F -> "000111" ++ "1" ++ bin fw f
ANDLW k -> "111001" ++ bin kw k
ANDWF f W -> "000101" ++ "0" ++ bin fw f
... | 2,393 | instructionCode config instr = case instr of
ADDLW k -> "111110" ++ bin kw k
ADDWF f W -> "000111" ++ "0" ++ bin fw f
ADDWF f F -> "000111" ++ "1" ++ bin fw f
ANDLW k -> "111001" ++ bin kw k
ANDWF f W -> "000101" ++ "0" ++ bin fw f
ANDWF f F -> "000101" ++ "1" ++ bin fw f
ASSERT _ _ ... | 2,335 | false | true | 0 | 11 | 783 | 745 | 354 | 391 | null | null |
wavewave/xournal-render | src/Graphics/Xournal/Render/Type/Hitted.hs | bsd-2-clause | mapAL :: (a -> c) -> (b -> d) -> AlterList a b -> AlterList c d
fmapAL _ _ Empty = Empty | 89 | fmapAL :: (a -> c) -> (b -> d) -> AlterList a b -> AlterList c d
fmapAL _ _ Empty = Empty | 89 | fmapAL _ _ Empty = Empty | 24 | false | true | 0 | 9 | 23 | 58 | 28 | 30 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/InspectorFrontendHost.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/InspectorFrontendHost.setAttachedWindowWidth Mozilla InspectorFrontendHost.setAttachedWindowWidth documentation>
setAttachedWindowWidth ::
(MonadDOM m) => InspectorFrontendHost -> Word -> m ()
setAttachedWindowWidth self width
= liftDOM
... | 385 | setAttachedWindowWidth ::
(MonadDOM m) => InspectorFrontendHost -> Word -> m ()
setAttachedWindowWidth self width
= liftDOM
(void (self ^. jsf "setAttachedWindowWidth" [toJSVal width])) | 216 | setAttachedWindowWidth self width
= liftDOM
(void (self ^. jsf "setAttachedWindowWidth" [toJSVal width])) | 113 | true | true | 0 | 12 | 60 | 71 | 34 | 37 | null | null |
rahulmutt/ghcvm | compiler/Eta/StgSyn/StgSyn.hs | bsd-3-clause | -- general case
pprStgRhs (StgRhsClosure cc bi free_vars upd_flag srt args body)
= sdocWithDynFlags $ \dflags ->
hang (hsep [if gopt Opt_SccProfilingOn dflags then ppr cc else empty,
pp_binder_info bi,
ifPprDebug (brackets (interppSP free_vars)),
char '\\' <> ppr up... | 394 | pprStgRhs (StgRhsClosure cc bi free_vars upd_flag srt args body)
= sdocWithDynFlags $ \dflags ->
hang (hsep [if gopt Opt_SccProfilingOn dflags then ppr cc else empty,
pp_binder_info bi,
ifPprDebug (brackets (interppSP free_vars)),
char '\\' <> ppr upd_flag, pprMaybe... | 378 | pprStgRhs (StgRhsClosure cc bi free_vars upd_flag srt args body)
= sdocWithDynFlags $ \dflags ->
hang (hsep [if gopt Opt_SccProfilingOn dflags then ppr cc else empty,
pp_binder_info bi,
ifPprDebug (brackets (interppSP free_vars)),
char '\\' <> ppr upd_flag, pprMaybe... | 378 | true | false | 2 | 12 | 109 | 135 | 65 | 70 | null | null |
pxqr/intset | tests/Main.hs | bsd-3-clause | prop_eqRefl :: IntSet -> Bool
prop_eqRefl a = a == a | 52 | prop_eqRefl :: IntSet -> Bool
prop_eqRefl a = a == a | 52 | prop_eqRefl a = a == a | 22 | false | true | 0 | 7 | 10 | 28 | 12 | 16 | null | null |
ocharles/hackage-server | Distribution/Server/Pages/Template.hs | bsd-3-clause | -- URL of the list of recent additions to the database
recentAdditionsURL :: URL
recentAdditionsURL = "/packages/recent" | 120 | recentAdditionsURL :: URL
recentAdditionsURL = "/packages/recent" | 65 | recentAdditionsURL = "/packages/recent" | 39 | true | true | 0 | 6 | 16 | 19 | 8 | 11 | null | null |
gregorias/pixelosolver | src/PixeloSolver/AI/OCR.hs | bsd-3-clause | safeHead :: [a] -> Maybe a
safeHead [] = Nothing | 48 | safeHead :: [a] -> Maybe a
safeHead [] = Nothing | 48 | safeHead [] = Nothing | 21 | false | true | 0 | 8 | 9 | 31 | 14 | 17 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.