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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AshyIsMe/osxmonad
|
OSXMonad/Keys.hs
|
bsd-3-clause
|
{--- Dvorak-}
{-osxKeyToX11 :: Int -> KeySym-}
{-osxKeyToX11 0x00 = xK_a-}
{-osxKeyToX11 0x01 = xK_o-}
{-osxKeyToX11 0x02 = xK_e-}
{-osxKeyToX11 0x03 = xK_u-}
{-osxKeyToX11 0x04 = xK_d-}
{-osxKeyToX11 0x05 = xK_i-}
{-osxKeyToX11 0x06 = xK_semicolon-}
{-osxKeyToX11 0x07 = xK_q-}
{-osxKeyToX11 0x08 = xK_j-}
{-osxKeyToX11 0x09 = xK_k-}
{-osxKeyToX11 0x0B = xK_x-}
{-osxKeyToX11 0x0C = xK_apostrophe-}
{-osxKeyToX11 0x0D = xK_comma-}
{-osxKeyToX11 0x0E = xK_period-}
{-osxKeyToX11 0x0F = xK_p-}
{-osxKeyToX11 0x10 = xK_f-}
{-osxKeyToX11 0x11 = xK_y-}
{-osxKeyToX11 0x12 = xK_1-}
{-osxKeyToX11 0x13 = xK_2-}
{-osxKeyToX11 0x14 = xK_3-}
{-osxKeyToX11 0x15 = xK_4-}
{-osxKeyToX11 0x16 = xK_6-}
{-osxKeyToX11 0x17 = xK_5-}
{-osxKeyToX11 0x18 = xK_bracketright-}
{-osxKeyToX11 0x19 = xK_9-}
{-osxKeyToX11 0x1A = xK_7-}
{-osxKeyToX11 0x1B = xK_bracketleft-}
{-osxKeyToX11 0x1C = xK_8-}
{-osxKeyToX11 0x1D = xK_0-}
{-osxKeyToX11 0x1E = xK_equal-}
{-osxKeyToX11 0x1F = xK_r-}
{-osxKeyToX11 0x20 = xK_g-}
{-osxKeyToX11 0x21 = xK_slash-}
{-osxKeyToX11 0x22 = xK_c-}
{-osxKeyToX11 0x23 = xK_l-}
{-osxKeyToX11 0x25 = xK_n-}
{-osxKeyToX11 0x26 = xK_h-}
{-osxKeyToX11 0x27 = xK_minus-}
{-osxKeyToX11 0x28 = xK_t-}
{-osxKeyToX11 0x29 = xK_s-}
{-osxKeyToX11 0x2A = xK_backslash-}
{-osxKeyToX11 0x2B = xK_w-}
{-osxKeyToX11 0x2C = xK_z-}
{-osxKeyToX11 0x2D = xK_b-}
{-osxKeyToX11 0x2E = xK_m-}
{-osxKeyToX11 0x2F = xK_v-}
{-osxKeyToX11 0x32 = xK_grave-}
{-osxKeyToX11 0x41 = xK_KP_Decimal-}
{-osxKeyToX11 0x43 = xK_KP_Multiply-}
{-osxKeyToX11 0x45 = xK_KP_Add-}
{--- TODO: 0x47-}
{-osxKeyToX11 0x48 = xK_KP_Divide-}
{-osxKeyToX11 0x4C = xK_KP_Enter-}
{-osxKeyToX11 0x4E = xK_KP_Subtract-}
{-osxKeyToX11 0x51 = xK_KP_Equal-}
{-osxKeyToX11 0x52 = xK_KP_0-}
{-osxKeyToX11 0x53 = xK_KP_1-}
{-osxKeyToX11 0x54 = xK_KP_2-}
{-osxKeyToX11 0x55 = xK_KP_3-}
{-osxKeyToX11 0x56 = xK_KP_4-}
{-osxKeyToX11 0x57 = xK_KP_5-}
{-osxKeyToX11 0x58 = xK_KP_6-}
{-osxKeyToX11 0x59 = xK_KP_7-}
{-osxKeyToX11 0x5B = xK_KP_8-}
{-osxKeyToX11 0x5C = xK_KP_9-}
osxKeyToX11 0x24 = xK_Return
| 2,044
|
osxKeyToX11 0x24 = xK_Return
| 28
|
osxKeyToX11 0x24 = xK_Return
| 28
| true
| false
| 0
| 5
| 271
| 76
| 71
| 5
| null | null |
mrwonko/wonkococo
|
wcc/Regex.hs
|
mit
|
deriveCharacter c (l `Intersection` r) = deriveCharacter c l `intersection` deriveCharacter c r
| 95
|
deriveCharacter c (l `Intersection` r) = deriveCharacter c l `intersection` deriveCharacter c r
| 95
|
deriveCharacter c (l `Intersection` r) = deriveCharacter c l `intersection` deriveCharacter c r
| 95
| false
| false
| 0
| 7
| 12
| 36
| 19
| 17
| null | null |
bacchanalia/KitchenSink
|
KitchenSink/Qualified.hs
|
gpl-3.0
|
-- |'VSM.set'
vsm_set = VSM.set
| 31
|
vsm_set = VSM.set
| 17
|
vsm_set = VSM.set
| 17
| true
| false
| 0
| 5
| 4
| 9
| 5
| 4
| null | null |
alexbaluta/courseography
|
dependencies/HaXml-1.25.3/src/Text/XML/HaXml/ParseLazy.hs
|
gpl-3.0
|
publicid :: XParser PublicID
publicid = do
word "PUBLIC"
p <- pubidliteral
return (PUBLICID p)
| 106
|
publicid :: XParser PublicID
publicid = do
word "PUBLIC"
p <- pubidliteral
return (PUBLICID p)
| 106
|
publicid = do
word "PUBLIC"
p <- pubidliteral
return (PUBLICID p)
| 77
| false
| true
| 1
| 10
| 26
| 43
| 17
| 26
| null | null |
GaloisInc/halvm-ghc
|
utils/genapply/Main.hs
|
bsd-3-clause
|
showArg V32 = "v32"
| 19
|
showArg V32 = "v32"
| 19
|
showArg V32 = "v32"
| 19
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
jwiegley/ghc-release
|
compiler/llvmGen/LlvmCodeGen/Base.hs
|
gpl-3.0
|
-- | Alignment to use for into tables
llvmInfAlign :: DynFlags -> LMAlign
llvmInfAlign dflags = Just (wORD_SIZE dflags)
| 119
|
llvmInfAlign :: DynFlags -> LMAlign
llvmInfAlign dflags = Just (wORD_SIZE dflags)
| 81
|
llvmInfAlign dflags = Just (wORD_SIZE dflags)
| 45
| true
| true
| 0
| 7
| 18
| 28
| 14
| 14
| null | null |
michaelochurch/summer-2015-haskell-class
|
Lisp/Builtins.hs
|
mit
|
eq (LVNumber v1) (LVNumber v2) = v1 == v2
| 41
|
eq (LVNumber v1) (LVNumber v2) = v1 == v2
| 41
|
eq (LVNumber v1) (LVNumber v2) = v1 == v2
| 41
| false
| false
| 0
| 6
| 8
| 29
| 13
| 16
| null | null |
glguy/ssh-hans
|
client/Main.hs
|
bsd-3-clause
|
-- TODO(conathan): add a default algorithm selection which is better
-- than the current "all algorithms" default. Some ideas for what
-- should be in the default here:
-- https://stribika.github.io/2015/01/04/secure-secure-shell.html.
-- TODO(conathan): implement key reexchange after threshold: RFC 4253
-- section 9 suggests that key reexchange should happen about every
-- hour or every GB of traffic, whichever comes first.
-- TODO(conathan): add real argument parsing? E.g., OpenSSh uses your
-- current username unless you put '<user>@' in front of the host name.
main :: IO ()
main = do
args <- getArgs
when ("-h" `elem` args || "--help" `elem` args ||
not (length args `elem` [3,4])) $ do
progName <- getProgName
die . unlines $
[ "usage: "++progName++" USER SERVER_ADDR SERVER_PORT [PRIVATE_KEY]"
, ""
, "The optional private key file must be in OpenSSH format;"
, "see `:/client/README.md` for details."
]
let (user:host:portStr:rest) = args
let port = read portStr
handle <- fmap handle2HandleLike $ withSocketsDo $
connectTo host (PortNumber $ fromIntegral port)
let keyFile = case rest of
[file] -> Just file
_ -> Nothing
let version = "SSH-HANS-Client"
let getPw = Just $ defaultGetPassword user host
let prefs = Just proposalPrefs
let transportHook = Nothing
-- Use an 'MVar' to tell the main thread when to clean up and
-- exit. Recall that in Haskell, all other threads get killed when
-- the main thread exits.
doneMVar <- C.newEmptyMVar
let channelHook = Just $ \h state -> do
let e k = echoChannelHook k h state
void $ mapConcurrently e [10..20]
C.putMVar doneMVar ()
let debugLevel = 1
clientSt <- defaultClientState
debugLevel
version user host port handle getPw
keyFile prefs transportHook channelHook
killClient <- sshClient clientSt
void $ C.takeMVar doneMVar
killClient
-- Might be useful for sending keys to server later.
{-
home <- getHomeDirectory
pubKeys <- loadPublicKeys (home </> ".ssh" </> "authorized_keys")
user <- getEnv "USER"
let creds = [(S8.pack user,pubKeys)]
-}
| 2,278
|
main :: IO ()
main = do
args <- getArgs
when ("-h" `elem` args || "--help" `elem` args ||
not (length args `elem` [3,4])) $ do
progName <- getProgName
die . unlines $
[ "usage: "++progName++" USER SERVER_ADDR SERVER_PORT [PRIVATE_KEY]"
, ""
, "The optional private key file must be in OpenSSH format;"
, "see `:/client/README.md` for details."
]
let (user:host:portStr:rest) = args
let port = read portStr
handle <- fmap handle2HandleLike $ withSocketsDo $
connectTo host (PortNumber $ fromIntegral port)
let keyFile = case rest of
[file] -> Just file
_ -> Nothing
let version = "SSH-HANS-Client"
let getPw = Just $ defaultGetPassword user host
let prefs = Just proposalPrefs
let transportHook = Nothing
-- Use an 'MVar' to tell the main thread when to clean up and
-- exit. Recall that in Haskell, all other threads get killed when
-- the main thread exits.
doneMVar <- C.newEmptyMVar
let channelHook = Just $ \h state -> do
let e k = echoChannelHook k h state
void $ mapConcurrently e [10..20]
C.putMVar doneMVar ()
let debugLevel = 1
clientSt <- defaultClientState
debugLevel
version user host port handle getPw
keyFile prefs transportHook channelHook
killClient <- sshClient clientSt
void $ C.takeMVar doneMVar
killClient
-- Might be useful for sending keys to server later.
{-
home <- getHomeDirectory
pubKeys <- loadPublicKeys (home </> ".ssh" </> "authorized_keys")
user <- getEnv "USER"
let creds = [(S8.pack user,pubKeys)]
-}
| 1,705
|
main = do
args <- getArgs
when ("-h" `elem` args || "--help" `elem` args ||
not (length args `elem` [3,4])) $ do
progName <- getProgName
die . unlines $
[ "usage: "++progName++" USER SERVER_ADDR SERVER_PORT [PRIVATE_KEY]"
, ""
, "The optional private key file must be in OpenSSH format;"
, "see `:/client/README.md` for details."
]
let (user:host:portStr:rest) = args
let port = read portStr
handle <- fmap handle2HandleLike $ withSocketsDo $
connectTo host (PortNumber $ fromIntegral port)
let keyFile = case rest of
[file] -> Just file
_ -> Nothing
let version = "SSH-HANS-Client"
let getPw = Just $ defaultGetPassword user host
let prefs = Just proposalPrefs
let transportHook = Nothing
-- Use an 'MVar' to tell the main thread when to clean up and
-- exit. Recall that in Haskell, all other threads get killed when
-- the main thread exits.
doneMVar <- C.newEmptyMVar
let channelHook = Just $ \h state -> do
let e k = echoChannelHook k h state
void $ mapConcurrently e [10..20]
C.putMVar doneMVar ()
let debugLevel = 1
clientSt <- defaultClientState
debugLevel
version user host port handle getPw
keyFile prefs transportHook channelHook
killClient <- sshClient clientSt
void $ C.takeMVar doneMVar
killClient
-- Might be useful for sending keys to server later.
{-
home <- getHomeDirectory
pubKeys <- loadPublicKeys (home </> ".ssh" </> "authorized_keys")
user <- getEnv "USER"
let creds = [(S8.pack user,pubKeys)]
-}
| 1,691
| true
| true
| 12
| 13
| 588
| 395
| 205
| 190
| null | null |
SimonRichards/HaskellOfLife
|
georgie.hs
|
apache-2.0
|
sqrtSums :: Int
sqrtSums = length (takeWhile (<100)(scanl1 (+) (map sqrt [1..]))) + 1
| 85
|
sqrtSums :: Int
sqrtSums = length (takeWhile (<100)(scanl1 (+) (map sqrt [1..]))) + 1
| 85
|
sqrtSums = length (takeWhile (<100)(scanl1 (+) (map sqrt [1..]))) + 1
| 69
| false
| true
| 0
| 13
| 13
| 51
| 28
| 23
| null | null |
nevrenato/HetsAlloy
|
Syntax/Parse_AS_Library.hs
|
gpl-2.0
|
library :: LogicGraph -> AParser st LIB_DEFN
library lG = do
(lG1, an1) <- lGAnnos lG
(ps, ln) <- option (nullRange, iriLibName nullIRI) $ do
s1 <- asKey libraryS <|> asKey distributedOntologyS
n <- libName lG1
return (tokPos s1, n)
(lG2, an2) <- lGAnnos lG1
ls <- libItems lG2
return (Lib_defn ln ls ps (an1 ++ an2))
-- | Parse library name
| 380
|
library :: LogicGraph -> AParser st LIB_DEFN
library lG = do
(lG1, an1) <- lGAnnos lG
(ps, ln) <- option (nullRange, iriLibName nullIRI) $ do
s1 <- asKey libraryS <|> asKey distributedOntologyS
n <- libName lG1
return (tokPos s1, n)
(lG2, an2) <- lGAnnos lG1
ls <- libItems lG2
return (Lib_defn ln ls ps (an1 ++ an2))
-- | Parse library name
| 380
|
library lG = do
(lG1, an1) <- lGAnnos lG
(ps, ln) <- option (nullRange, iriLibName nullIRI) $ do
s1 <- asKey libraryS <|> asKey distributedOntologyS
n <- libName lG1
return (tokPos s1, n)
(lG2, an2) <- lGAnnos lG1
ls <- libItems lG2
return (Lib_defn ln ls ps (an1 ++ an2))
-- | Parse library name
| 335
| false
| true
| 0
| 13
| 100
| 162
| 77
| 85
| null | null |
yuto-matsum/contest-util-hs
|
src/Euler/021.hs
|
mit
|
answer n = concat [if p/=q then p:q:[] else [] | (p:q:[])<-amicables n]
| 71
|
answer n = concat [if p/=q then p:q:[] else [] | (p:q:[])<-amicables n]
| 71
|
answer n = concat [if p/=q then p:q:[] else [] | (p:q:[])<-amicables n]
| 71
| false
| false
| 1
| 12
| 12
| 67
| 32
| 35
| null | null |
collective/ECSpooler
|
backends/haskell/haskell_libs/ListQueue.hs
|
gpl-2.0
|
enqueue x (Q q) = Q (q ++ [x])
| 33
|
enqueue x (Q q) = Q (q ++ [x])
| 33
|
enqueue x (Q q) = Q (q ++ [x])
| 33
| false
| false
| 0
| 8
| 11
| 30
| 15
| 15
| null | null |
mrakgr/futhark
|
src/Language/Futhark/TypeChecker.hs
|
bsd-3-clause
|
checkExp (Rearrange perm arrexp pos) = do
arrexp' <- checkExp arrexp
let rank = arrayRank $ typeOf arrexp'
when (length perm /= rank || sort perm /= [0..rank-1]) $
bad $ PermutationError pos perm rank name
return $ Rearrange perm arrexp' pos
where name = case arrexp of Var v -> Just $ baseName $ identName v
_ -> Nothing
| 369
|
checkExp (Rearrange perm arrexp pos) = do
arrexp' <- checkExp arrexp
let rank = arrayRank $ typeOf arrexp'
when (length perm /= rank || sort perm /= [0..rank-1]) $
bad $ PermutationError pos perm rank name
return $ Rearrange perm arrexp' pos
where name = case arrexp of Var v -> Just $ baseName $ identName v
_ -> Nothing
| 369
|
checkExp (Rearrange perm arrexp pos) = do
arrexp' <- checkExp arrexp
let rank = arrayRank $ typeOf arrexp'
when (length perm /= rank || sort perm /= [0..rank-1]) $
bad $ PermutationError pos perm rank name
return $ Rearrange perm arrexp' pos
where name = case arrexp of Var v -> Just $ baseName $ identName v
_ -> Nothing
| 369
| false
| false
| 0
| 14
| 107
| 150
| 69
| 81
| null | null |
brendanhay/gogol
|
gogol-books/gen/Network/Google/Books/Types/Product.hs
|
mpl-2.0
|
-- | Resource type.
mKind :: Lens' Metadata (Maybe Text)
mKind = lens _mKind (\ s a -> s{_mKind = a})
| 101
|
mKind :: Lens' Metadata (Maybe Text)
mKind = lens _mKind (\ s a -> s{_mKind = a})
| 81
|
mKind = lens _mKind (\ s a -> s{_mKind = a})
| 44
| true
| true
| 1
| 9
| 20
| 49
| 25
| 24
| null | null |
DougBurke/swish
|
src/Swish/RDF/Vocabulary/SIOC.hs
|
lgpl-2.1
|
-- | @sioc:avatar@ from <http://rdfs.org/sioc/spec/#term_avatar>.
siocavatar :: ScopedName
siocavatar = toS "avatar"
| 117
|
siocavatar :: ScopedName
siocavatar = toS "avatar"
| 50
|
siocavatar = toS "avatar"
| 25
| true
| true
| 0
| 5
| 12
| 15
| 8
| 7
| null | null |
haskell-munich/db
|
src/Database/Distributed/Parser.hs
|
bsd-3-clause
|
anyString :: Parser String
anyString = many (noneOf ";")
| 56
|
anyString :: Parser String
anyString = many (noneOf ";")
| 56
|
anyString = many (noneOf ";")
| 29
| false
| true
| 0
| 7
| 8
| 23
| 11
| 12
| null | null |
Jim-Holmstroem/ArchLinux
|
window_manager/root/home/jim/.xmonad/xmonad.hs
|
unlicense
|
baseConfig = desktopConfig
| 26
|
baseConfig = desktopConfig
| 26
|
baseConfig = desktopConfig
| 26
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
bendmorris/scotch
|
Scotch/Parse/Expressions.hs
|
gpl-3.0
|
nonCurryExpression = try (operation False) <|>
term
| 72
|
nonCurryExpression = try (operation False) <|>
term
| 72
|
nonCurryExpression = try (operation False) <|>
term
| 72
| false
| false
| 1
| 7
| 27
| 23
| 9
| 14
| null | null |
mitchellwrosen/slacky
|
app/Main.hs
|
bsd-3-clause
|
wsClient
:: forall m.
(MonadLogger m, MonadMask m, MonadIO m, MonadBaseUnlift IO m)
=> RtmInfo -> WebSockets.Connection -> m ()
wsClient RtmInfo{..} conn = do
msg_queue <- io (newMVar [])
serverState <-
io (newServerState
(swapMVar msg_queue [])
(WebSockets.sendTextData conn)
(rtmUsers <> rtmChannels <> rtmGroups <> rtmIMs)
(invertMap (rtmChannels <> rtmGroups <> rtmIMs)))
let server :: m ()
server = runDomainSocket globalSockfile (slackyServer serverState)
client :: m ()
client =
slackyClient
(clientState (\m -> modifyMVarMasked_ msg_queue (\ms -> pure (m:ms)))
(WebSockets.receiveData conn))
race_ server client
-- | Does the following:
--
-- - ensure HOME and SLACK_API_TOKEN env variables exist
-- - cd to ~/.config/slacky
-- - attempt to acquire lock on pidfile
--
-- If successfull, passes the "write pid to pidfile" action and the Slack API
-- token to the provided continuation.
| 996
|
wsClient
:: forall m.
(MonadLogger m, MonadMask m, MonadIO m, MonadBaseUnlift IO m)
=> RtmInfo -> WebSockets.Connection -> m ()
wsClient RtmInfo{..} conn = do
msg_queue <- io (newMVar [])
serverState <-
io (newServerState
(swapMVar msg_queue [])
(WebSockets.sendTextData conn)
(rtmUsers <> rtmChannels <> rtmGroups <> rtmIMs)
(invertMap (rtmChannels <> rtmGroups <> rtmIMs)))
let server :: m ()
server = runDomainSocket globalSockfile (slackyServer serverState)
client :: m ()
client =
slackyClient
(clientState (\m -> modifyMVarMasked_ msg_queue (\ms -> pure (m:ms)))
(WebSockets.receiveData conn))
race_ server client
-- | Does the following:
--
-- - ensure HOME and SLACK_API_TOKEN env variables exist
-- - cd to ~/.config/slacky
-- - attempt to acquire lock on pidfile
--
-- If successfull, passes the "write pid to pidfile" action and the Slack API
-- token to the provided continuation.
| 996
|
wsClient RtmInfo{..} conn = do
msg_queue <- io (newMVar [])
serverState <-
io (newServerState
(swapMVar msg_queue [])
(WebSockets.sendTextData conn)
(rtmUsers <> rtmChannels <> rtmGroups <> rtmIMs)
(invertMap (rtmChannels <> rtmGroups <> rtmIMs)))
let server :: m ()
server = runDomainSocket globalSockfile (slackyServer serverState)
client :: m ()
client =
slackyClient
(clientState (\m -> modifyMVarMasked_ msg_queue (\ms -> pure (m:ms)))
(WebSockets.receiveData conn))
race_ server client
-- | Does the following:
--
-- - ensure HOME and SLACK_API_TOKEN env variables exist
-- - cd to ~/.config/slacky
-- - attempt to acquire lock on pidfile
--
-- If successfull, passes the "write pid to pidfile" action and the Slack API
-- token to the provided continuation.
| 859
| false
| true
| 0
| 21
| 236
| 276
| 140
| 136
| null | null |
royopa/pandoc
|
src/Text/Pandoc.hs
|
gpl-2.0
|
getDefaultExtensions "epub" = Set.fromList [Ext_auto_identifiers,
Ext_raw_html,
Ext_native_divs,
Ext_native_spans,
Ext_epub_html_exts]
| 365
|
getDefaultExtensions "epub" = Set.fromList [Ext_auto_identifiers,
Ext_raw_html,
Ext_native_divs,
Ext_native_spans,
Ext_epub_html_exts]
| 365
|
getDefaultExtensions "epub" = Set.fromList [Ext_auto_identifiers,
Ext_raw_html,
Ext_native_divs,
Ext_native_spans,
Ext_epub_html_exts]
| 365
| false
| false
| 0
| 6
| 239
| 29
| 16
| 13
| null | null |
ChrisSwires/One
|
Handler/Blog.hs
|
bsd-2-clause
|
-- The view showing the list of articles
getBlogR :: Handler RepHtml
getBlogR = do
muser <- maybeAuth
-- Get the list of articles inside the database.
articles <- runDB $ selectList [] [Desc ArticleTitle]
(articleWidget, enctype) <- generateFormPost entryForm
defaultLayout $ do
$(widgetFile "articles")
[whamlet|
$maybe Entity _ user <- muser
$if isAdmin user
<form method=post enctype=#{enctype}>
^{articleWidget}
<div>
<input type=submit value=Post New Article>
|]
| 614
|
getBlogR :: Handler RepHtml
getBlogR = do
muser <- maybeAuth
-- Get the list of articles inside the database.
articles <- runDB $ selectList [] [Desc ArticleTitle]
(articleWidget, enctype) <- generateFormPost entryForm
defaultLayout $ do
$(widgetFile "articles")
[whamlet|
$maybe Entity _ user <- muser
$if isAdmin user
<form method=post enctype=#{enctype}>
^{articleWidget}
<div>
<input type=submit value=Post New Article>
|]
| 573
|
getBlogR = do
muser <- maybeAuth
-- Get the list of articles inside the database.
articles <- runDB $ selectList [] [Desc ArticleTitle]
(articleWidget, enctype) <- generateFormPost entryForm
defaultLayout $ do
$(widgetFile "articles")
[whamlet|
$maybe Entity _ user <- muser
$if isAdmin user
<form method=post enctype=#{enctype}>
^{articleWidget}
<div>
<input type=submit value=Post New Article>
|]
| 545
| true
| true
| 0
| 12
| 212
| 87
| 43
| 44
| null | null |
timtylin/scholdoc-texmath
|
src/Text/TeXMath/Readers/OMML.hs
|
gpl-2.0
|
oMathRunTextStyleToTextType :: OMathRunTextStyle -> Maybe TextType
oMathRunTextStyleToTextType (Normal) = Just $ TextNormal
| 123
|
oMathRunTextStyleToTextType :: OMathRunTextStyle -> Maybe TextType
oMathRunTextStyleToTextType (Normal) = Just $ TextNormal
| 123
|
oMathRunTextStyleToTextType (Normal) = Just $ TextNormal
| 56
| false
| true
| 0
| 6
| 11
| 28
| 14
| 14
| null | null |
roberth/uu-helium
|
src/Helium/Parser/Lexer.hs
|
gpl-3.0
|
lexOneLineComment :: Lexer
lexOneLineComment input =
case input of
[] -> mainLexer []
('\n':cs) -> do
nextPos '\n'
mainLexer cs
(c:cs) -> do
nextPos c
lexOneLineComment cs
| 247
|
lexOneLineComment :: Lexer
lexOneLineComment input =
case input of
[] -> mainLexer []
('\n':cs) -> do
nextPos '\n'
mainLexer cs
(c:cs) -> do
nextPos c
lexOneLineComment cs
| 247
|
lexOneLineComment input =
case input of
[] -> mainLexer []
('\n':cs) -> do
nextPos '\n'
mainLexer cs
(c:cs) -> do
nextPos c
lexOneLineComment cs
| 220
| false
| true
| 0
| 11
| 102
| 87
| 38
| 49
| null | null |
jyrimatti/alava
|
src-lib/TypeCheck.hs
|
mit
|
tcTerm env term@(App f arg) Nothing = do
logDebug $ "tcTerm: " <> show term
(eF, tF) <- inferType env f
(mname, eA, eB) <- ensurePi env tF
logDebug $ "Checking if application parameter (" <> show arg <> ") matches function argument type (" <> show eA <> ")"
(eArg, _) <- withExceptT ((<>) $ err $ AppTypesDontMatch env term eA arg) $ checkType env arg eA
let substitutedB = subst mname eArg eB
logAndReturn (EApp term eF eArg substitutedB) substitutedB
| 483
|
tcTerm env term@(App f arg) Nothing = do
logDebug $ "tcTerm: " <> show term
(eF, tF) <- inferType env f
(mname, eA, eB) <- ensurePi env tF
logDebug $ "Checking if application parameter (" <> show arg <> ") matches function argument type (" <> show eA <> ")"
(eArg, _) <- withExceptT ((<>) $ err $ AppTypesDontMatch env term eA arg) $ checkType env arg eA
let substitutedB = subst mname eArg eB
logAndReturn (EApp term eF eArg substitutedB) substitutedB
| 483
|
tcTerm env term@(App f arg) Nothing = do
logDebug $ "tcTerm: " <> show term
(eF, tF) <- inferType env f
(mname, eA, eB) <- ensurePi env tF
logDebug $ "Checking if application parameter (" <> show arg <> ") matches function argument type (" <> show eA <> ")"
(eArg, _) <- withExceptT ((<>) $ err $ AppTypesDontMatch env term eA arg) $ checkType env arg eA
let substitutedB = subst mname eArg eB
logAndReturn (EApp term eF eArg substitutedB) substitutedB
| 483
| false
| false
| 0
| 12
| 112
| 196
| 92
| 104
| null | null |
vikraman/ghc
|
testsuite/tests/dependent/should_compile/dynamic-paper.hs
|
bsd-3-clause
|
delta :: forall a. TypeRep a -> a -> a
delta ra x = case (eqT ra rt) of
Just Refl -> case x of MkT y -> y rt x
Nothing -> x
| 153
|
delta :: forall a. TypeRep a -> a -> a
delta ra x = case (eqT ra rt) of
Just Refl -> case x of MkT y -> y rt x
Nothing -> x
| 153
|
delta ra x = case (eqT ra rt) of
Just Refl -> case x of MkT y -> y rt x
Nothing -> x
| 114
| false
| true
| 0
| 11
| 63
| 82
| 38
| 44
| null | null |
jeroennoels/exact-real
|
src/Ternary/Sampling/Calculation.hs
|
mit
|
initNodeCalc (Plus a b) shift = initPlusMinNodeCalc a b shift id
| 64
|
initNodeCalc (Plus a b) shift = initPlusMinNodeCalc a b shift id
| 64
|
initNodeCalc (Plus a b) shift = initPlusMinNodeCalc a b shift id
| 64
| false
| false
| 0
| 7
| 10
| 28
| 13
| 15
| null | null |
ezyang/ghc
|
compiler/typecheck/TcGenDeriv.hs
|
bsd-3-clause
|
isSym (c : _) = startsVarSym c || startsConSym c
| 48
|
isSym (c : _) = startsVarSym c || startsConSym c
| 48
|
isSym (c : _) = startsVarSym c || startsConSym c
| 48
| false
| false
| 0
| 6
| 9
| 27
| 12
| 15
| null | null |
olorin/amazonka
|
amazonka-directconnect/test/Test/AWS/Gen/DirectConnect.hs
|
mpl-2.0
|
testAllocatePublicVirtualInterfaceResponse :: VirtualInterface -> TestTree
testAllocatePublicVirtualInterfaceResponse = res
"AllocatePublicVirtualInterfaceResponse"
"fixture/AllocatePublicVirtualInterfaceResponse.proto"
directConnect
(Proxy :: Proxy AllocatePublicVirtualInterface)
| 297
|
testAllocatePublicVirtualInterfaceResponse :: VirtualInterface -> TestTree
testAllocatePublicVirtualInterfaceResponse = res
"AllocatePublicVirtualInterfaceResponse"
"fixture/AllocatePublicVirtualInterfaceResponse.proto"
directConnect
(Proxy :: Proxy AllocatePublicVirtualInterface)
| 297
|
testAllocatePublicVirtualInterfaceResponse = res
"AllocatePublicVirtualInterfaceResponse"
"fixture/AllocatePublicVirtualInterfaceResponse.proto"
directConnect
(Proxy :: Proxy AllocatePublicVirtualInterface)
| 222
| false
| true
| 0
| 6
| 30
| 36
| 17
| 19
| null | null |
jsavatgy/hatupist
|
code/timing.hs
|
gpl-2.0
|
rColFuncs = [ rDate, rSpeed . rMrks, show . rRank, rErrorPros]
| 69
|
rColFuncs = [ rDate, rSpeed . rMrks, show . rRank, rErrorPros]
| 69
|
rColFuncs = [ rDate, rSpeed . rMrks, show . rRank, rErrorPros]
| 69
| false
| false
| 0
| 6
| 17
| 26
| 15
| 11
| null | null |
brendanhay/gogol
|
gogol-compute/gen/Network/Google/Resource/Compute/FirewallPolicies/RemoveRule.hs
|
mpl-2.0
|
-- | The priority of the rule to remove from the firewall policy.
fprrPriority :: Lens' FirewallPoliciesRemoveRule (Maybe Int32)
fprrPriority
= lens _fprrPriority (\ s a -> s{_fprrPriority = a})
. mapping _Coerce
| 220
|
fprrPriority :: Lens' FirewallPoliciesRemoveRule (Maybe Int32)
fprrPriority
= lens _fprrPriority (\ s a -> s{_fprrPriority = a})
. mapping _Coerce
| 154
|
fprrPriority
= lens _fprrPriority (\ s a -> s{_fprrPriority = a})
. mapping _Coerce
| 91
| true
| true
| 2
| 8
| 40
| 60
| 28
| 32
| null | null |
alexander-at-github/eta
|
libraries/base/Foreign/C/Error.hs
|
bsd-3-clause
|
-- throw current "errno" value
-- ---------------------------
-- | Throw an 'IOError' corresponding to the current value of 'getErrno'.
--
throwErrno :: String -- ^ textual description of the error location
-> IO a
throwErrno loc =
do
errno <- getErrno
ioError (errnoToIOError loc errno Nothing Nothing)
-- guards for IO operations that may fail
-- --------------------------------------
-- | Throw an 'IOError' corresponding to the current value of 'getErrno'
-- if the result value of the 'IO' action meets the given predicate.
--
| 573
|
throwErrno :: String -- ^ textual description of the error location
-> IO a
throwErrno loc =
do
errno <- getErrno
ioError (errnoToIOError loc errno Nothing Nothing)
-- guards for IO operations that may fail
-- --------------------------------------
-- | Throw an 'IOError' corresponding to the current value of 'getErrno'
-- if the result value of the 'IO' action meets the given predicate.
--
| 433
|
throwErrno loc =
do
errno <- getErrno
ioError (errnoToIOError loc errno Nothing Nothing)
-- guards for IO operations that may fail
-- --------------------------------------
-- | Throw an 'IOError' corresponding to the current value of 'getErrno'
-- if the result value of the 'IO' action meets the given predicate.
--
| 331
| true
| true
| 0
| 9
| 123
| 56
| 31
| 25
| null | null |
DavidAlphaFox/ghc
|
libraries/terminfo/System/Console/Terminfo/Edit.hs
|
bsd-3-clause
|
-- | Clear from cursor to end of line.
clearEOL :: TermStr s => Capability s
clearEOL = tiGetOutput1 "el"
| 105
|
clearEOL :: TermStr s => Capability s
clearEOL = tiGetOutput1 "el"
| 66
|
clearEOL = tiGetOutput1 "el"
| 28
| true
| true
| 0
| 7
| 19
| 31
| 13
| 18
| null | null |
AubreyEAnderson/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
prop_checkLiteralBreakingTest3 = verify checkLiteralBreakingTest "[ $foo!=3 ]"
| 78
|
prop_checkLiteralBreakingTest3 = verify checkLiteralBreakingTest "[ $foo!=3 ]"
| 78
|
prop_checkLiteralBreakingTest3 = verify checkLiteralBreakingTest "[ $foo!=3 ]"
| 78
| false
| false
| 0
| 5
| 6
| 11
| 5
| 6
| null | null |
SnipyJulmy/mcs_notes_and_resume
|
fun-and-log-prog/exercices/s02/s02.hs
|
lgpl-3.0
|
delete' (e) (x:xs) = if e == x then xs else x:(delete' e xs)
| 60
|
delete' (e) (x:xs) = if e == x then xs else x:(delete' e xs)
| 60
|
delete' (e) (x:xs) = if e == x then xs else x:(delete' e xs)
| 60
| false
| false
| 0
| 8
| 13
| 45
| 24
| 21
| null | null |
hanshoglund/comb
|
src/Sound/Comb/Prim/Common.hs
|
bsd-3-clause
|
requiredDelay :: Signal -> Int
requiredDelay = go
where
go Random = 0
go Time = 0
go (Constant _) = 0
go (Lift _ _ a) = go a
go (Lift2 _ _ a b) = go a `max` go b
go (Input _) = 0
go (Output n _ a) = n `max` go a
go _ = error "requiredDelay: Unknown signal type, perhaps you forgot simplify"
-- |
-- Optimize a signal. Only works on simplified signals.
--
| 478
|
requiredDelay :: Signal -> Int
requiredDelay = go
where
go Random = 0
go Time = 0
go (Constant _) = 0
go (Lift _ _ a) = go a
go (Lift2 _ _ a b) = go a `max` go b
go (Input _) = 0
go (Output n _ a) = n `max` go a
go _ = error "requiredDelay: Unknown signal type, perhaps you forgot simplify"
-- |
-- Optimize a signal. Only works on simplified signals.
--
| 478
|
requiredDelay = go
where
go Random = 0
go Time = 0
go (Constant _) = 0
go (Lift _ _ a) = go a
go (Lift2 _ _ a b) = go a `max` go b
go (Input _) = 0
go (Output n _ a) = n `max` go a
go _ = error "requiredDelay: Unknown signal type, perhaps you forgot simplify"
-- |
-- Optimize a signal. Only works on simplified signals.
--
| 447
| false
| true
| 7
| 9
| 204
| 153
| 79
| 74
| null | null |
neothemachine/monadiccp
|
src/Control/CP/FD/Interface.hs
|
bsd-3-clause
|
-- class (Solver s, Term s ModelBool, Term s ModelInt, Term s ModelCol) => Modelable s where
-- instance Modelable DummySolver where
-- instance FDSolver s => Modelable (FDInstance s) where
treeToModel :: Tree DummySolver () -> Model
treeToModel (Return _) = BoolConst True
| 277
|
treeToModel :: Tree DummySolver () -> Model
treeToModel (Return _) = BoolConst True
| 83
|
treeToModel (Return _) = BoolConst True
| 39
| true
| true
| 0
| 9
| 47
| 42
| 20
| 22
| null | null |
jhance/llvm-untyped
|
LLVM/Untyped/Core.hs
|
gpl-3.0
|
doubleType :: Type
doubleType = Type L.doubleType
| 49
|
doubleType :: Type
doubleType = Type L.doubleType
| 49
|
doubleType = Type L.doubleType
| 30
| false
| true
| 0
| 6
| 6
| 16
| 8
| 8
| null | null |
weissi/hs-shonky-crypt
|
test/TestShonkyCrypt.hs
|
bsd-3-clause
|
_EPSILON_ :: Double
_EPSILON_ = 0.00001
| 39
|
_EPSILON_ :: Double
_EPSILON_ = 0.00001
| 39
|
_EPSILON_ = 0.00001
| 19
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
conal/lambda-ccc
|
src/LambdaCCC/Unused/Reify.hs
|
bsd-3-clause
|
-- TODO: rename "unless" to "reject"
hasTC :: String -> Type -> Bool
hasTC name (TyConApp tc [_]) = uqName (tyConName tc) == name
| 130
|
hasTC :: String -> Type -> Bool
hasTC name (TyConApp tc [_]) = uqName (tyConName tc) == name
| 92
|
hasTC name (TyConApp tc [_]) = uqName (tyConName tc) == name
| 60
| true
| true
| 0
| 11
| 24
| 55
| 26
| 29
| null | null |
dsalisbury/xmobar
|
src/Plugins/Monitors/Common.hs
|
bsd-3-clause
|
doArgs :: [String] -> ([String] -> Monitor String) -> ([String] -> Monitor Bool) -> Monitor String
doArgs args action detect =
case getOpt Permute options args of
(o, n, []) -> do doConfigOptions o
ready <- detect n
if ready
then action n
else return "<Waiting...>"
(_, _, errs) -> return (concat errs)
| 426
|
doArgs :: [String] -> ([String] -> Monitor String) -> ([String] -> Monitor Bool) -> Monitor String
doArgs args action detect =
case getOpt Permute options args of
(o, n, []) -> do doConfigOptions o
ready <- detect n
if ready
then action n
else return "<Waiting...>"
(_, _, errs) -> return (concat errs)
| 426
|
doArgs args action detect =
case getOpt Permute options args of
(o, n, []) -> do doConfigOptions o
ready <- detect n
if ready
then action n
else return "<Waiting...>"
(_, _, errs) -> return (concat errs)
| 327
| false
| true
| 0
| 11
| 176
| 151
| 75
| 76
| null | null |
elieux/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
opt_P :: DynFlags -> [String]
opt_P dflags = concatMap (wayOptP (targetPlatform dflags)) (ways dflags)
++ sOpt_P (settings dflags)
| 158
|
opt_P :: DynFlags -> [String]
opt_P dflags = concatMap (wayOptP (targetPlatform dflags)) (ways dflags)
++ sOpt_P (settings dflags)
| 158
|
opt_P dflags = concatMap (wayOptP (targetPlatform dflags)) (ways dflags)
++ sOpt_P (settings dflags)
| 112
| false
| true
| 0
| 10
| 45
| 57
| 28
| 29
| null | null |
mightymoose/liquidhaskell
|
tests/todo/maybe0000.hs
|
bsd-3-clause
|
-- crashes with :
-- Fixpoint: Testing Solution
-- z3Pred: error converting && [ (isJust(lq_anf__ddc) <=> false)
-- ; (lq_anf__ddc = ds_dd9)
-- ; (fromJustS([gloop#r9K]) = True#6u)
-- ; (Bexp True#6u)
-- ; (~ ((Bexp False#68)))]
--
-- Fatal error: exception Failure("Z3: type error")
myisJust :: Maybe a -> Bool
myisJust Nothing = True
| 452
|
myisJust :: Maybe a -> Bool
myisJust Nothing = True
| 52
|
myisJust Nothing = True
| 24
| true
| true
| 0
| 6
| 170
| 30
| 19
| 11
| null | null |
uduki/hsQt
|
Qtc/ClassTypes/Gui.hs
|
bsd-2-clause
|
withQIconEngineResult :: IO (Ptr (TQIconEngine a)) -> IO (QIconEngine a)
withQIconEngineResult f
= withObjectResult qtc_QIconEngine_getFinalizer f
| 148
|
withQIconEngineResult :: IO (Ptr (TQIconEngine a)) -> IO (QIconEngine a)
withQIconEngineResult f
= withObjectResult qtc_QIconEngine_getFinalizer f
| 148
|
withQIconEngineResult f
= withObjectResult qtc_QIconEngine_getFinalizer f
| 75
| false
| true
| 0
| 10
| 17
| 47
| 22
| 25
| null | null |
nushio3/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
pprDo MonadComp stmts = brackets $ pprComp stmts
| 55
|
pprDo MonadComp stmts = brackets $ pprComp stmts
| 55
|
pprDo MonadComp stmts = brackets $ pprComp stmts
| 55
| false
| false
| 0
| 6
| 14
| 18
| 8
| 10
| null | null |
mlite/hLLVM
|
src/Llvm/Asm/Printer/Common.hs
|
bsd-3-clause
|
sepMaybe f sep (Just x) = sep $ f x
| 35
|
sepMaybe f sep (Just x) = sep $ f x
| 35
|
sepMaybe f sep (Just x) = sep $ f x
| 35
| false
| false
| 0
| 6
| 9
| 29
| 12
| 17
| null | null |
dimara/ganeti
|
src/Ganeti/Types.hs
|
bsd-2-clause
|
addParamsToStorageUnit _ (SURaw StorageRados key) = SURados key
| 63
|
addParamsToStorageUnit _ (SURaw StorageRados key) = SURados key
| 63
|
addParamsToStorageUnit _ (SURaw StorageRados key) = SURados key
| 63
| false
| false
| 1
| 6
| 7
| 24
| 10
| 14
| null | null |
PaulGustafson/stringnet
|
LocalMoves.hs
|
mit
|
efaultEdgeTree :: TwoComplex -> Vertex -> Tree Edge
defaultEdgeTree = undefined
| 80
|
defaultEdgeTree :: TwoComplex -> Vertex -> Tree Edge
defaultEdgeTree = undefined
| 80
|
defaultEdgeTree = undefined
| 27
| false
| true
| 0
| 7
| 11
| 22
| 11
| 11
| null | null |
elieux/ghc
|
compiler/typecheck/TcGenDeriv.hs
|
bsd-3-clause
|
-- illegal_Expr is used when signalling error conditions in the RHS of a derived
-- method. It is currently only used by Enum.{succ,pred}
illegal_Expr :: String -> String -> String -> LHsExpr RdrName
illegal_Expr meth tp msg =
nlHsApp (nlHsVar error_RDR) (nlHsLit (mkHsString (meth ++ '{':tp ++ "}: " ++ msg)))
| 313
|
illegal_Expr :: String -> String -> String -> LHsExpr RdrName
illegal_Expr meth tp msg =
nlHsApp (nlHsVar error_RDR) (nlHsLit (mkHsString (meth ++ '{':tp ++ "}: " ++ msg)))
| 175
|
illegal_Expr meth tp msg =
nlHsApp (nlHsVar error_RDR) (nlHsLit (mkHsString (meth ++ '{':tp ++ "}: " ++ msg)))
| 113
| true
| true
| 0
| 14
| 53
| 82
| 40
| 42
| null | null |
mettekou/ghc
|
compiler/utils/Bag.hs
|
bsd-3-clause
|
foldlBagM :: (Monad m) => (b -> a -> m b) -> b -> Bag a -> m b
foldlBagM _ z EmptyBag = return z
| 103
|
foldlBagM :: (Monad m) => (b -> a -> m b) -> b -> Bag a -> m b
foldlBagM _ z EmptyBag = return z
| 103
|
foldlBagM _ z EmptyBag = return z
| 40
| false
| true
| 0
| 10
| 32
| 62
| 30
| 32
| null | null |
karamellpelle/MEnv
|
source/MEnv/Keys/IOS.hs
|
bsd-2-clause
|
-- | reset keys
keysClear :: MEnv res ()
keysClear = io $
ios_keysClear
| 76
|
keysClear :: MEnv res ()
keysClear = io $
ios_keysClear
| 60
|
keysClear = io $
ios_keysClear
| 35
| true
| true
| 0
| 6
| 18
| 23
| 12
| 11
| null | null |
romildo/hprettybox
|
src/Text/PrettyPrint/Box.hs
|
bsd-3-clause
|
(<>) :: Box -> Box -> Box
box1 <> box2 = Box (zipWith (++) xs1 xs2)
where
Box xs1 = heighten box1 (height box2)
Box xs2 = heighten box2 (height box1)
| 165
|
(<>) :: Box -> Box -> Box
box1 <> box2 = Box (zipWith (++) xs1 xs2)
where
Box xs1 = heighten box1 (height box2)
Box xs2 = heighten box2 (height box1)
| 165
|
box1 <> box2 = Box (zipWith (++) xs1 xs2)
where
Box xs1 = heighten box1 (height box2)
Box xs2 = heighten box2 (height box1)
| 139
| false
| true
| 1
| 7
| 46
| 81
| 41
| 40
| null | null |
bitemyapp/checkers
|
src/Test/QuickCheck/Instances/Num.hs
|
bsd-3-clause
|
nonZero :: (Eq a, Num a, Arbitrary a) => Gen a -> Gen a
nonZero g =
sized (\s -> satisfiesM (/= 0) (if (s == 0) then (resize 1 g) else g))
| 140
|
nonZero :: (Eq a, Num a, Arbitrary a) => Gen a -> Gen a
nonZero g =
sized (\s -> satisfiesM (/= 0) (if (s == 0) then (resize 1 g) else g))
| 140
|
nonZero g =
sized (\s -> satisfiesM (/= 0) (if (s == 0) then (resize 1 g) else g))
| 84
| false
| true
| 0
| 12
| 34
| 91
| 48
| 43
| null | null |
klarh/hasdy
|
src/Hasdy/Prop.hs
|
apache-2.0
|
reducePerType::Elt a=>(Exp a->Exp a->Exp a)->Exp a->PerTypeProp a->SingleProp a
reducePerType f x0 = SingleProp . unit . M.foldr (f . the) x0 . unPerTypeProp
| 157
|
reducePerType::Elt a=>(Exp a->Exp a->Exp a)->Exp a->PerTypeProp a->SingleProp a
reducePerType f x0 = SingleProp . unit . M.foldr (f . the) x0 . unPerTypeProp
| 157
|
reducePerType f x0 = SingleProp . unit . M.foldr (f . the) x0 . unPerTypeProp
| 77
| false
| true
| 0
| 10
| 22
| 96
| 43
| 53
| null | null |
forked-upstream-packages-for-ghcjs/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
eqRelRole :: EqRel -> Role
eqRelRole NomEq = Nominal
| 53
|
eqRelRole :: EqRel -> Role
eqRelRole NomEq = Nominal
| 53
|
eqRelRole NomEq = Nominal
| 26
| false
| true
| 0
| 7
| 9
| 24
| 10
| 14
| null | null |
harendra-kumar/stack
|
src/main/Main.hs
|
bsd-3-clause
|
dockerResetCmd :: Bool -> GlobalOpts -> IO ()
dockerResetCmd keepHome go@GlobalOpts{..} = do
(manager,lc) <- liftIO (loadConfigWithOpts go)
-- TODO: can we eliminate this lock if it doesn't touch ~/.stack/?
withUserFileLock go (configStackRoot $ lcConfig lc) $ \_ ->
runStackTGlobal manager (lcConfig lc) go $
Docker.preventInContainer $ Docker.reset (lcProjectRoot lc) keepHome
-- | Cleanup Docker images and containers.
| 448
|
dockerResetCmd :: Bool -> GlobalOpts -> IO ()
dockerResetCmd keepHome go@GlobalOpts{..} = do
(manager,lc) <- liftIO (loadConfigWithOpts go)
-- TODO: can we eliminate this lock if it doesn't touch ~/.stack/?
withUserFileLock go (configStackRoot $ lcConfig lc) $ \_ ->
runStackTGlobal manager (lcConfig lc) go $
Docker.preventInContainer $ Docker.reset (lcProjectRoot lc) keepHome
-- | Cleanup Docker images and containers.
| 448
|
dockerResetCmd keepHome go@GlobalOpts{..} = do
(manager,lc) <- liftIO (loadConfigWithOpts go)
-- TODO: can we eliminate this lock if it doesn't touch ~/.stack/?
withUserFileLock go (configStackRoot $ lcConfig lc) $ \_ ->
runStackTGlobal manager (lcConfig lc) go $
Docker.preventInContainer $ Docker.reset (lcProjectRoot lc) keepHome
-- | Cleanup Docker images and containers.
| 402
| false
| true
| 0
| 13
| 84
| 125
| 62
| 63
| null | null |
DanielSchuessler/hstri
|
PreRenderable.hs
|
gpl-3.0
|
pr_mapDs
:: (Vert t ~ Vert s,
Ed t ~ Ed s,
Tri t ~ Tri s,
PreDeltaSet2 s,
OrdToDim1 s
) =>
(t -> s) -> PreRenderable t -> PreRenderable s
pr_mapDs f (PreRenderable a b c d e) = PreRenderable a' b c d e
where
a' = addSuperfaceLookup2 (f (wsl2_underlying a))
| 306
|
pr_mapDs
:: (Vert t ~ Vert s,
Ed t ~ Ed s,
Tri t ~ Tri s,
PreDeltaSet2 s,
OrdToDim1 s
) =>
(t -> s) -> PreRenderable t -> PreRenderable s
pr_mapDs f (PreRenderable a b c d e) = PreRenderable a' b c d e
where
a' = addSuperfaceLookup2 (f (wsl2_underlying a))
| 306
|
pr_mapDs f (PreRenderable a b c d e) = PreRenderable a' b c d e
where
a' = addSuperfaceLookup2 (f (wsl2_underlying a))
| 131
| false
| true
| 1
| 11
| 103
| 149
| 68
| 81
| null | null |
Mokosha/Lambency
|
examples/Pong.hs
|
mit
|
dashedMidsection :: L.Sprite -> [(V2 Float, V2 Int, L.Sprite)]
dashedMidsection s = [(tr x, V2 4 20, s) | x <- [0,1..12]]
where
tr :: Int -> V2 Float
tr x = 0.5 *^ (vi2f2 $ V2 screenWidth (80 * x)) ^-^ (V2 1.5 0)
| 222
|
dashedMidsection :: L.Sprite -> [(V2 Float, V2 Int, L.Sprite)]
dashedMidsection s = [(tr x, V2 4 20, s) | x <- [0,1..12]]
where
tr :: Int -> V2 Float
tr x = 0.5 *^ (vi2f2 $ V2 screenWidth (80 * x)) ^-^ (V2 1.5 0)
| 222
|
dashedMidsection s = [(tr x, V2 4 20, s) | x <- [0,1..12]]
where
tr :: Int -> V2 Float
tr x = 0.5 *^ (vi2f2 $ V2 screenWidth (80 * x)) ^-^ (V2 1.5 0)
| 159
| false
| true
| 0
| 11
| 54
| 139
| 71
| 68
| null | null |
d12frosted/optparse-applicative-kb
|
tests/Tests.hs
|
bsd-3-clause
|
case_cabal_conf :: Assertion
case_cabal_conf = checkHelpText "cabal" Cabal.pinfo ["configure", "--help"]
| 104
|
case_cabal_conf :: Assertion
case_cabal_conf = checkHelpText "cabal" Cabal.pinfo ["configure", "--help"]
| 104
|
case_cabal_conf = checkHelpText "cabal" Cabal.pinfo ["configure", "--help"]
| 75
| false
| true
| 0
| 6
| 9
| 26
| 14
| 12
| null | null |
ghc-android/ghc
|
testsuite/tests/ghci/should_run/ghcirun004.hs
|
bsd-3-clause
|
2545 = 2544
| 11
|
2545 = 2544
| 11
|
2545 = 2544
| 11
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
nomeata/ghc
|
compiler/nativeGen/X86/Ppr.hs
|
bsd-3-clause
|
pprGInstr (GLD1 dst) = pprSizeReg (sLit "gld1") FF64 dst
| 56
|
pprGInstr (GLD1 dst) = pprSizeReg (sLit "gld1") FF64 dst
| 56
|
pprGInstr (GLD1 dst) = pprSizeReg (sLit "gld1") FF64 dst
| 56
| false
| false
| 0
| 7
| 8
| 28
| 13
| 15
| null | null |
sdiehl/ghc
|
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
|
bsd-3-clause
|
pprExp :: Precedence -> Exp -> Doc
pprExp _ (VarE v) = pprName' Applied v
| 77
|
pprExp :: Precedence -> Exp -> Doc
pprExp _ (VarE v) = pprName' Applied v
| 77
|
pprExp _ (VarE v) = pprName' Applied v
| 42
| false
| true
| 0
| 10
| 18
| 40
| 18
| 22
| null | null |
mikoim/musor
|
haskell/Learn You a Haskell for Great Good!/higher-order-function.hs
|
unlicense
|
applyTwice :: (a -> a) -> a -> a
applyTwice f x = f (f x)
| 57
|
applyTwice :: (a -> a) -> a -> a
applyTwice f x = f (f x)
| 57
|
applyTwice f x = f (f x)
| 24
| false
| true
| 0
| 7
| 15
| 40
| 20
| 20
| null | null |
brendanhay/gogol
|
gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Threads/List.hs
|
mpl-2.0
|
-- | Page token to retrieve a specific page of results in the list.
utlPageToken :: Lens' UsersThreadsList (Maybe Text)
utlPageToken
= lens _utlPageToken (\ s a -> s{_utlPageToken = a})
| 187
|
utlPageToken :: Lens' UsersThreadsList (Maybe Text)
utlPageToken
= lens _utlPageToken (\ s a -> s{_utlPageToken = a})
| 119
|
utlPageToken
= lens _utlPageToken (\ s a -> s{_utlPageToken = a})
| 67
| true
| true
| 1
| 9
| 32
| 52
| 25
| 27
| null | null |
GaloisInc/halvm-ghc
|
compiler/basicTypes/DataCon.hs
|
bsd-3-clause
|
-- | Substitute in an 'EqSpec'. Precondition: if the LHS of the EqSpec
-- is mapped in the substitution, it is mapped to a type variable, not
-- a full type.
substEqSpec :: TCvSubst -> EqSpec -> EqSpec
substEqSpec subst (EqSpec tv ty)
= EqSpec tv' (substTy subst ty)
where
tv' = getTyVar "substEqSpec" (substTyVar subst tv)
-- | Filter out any TyBinders mentioned in an EqSpec
| 385
|
substEqSpec :: TCvSubst -> EqSpec -> EqSpec
substEqSpec subst (EqSpec tv ty)
= EqSpec tv' (substTy subst ty)
where
tv' = getTyVar "substEqSpec" (substTyVar subst tv)
-- | Filter out any TyBinders mentioned in an EqSpec
| 227
|
substEqSpec subst (EqSpec tv ty)
= EqSpec tv' (substTy subst ty)
where
tv' = getTyVar "substEqSpec" (substTyVar subst tv)
-- | Filter out any TyBinders mentioned in an EqSpec
| 183
| true
| true
| 0
| 7
| 75
| 70
| 36
| 34
| null | null |
niswegmann/copilot-c99
|
src/Copilot/Compile/C99/Test/ReadCSV.hs
|
bsd-3-clause
|
triggerName :: Record -> String
triggerName = B.unpack . head
| 61
|
triggerName :: Record -> String
triggerName = B.unpack . head
| 61
|
triggerName = B.unpack . head
| 29
| false
| true
| 0
| 6
| 9
| 21
| 11
| 10
| null | null |
olsner/ghc
|
compiler/codeGen/StgCmmForeign.hs
|
bsd-3-clause
|
nursery_bdescr_start dflags cn =
cmmOffset dflags (CmmReg cn) (oFFSET_bdescr_start dflags)
| 93
|
nursery_bdescr_start dflags cn =
cmmOffset dflags (CmmReg cn) (oFFSET_bdescr_start dflags)
| 93
|
nursery_bdescr_start dflags cn =
cmmOffset dflags (CmmReg cn) (oFFSET_bdescr_start dflags)
| 93
| false
| false
| 0
| 7
| 12
| 30
| 14
| 16
| null | null |
fffej/haskellprojects
|
ants/AntsVis.hs
|
bsd-2-clause
|
-- |Timeout for the ants
antTick :: Int
antTick = 100
| 54
|
antTick :: Int
antTick = 100
| 28
|
antTick = 100
| 13
| true
| true
| 0
| 6
| 11
| 19
| 8
| 11
| null | null |
danidiaz/danibot
|
lib/Network/Danibot.hs
|
mit
|
{-| Is the given port listening on the given host?
-}
isUpHandler :: (Text -> IO Text,Description)
isUpHandler =
let go (Text.break isSpace . Text.strip -> (Text.strip -> host,Text.strip -> port)) = do
case (extractAddress host, readMaybe (Text.unpack port)) of
(Right host', Just numericport) -> do
let attempt =
catchAny
(bracket (Network.connectTo (Text.unpack host') (PortNumber (fromInteger numericport)))
hClose
(\_ -> pure "The port is listening."))
(\e -> pure ("Exception when trying to connect: " <> Text.pack (show e)))
either id id <$> race attempt (threadDelay 3e6 *> pure "Timeout.")
_ -> pure "Expected arguments: host port"
in (go, "host port")
where
catchAny :: IO a -> (SomeException -> IO a) -> IO a
catchAny = catch
extractAddress :: Text -> Either String Text
extractAddress txt = Atto.parseOnly extractor txt
where
extractor =
(Atto.string "<" *> Atto.takeTill (\c -> c == '|')
*> Atto.string "|"
*> Atto.takeTill (\c -> c == '>')
<* Atto.string ">")
<|>
Atto.takeText
{-| Builds the help message.
-}
| 1,446
|
isUpHandler :: (Text -> IO Text,Description)
isUpHandler =
let go (Text.break isSpace . Text.strip -> (Text.strip -> host,Text.strip -> port)) = do
case (extractAddress host, readMaybe (Text.unpack port)) of
(Right host', Just numericport) -> do
let attempt =
catchAny
(bracket (Network.connectTo (Text.unpack host') (PortNumber (fromInteger numericport)))
hClose
(\_ -> pure "The port is listening."))
(\e -> pure ("Exception when trying to connect: " <> Text.pack (show e)))
either id id <$> race attempt (threadDelay 3e6 *> pure "Timeout.")
_ -> pure "Expected arguments: host port"
in (go, "host port")
where
catchAny :: IO a -> (SomeException -> IO a) -> IO a
catchAny = catch
extractAddress :: Text -> Either String Text
extractAddress txt = Atto.parseOnly extractor txt
where
extractor =
(Atto.string "<" *> Atto.takeTill (\c -> c == '|')
*> Atto.string "|"
*> Atto.takeTill (\c -> c == '>')
<* Atto.string ">")
<|>
Atto.takeText
{-| Builds the help message.
-}
| 1,389
|
isUpHandler =
let go (Text.break isSpace . Text.strip -> (Text.strip -> host,Text.strip -> port)) = do
case (extractAddress host, readMaybe (Text.unpack port)) of
(Right host', Just numericport) -> do
let attempt =
catchAny
(bracket (Network.connectTo (Text.unpack host') (PortNumber (fromInteger numericport)))
hClose
(\_ -> pure "The port is listening."))
(\e -> pure ("Exception when trying to connect: " <> Text.pack (show e)))
either id id <$> race attempt (threadDelay 3e6 *> pure "Timeout.")
_ -> pure "Expected arguments: host port"
in (go, "host port")
where
catchAny :: IO a -> (SomeException -> IO a) -> IO a
catchAny = catch
extractAddress :: Text -> Either String Text
extractAddress txt = Atto.parseOnly extractor txt
where
extractor =
(Atto.string "<" *> Atto.takeTill (\c -> c == '|')
*> Atto.string "|"
*> Atto.takeTill (\c -> c == '>')
<* Atto.string ">")
<|>
Atto.takeText
{-| Builds the help message.
-}
| 1,344
| true
| true
| 0
| 27
| 585
| 407
| 203
| 204
| null | null |
rad1al/hutton_exercises
|
notes_ch06.hs
|
gpl-2.0
|
drop'' n (x:xs) = drop'' (n-1) xs
| 33
|
drop'' n (x:xs) = drop'' (n-1) xs
| 33
|
drop'' n (x:xs) = drop'' (n-1) xs
| 33
| false
| false
| 0
| 6
| 6
| 33
| 15
| 18
| null | null |
sdiehl/ghc
|
compiler/simplCore/SimplUtils.hs
|
bsd-3-clause
|
contHoleType (CastIt co _) = coercionLKind co
| 64
|
contHoleType (CastIt co _) = coercionLKind co
| 64
|
contHoleType (CastIt co _) = coercionLKind co
| 64
| false
| false
| 0
| 6
| 25
| 21
| 9
| 12
| null | null |
GaloisInc/aterm-utils
|
src/ATerm/Matching.hs
|
bsd-3-clause
|
contains :: [ATermTable -> a] -> ATermTable -> [a]
contains ms t = case getATerm t of
ShAAppl _ ls _ -> containsChildren ms ls t
ShAList ls _ -> containsChildren ms ls t
_ -> mzero
-- | Matches a partial specification of a sub aterm List. The
-- matching is maximised so that if the pattern occurs more than
-- once it is matched each time it appears.
| 373
|
contains :: [ATermTable -> a] -> ATermTable -> [a]
contains ms t = case getATerm t of
ShAAppl _ ls _ -> containsChildren ms ls t
ShAList ls _ -> containsChildren ms ls t
_ -> mzero
-- | Matches a partial specification of a sub aterm List. The
-- matching is maximised so that if the pattern occurs more than
-- once it is matched each time it appears.
| 373
|
contains ms t = case getATerm t of
ShAAppl _ ls _ -> containsChildren ms ls t
ShAList ls _ -> containsChildren ms ls t
_ -> mzero
-- | Matches a partial specification of a sub aterm List. The
-- matching is maximised so that if the pattern occurs more than
-- once it is matched each time it appears.
| 322
| false
| true
| 0
| 9
| 91
| 94
| 45
| 49
| null | null |
gcampax/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
constructorClassName = clsQual gHC_GENERICS (fsLit "Constructor") constructorClassKey
| 85
|
constructorClassName = clsQual gHC_GENERICS (fsLit "Constructor") constructorClassKey
| 85
|
constructorClassName = clsQual gHC_GENERICS (fsLit "Constructor") constructorClassKey
| 85
| false
| false
| 0
| 7
| 6
| 19
| 9
| 10
| null | null |
keithshep/txt-sushi
|
Database/TxtSushi/SQLParser.hs
|
bsd-3-clause
|
opChars :: [Char]
opChars = "~!@#$%^&*-+=|\\<>/?."
| 50
|
opChars :: [Char]
opChars = "~!@#$%^&*-+=|\\<>/?."
| 50
|
opChars = "~!@#$%^&*-+=|\\<>/?."
| 32
| false
| true
| 0
| 5
| 5
| 14
| 8
| 6
| null | null |
brendanhay/gogol
|
gogol-ml/gen/Network/Google/MachineLearning/Types/Product.hs
|
mpl-2.0
|
-- | Output only. The detailed state of a job.
gcmvjState :: Lens' GoogleCloudMlV1__Job (Maybe GoogleCloudMlV1__JobState)
gcmvjState
= lens _gcmvjState (\ s a -> s{_gcmvjState = a})
| 183
|
gcmvjState :: Lens' GoogleCloudMlV1__Job (Maybe GoogleCloudMlV1__JobState)
gcmvjState
= lens _gcmvjState (\ s a -> s{_gcmvjState = a})
| 136
|
gcmvjState
= lens _gcmvjState (\ s a -> s{_gcmvjState = a})
| 61
| true
| true
| 0
| 9
| 28
| 48
| 25
| 23
| null | null |
twopoint718/haifa
|
src/Text/XML/SOAP11/Encoding.hs
|
gpl-2.0
|
thisNamespace = "http://schemas.xmlsoap.org/soap/encoding/"
| 59
|
thisNamespace = "http://schemas.xmlsoap.org/soap/encoding/"
| 59
|
thisNamespace = "http://schemas.xmlsoap.org/soap/encoding/"
| 59
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
scsibug/hbeanstalk
|
Network/Beanstalk.hs
|
bsd-3-clause
|
-- Read a YAML list, and parse it.
readYamlList :: Socket -> IO [B.ByteString]
readYamlList s = do result <- parseWith (recv s 1024) yamlListParser ""
case result of
Done _ x -> return x
_ -> return []
| 272
|
readYamlList :: Socket -> IO [B.ByteString]
readYamlList s = do result <- parseWith (recv s 1024) yamlListParser ""
case result of
Done _ x -> return x
_ -> return []
| 237
|
readYamlList s = do result <- parseWith (recv s 1024) yamlListParser ""
case result of
Done _ x -> return x
_ -> return []
| 193
| true
| true
| 0
| 11
| 109
| 81
| 38
| 43
| null | null |
weissi/diplomarbeit
|
test/TestRAE.hs
|
gpl-3.0
|
_TEST_VAR_MAP_ :: Field el => VarMapping el
_TEST_VAR_MAP_ = M.fromList [ ("x", _VAL_X_)
, (leftVar "x", _VAL_X_)
, (rightVar "x", _VAL_X_)
, ("y", _VAL_Y_)
, (leftVar "y", _VAL_Y_)
, (rightVar "y", _VAL_Y_)
]
| 377
|
_TEST_VAR_MAP_ :: Field el => VarMapping el
_TEST_VAR_MAP_ = M.fromList [ ("x", _VAL_X_)
, (leftVar "x", _VAL_X_)
, (rightVar "x", _VAL_X_)
, ("y", _VAL_Y_)
, (leftVar "y", _VAL_Y_)
, (rightVar "y", _VAL_Y_)
]
| 377
|
_TEST_VAR_MAP_ = M.fromList [ ("x", _VAL_X_)
, (leftVar "x", _VAL_X_)
, (rightVar "x", _VAL_X_)
, ("y", _VAL_Y_)
, (leftVar "y", _VAL_Y_)
, (rightVar "y", _VAL_Y_)
]
| 333
| false
| true
| 0
| 8
| 200
| 92
| 52
| 40
| null | null |
rgoulter/expenses-csv-utils
|
src/Data/Expenses/Parse/Megaparsec/Document.hs
|
mit
|
-- PARSER
scn :: Parser ()
scn = hidden . skipMany $ choice [void spaceChar, L.skipLineComment "#"]
| 102
|
scn :: Parser ()
scn = hidden . skipMany $ choice [void spaceChar, L.skipLineComment "#"]
| 89
|
scn = hidden . skipMany $ choice [void spaceChar, L.skipLineComment "#"]
| 72
| true
| true
| 0
| 9
| 19
| 42
| 21
| 21
| null | null |
termite2/simple-abstractor
|
SimpleAbstractor/Analysis.hs
|
bsd-3-clause
|
valExprToAST :: ValExpr (ASTEqPred ValType) ValType -> P v c f ValType
valExprToAST (Lit l) = P $ Leaf (Right l)
| 118
|
valExprToAST :: ValExpr (ASTEqPred ValType) ValType -> P v c f ValType
valExprToAST (Lit l) = P $ Leaf (Right l)
| 118
|
valExprToAST (Lit l) = P $ Leaf (Right l)
| 47
| false
| true
| 0
| 8
| 26
| 57
| 27
| 30
| null | null |
jrclogic/SMCDEL
|
src/SMCDEL/Examples/MuddyChildren.hs
|
gpl-2.0
|
mudScn1 :: KnowScene
mudScn1 = update mudScn0 (nobodyknows 3)
| 61
|
mudScn1 :: KnowScene
mudScn1 = update mudScn0 (nobodyknows 3)
| 61
|
mudScn1 = update mudScn0 (nobodyknows 3)
| 40
| false
| true
| 0
| 7
| 8
| 28
| 12
| 16
| null | null |
judah/haskeline
|
System/Console/Haskeline/Backend/DumbTerm.hs
|
bsd-3-clause
|
clearDeadText :: Int -> String
clearDeadText n | n > 0 = spaces n ++ backs n
| otherwise = ""
| 109
|
clearDeadText :: Int -> String
clearDeadText n | n > 0 = spaces n ++ backs n
| otherwise = ""
| 109
|
clearDeadText n | n > 0 = spaces n ++ backs n
| otherwise = ""
| 78
| false
| true
| 0
| 8
| 36
| 47
| 21
| 26
| null | null |
creichert/wai
|
warp/Network/Wai/Handler/Warp/HTTP2/Manager.hs
|
mit
|
-- | Starting a thread pool manager.
-- Its action is initially set to 'return ()' and should be set
-- by 'setAction'. This allows that the action can include
-- the manager itself.
start :: Settings -> IO Manager
start set = do
q <- newTQueueIO
ref <- newIORef (\_ -> return ())
timmgr <- T.initialize $ settingsTimeout set * 1000000
void $ forkIO $ go q Set.empty ref timmgr
return $ Manager q ref
where
go q !tset0 ref timmgr = do
x <- atomically $ readTQueue q
case x of
Stop -> kill tset0 >> T.killManager timmgr
Spawn -> next tset0
Add newtid -> let !tset = add newtid tset0
in go q tset ref timmgr
Delete oldtid -> let !tset = del oldtid tset0
in go q tset ref timmgr
where
next tset = do
action <- readIORef ref
newtid <- forkIO (action timmgr)
let !tset' = add newtid tset
go q tset' ref timmgr
| 1,040
|
start :: Settings -> IO Manager
start set = do
q <- newTQueueIO
ref <- newIORef (\_ -> return ())
timmgr <- T.initialize $ settingsTimeout set * 1000000
void $ forkIO $ go q Set.empty ref timmgr
return $ Manager q ref
where
go q !tset0 ref timmgr = do
x <- atomically $ readTQueue q
case x of
Stop -> kill tset0 >> T.killManager timmgr
Spawn -> next tset0
Add newtid -> let !tset = add newtid tset0
in go q tset ref timmgr
Delete oldtid -> let !tset = del oldtid tset0
in go q tset ref timmgr
where
next tset = do
action <- readIORef ref
newtid <- forkIO (action timmgr)
let !tset' = add newtid tset
go q tset' ref timmgr
| 851
|
start set = do
q <- newTQueueIO
ref <- newIORef (\_ -> return ())
timmgr <- T.initialize $ settingsTimeout set * 1000000
void $ forkIO $ go q Set.empty ref timmgr
return $ Manager q ref
where
go q !tset0 ref timmgr = do
x <- atomically $ readTQueue q
case x of
Stop -> kill tset0 >> T.killManager timmgr
Spawn -> next tset0
Add newtid -> let !tset = add newtid tset0
in go q tset ref timmgr
Delete oldtid -> let !tset = del oldtid tset0
in go q tset ref timmgr
where
next tset = do
action <- readIORef ref
newtid <- forkIO (action timmgr)
let !tset' = add newtid tset
go q tset' ref timmgr
| 819
| true
| true
| 0
| 14
| 394
| 310
| 138
| 172
| null | null |
rekahsoft/HS-FSM
|
Tests.hs
|
gpl-3.0
|
singleOneOrZeroDFA :: DFA Binary
singleOneOrZeroDFA = let start = DFAStartState s0
s0 = DFAState $ const s1
s1 = DFAAcceptState $ const s2
s2 = DFAState $ const s2
in DFA start
| 272
|
singleOneOrZeroDFA :: DFA Binary
singleOneOrZeroDFA = let start = DFAStartState s0
s0 = DFAState $ const s1
s1 = DFAAcceptState $ const s2
s2 = DFAState $ const s2
in DFA start
| 272
|
singleOneOrZeroDFA = let start = DFAStartState s0
s0 = DFAState $ const s1
s1 = DFAAcceptState $ const s2
s2 = DFAState $ const s2
in DFA start
| 239
| false
| true
| 0
| 10
| 127
| 67
| 32
| 35
| null | null |
vladimir-ipatov/ganeti
|
src/Ganeti/HTools/Cluster.hs
|
gpl-2.0
|
bestAllocElement Nothing b = b
| 30
|
bestAllocElement Nothing b = b
| 30
|
bestAllocElement Nothing b = b
| 30
| false
| false
| 0
| 5
| 4
| 13
| 5
| 8
| null | null |
andrewthad/persistent
|
persistent-mysql/Database/Persist/MySQL.hs
|
mit
|
showSqlType SqlString Nothing False = "TEXT"
| 48
|
showSqlType SqlString Nothing False = "TEXT"
| 48
|
showSqlType SqlString Nothing False = "TEXT"
| 48
| false
| false
| 0
| 5
| 9
| 13
| 6
| 7
| null | null |
gibiansky/IHaskell
|
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Selection/Select.hs
|
mit
|
-- | Create a new Select widget
mkSelect :: IO Select
mkSelect = do
-- Default properties, with a random uuid
wid <- U.random
layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultSelectionWidget "SelectView" "SelectModel" layout $ StyleWidget dstyle
selectAttrs = (Rows =:: Just 5)
:& RNil
widgetState = WidgetState $ selectionAttrs <+> selectAttrs
stateIO <- newIORef widgetState
let widget = IPythonWidget wid stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen widget $ toJSON widgetState
-- Return the widget
return widget
| 644
|
mkSelect :: IO Select
mkSelect = do
-- Default properties, with a random uuid
wid <- U.random
layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultSelectionWidget "SelectView" "SelectModel" layout $ StyleWidget dstyle
selectAttrs = (Rows =:: Just 5)
:& RNil
widgetState = WidgetState $ selectionAttrs <+> selectAttrs
stateIO <- newIORef widgetState
let widget = IPythonWidget wid stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen widget $ toJSON widgetState
-- Return the widget
return widget
| 612
|
mkSelect = do
-- Default properties, with a random uuid
wid <- U.random
layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultSelectionWidget "SelectView" "SelectModel" layout $ StyleWidget dstyle
selectAttrs = (Rows =:: Just 5)
:& RNil
widgetState = WidgetState $ selectionAttrs <+> selectAttrs
stateIO <- newIORef widgetState
let widget = IPythonWidget wid stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen widget $ toJSON widgetState
-- Return the widget
return widget
| 590
| true
| true
| 0
| 13
| 148
| 139
| 65
| 74
| null | null |
nevrenato/Hets_Fork
|
atermlib/src/ATerm/Diff.hs
|
gpl-2.0
|
atDiff a1 a2 = (AAppl "<diff-types>" [] [], [AAppl "diff" [a1,a2] []])
| 70
|
atDiff a1 a2 = (AAppl "<diff-types>" [] [], [AAppl "diff" [a1,a2] []])
| 70
|
atDiff a1 a2 = (AAppl "<diff-types>" [] [], [AAppl "diff" [a1,a2] []])
| 70
| false
| false
| 0
| 8
| 11
| 46
| 24
| 22
| null | null |
phi16/RayMarch
|
RayMarch/Primitive.hs
|
gpl-3.0
|
areaFractal :: Float -> [(Distance s, Point)] -> Object s -> Distance s
areaFractal z xs o p = (dist * z**(-fromIntegral count+1), o) where
count = 4
(_,(_,dist)) = iterateN count (expand . proc) (p, undefined)
expand (p,(x,d)) = ((p<->x)<*>z<+>x, (x,d))
proc (p,_) = (p, foldr run (p,infinity) xs) where
run (f,x) (u,d) = let l = fst $ f p in if l < d then (x,l) else (u,d)
| 386
|
areaFractal :: Float -> [(Distance s, Point)] -> Object s -> Distance s
areaFractal z xs o p = (dist * z**(-fromIntegral count+1), o) where
count = 4
(_,(_,dist)) = iterateN count (expand . proc) (p, undefined)
expand (p,(x,d)) = ((p<->x)<*>z<+>x, (x,d))
proc (p,_) = (p, foldr run (p,infinity) xs) where
run (f,x) (u,d) = let l = fst $ f p in if l < d then (x,l) else (u,d)
| 386
|
areaFractal z xs o p = (dist * z**(-fromIntegral count+1), o) where
count = 4
(_,(_,dist)) = iterateN count (expand . proc) (p, undefined)
expand (p,(x,d)) = ((p<->x)<*>z<+>x, (x,d))
proc (p,_) = (p, foldr run (p,infinity) xs) where
run (f,x) (u,d) = let l = fst $ f p in if l < d then (x,l) else (u,d)
| 314
| false
| true
| 0
| 14
| 82
| 269
| 150
| 119
| null | null |
devalot/distinfo
|
distinfo.hs
|
bsd-3-clause
|
boot :: Config -> Backend -> Process ()
boot Config{..} backend = do
nid <- getSelfNode
pid <- getSelfPid
peers <- filter (/= nid) <$> liftIO (findPeers backend 1000000)
say $ "peers: " ++ show peers
register "distInfoServer" pid
mapM_ (`whereisRemoteAsync` "distInfoServer") peers
distInfoServer $ if webEnable then Just webPort else Nothing
--------------------------------------------------------------------------------
| 444
|
boot :: Config -> Backend -> Process ()
boot Config{..} backend = do
nid <- getSelfNode
pid <- getSelfPid
peers <- filter (/= nid) <$> liftIO (findPeers backend 1000000)
say $ "peers: " ++ show peers
register "distInfoServer" pid
mapM_ (`whereisRemoteAsync` "distInfoServer") peers
distInfoServer $ if webEnable then Just webPort else Nothing
--------------------------------------------------------------------------------
| 444
|
boot Config{..} backend = do
nid <- getSelfNode
pid <- getSelfPid
peers <- filter (/= nid) <$> liftIO (findPeers backend 1000000)
say $ "peers: " ++ show peers
register "distInfoServer" pid
mapM_ (`whereisRemoteAsync` "distInfoServer") peers
distInfoServer $ if webEnable then Just webPort else Nothing
--------------------------------------------------------------------------------
| 404
| false
| true
| 1
| 12
| 73
| 143
| 66
| 77
| null | null |
nushio3/ghc
|
compiler/coreSyn/CoreSyn.hs
|
bsd-3-clause
|
mkNoScope n@ProfNote{} = n {profNoteScope = False}
| 69
|
mkNoScope n@ProfNote{} = n {profNoteScope = False}
| 69
|
mkNoScope n@ProfNote{} = n {profNoteScope = False}
| 69
| false
| false
| 0
| 7
| 25
| 24
| 13
| 11
| null | null |
randen/cabal
|
Cabal/Distribution/PackageDescription.hs
|
bsd-3-clause
|
knownRepoTypes :: [RepoType]
knownRepoTypes = [Darcs, Git, SVN, CVS
,Mercurial, GnuArch, Bazaar, Monotone]
| 123
|
knownRepoTypes :: [RepoType]
knownRepoTypes = [Darcs, Git, SVN, CVS
,Mercurial, GnuArch, Bazaar, Monotone]
| 123
|
knownRepoTypes = [Darcs, Git, SVN, CVS
,Mercurial, GnuArch, Bazaar, Monotone]
| 94
| false
| true
| 0
| 5
| 29
| 38
| 24
| 14
| null | null |
lancelotsix/hs-tls
|
core/Network/TLS/State.hs
|
bsd-3-clause
|
setClientEllipticCurveSuggest :: [NamedCurve] -> TLSSt ()
setClientEllipticCurveSuggest nc = modify (\st -> st { stClientEllipticCurveSuggest = Just nc})
| 153
|
setClientEllipticCurveSuggest :: [NamedCurve] -> TLSSt ()
setClientEllipticCurveSuggest nc = modify (\st -> st { stClientEllipticCurveSuggest = Just nc})
| 153
|
setClientEllipticCurveSuggest nc = modify (\st -> st { stClientEllipticCurveSuggest = Just nc})
| 95
| false
| true
| 0
| 10
| 17
| 48
| 25
| 23
| null | null |
baig/pandoc-csv2table
|
src/Text/Table/Helper.hs
|
mit
|
getString = unpack
| 18
|
getString = unpack
| 18
|
getString = unpack
| 18
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
ben-schulz/Idris-dev
|
src/Idris/Core/Unify.hs
|
bsd-3-clause
|
boundVs i (Bind n b sc) = boundVs (i + 1) sc
| 44
|
boundVs i (Bind n b sc) = boundVs (i + 1) sc
| 44
|
boundVs i (Bind n b sc) = boundVs (i + 1) sc
| 44
| false
| false
| 0
| 7
| 11
| 36
| 16
| 20
| null | null |
spechub/Hets
|
CspCASLProver/Utils.hs
|
gpl-2.0
|
{- | Add a single choose function lemma for a given sort to an
Isabelle theory. The following Isabelle code is produced by this
function: lemma "choose_Nat (class (C_Nat x)) = x". The proof is
also produced. -}
addChooseFunctionLemma :: IsaTheory -> SORT -> IsaTheory
addChooseFunctionLemma isaTh sort =
let sortType = Type {typeId = convertSort2String sort,
typeSort = [],
typeArgs = []}
chooseFunName = mkChooseFunName sort
x = mkFree "x"
y = mkFree "y"
sortConsOp = termAppl (conDouble (mkPreAlphabetConstructor sort))
-- theorm
subgoalTacTermLhsBinEq = binEq (classOp $ sortConsOp y)
(classOp $ sortConsOp x)
subgoalTacTermLhs = Set $ SubSet y sortType subgoalTacTermLhsBinEq
subgoalTacTermRhs = Set $ FixedSet [x]
subgoalTacTerm = binEq subgoalTacTermLhs subgoalTacTermRhs
thmConds = []
thmConcl = binEq (mkChooseFunOp sort $ classOp $ sortConsOp x) x
proof' = IsaProof [Apply [Other ("unfold " ++ chooseFunName ++ "_def")]
False,
Apply [SubgoalTac subgoalTacTerm] False,
Apply [Simp] False,
Apply [SimpAdd Nothing [quotEqualityS]] False,
Apply [Other ("unfold " ++ preAlphabetSimS
++ "_def")] False,
Apply [Auto] False]
Done
in addTheoremWithProof chooseFunName thmConds thmConcl proof' isaTh
| 1,630
|
addChooseFunctionLemma :: IsaTheory -> SORT -> IsaTheory
addChooseFunctionLemma isaTh sort =
let sortType = Type {typeId = convertSort2String sort,
typeSort = [],
typeArgs = []}
chooseFunName = mkChooseFunName sort
x = mkFree "x"
y = mkFree "y"
sortConsOp = termAppl (conDouble (mkPreAlphabetConstructor sort))
-- theorm
subgoalTacTermLhsBinEq = binEq (classOp $ sortConsOp y)
(classOp $ sortConsOp x)
subgoalTacTermLhs = Set $ SubSet y sortType subgoalTacTermLhsBinEq
subgoalTacTermRhs = Set $ FixedSet [x]
subgoalTacTerm = binEq subgoalTacTermLhs subgoalTacTermRhs
thmConds = []
thmConcl = binEq (mkChooseFunOp sort $ classOp $ sortConsOp x) x
proof' = IsaProof [Apply [Other ("unfold " ++ chooseFunName ++ "_def")]
False,
Apply [SubgoalTac subgoalTacTerm] False,
Apply [Simp] False,
Apply [SimpAdd Nothing [quotEqualityS]] False,
Apply [Other ("unfold " ++ preAlphabetSimS
++ "_def")] False,
Apply [Auto] False]
Done
in addTheoremWithProof chooseFunName thmConds thmConcl proof' isaTh
| 1,417
|
addChooseFunctionLemma isaTh sort =
let sortType = Type {typeId = convertSort2String sort,
typeSort = [],
typeArgs = []}
chooseFunName = mkChooseFunName sort
x = mkFree "x"
y = mkFree "y"
sortConsOp = termAppl (conDouble (mkPreAlphabetConstructor sort))
-- theorm
subgoalTacTermLhsBinEq = binEq (classOp $ sortConsOp y)
(classOp $ sortConsOp x)
subgoalTacTermLhs = Set $ SubSet y sortType subgoalTacTermLhsBinEq
subgoalTacTermRhs = Set $ FixedSet [x]
subgoalTacTerm = binEq subgoalTacTermLhs subgoalTacTermRhs
thmConds = []
thmConcl = binEq (mkChooseFunOp sort $ classOp $ sortConsOp x) x
proof' = IsaProof [Apply [Other ("unfold " ++ chooseFunName ++ "_def")]
False,
Apply [SubgoalTac subgoalTacTerm] False,
Apply [Simp] False,
Apply [SimpAdd Nothing [quotEqualityS]] False,
Apply [Other ("unfold " ++ preAlphabetSimS
++ "_def")] False,
Apply [Auto] False]
Done
in addTheoremWithProof chooseFunName thmConds thmConcl proof' isaTh
| 1,360
| true
| true
| 0
| 16
| 602
| 345
| 176
| 169
| null | null |
pachopepe/mfxparser
|
src/MixFix/Parser.hs
|
bsd-3-clause
|
parseRange :: Env -> TParser b (Expr)
parseRange env = option cstTrue (try $ parseExpr' env)
| 93
|
parseRange :: Env -> TParser b (Expr)
parseRange env = option cstTrue (try $ parseExpr' env)
| 92
|
parseRange env = option cstTrue (try $ parseExpr' env)
| 54
| false
| true
| 0
| 8
| 16
| 45
| 21
| 24
| null | null |
dsferruzza/datura-corsets
|
site.hs
|
mit
|
--------------------------------------------------------------------------------
main :: IO ()
main = do
setLocaleEncoding utf8 -- These 3 lines deal with an encoding problem on Windows:
setFileSystemEncoding utf8 -- when having some characters like ' in markdown content, site couldn't build
setForeignEncoding utf8
withSocketsDo $ hakyll $ do -- withSocketsDo fixes a bug with external links & the checker ; see https://github.com/jaspervdj/hakyll/issues/236
tags <- buildTags "articles/**.md" (fromCapture "galerie/*/index.html")
tagsDependencies <- makePatternDependency "articles/**.md"
rulesExtraDependencies [tagsDependencies] $ tagsRules tags $ \tag pattern -> do
let title = tag
route idRoute
compile $ do
list <- articleList tags pattern alphabetical
makeItem ""
>>= loadAndApplyTemplate "templates/tags-articles.html"
(constField "title" title <>
constField "body" list <>
defaultContext)
>>= loadAndApplyTemplate "templates/default.html" (constField "title" title <> layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "js/*.js" $ do
route idRoute
compile copyFileCompiler
match "css/*.css" $ do
route idRoute
compile compressCssCompiler
match "fonts/*" $ do
route idRoute
compile copyFileCompiler
match "favicon.ico" $ do
route idRoute
compile copyFileCompiler
match "articles/**.md" $ do
route $ niceRoute "articles" `composeRoutes` setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/article.html" (articleContext tags)
>>= loadAndApplyTemplate "templates/default.html" (listField "cover" coverPicContext getFirstPicInDir <> layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "articles/**.jpg" $ do
route $ niceRoute "articles"
compile copyFileCompiler
match "articles/**.jpg" $ version "thumb" $ do
route $ niceRoute "articles" `composeRoutes` setExtension "thumb.jpg"
compile $ getResourceLBS
>>= withItemBody (unixFilterLBS "convert" ["-resize", "100x100", "-", "-"])
match "articles/**/index.jpg" $ version "cover" $ do
route $ niceRoute "articles" `composeRoutes` setExtension "cover.jpg"
compile $ getResourceLBS
>>= withItemBody (unixFilterLBS "convert" ["-resize", "500x250", "-", "-"])
match "pages/**.md" $ do
route $ niceRoute "pages" `composeRoutes` setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" (layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "pages/**.html" $ do
route $ niceRoute "pages"
compile $ do
getResourceBody
>>= applyAsTemplate (layoutDefaultContext tags)
>>= loadAndApplyTemplate "templates/default.html" (layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "pages/img/**" $ do
route $ niceRoute "pages"
compile copyFileCompiler
match "pages/img/**" $ version "thumb" $ do
route $ niceRoute "pages" `composeRoutes` setExtension "thumb.jpg"
compile $ getResourceLBS
>>= withItemBody (unixFilterLBS "convert" ["-resize", "200x200", "-", "-"])
rulesExtraDependencies [tagsDependencies] $ create ["galerie/index.html"] $ do
route idRoute
compile $ do
articles <- loadAll "articles/**.md"
let indexCtx = listField "articles" (articleContext tags) (return articles) <> (layoutDefaultContext tags)
makeItem ""
>>= loadAndApplyTemplate "templates/galerie.html" indexCtx
>>= loadAndApplyTemplate "templates/default.html" (constField "title" "Galerie" <> layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "templates/*" $ compile templateCompiler
--------------------------------------------------------------------------------
-- ARTICLE CONTEXT
| 4,456
|
main :: IO ()
main = do
setLocaleEncoding utf8 -- These 3 lines deal with an encoding problem on Windows:
setFileSystemEncoding utf8 -- when having some characters like ' in markdown content, site couldn't build
setForeignEncoding utf8
withSocketsDo $ hakyll $ do -- withSocketsDo fixes a bug with external links & the checker ; see https://github.com/jaspervdj/hakyll/issues/236
tags <- buildTags "articles/**.md" (fromCapture "galerie/*/index.html")
tagsDependencies <- makePatternDependency "articles/**.md"
rulesExtraDependencies [tagsDependencies] $ tagsRules tags $ \tag pattern -> do
let title = tag
route idRoute
compile $ do
list <- articleList tags pattern alphabetical
makeItem ""
>>= loadAndApplyTemplate "templates/tags-articles.html"
(constField "title" title <>
constField "body" list <>
defaultContext)
>>= loadAndApplyTemplate "templates/default.html" (constField "title" title <> layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "js/*.js" $ do
route idRoute
compile copyFileCompiler
match "css/*.css" $ do
route idRoute
compile compressCssCompiler
match "fonts/*" $ do
route idRoute
compile copyFileCompiler
match "favicon.ico" $ do
route idRoute
compile copyFileCompiler
match "articles/**.md" $ do
route $ niceRoute "articles" `composeRoutes` setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/article.html" (articleContext tags)
>>= loadAndApplyTemplate "templates/default.html" (listField "cover" coverPicContext getFirstPicInDir <> layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "articles/**.jpg" $ do
route $ niceRoute "articles"
compile copyFileCompiler
match "articles/**.jpg" $ version "thumb" $ do
route $ niceRoute "articles" `composeRoutes` setExtension "thumb.jpg"
compile $ getResourceLBS
>>= withItemBody (unixFilterLBS "convert" ["-resize", "100x100", "-", "-"])
match "articles/**/index.jpg" $ version "cover" $ do
route $ niceRoute "articles" `composeRoutes` setExtension "cover.jpg"
compile $ getResourceLBS
>>= withItemBody (unixFilterLBS "convert" ["-resize", "500x250", "-", "-"])
match "pages/**.md" $ do
route $ niceRoute "pages" `composeRoutes` setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" (layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "pages/**.html" $ do
route $ niceRoute "pages"
compile $ do
getResourceBody
>>= applyAsTemplate (layoutDefaultContext tags)
>>= loadAndApplyTemplate "templates/default.html" (layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "pages/img/**" $ do
route $ niceRoute "pages"
compile copyFileCompiler
match "pages/img/**" $ version "thumb" $ do
route $ niceRoute "pages" `composeRoutes` setExtension "thumb.jpg"
compile $ getResourceLBS
>>= withItemBody (unixFilterLBS "convert" ["-resize", "200x200", "-", "-"])
rulesExtraDependencies [tagsDependencies] $ create ["galerie/index.html"] $ do
route idRoute
compile $ do
articles <- loadAll "articles/**.md"
let indexCtx = listField "articles" (articleContext tags) (return articles) <> (layoutDefaultContext tags)
makeItem ""
>>= loadAndApplyTemplate "templates/galerie.html" indexCtx
>>= loadAndApplyTemplate "templates/default.html" (constField "title" "Galerie" <> layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "templates/*" $ compile templateCompiler
--------------------------------------------------------------------------------
-- ARTICLE CONTEXT
| 4,375
|
main = do
setLocaleEncoding utf8 -- These 3 lines deal with an encoding problem on Windows:
setFileSystemEncoding utf8 -- when having some characters like ' in markdown content, site couldn't build
setForeignEncoding utf8
withSocketsDo $ hakyll $ do -- withSocketsDo fixes a bug with external links & the checker ; see https://github.com/jaspervdj/hakyll/issues/236
tags <- buildTags "articles/**.md" (fromCapture "galerie/*/index.html")
tagsDependencies <- makePatternDependency "articles/**.md"
rulesExtraDependencies [tagsDependencies] $ tagsRules tags $ \tag pattern -> do
let title = tag
route idRoute
compile $ do
list <- articleList tags pattern alphabetical
makeItem ""
>>= loadAndApplyTemplate "templates/tags-articles.html"
(constField "title" title <>
constField "body" list <>
defaultContext)
>>= loadAndApplyTemplate "templates/default.html" (constField "title" title <> layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "js/*.js" $ do
route idRoute
compile copyFileCompiler
match "css/*.css" $ do
route idRoute
compile compressCssCompiler
match "fonts/*" $ do
route idRoute
compile copyFileCompiler
match "favicon.ico" $ do
route idRoute
compile copyFileCompiler
match "articles/**.md" $ do
route $ niceRoute "articles" `composeRoutes` setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/article.html" (articleContext tags)
>>= loadAndApplyTemplate "templates/default.html" (listField "cover" coverPicContext getFirstPicInDir <> layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "articles/**.jpg" $ do
route $ niceRoute "articles"
compile copyFileCompiler
match "articles/**.jpg" $ version "thumb" $ do
route $ niceRoute "articles" `composeRoutes` setExtension "thumb.jpg"
compile $ getResourceLBS
>>= withItemBody (unixFilterLBS "convert" ["-resize", "100x100", "-", "-"])
match "articles/**/index.jpg" $ version "cover" $ do
route $ niceRoute "articles" `composeRoutes` setExtension "cover.jpg"
compile $ getResourceLBS
>>= withItemBody (unixFilterLBS "convert" ["-resize", "500x250", "-", "-"])
match "pages/**.md" $ do
route $ niceRoute "pages" `composeRoutes` setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" (layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "pages/**.html" $ do
route $ niceRoute "pages"
compile $ do
getResourceBody
>>= applyAsTemplate (layoutDefaultContext tags)
>>= loadAndApplyTemplate "templates/default.html" (layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "pages/img/**" $ do
route $ niceRoute "pages"
compile copyFileCompiler
match "pages/img/**" $ version "thumb" $ do
route $ niceRoute "pages" `composeRoutes` setExtension "thumb.jpg"
compile $ getResourceLBS
>>= withItemBody (unixFilterLBS "convert" ["-resize", "200x200", "-", "-"])
rulesExtraDependencies [tagsDependencies] $ create ["galerie/index.html"] $ do
route idRoute
compile $ do
articles <- loadAll "articles/**.md"
let indexCtx = listField "articles" (articleContext tags) (return articles) <> (layoutDefaultContext tags)
makeItem ""
>>= loadAndApplyTemplate "templates/galerie.html" indexCtx
>>= loadAndApplyTemplate "templates/default.html" (constField "title" "Galerie" <> layoutDefaultContext tags)
>>= removeIndexHtml
>>= relativizeUrls
match "templates/*" $ compile templateCompiler
--------------------------------------------------------------------------------
-- ARTICLE CONTEXT
| 4,361
| true
| true
| 1
| 66
| 1,224
| 942
| 417
| 525
| null | null |
runjak/carbon-adf
|
Carbon/Website/Item.hs
|
gpl-3.0
|
displayItem :: Item Id -> OBW Response
displayItem i = do
i' <- liftB $ idToH i
respOk $ responseJSON' i'
-- sane :: Item a -> OBW Response
| 144
|
displayItem :: Item Id -> OBW Response
displayItem i = do
i' <- liftB $ idToH i
respOk $ responseJSON' i'
-- sane :: Item a -> OBW Response
| 144
|
displayItem i = do
i' <- liftB $ idToH i
respOk $ responseJSON' i'
-- sane :: Item a -> OBW Response
| 105
| false
| true
| 0
| 9
| 33
| 49
| 22
| 27
| null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/show_4.hs
|
mit
|
primDivNatS Zero (Succ x) = Zero
| 32
|
primDivNatS Zero (Succ x) = Zero
| 32
|
primDivNatS Zero (Succ x) = Zero
| 32
| false
| false
| 0
| 6
| 5
| 19
| 8
| 11
| null | null |
conal/lambda-ccc
|
src/LambdaCCC/Unused/ReifyLambda.hs
|
bsd-3-clause
|
appVTysT :: (ExtendPath c Crumb, Monad m) =>
Translate c m Var a -> (a -> [Type] -> b) -> Translate c m CoreExpr b
appVTysT tv h = translate $ \c ->
\ case (collectTypeArgs -> (ts, Var v)) ->
liftM2 h (Kure.apply tv (applyN (length ts) (@@ App_Fun) c) v)
(return ts)
_ -> fail "not an application of a variable to types."
where
applyN :: Int -> (a -> a) -> a -> a
applyN n f a = foldr ($) a (replicate n f)
#endif
| 477
|
appVTysT :: (ExtendPath c Crumb, Monad m) =>
Translate c m Var a -> (a -> [Type] -> b) -> Translate c m CoreExpr b
appVTysT tv h = translate $ \c ->
\ case (collectTypeArgs -> (ts, Var v)) ->
liftM2 h (Kure.apply tv (applyN (length ts) (@@ App_Fun) c) v)
(return ts)
_ -> fail "not an application of a variable to types."
where
applyN :: Int -> (a -> a) -> a -> a
applyN n f a = foldr ($) a (replicate n f)
#endif
| 477
|
appVTysT tv h = translate $ \c ->
\ case (collectTypeArgs -> (ts, Var v)) ->
liftM2 h (Kure.apply tv (applyN (length ts) (@@ App_Fun) c) v)
(return ts)
_ -> fail "not an application of a variable to types."
where
applyN :: Int -> (a -> a) -> a -> a
applyN n f a = foldr ($) a (replicate n f)
#endif
| 350
| false
| true
| 0
| 16
| 152
| 217
| 112
| 105
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.