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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vincenthz/cryptonite
|
Crypto/PubKey/ECC/Types.hs
|
bsd-3-clause
|
getCurveByName SEC_p224r1 = CurveFP $ CurvePrime
0xffffffffffffffffffffffffffffffff000000000000000000000001
(CurveCommon
{ ecc_a = 0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffe
, ecc_b = 0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4
, ecc_g = Point 0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21
0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34
, ecc_n = 0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d
, ecc_h = 1
})
| 557
|
getCurveByName SEC_p224r1 = CurveFP $ CurvePrime
0xffffffffffffffffffffffffffffffff000000000000000000000001
(CurveCommon
{ ecc_a = 0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffe
, ecc_b = 0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4
, ecc_g = Point 0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21
0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34
, ecc_n = 0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d
, ecc_h = 1
})
| 557
|
getCurveByName SEC_p224r1 = CurveFP $ CurvePrime
0xffffffffffffffffffffffffffffffff000000000000000000000001
(CurveCommon
{ ecc_a = 0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffe
, ecc_b = 0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4
, ecc_g = Point 0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21
0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34
, ecc_n = 0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d
, ecc_h = 1
})
| 557
| false
| false
| 0
| 8
| 111
| 60
| 33
| 27
| null | null |
fpco/schoolofhaskell.com
|
src/Azure/BlobStorage/Exception.hs
|
mit
|
checkCreated :: MonadThrow m => ByteString -> CheckStatus m
checkCreated sig res consumeBody =
if responseStatus res == Status 201 "Created"
then return ()
else do
checkErrorCode sig res consumeBody
throwM BlobNotCreated
| 242
|
checkCreated :: MonadThrow m => ByteString -> CheckStatus m
checkCreated sig res consumeBody =
if responseStatus res == Status 201 "Created"
then return ()
else do
checkErrorCode sig res consumeBody
throwM BlobNotCreated
| 242
|
checkCreated sig res consumeBody =
if responseStatus res == Status 201 "Created"
then return ()
else do
checkErrorCode sig res consumeBody
throwM BlobNotCreated
| 182
| false
| true
| 0
| 8
| 53
| 73
| 33
| 40
| null | null |
sakhnik/FreeCell
|
Cards.hs
|
bsd-3-clause
|
-- Shuffle given pack of cards, using random seed.
shuffle :: Int -> [a] -> [a]
shuffle seed pack =
let stdGen = mkStdGen seed
-- A list of random indices.
rndIdx 0 _ = []
rndIdx len gen = [a] ++ (rndIdx (len - 1) gen')
where
(a, gen') = randomR (0, len - 1) gen
-- Extract of random cards from the pack pk.
result [] _ = []
result pk idx = [card] ++ result pk' (tail idx)
where
i = head idx -- current index
card = pk !! i -- chosen random card
pk' = take i pk ++ drop (i+1) pk -- pack without chosen card
rndIdx' = rndIdx (length pack) stdGen
in result pack rndIdx'
| 773
|
shuffle :: Int -> [a] -> [a]
shuffle seed pack =
let stdGen = mkStdGen seed
-- A list of random indices.
rndIdx 0 _ = []
rndIdx len gen = [a] ++ (rndIdx (len - 1) gen')
where
(a, gen') = randomR (0, len - 1) gen
-- Extract of random cards from the pack pk.
result [] _ = []
result pk idx = [card] ++ result pk' (tail idx)
where
i = head idx -- current index
card = pk !! i -- chosen random card
pk' = take i pk ++ drop (i+1) pk -- pack without chosen card
rndIdx' = rndIdx (length pack) stdGen
in result pack rndIdx'
| 722
|
shuffle seed pack =
let stdGen = mkStdGen seed
-- A list of random indices.
rndIdx 0 _ = []
rndIdx len gen = [a] ++ (rndIdx (len - 1) gen')
where
(a, gen') = randomR (0, len - 1) gen
-- Extract of random cards from the pack pk.
result [] _ = []
result pk idx = [card] ++ result pk' (tail idx)
where
i = head idx -- current index
card = pk !! i -- chosen random card
pk' = take i pk ++ drop (i+1) pk -- pack without chosen card
rndIdx' = rndIdx (length pack) stdGen
in result pack rndIdx'
| 693
| true
| true
| 0
| 14
| 327
| 231
| 121
| 110
| null | null |
DiegoNolan/Asciify
|
Asciify.hs
|
mit
|
charToNovem 'O' = Novemant Lgt Drk Lgt Drk Bnk Drk Lgt Drk Lgt
| 64
|
charToNovem 'O' = Novemant Lgt Drk Lgt Drk Bnk Drk Lgt Drk Lgt
| 64
|
charToNovem 'O' = Novemant Lgt Drk Lgt Drk Bnk Drk Lgt Drk Lgt
| 64
| false
| false
| 0
| 5
| 14
| 29
| 13
| 16
| null | null |
ambiata/snooze
|
src/Snooze/Balance/Http.hs
|
bsd-3-clause
|
httpBalancedT ::
MonadIO m
=> BalanceConfig
-> Request
-> EitherT BalanceError m (Response BSL.ByteString)
httpBalancedT c r =
httpBalancedReq' (flip balanceRequest' r) c
| 185
|
httpBalancedT ::
MonadIO m
=> BalanceConfig
-> Request
-> EitherT BalanceError m (Response BSL.ByteString)
httpBalancedT c r =
httpBalancedReq' (flip balanceRequest' r) c
| 185
|
httpBalancedT c r =
httpBalancedReq' (flip balanceRequest' r) c
| 67
| false
| true
| 0
| 12
| 37
| 60
| 28
| 32
| null | null |
lemol/dotfiles
|
xmonad/xmonad.hs
|
mit
|
main = do
xmonad $ defaultConfig {
terminal = myTerminal,
modMask = myModMask,
keys = myKeys
}
| 110
|
main = do
xmonad $ defaultConfig {
terminal = myTerminal,
modMask = myModMask,
keys = myKeys
}
| 110
|
main = do
xmonad $ defaultConfig {
terminal = myTerminal,
modMask = myModMask,
keys = myKeys
}
| 110
| false
| false
| 0
| 9
| 32
| 33
| 19
| 14
| null | null |
fffej/HS-Poker
|
LookupPatternMatch.hs
|
bsd-3-clause
|
getValueFromProduct 10682755 = 1628
| 35
|
getValueFromProduct 10682755 = 1628
| 35
|
getValueFromProduct 10682755 = 1628
| 35
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
dmvianna/haskellbook
|
src/Ch11-BinaryTree.hs
|
unlicense
|
mapTree' :: (a -> b) -> BinaryTree a -> BinaryTree b
mapTree' f = foldTree (\a b c -> Node b (f a) c) Leaf
| 106
|
mapTree' :: (a -> b) -> BinaryTree a -> BinaryTree b
mapTree' f = foldTree (\a b c -> Node b (f a) c) Leaf
| 106
|
mapTree' f = foldTree (\a b c -> Node b (f a) c) Leaf
| 53
| false
| true
| 0
| 10
| 24
| 65
| 32
| 33
| null | null |
andrewcchen/matasano-cryptopals-solutions
|
modules/AES.hs
|
bsd-3-clause
|
genCTRKeyStream :: (Int, Int) -> ByteVector -> ByteVector -> ByteVector
genCTRKeyStream (start, end) key nonce
| V.length key /= 16 = error "key must be 128 bits"
| V.length nonce /= 8 = error "nonce must be 64 bits"
| otherwise = chop $ V.concat $ map keyStreamBlock [startBlock..endBlock]
where
startBlock = start `quot` 16
endBlock = end `quot` 16
startDrop = start - startBlock * 16
endDrop = (endBlock * 16 + 15) - end
chop = dropFromTail endDrop . V.drop startDrop
where
dropFromTail len bytes = V.take (V.length bytes - len) bytes
keyStreamBlock ind = encryptECB key ctr
where
ctr = nonce V.++ word64ToBytes (fromIntegral ind)
where
word64ToBytes :: Word64 -> ByteVector
word64ToBytes = V.fromList . splitBitsAt [0, 8..63]
| 756
|
genCTRKeyStream :: (Int, Int) -> ByteVector -> ByteVector -> ByteVector
genCTRKeyStream (start, end) key nonce
| V.length key /= 16 = error "key must be 128 bits"
| V.length nonce /= 8 = error "nonce must be 64 bits"
| otherwise = chop $ V.concat $ map keyStreamBlock [startBlock..endBlock]
where
startBlock = start `quot` 16
endBlock = end `quot` 16
startDrop = start - startBlock * 16
endDrop = (endBlock * 16 + 15) - end
chop = dropFromTail endDrop . V.drop startDrop
where
dropFromTail len bytes = V.take (V.length bytes - len) bytes
keyStreamBlock ind = encryptECB key ctr
where
ctr = nonce V.++ word64ToBytes (fromIntegral ind)
where
word64ToBytes :: Word64 -> ByteVector
word64ToBytes = V.fromList . splitBitsAt [0, 8..63]
| 756
|
genCTRKeyStream (start, end) key nonce
| V.length key /= 16 = error "key must be 128 bits"
| V.length nonce /= 8 = error "nonce must be 64 bits"
| otherwise = chop $ V.concat $ map keyStreamBlock [startBlock..endBlock]
where
startBlock = start `quot` 16
endBlock = end `quot` 16
startDrop = start - startBlock * 16
endDrop = (endBlock * 16 + 15) - end
chop = dropFromTail endDrop . V.drop startDrop
where
dropFromTail len bytes = V.take (V.length bytes - len) bytes
keyStreamBlock ind = encryptECB key ctr
where
ctr = nonce V.++ word64ToBytes (fromIntegral ind)
where
word64ToBytes :: Word64 -> ByteVector
word64ToBytes = V.fromList . splitBitsAt [0, 8..63]
| 684
| false
| true
| 1
| 10
| 147
| 286
| 145
| 141
| null | null |
paf31/language-typescript
|
src/Language/TypeScript/Pretty.hs
|
mit
|
renderAmbientExternalModuleElement (ExportAssignment name) =
text "export"
<+> char '='
<+> text name
<+> semi
| 118
|
renderAmbientExternalModuleElement (ExportAssignment name) =
text "export"
<+> char '='
<+> text name
<+> semi
| 118
|
renderAmbientExternalModuleElement (ExportAssignment name) =
text "export"
<+> char '='
<+> text name
<+> semi
| 118
| false
| false
| 6
| 7
| 21
| 40
| 16
| 24
| null | null |
neongreen/hat
|
src/JS.hs
|
bsd-3-clause
|
-- | Switch sections /everywhere/ inside the container.
--
-- See Note [show-hide]
switchSectionsEverywhere :: JSFunction a => a
switchSectionsEverywhere =
makeJSFunction "switchSectionsEverywhere" ["node", "section"]
[text|
$(node).find(".section").removeClass("shown");
$(node).find(".section."+section).addClass("shown");
// See Note [autosize]
autosize($('textarea'));
autosize.update($('textarea'));
|]
| 433
|
switchSectionsEverywhere :: JSFunction a => a
switchSectionsEverywhere =
makeJSFunction "switchSectionsEverywhere" ["node", "section"]
[text|
$(node).find(".section").removeClass("shown");
$(node).find(".section."+section).addClass("shown");
// See Note [autosize]
autosize($('textarea'));
autosize.update($('textarea'));
|]
| 350
|
switchSectionsEverywhere =
makeJSFunction "switchSectionsEverywhere" ["node", "section"]
[text|
$(node).find(".section").removeClass("shown");
$(node).find(".section."+section).addClass("shown");
// See Note [autosize]
autosize($('textarea'));
autosize.update($('textarea'));
|]
| 304
| true
| true
| 0
| 6
| 60
| 39
| 23
| 16
| null | null |
amremam2004/vxmlizer
|
VXMLTree.hs
|
bsd-3-clause
|
tree1 = VXMLFile "hello.vxml" [m1]
| 34
|
tree1 = VXMLFile "hello.vxml" [m1]
| 34
|
tree1 = VXMLFile "hello.vxml" [m1]
| 34
| false
| false
| 0
| 6
| 4
| 14
| 7
| 7
| null | null |
dreamcodez/bonedewd
|
src/BoneDewd/RxPacket.hs
|
bsd-3-clause
|
parseApp 0xBF raw =
runGet getter (strict2lazy raw)
where _plen = B.length raw
getter = do
skip 3
subcmd <- getWord16be
case subcmd of
0x05 -> do -- ScreenSize
skip 2
x <- getWord16be
y <- getWord16be
return $ Right (ScreenSize x y)
0x0B -> do -- ClientLanguage
l <- getFixedString 3
return $ Right (ClientLanguage l)
0x0C -> do -- ClosedStatusGump
s <- Serial <$> getWord32be
return $ Right (ClosedStatusGump s)
0x0F -> do -- PopupEntrySelection
cid <- getWord32be
eid <- getWord8 -- i think this is right, penultima says word16 tho..
return $ Right (PopupEntrySelection cid eid)
0x24 -> do -- unknown. UOSE Introduced (http://docs.polserver.com/packets/index.php?Packet=0xBF)
return (Right IgnoredPacket)
_ -> return $ Left ("don't know how to parse subcommand of 0xBF: " ++ printf "0x%02x" subcmd ++ "\n" ++ fmtHex raw)
-- [0xD7] generalized AOS packet
| 1,288
|
parseApp 0xBF raw =
runGet getter (strict2lazy raw)
where _plen = B.length raw
getter = do
skip 3
subcmd <- getWord16be
case subcmd of
0x05 -> do -- ScreenSize
skip 2
x <- getWord16be
y <- getWord16be
return $ Right (ScreenSize x y)
0x0B -> do -- ClientLanguage
l <- getFixedString 3
return $ Right (ClientLanguage l)
0x0C -> do -- ClosedStatusGump
s <- Serial <$> getWord32be
return $ Right (ClosedStatusGump s)
0x0F -> do -- PopupEntrySelection
cid <- getWord32be
eid <- getWord8 -- i think this is right, penultima says word16 tho..
return $ Right (PopupEntrySelection cid eid)
0x24 -> do -- unknown. UOSE Introduced (http://docs.polserver.com/packets/index.php?Packet=0xBF)
return (Right IgnoredPacket)
_ -> return $ Left ("don't know how to parse subcommand of 0xBF: " ++ printf "0x%02x" subcmd ++ "\n" ++ fmtHex raw)
-- [0xD7] generalized AOS packet
| 1,288
|
parseApp 0xBF raw =
runGet getter (strict2lazy raw)
where _plen = B.length raw
getter = do
skip 3
subcmd <- getWord16be
case subcmd of
0x05 -> do -- ScreenSize
skip 2
x <- getWord16be
y <- getWord16be
return $ Right (ScreenSize x y)
0x0B -> do -- ClientLanguage
l <- getFixedString 3
return $ Right (ClientLanguage l)
0x0C -> do -- ClosedStatusGump
s <- Serial <$> getWord32be
return $ Right (ClosedStatusGump s)
0x0F -> do -- PopupEntrySelection
cid <- getWord32be
eid <- getWord8 -- i think this is right, penultima says word16 tho..
return $ Right (PopupEntrySelection cid eid)
0x24 -> do -- unknown. UOSE Introduced (http://docs.polserver.com/packets/index.php?Packet=0xBF)
return (Right IgnoredPacket)
_ -> return $ Left ("don't know how to parse subcommand of 0xBF: " ++ printf "0x%02x" subcmd ++ "\n" ++ fmtHex raw)
-- [0xD7] generalized AOS packet
| 1,288
| false
| false
| 0
| 18
| 570
| 267
| 124
| 143
| null | null |
frantisekfarka/ghc-dsi
|
libraries/base/Foreign/C/Error.hs
|
bsd-3-clause
|
eOK, e2BIG, eACCES, eADDRINUSE, eADDRNOTAVAIL, eADV, eAFNOSUPPORT, eAGAIN,
eALREADY, eBADF, eBADMSG, eBADRPC, eBUSY, eCHILD, eCOMM, eCONNABORTED,
eCONNREFUSED, eCONNRESET, eDEADLK, eDESTADDRREQ, eDIRTY, eDOM, eDQUOT,
eEXIST, eFAULT, eFBIG, eFTYPE, eHOSTDOWN, eHOSTUNREACH, eIDRM, eILSEQ,
eINPROGRESS, eINTR, eINVAL, eIO, eISCONN, eISDIR, eLOOP, eMFILE, eMLINK,
eMSGSIZE, eMULTIHOP, eNAMETOOLONG, eNETDOWN, eNETRESET, eNETUNREACH,
eNFILE, eNOBUFS, eNODATA, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOLINK,
eNOMEM, eNOMSG, eNONET, eNOPROTOOPT, eNOSPC, eNOSR, eNOSTR, eNOSYS,
eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTSUP, eNOTTY, eNXIO,
eOPNOTSUPP, ePERM, ePFNOSUPPORT, ePIPE, ePROCLIM, ePROCUNAVAIL,
ePROGMISMATCH, ePROGUNAVAIL, ePROTO, ePROTONOSUPPORT, ePROTOTYPE,
eRANGE, eREMCHG, eREMOTE, eROFS, eRPCMISMATCH, eRREMOTE, eSHUTDOWN,
eSOCKTNOSUPPORT, eSPIPE, eSRCH, eSRMNT, eSTALE, eTIME, eTIMEDOUT,
eTOOMANYREFS, eTXTBSY, eUSERS, eWOULDBLOCK, eXDEV :: Errno
--
-- the cCONST_XXX identifiers are cpp symbols whose value is computed by
-- configure
--
eOK = Errno 0
| 1,137
|
eOK, e2BIG, eACCES, eADDRINUSE, eADDRNOTAVAIL, eADV, eAFNOSUPPORT, eAGAIN,
eALREADY, eBADF, eBADMSG, eBADRPC, eBUSY, eCHILD, eCOMM, eCONNABORTED,
eCONNREFUSED, eCONNRESET, eDEADLK, eDESTADDRREQ, eDIRTY, eDOM, eDQUOT,
eEXIST, eFAULT, eFBIG, eFTYPE, eHOSTDOWN, eHOSTUNREACH, eIDRM, eILSEQ,
eINPROGRESS, eINTR, eINVAL, eIO, eISCONN, eISDIR, eLOOP, eMFILE, eMLINK,
eMSGSIZE, eMULTIHOP, eNAMETOOLONG, eNETDOWN, eNETRESET, eNETUNREACH,
eNFILE, eNOBUFS, eNODATA, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOLINK,
eNOMEM, eNOMSG, eNONET, eNOPROTOOPT, eNOSPC, eNOSR, eNOSTR, eNOSYS,
eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTSUP, eNOTTY, eNXIO,
eOPNOTSUPP, ePERM, ePFNOSUPPORT, ePIPE, ePROCLIM, ePROCUNAVAIL,
ePROGMISMATCH, ePROGUNAVAIL, ePROTO, ePROTONOSUPPORT, ePROTOTYPE,
eRANGE, eREMCHG, eREMOTE, eROFS, eRPCMISMATCH, eRREMOTE, eSHUTDOWN,
eSOCKTNOSUPPORT, eSPIPE, eSRCH, eSRMNT, eSTALE, eTIME, eTIMEDOUT,
eTOOMANYREFS, eTXTBSY, eUSERS, eWOULDBLOCK, eXDEV :: Errno
eOK = Errno 0
| 1,044
|
eOK = Errno 0
| 25
| true
| true
| 2
| 5
| 191
| 220
| 209
| 11
| null | null |
zeniuseducation/poly-euler
|
Alfa/ml/one.hs
|
epl-1.0
|
isLychrel :: Integral a => a -> Bool
isLychrel n = b >= 50
where f (a,b) = (a + (colnum $ reverse $ numcol a), b+1)
((a,b):_) = dropWhile (\(a,b) -> (not.isPalin $ a) && b < 50) $ iterate f (f (n,0))
| 209
|
isLychrel :: Integral a => a -> Bool
isLychrel n = b >= 50
where f (a,b) = (a + (colnum $ reverse $ numcol a), b+1)
((a,b):_) = dropWhile (\(a,b) -> (not.isPalin $ a) && b < 50) $ iterate f (f (n,0))
| 209
|
isLychrel n = b >= 50
where f (a,b) = (a + (colnum $ reverse $ numcol a), b+1)
((a,b):_) = dropWhile (\(a,b) -> (not.isPalin $ a) && b < 50) $ iterate f (f (n,0))
| 172
| false
| true
| 2
| 13
| 53
| 156
| 81
| 75
| null | null |
fpco/stackage-server
|
src/Stackage/Database/PackageInfo.hs
|
mit
|
isMarkdownFilePath :: SafeFilePath -> Bool
isMarkdownFilePath sfp =
case T.split (== '.') $ unSafeFilePath sfp of
[_, "md"] -> True
[_, "markdown"] -> True
_ -> False
| 214
|
isMarkdownFilePath :: SafeFilePath -> Bool
isMarkdownFilePath sfp =
case T.split (== '.') $ unSafeFilePath sfp of
[_, "md"] -> True
[_, "markdown"] -> True
_ -> False
| 214
|
isMarkdownFilePath sfp =
case T.split (== '.') $ unSafeFilePath sfp of
[_, "md"] -> True
[_, "markdown"] -> True
_ -> False
| 171
| false
| true
| 0
| 8
| 74
| 68
| 36
| 32
| null | null |
ftomassetti/civs-haskell
|
src/Civs/ConsoleExplorer.hs
|
apache-2.0
|
drawBorderCells :: [ScreenPos] -> IO ()
drawBorderCells [] = return ()
| 70
|
drawBorderCells :: [ScreenPos] -> IO ()
drawBorderCells [] = return ()
| 70
|
drawBorderCells [] = return ()
| 30
| false
| true
| 0
| 7
| 10
| 33
| 16
| 17
| null | null |
snowmantw/Frag
|
src/Quaternion.hs
|
gpl-2.0
|
-- converts from quaternion to matrix
quat2Mat :: Quaternion -> (Float,Float,Float) -> IO (GLmatrix GLfloat)
quat2Mat (x,y,z,w) (t1,t2,t3)=
newMatrix ColumnMajor $ map realToFrac $ [r00,r01,r02,r03,
r10,r11,r12,r13,
r20,r21,r22,r23,
r30,r31,r32,r33]
where r00 = 1 - (2*((y*y)+(z*z)))
r01 = 2 * ((x*y)-(w*z))
r02 = 2 * ((x*z)+(w*y))
r03 = 0
r10 = 2 * ((x*y)+(w*z))
r11 = 1 - (2*((x*x)+(z*z)))
r12 = 2 * ((y*z)-(w*x))
r13 = 0
r20 = 2 * ((x*z)-(w*y))
r21 = 2 * ((y*z)+(w*x))
r22 = 1 - (2*((x*x)+(y*y)))
r23 = 0
r30 = t1
r31 = t2
r32 = t3
r33 = 1
-- converts from matrix to quaternion
| 887
|
quat2Mat :: Quaternion -> (Float,Float,Float) -> IO (GLmatrix GLfloat)
quat2Mat (x,y,z,w) (t1,t2,t3)=
newMatrix ColumnMajor $ map realToFrac $ [r00,r01,r02,r03,
r10,r11,r12,r13,
r20,r21,r22,r23,
r30,r31,r32,r33]
where r00 = 1 - (2*((y*y)+(z*z)))
r01 = 2 * ((x*y)-(w*z))
r02 = 2 * ((x*z)+(w*y))
r03 = 0
r10 = 2 * ((x*y)+(w*z))
r11 = 1 - (2*((x*x)+(z*z)))
r12 = 2 * ((y*z)-(w*x))
r13 = 0
r20 = 2 * ((x*z)-(w*y))
r21 = 2 * ((y*z)+(w*x))
r22 = 1 - (2*((x*x)+(y*y)))
r23 = 0
r30 = t1
r31 = t2
r32 = t3
r33 = 1
-- converts from matrix to quaternion
| 847
|
quat2Mat (x,y,z,w) (t1,t2,t3)=
newMatrix ColumnMajor $ map realToFrac $ [r00,r01,r02,r03,
r10,r11,r12,r13,
r20,r21,r22,r23,
r30,r31,r32,r33]
where r00 = 1 - (2*((y*y)+(z*z)))
r01 = 2 * ((x*y)-(w*z))
r02 = 2 * ((x*z)+(w*y))
r03 = 0
r10 = 2 * ((x*y)+(w*z))
r11 = 1 - (2*((x*x)+(z*z)))
r12 = 2 * ((y*z)-(w*x))
r13 = 0
r20 = 2 * ((x*z)-(w*y))
r21 = 2 * ((y*z)+(w*x))
r22 = 1 - (2*((x*x)+(y*y)))
r23 = 0
r30 = t1
r31 = t2
r32 = t3
r33 = 1
-- converts from matrix to quaternion
| 776
| true
| true
| 24
| 11
| 407
| 519
| 264
| 255
| null | null |
Chasego/nie
|
proj/lang/C++/cpp_primer_5th/[SUPPORT] learning-master/real-world-haskell/ch4/FixLines.hs
|
gpl-3.0
|
interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input)
| 139
|
interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input)
| 139
|
interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input)
| 139
| false
| false
| 0
| 9
| 39
| 39
| 16
| 23
| null | null |
LeifW/rdf4h
|
src/Data/RDF/Query.hs
|
bsd-3-clause
|
expandTriples' acc baseURL prefixMaps (t:rest) = expandTriples' (normalize baseURL prefixMaps t : acc) baseURL prefixMaps rest
where normalize baseURL' prefixMaps' = absolutizeTriple baseURL' . expandTriple prefixMaps'
-- |Expand the triple with the prefix map.
| 264
|
expandTriples' acc baseURL prefixMaps (t:rest) = expandTriples' (normalize baseURL prefixMaps t : acc) baseURL prefixMaps rest
where normalize baseURL' prefixMaps' = absolutizeTriple baseURL' . expandTriple prefixMaps'
-- |Expand the triple with the prefix map.
| 264
|
expandTriples' acc baseURL prefixMaps (t:rest) = expandTriples' (normalize baseURL prefixMaps t : acc) baseURL prefixMaps rest
where normalize baseURL' prefixMaps' = absolutizeTriple baseURL' . expandTriple prefixMaps'
-- |Expand the triple with the prefix map.
| 264
| false
| false
| 0
| 8
| 36
| 68
| 33
| 35
| null | null |
oldmanmike/ghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
-- #define sizzeofMutableByteArrayzh(r,a) \
-- r = ((StgArrBytes *)(a))->bytes
emitPrimOp dflags [res] SizeofMutableByteArrayOp [arg]
= emitPrimOp dflags [res] SizeofByteArrayOp [arg]
| 192
|
emitPrimOp dflags [res] SizeofMutableByteArrayOp [arg]
= emitPrimOp dflags [res] SizeofByteArrayOp [arg]
| 107
|
emitPrimOp dflags [res] SizeofMutableByteArrayOp [arg]
= emitPrimOp dflags [res] SizeofByteArrayOp [arg]
| 107
| true
| false
| 0
| 6
| 28
| 38
| 21
| 17
| null | null |
Gabriel439/Haskell-Bears-Library
|
src/Bears.hs
|
bsd-3-clause
|
writeCsv :: Csv.ToRecord a => FilePath -> Vector a -> IO ()
writeCsv path as = ByteString.writeFile path (Csv.encode (Data.Foldable.toList as))
| 143
|
writeCsv :: Csv.ToRecord a => FilePath -> Vector a -> IO ()
writeCsv path as = ByteString.writeFile path (Csv.encode (Data.Foldable.toList as))
| 143
|
writeCsv path as = ByteString.writeFile path (Csv.encode (Data.Foldable.toList as))
| 83
| false
| true
| 0
| 10
| 20
| 69
| 32
| 37
| null | null |
grzegorzbalcerek/chess-haskell
|
Chess/Game.hs
|
mit
|
-- | Verifies if the en passant capture move is possible.
isEnPassantCapture GameStart _ _ = False
| 98
|
isEnPassantCapture GameStart _ _ = False
| 40
|
isEnPassantCapture GameStart _ _ = False
| 40
| true
| false
| 0
| 5
| 16
| 14
| 7
| 7
| null | null |
josefs/autosar
|
ARSim/arsim/AUTOSAR/ARSim.hs
|
bsd-3-clause
|
printWarnings :: Trace -> IO Trace
printWarnings (a, ts) = do
mapM_ putStrLn (mapMaybe transError ts)
return (a, ts)
| 121
|
printWarnings :: Trace -> IO Trace
printWarnings (a, ts) = do
mapM_ putStrLn (mapMaybe transError ts)
return (a, ts)
| 121
|
printWarnings (a, ts) = do
mapM_ putStrLn (mapMaybe transError ts)
return (a, ts)
| 86
| false
| true
| 0
| 9
| 23
| 55
| 27
| 28
| null | null |
BartAdv/Idris-dev
|
src/Idris/ElabQuasiquote.hs
|
bsd-3-clause
|
extractUnquotes n (PDisamb ns tm)
= do (tm', ex) <- extractUnquotes n tm
return (PDisamb ns tm', ex)
| 109
|
extractUnquotes n (PDisamb ns tm)
= do (tm', ex) <- extractUnquotes n tm
return (PDisamb ns tm', ex)
| 109
|
extractUnquotes n (PDisamb ns tm)
= do (tm', ex) <- extractUnquotes n tm
return (PDisamb ns tm', ex)
| 109
| false
| false
| 0
| 9
| 26
| 56
| 26
| 30
| null | null |
phadej/boolean-normal-forms
|
src/Data/Algebra/Boolean/DNF/Set.hs
|
mit
|
dnfNot :: (Ord a, Negable a) => DNF a -> DNF a
dnfNot = all or . map (map $ toNormalForm . Negable.not) . toDoubleList
| 118
|
dnfNot :: (Ord a, Negable a) => DNF a -> DNF a
dnfNot = all or . map (map $ toNormalForm . Negable.not) . toDoubleList
| 118
|
dnfNot = all or . map (map $ toNormalForm . Negable.not) . toDoubleList
| 71
| false
| true
| 0
| 10
| 24
| 63
| 31
| 32
| null | null |
lynnard/reflex-cocos2d
|
src/Reflex/Extra.hs
|
mit
|
-- | Convert an Event into a Dynamic of Maybe
dynMaybe :: (Reflex t, MonadHold t m)
=> Event t a -> m (Dynamic t (Maybe a))
dynMaybe e = holdDyn Nothing $ Just <$> e
| 174
|
dynMaybe :: (Reflex t, MonadHold t m)
=> Event t a -> m (Dynamic t (Maybe a))
dynMaybe e = holdDyn Nothing $ Just <$> e
| 128
|
dynMaybe e = holdDyn Nothing $ Just <$> e
| 41
| true
| true
| 0
| 11
| 44
| 69
| 34
| 35
| null | null |
NightRa/Idris-dev
|
src/IRTS/CodegenC.hs
|
bsd-3-clause
|
debug _ = ""
| 12
|
debug _ = ""
| 12
|
debug _ = ""
| 12
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
Hodapp87/ivory
|
ivory-examples/examples/ClassHierarchy.hs
|
bsd-3-clause
|
makeCCode :: IO ()
makeCCode = runCompiler [cmodule] [] opts
where
opts = initialOpts { outDir = Nothing, constFold = True }
cmodule = package "Module" $ do
defStruct (Proxy :: Proxy "StanagBase")
defStruct (Proxy :: Proxy "StanagBaseMsg1")
defStruct (Proxy :: Proxy "StanagBaseMsg2")
incl bar
| 315
|
makeCCode :: IO ()
makeCCode = runCompiler [cmodule] [] opts
where
opts = initialOpts { outDir = Nothing, constFold = True }
cmodule = package "Module" $ do
defStruct (Proxy :: Proxy "StanagBase")
defStruct (Proxy :: Proxy "StanagBaseMsg1")
defStruct (Proxy :: Proxy "StanagBaseMsg2")
incl bar
| 315
|
makeCCode = runCompiler [cmodule] [] opts
where
opts = initialOpts { outDir = Nothing, constFold = True }
cmodule = package "Module" $ do
defStruct (Proxy :: Proxy "StanagBase")
defStruct (Proxy :: Proxy "StanagBaseMsg1")
defStruct (Proxy :: Proxy "StanagBaseMsg2")
incl bar
| 296
| false
| true
| 4
| 10
| 66
| 130
| 58
| 72
| null | null |
redfish64/IrcScanner
|
src/IrcScanner/KeywordIndexPage.hs
|
bsd-3-clause
|
keywordIndexHandler :: HasHeist x => Handler x IrcSnaplet ()
keywordIndexHandler = do
s <- ask
st <- liftIO $ readIORef (view (iconfig . cstate) s)
renderWithSplices "keyword_index" (allSplices (_scirs st))
| 215
|
keywordIndexHandler :: HasHeist x => Handler x IrcSnaplet ()
keywordIndexHandler = do
s <- ask
st <- liftIO $ readIORef (view (iconfig . cstate) s)
renderWithSplices "keyword_index" (allSplices (_scirs st))
| 215
|
keywordIndexHandler = do
s <- ask
st <- liftIO $ readIORef (view (iconfig . cstate) s)
renderWithSplices "keyword_index" (allSplices (_scirs st))
| 154
| false
| true
| 0
| 14
| 38
| 89
| 40
| 49
| null | null |
haroldcarr/learn-haskell-coq-ml-etc
|
haskell/course/2014-10-edx-delft-fp101x-intro-to-fp-erik-meijer/hw07-parsing.hs
|
unlicense
|
------------------------------------------------------------------------------
-- EXERCISE 5
e5t :: [Test]
e5t = U.t "e5t"
(parse (char 'a' +++ return 'b') "abc")
[('a',"bc")]
| 186
|
e5t :: [Test]
e5t = U.t "e5t"
(parse (char 'a' +++ return 'b') "abc")
[('a',"bc")]
| 92
|
e5t = U.t "e5t"
(parse (char 'a' +++ return 'b') "abc")
[('a',"bc")]
| 78
| true
| true
| 0
| 9
| 29
| 63
| 31
| 32
| null | null |
tittoassini/typed
|
src/ZM/AsValue.hs
|
bsd-3-clause
|
wrongValue :: (Show a1, Show a2) => a1 -> a2 -> a3
wrongValue v vs = error $ unwords ["Wrong Value", show v, show vs]
| 117
|
wrongValue :: (Show a1, Show a2) => a1 -> a2 -> a3
wrongValue v vs = error $ unwords ["Wrong Value", show v, show vs]
| 117
|
wrongValue v vs = error $ unwords ["Wrong Value", show v, show vs]
| 66
| false
| true
| 2
| 9
| 24
| 68
| 32
| 36
| null | null |
tjakway/ghcjvm
|
compiler/cmm/PprC.hs
|
bsd-3-clause
|
is_cishCC :: CCallConv -> Bool
is_cishCC CCallConv = True
| 60
|
is_cishCC :: CCallConv -> Bool
is_cishCC CCallConv = True
| 60
|
is_cishCC CCallConv = True
| 29
| false
| true
| 0
| 5
| 11
| 18
| 9
| 9
| null | null |
haskell-infra/arc-lite
|
src/Main.hs
|
gpl-3.0
|
execArcOpts :: ArcOpts -> IO ()
execArcOpts opts@(ArcOpts {..}) = withOpenSSL $ do
let verbosity = if verbose then Verbose else Info
cfg <- readConfig opts
let mkCond (Config {..}) = case (cfgAuth, cfgApiURL) of
(ConfigAuthCert user cert, Just u) -> second Just <$> runConduit (conduitSessionAuth u user cert)
(ConfigAuthToken tok, Just u) -> pure (conduitAPITokenAuth u tok, Nothing)
(ConfigAuthAnon, Just u) -> pure (conduitAnonAuth u, Nothing)
(_, Nothing) -> fail "Could not infer Phabricator API URI"
case cmd of
ArcList -> do
(conduit, muid) <- mkCond cfg
uid <- maybe (u_phid <$> runConduit (userWhoami conduit)) pure muid
diffs <- runConduit $ differentialQuery conduit uid
forM_ diffs $ \DRev {..} -> do
-- quickndirty padding
let statusName = T.take 16 (d_statusName <> T.replicate 16 " ")
T.putStrLn $ mconcat
[ " ", statusName, " D", d_id, ": " , d_title ]
ArcCallConduit meth -> do
(conduit, _) <- mkCond cfg
req <- (either fail pure . eitherDecodeStrict') =<< BS.getContents
res <- callConduitPairs conduit meth (HM.toList (req :: Object))
-- emulate legacy output format emitted by `arc`
let res' = object $ case res of
ConduitResult v -> [ "error" .= Null, "errorMessage" .= Null, "response" .= (v :: Value) ]
ConduitError c i -> [ "error" .= c, "errorMessage" .= mconcat [c,": ",i], "response" .= Null ]
BC8.putStrLn (BL.toStrict $ encode res')
ArcInstallCert muri -> do
let cfg' | Just uri <- muri = cfg { cfgApiURL = Just $ T.encodeUtf8 $ normApiUrl $ T.pack uri }
| otherwise = cfg
(conduit0, _) <- mkCond cfg' { cfgAuth = ConfigAuthAnon }
-- test API URL anonymously
logInfo verbosity "Trying to contact server..."
_ <- runConduit $ conduitPing conduit0
ConduitCapabilities {..} <- runConduit $ conduitGetCapabilities conduit0
unless ("token" `elem` cap_authentication) $ do
logError verbosity "Phabricator server doesn't support token-based auth, maybe too old?"
exitFailure
let textUrl = T.dropEnd 4 (T.decodeUtf8 apiurl) <> "conduit/login/"
apiurl = fromMaybe (error "missing URI") $ cfgApiURL cfg'
T.putStrLn $ T.unlines
[ "Open this page in your browser and login to Phabricator if necessary:"
, ""
, textUrl
, ""
, "Then paste the API Token on that page below."
]
T.putStr " Paste API Token from that page: " >> hFlush stdout
tok <- T.strip <$> T.getLine
-- Verify authentication token works
(conduit1, _) <- mkCond cfg' { cfgAuth = ConfigAuthToken tok }
User {..} <- runConduit $ userWhoami conduit1
T.putStrLn ""
T.putStrLn ("login successful for " <> T.pack (show u_userName))
updateUserConfHostEntry apiurl tok
| 3,292
|
execArcOpts :: ArcOpts -> IO ()
execArcOpts opts@(ArcOpts {..}) = withOpenSSL $ do
let verbosity = if verbose then Verbose else Info
cfg <- readConfig opts
let mkCond (Config {..}) = case (cfgAuth, cfgApiURL) of
(ConfigAuthCert user cert, Just u) -> second Just <$> runConduit (conduitSessionAuth u user cert)
(ConfigAuthToken tok, Just u) -> pure (conduitAPITokenAuth u tok, Nothing)
(ConfigAuthAnon, Just u) -> pure (conduitAnonAuth u, Nothing)
(_, Nothing) -> fail "Could not infer Phabricator API URI"
case cmd of
ArcList -> do
(conduit, muid) <- mkCond cfg
uid <- maybe (u_phid <$> runConduit (userWhoami conduit)) pure muid
diffs <- runConduit $ differentialQuery conduit uid
forM_ diffs $ \DRev {..} -> do
-- quickndirty padding
let statusName = T.take 16 (d_statusName <> T.replicate 16 " ")
T.putStrLn $ mconcat
[ " ", statusName, " D", d_id, ": " , d_title ]
ArcCallConduit meth -> do
(conduit, _) <- mkCond cfg
req <- (either fail pure . eitherDecodeStrict') =<< BS.getContents
res <- callConduitPairs conduit meth (HM.toList (req :: Object))
-- emulate legacy output format emitted by `arc`
let res' = object $ case res of
ConduitResult v -> [ "error" .= Null, "errorMessage" .= Null, "response" .= (v :: Value) ]
ConduitError c i -> [ "error" .= c, "errorMessage" .= mconcat [c,": ",i], "response" .= Null ]
BC8.putStrLn (BL.toStrict $ encode res')
ArcInstallCert muri -> do
let cfg' | Just uri <- muri = cfg { cfgApiURL = Just $ T.encodeUtf8 $ normApiUrl $ T.pack uri }
| otherwise = cfg
(conduit0, _) <- mkCond cfg' { cfgAuth = ConfigAuthAnon }
-- test API URL anonymously
logInfo verbosity "Trying to contact server..."
_ <- runConduit $ conduitPing conduit0
ConduitCapabilities {..} <- runConduit $ conduitGetCapabilities conduit0
unless ("token" `elem` cap_authentication) $ do
logError verbosity "Phabricator server doesn't support token-based auth, maybe too old?"
exitFailure
let textUrl = T.dropEnd 4 (T.decodeUtf8 apiurl) <> "conduit/login/"
apiurl = fromMaybe (error "missing URI") $ cfgApiURL cfg'
T.putStrLn $ T.unlines
[ "Open this page in your browser and login to Phabricator if necessary:"
, ""
, textUrl
, ""
, "Then paste the API Token on that page below."
]
T.putStr " Paste API Token from that page: " >> hFlush stdout
tok <- T.strip <$> T.getLine
-- Verify authentication token works
(conduit1, _) <- mkCond cfg' { cfgAuth = ConfigAuthToken tok }
User {..} <- runConduit $ userWhoami conduit1
T.putStrLn ""
T.putStrLn ("login successful for " <> T.pack (show u_userName))
updateUserConfHostEntry apiurl tok
| 3,292
|
execArcOpts opts@(ArcOpts {..}) = withOpenSSL $ do
let verbosity = if verbose then Verbose else Info
cfg <- readConfig opts
let mkCond (Config {..}) = case (cfgAuth, cfgApiURL) of
(ConfigAuthCert user cert, Just u) -> second Just <$> runConduit (conduitSessionAuth u user cert)
(ConfigAuthToken tok, Just u) -> pure (conduitAPITokenAuth u tok, Nothing)
(ConfigAuthAnon, Just u) -> pure (conduitAnonAuth u, Nothing)
(_, Nothing) -> fail "Could not infer Phabricator API URI"
case cmd of
ArcList -> do
(conduit, muid) <- mkCond cfg
uid <- maybe (u_phid <$> runConduit (userWhoami conduit)) pure muid
diffs <- runConduit $ differentialQuery conduit uid
forM_ diffs $ \DRev {..} -> do
-- quickndirty padding
let statusName = T.take 16 (d_statusName <> T.replicate 16 " ")
T.putStrLn $ mconcat
[ " ", statusName, " D", d_id, ": " , d_title ]
ArcCallConduit meth -> do
(conduit, _) <- mkCond cfg
req <- (either fail pure . eitherDecodeStrict') =<< BS.getContents
res <- callConduitPairs conduit meth (HM.toList (req :: Object))
-- emulate legacy output format emitted by `arc`
let res' = object $ case res of
ConduitResult v -> [ "error" .= Null, "errorMessage" .= Null, "response" .= (v :: Value) ]
ConduitError c i -> [ "error" .= c, "errorMessage" .= mconcat [c,": ",i], "response" .= Null ]
BC8.putStrLn (BL.toStrict $ encode res')
ArcInstallCert muri -> do
let cfg' | Just uri <- muri = cfg { cfgApiURL = Just $ T.encodeUtf8 $ normApiUrl $ T.pack uri }
| otherwise = cfg
(conduit0, _) <- mkCond cfg' { cfgAuth = ConfigAuthAnon }
-- test API URL anonymously
logInfo verbosity "Trying to contact server..."
_ <- runConduit $ conduitPing conduit0
ConduitCapabilities {..} <- runConduit $ conduitGetCapabilities conduit0
unless ("token" `elem` cap_authentication) $ do
logError verbosity "Phabricator server doesn't support token-based auth, maybe too old?"
exitFailure
let textUrl = T.dropEnd 4 (T.decodeUtf8 apiurl) <> "conduit/login/"
apiurl = fromMaybe (error "missing URI") $ cfgApiURL cfg'
T.putStrLn $ T.unlines
[ "Open this page in your browser and login to Phabricator if necessary:"
, ""
, textUrl
, ""
, "Then paste the API Token on that page below."
]
T.putStr " Paste API Token from that page: " >> hFlush stdout
tok <- T.strip <$> T.getLine
-- Verify authentication token works
(conduit1, _) <- mkCond cfg' { cfgAuth = ConfigAuthToken tok }
User {..} <- runConduit $ userWhoami conduit1
T.putStrLn ""
T.putStrLn ("login successful for " <> T.pack (show u_userName))
updateUserConfHostEntry apiurl tok
| 3,260
| false
| true
| 0
| 24
| 1,158
| 926
| 454
| 472
| null | null |
bennofs/reflex
|
src/Reflex/Spider/Internal.hs
|
bsd-3-clause
|
getRootSubscribed :: Root a -> EventM (RootSubscribed a)
getRootSubscribed r = do
mSubscribed <- liftIO $ readIORef $ rootSubscribed r
case mSubscribed of
Just subscribed -> return subscribed
Nothing -> liftIO $ do
subscribersRef <- newIORef []
let !subscribed = RootSubscribed
{ rootSubscribedOccurrence = rootOccurrence r
, rootSubscribedSubscribers = subscribersRef
}
-- Strangely, init needs the same stuff as a RootSubscribed has, but it must not be the same as the one that everyone's subscribing to, or it'll leak memory
uninit <- rootInit r $ RootTrigger (subscribersRef, rootOccurrence r)
addFinalizer subscribed $ do
-- putStrLn "Uninit root"
uninit
liftIO $ writeIORef (rootSubscribed r) $ Just subscribed
return subscribed
-- When getPushSubscribed returns, the PushSubscribed returned will have a fully filled-in
| 931
|
getRootSubscribed :: Root a -> EventM (RootSubscribed a)
getRootSubscribed r = do
mSubscribed <- liftIO $ readIORef $ rootSubscribed r
case mSubscribed of
Just subscribed -> return subscribed
Nothing -> liftIO $ do
subscribersRef <- newIORef []
let !subscribed = RootSubscribed
{ rootSubscribedOccurrence = rootOccurrence r
, rootSubscribedSubscribers = subscribersRef
}
-- Strangely, init needs the same stuff as a RootSubscribed has, but it must not be the same as the one that everyone's subscribing to, or it'll leak memory
uninit <- rootInit r $ RootTrigger (subscribersRef, rootOccurrence r)
addFinalizer subscribed $ do
-- putStrLn "Uninit root"
uninit
liftIO $ writeIORef (rootSubscribed r) $ Just subscribed
return subscribed
-- When getPushSubscribed returns, the PushSubscribed returned will have a fully filled-in
| 931
|
getRootSubscribed r = do
mSubscribed <- liftIO $ readIORef $ rootSubscribed r
case mSubscribed of
Just subscribed -> return subscribed
Nothing -> liftIO $ do
subscribersRef <- newIORef []
let !subscribed = RootSubscribed
{ rootSubscribedOccurrence = rootOccurrence r
, rootSubscribedSubscribers = subscribersRef
}
-- Strangely, init needs the same stuff as a RootSubscribed has, but it must not be the same as the one that everyone's subscribing to, or it'll leak memory
uninit <- rootInit r $ RootTrigger (subscribersRef, rootOccurrence r)
addFinalizer subscribed $ do
-- putStrLn "Uninit root"
uninit
liftIO $ writeIORef (rootSubscribed r) $ Just subscribed
return subscribed
-- When getPushSubscribed returns, the PushSubscribed returned will have a fully filled-in
| 874
| false
| true
| 0
| 18
| 225
| 188
| 86
| 102
| null | null |
castaway/pandoc
|
src/Text/Pandoc/Readers/RST.hs
|
gpl-2.0
|
definitionList :: GenParser Char ParserState Block
definitionList = many1 definitionListItem >>= return . DefinitionList
| 120
|
definitionList :: GenParser Char ParserState Block
definitionList = many1 definitionListItem >>= return . DefinitionList
| 120
|
definitionList = many1 definitionListItem >>= return . DefinitionList
| 69
| false
| true
| 1
| 6
| 13
| 35
| 14
| 21
| null | null |
princemaple/SPLEE
|
logic.hs
|
mit
|
eliminate w@(_ :& _) = toAnd $ fromAnd w []
| 43
|
eliminate w@(_ :& _) = toAnd $ fromAnd w []
| 43
|
eliminate w@(_ :& _) = toAnd $ fromAnd w []
| 43
| false
| false
| 0
| 8
| 9
| 30
| 15
| 15
| null | null |
adinapoli/myo
|
src/Myo/WebSockets.hs
|
bsd-3-clause
|
connect :: APIVersion
-> ApplicationID
-- ^ The Myo ApplicationID
-> String
-- ^ Host
-> Int
-- ^ Port
-> ClientApp a
-> IO a
connect apiVr aId host port app = do
runClient host port ("/myo/" <> show apiVr <> "?appid=" <> aId) app
--------------------------------------------------------------------------------
| 378
|
connect :: APIVersion
-> ApplicationID
-- ^ The Myo ApplicationID
-> String
-- ^ Host
-> Int
-- ^ Port
-> ClientApp a
-> IO a
connect apiVr aId host port app = do
runClient host port ("/myo/" <> show apiVr <> "?appid=" <> aId) app
--------------------------------------------------------------------------------
| 378
|
connect apiVr aId host port app = do
runClient host port ("/myo/" <> show apiVr <> "?appid=" <> aId) app
--------------------------------------------------------------------------------
| 188
| false
| true
| 0
| 12
| 113
| 82
| 41
| 41
| null | null |
TomMD/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
-- Later substitutions in the list over-ride earlier ones,
-- but there should be no loops
zip_ty_env :: [TyVar] -> [Type] -> TvSubstEnv -> TvSubstEnv
zip_ty_env [] [] env = env
| 189
|
zip_ty_env :: [TyVar] -> [Type] -> TvSubstEnv -> TvSubstEnv
zip_ty_env [] [] env = env
| 98
|
zip_ty_env [] [] env = env
| 38
| true
| true
| 0
| 10
| 42
| 48
| 24
| 24
| null | null |
ku-fpg/kansas-amber
|
tests/ExprTests/ExprWord8.hs
|
bsd-3-clause
|
prop_add :: ArduinoConnection -> RemoteRef Word8 -> Word8 -> Word8 -> Property
prop_add c r x y = monadicIO $ do
let local = x + y
remote <- run $ send c $ do
writeRemoteRefE r $ (lit x) + (lit y)
v <- readRemoteRefE r
return v
assert (local == litEval8 remote)
| 297
|
prop_add :: ArduinoConnection -> RemoteRef Word8 -> Word8 -> Word8 -> Property
prop_add c r x y = monadicIO $ do
let local = x + y
remote <- run $ send c $ do
writeRemoteRefE r $ (lit x) + (lit y)
v <- readRemoteRefE r
return v
assert (local == litEval8 remote)
| 297
|
prop_add c r x y = monadicIO $ do
let local = x + y
remote <- run $ send c $ do
writeRemoteRefE r $ (lit x) + (lit y)
v <- readRemoteRefE r
return v
assert (local == litEval8 remote)
| 218
| false
| true
| 0
| 16
| 89
| 138
| 61
| 77
| null | null |
flocc-net/flocc
|
v0.1/Compiler/Types/Solver.hs
|
apache-2.0
|
noChoices=[]
| 12
|
noChoices=[]
| 12
|
noChoices=[]
| 12
| false
| false
| 0
| 5
| 0
| 8
| 4
| 4
| null | null |
phaazon/Idris-dev
|
src/IRTS/CodegenJavaScript.hs
|
bsd-3-clause
|
jsSTOREOLD :: CompileInfo ->JS
jsSTOREOLD _ = JSAssign (JSProj jsMYOLDBASE "addr") jsSTACKBASE
| 94
|
jsSTOREOLD :: CompileInfo ->JS
jsSTOREOLD _ = JSAssign (JSProj jsMYOLDBASE "addr") jsSTACKBASE
| 94
|
jsSTOREOLD _ = JSAssign (JSProj jsMYOLDBASE "addr") jsSTACKBASE
| 63
| false
| true
| 0
| 7
| 11
| 31
| 15
| 16
| null | null |
atulag/CS653-Projects
|
dist/build/autogen/Paths_HSVG.hs
|
bsd-3-clause
|
libexecdir = "/home/atulag/.cabal/libexec"
| 42
|
libexecdir = "/home/atulag/.cabal/libexec"
| 42
|
libexecdir = "/home/atulag/.cabal/libexec"
| 42
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
kazu-yamamoto/git-object
|
System/Git.hs
|
bsd-3-clause
|
{-|
Getting 'SHA1' corresponding to 'GitPath'.
-}
gitPathToSha1 :: GitPath -> GitDir -> IO SHA1
gitPathToSha1 path gitDir = do
GoCommit _ commit <- rootCommitObj gitDir
let sha1OfRootTreeObj = commitRef commit
pathToSha1 ps sha1OfRootTreeObj gitDir
where
ps = tail $ splitFilePath path
| 305
|
gitPathToSha1 :: GitPath -> GitDir -> IO SHA1
gitPathToSha1 path gitDir = do
GoCommit _ commit <- rootCommitObj gitDir
let sha1OfRootTreeObj = commitRef commit
pathToSha1 ps sha1OfRootTreeObj gitDir
where
ps = tail $ splitFilePath path
| 253
|
gitPathToSha1 path gitDir = do
GoCommit _ commit <- rootCommitObj gitDir
let sha1OfRootTreeObj = commitRef commit
pathToSha1 ps sha1OfRootTreeObj gitDir
where
ps = tail $ splitFilePath path
| 207
| true
| true
| 3
| 10
| 61
| 89
| 37
| 52
| null | null |
ihc/futhark
|
src/Language/Futhark/Attributes.hs
|
isc
|
-- | Names of primitive types to types. This is only valid if no
-- shadowing is going on, but useful for tools.
namesToPrimTypes :: M.Map Name PrimType
namesToPrimTypes = M.fromList
[ (nameFromString $ pretty t, t) |
t <- Bool :
map Signed [minBound..maxBound] ++
map Unsigned [minBound..maxBound] ++
map FloatType [minBound..maxBound] ]
| 457
|
namesToPrimTypes :: M.Map Name PrimType
namesToPrimTypes = M.fromList
[ (nameFromString $ pretty t, t) |
t <- Bool :
map Signed [minBound..maxBound] ++
map Unsigned [minBound..maxBound] ++
map FloatType [minBound..maxBound] ]
| 343
|
namesToPrimTypes = M.fromList
[ (nameFromString $ pretty t, t) |
t <- Bool :
map Signed [minBound..maxBound] ++
map Unsigned [minBound..maxBound] ++
map FloatType [minBound..maxBound] ]
| 303
| true
| true
| 0
| 13
| 172
| 91
| 47
| 44
| null | null |
kmate/HaRe
|
old/testing/refacFunDef/Test18.hs
|
bsd-3-clause
|
g = [1] ++ [1]
| 14
|
g = [1] ++ [1]
| 14
|
g = [1] ++ [1]
| 14
| false
| false
| 1
| 6
| 4
| 19
| 9
| 10
| null | null |
HJvT/hdirect
|
src/Parser.hs
|
bsd-3-clause
|
action_524 (176#) = happyShift action_86
| 40
|
action_524 (176#) = happyShift action_86
| 40
|
action_524 (176#) = happyShift action_86
| 40
| false
| false
| 0
| 6
| 4
| 15
| 7
| 8
| null | null |
bryangarza/cheese
|
src/Cheese.hs
|
mit
|
-- | Left and right shifts for sliding pieces King and Knight.
shiftLR :: [(BoardLayer,Int)] -> [(BoardLayer,Int)] -> BoardLayer
shiftLR l r = orFold (mapL ++ mapR)
where shiftL' = uncurry shiftL
mapL = map shiftL' l
shiftR' = uncurry shiftR
mapR = map shiftR' r
-- | Possible moves and attacks for a king piece.
-- | [north, east, northwest, northeast]
-- | [south, west, southeast, southwest]
| 427
|
shiftLR :: [(BoardLayer,Int)] -> [(BoardLayer,Int)] -> BoardLayer
shiftLR l r = orFold (mapL ++ mapR)
where shiftL' = uncurry shiftL
mapL = map shiftL' l
shiftR' = uncurry shiftR
mapR = map shiftR' r
-- | Possible moves and attacks for a king piece.
-- | [north, east, northwest, northeast]
-- | [south, west, southeast, southwest]
| 364
|
shiftLR l r = orFold (mapL ++ mapR)
where shiftL' = uncurry shiftL
mapL = map shiftL' l
shiftR' = uncurry shiftR
mapR = map shiftR' r
-- | Possible moves and attacks for a king piece.
-- | [north, east, northwest, northeast]
-- | [south, west, southeast, southwest]
| 298
| true
| true
| 3
| 8
| 100
| 95
| 52
| 43
| null | null |
nzok/decimal
|
FixedTest.hs
|
mit
|
prop_order_trichotomy =
forAll sdGen $ \x ->
forAll sdGen $ \y ->
(length $ filter id $ [x < y, x == y, x > y]) == 1
| 128
|
prop_order_trichotomy =
forAll sdGen $ \x ->
forAll sdGen $ \y ->
(length $ filter id $ [x < y, x == y, x > y]) == 1
| 128
|
prop_order_trichotomy =
forAll sdGen $ \x ->
forAll sdGen $ \y ->
(length $ filter id $ [x < y, x == y, x > y]) == 1
| 128
| false
| false
| 0
| 13
| 39
| 69
| 36
| 33
| null | null |
rleshchinskiy/vector
|
Data/Vector/Storable.hs
|
bsd-3-clause
|
maximum = G.maximum
| 19
|
maximum = G.maximum
| 19
|
maximum = G.maximum
| 19
| false
| false
| 1
| 6
| 2
| 12
| 4
| 8
| null | null |
rvion/ride
|
jetpack/src/Data/Text/Lazy/IO/AsLt.hs
|
bsd-3-clause
|
-- lt_writeFile :: FilePath -> Text -> IO ()
lt_writeFile = I.writeFile
| 71
|
lt_writeFile = I.writeFile
| 26
|
lt_writeFile = I.writeFile
| 26
| true
| false
| 0
| 5
| 11
| 9
| 5
| 4
| null | null |
brendanhay/gogol
|
gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs
|
mpl-2.0
|
-- | The id of the tag the user code will emit to this output by; this should
-- correspond to the tag of some SideInputInfo.
moiTag :: Lens' MultiOutputInfo (Maybe Text)
moiTag = lens _moiTag (\ s a -> s{_moiTag = a})
| 218
|
moiTag :: Lens' MultiOutputInfo (Maybe Text)
moiTag = lens _moiTag (\ s a -> s{_moiTag = a})
| 92
|
moiTag = lens _moiTag (\ s a -> s{_moiTag = a})
| 47
| true
| true
| 0
| 9
| 42
| 47
| 26
| 21
| null | null |
solidsnack/taskl
|
System/TaskL/Compiler.hs
|
bsd-3-clause
|
unify :: (Ord t) => Forest t :- Forest t
unify forest | cyclic = Left "Cycle detected."
| Just vs <- roots = Right [ f <$> tree | tree <- full vs ]
| otherwise = Left "Impossible error!"
where (g, f, v) = graph . asMap $ concatMap adjacencies forest
roots = mapM v [ a | Node a _ <- forest ]
cyclic = any (/=[]) [ sub | Node _ sub <- Graph.scc g ]
full vs = mconcat [ Graph.dfs g [v] | v <- vs ]
-- | Transform a tree to an adjacency list representation of its edges.
-- Duplicate edges are retained.
| 577
|
unify :: (Ord t) => Forest t :- Forest t
unify forest | cyclic = Left "Cycle detected."
| Just vs <- roots = Right [ f <$> tree | tree <- full vs ]
| otherwise = Left "Impossible error!"
where (g, f, v) = graph . asMap $ concatMap adjacencies forest
roots = mapM v [ a | Node a _ <- forest ]
cyclic = any (/=[]) [ sub | Node _ sub <- Graph.scc g ]
full vs = mconcat [ Graph.dfs g [v] | v <- vs ]
-- | Transform a tree to an adjacency list representation of its edges.
-- Duplicate edges are retained.
| 577
|
unify forest | cyclic = Left "Cycle detected."
| Just vs <- roots = Right [ f <$> tree | tree <- full vs ]
| otherwise = Left "Impossible error!"
where (g, f, v) = graph . asMap $ concatMap adjacencies forest
roots = mapM v [ a | Node a _ <- forest ]
cyclic = any (/=[]) [ sub | Node _ sub <- Graph.scc g ]
full vs = mconcat [ Graph.dfs g [v] | v <- vs ]
-- | Transform a tree to an adjacency list representation of its edges.
-- Duplicate edges are retained.
| 536
| false
| true
| 3
| 11
| 187
| 217
| 107
| 110
| null | null |
revnull/fixfile
|
src/Data/FixFile.hs
|
lgpl-3.0
|
{- |
'cloneH' is 'clone' but taking a 'Handle' as an argument instead of a
'FilePath'.
-}
cloneH :: Root r => FixFile r -> Handle -> IO ()
cloneH (FixFile _ mv _) dh = runClone where
runClone = do
mv'@(ffh, root) <- takeMVar mv
BS.hPut dh (encode (Ptr 0))
wb <- initWB dh
wb' <- newIORef wb
dffh <- FFH <$> newMVar dh <*> return wb' <*> newMVar M.empty
root' <- traverseFix (copyPtr ffh dffh) root
r' <- putRawBlock True root' dffh
hSeek dh AbsoluteSeek 0
BS.hPut dh (encode r')
putMVar mv mv'
copyPtr ffh h = hyloM
(getBlock' ffh)
((Ptr <$>) . flip (putRawBlock False) h)
{- |
It's potentially useful to copy the contents of a 'FixFile' to a new
location as a backup. The 'clone' function essentially runs 'vacuum'
on a 'FixFile', but writes the output to the specified path.
-}
| 912
|
cloneH :: Root r => FixFile r -> Handle -> IO ()
cloneH (FixFile _ mv _) dh = runClone where
runClone = do
mv'@(ffh, root) <- takeMVar mv
BS.hPut dh (encode (Ptr 0))
wb <- initWB dh
wb' <- newIORef wb
dffh <- FFH <$> newMVar dh <*> return wb' <*> newMVar M.empty
root' <- traverseFix (copyPtr ffh dffh) root
r' <- putRawBlock True root' dffh
hSeek dh AbsoluteSeek 0
BS.hPut dh (encode r')
putMVar mv mv'
copyPtr ffh h = hyloM
(getBlock' ffh)
((Ptr <$>) . flip (putRawBlock False) h)
{- |
It's potentially useful to copy the contents of a 'FixFile' to a new
location as a backup. The 'clone' function essentially runs 'vacuum'
on a 'FixFile', but writes the output to the specified path.
-}
| 814
|
cloneH (FixFile _ mv _) dh = runClone where
runClone = do
mv'@(ffh, root) <- takeMVar mv
BS.hPut dh (encode (Ptr 0))
wb <- initWB dh
wb' <- newIORef wb
dffh <- FFH <$> newMVar dh <*> return wb' <*> newMVar M.empty
root' <- traverseFix (copyPtr ffh dffh) root
r' <- putRawBlock True root' dffh
hSeek dh AbsoluteSeek 0
BS.hPut dh (encode r')
putMVar mv mv'
copyPtr ffh h = hyloM
(getBlock' ffh)
((Ptr <$>) . flip (putRawBlock False) h)
{- |
It's potentially useful to copy the contents of a 'FixFile' to a new
location as a backup. The 'clone' function essentially runs 'vacuum'
on a 'FixFile', but writes the output to the specified path.
-}
| 765
| true
| true
| 0
| 13
| 278
| 264
| 122
| 142
| null | null |
fultonms/artificial-intelligence
|
a1/PCP.hs
|
mit
|
botWord (x:xs) = snd x ++ botWord(xs)
| 37
|
botWord (x:xs) = snd x ++ botWord(xs)
| 37
|
botWord (x:xs) = snd x ++ botWord(xs)
| 37
| false
| false
| 0
| 7
| 6
| 29
| 14
| 15
| null | null |
ghcjs/ghcjs-base
|
test/Tests/Properties.hs
|
mit
|
sf_foldl1' p f = (L.foldl1' f . L.filter p) `eqP` (S.foldl1' f . S.filter p)
| 79
|
sf_foldl1' p f = (L.foldl1' f . L.filter p) `eqP` (S.foldl1' f . S.filter p)
| 79
|
sf_foldl1' p f = (L.foldl1' f . L.filter p) `eqP` (S.foldl1' f . S.filter p)
| 79
| false
| false
| 0
| 9
| 17
| 51
| 25
| 26
| null | null |
epsilonhalbe/Mastermind
|
dist/build/autogen/Paths_Mastermind.hs
|
mit
|
bindir, libdir, datadir, libexecdir :: FilePath
bindir = "/home/epsilonhalbe/.cabal/bin"
| 93
|
bindir, libdir, datadir, libexecdir :: FilePath
bindir = "/home/epsilonhalbe/.cabal/bin"
| 92
|
bindir = "/home/epsilonhalbe/.cabal/bin"
| 44
| false
| true
| 6
| 6
| 13
| 33
| 12
| 21
| null | null |
jwaldmann/satchmo-solver
|
test/Ramsey.hs
|
gpl-3.0
|
isomorphism p e = do
assertM $ regular 1 p
assertM $ regular 1 $ mirror p
e' <- foldM product ( mirror p ) [ e, p ]
assertM $ implies e e'
assertM $ implies e' e
| 181
|
isomorphism p e = do
assertM $ regular 1 p
assertM $ regular 1 $ mirror p
e' <- foldM product ( mirror p ) [ e, p ]
assertM $ implies e e'
assertM $ implies e' e
| 181
|
isomorphism p e = do
assertM $ regular 1 p
assertM $ regular 1 $ mirror p
e' <- foldM product ( mirror p ) [ e, p ]
assertM $ implies e e'
assertM $ implies e' e
| 181
| false
| false
| 0
| 10
| 58
| 90
| 40
| 50
| null | null |
haskell-pkg-janitors/feed
|
Text/RSS/Import.hs
|
bsd-3-clause
|
elementToGuid :: XML.Element -> Maybe RSSGuid
elementToGuid e = do
guard (elementName e == qualName "guid")
let as = elementAttributes e
return RSSGuid
{ rssGuidPermanentURL = pAttr "isPermaLink" e >>= readBool
, rssGuidAttrs = filter (\ (k,_) -> not (nameLocalName k `elem` known_attrs)) as
, rssGuidValue = strContent e
}
where
known_attrs = ["isPermaLink"]
| 398
|
elementToGuid :: XML.Element -> Maybe RSSGuid
elementToGuid e = do
guard (elementName e == qualName "guid")
let as = elementAttributes e
return RSSGuid
{ rssGuidPermanentURL = pAttr "isPermaLink" e >>= readBool
, rssGuidAttrs = filter (\ (k,_) -> not (nameLocalName k `elem` known_attrs)) as
, rssGuidValue = strContent e
}
where
known_attrs = ["isPermaLink"]
| 398
|
elementToGuid e = do
guard (elementName e == qualName "guid")
let as = elementAttributes e
return RSSGuid
{ rssGuidPermanentURL = pAttr "isPermaLink" e >>= readBool
, rssGuidAttrs = filter (\ (k,_) -> not (nameLocalName k `elem` known_attrs)) as
, rssGuidValue = strContent e
}
where
known_attrs = ["isPermaLink"]
| 352
| false
| true
| 1
| 16
| 92
| 144
| 70
| 74
| null | null |
bjpop/berp
|
libs/src/Berp/Base/StdTypes/None.hs
|
bsd-3-clause
|
attributes :: IO Object
attributes = mkAttributesList
[ (specialEqName, primitive 2 eq)
, (specialStrName, primitive 1 str)
]
| 134
|
attributes :: IO Object
attributes = mkAttributesList
[ (specialEqName, primitive 2 eq)
, (specialStrName, primitive 1 str)
]
| 134
|
attributes = mkAttributesList
[ (specialEqName, primitive 2 eq)
, (specialStrName, primitive 1 str)
]
| 110
| false
| true
| 0
| 7
| 26
| 45
| 24
| 21
| null | null |
TrevorBender/lithp
|
src/Lisp.hs
|
gpl-3.0
|
showError (TypeMismatch typ found) = "Type mismatch, Expected " ++ typ ++ " ; found " ++ show found
| 99
|
showError (TypeMismatch typ found) = "Type mismatch, Expected " ++ typ ++ " ; found " ++ show found
| 99
|
showError (TypeMismatch typ found) = "Type mismatch, Expected " ++ typ ++ " ; found " ++ show found
| 99
| false
| false
| 0
| 7
| 18
| 32
| 15
| 17
| null | null |
mlite/hLLVM
|
src/Llvm/AsmHirConversion/LabelMapM.hs
|
bsd-3-clause
|
invertMap :: M.Map (I.Gname, A.LabelId) H.Label -> M.Map (I.Gname, H.Label) A.LabelId
invertMap m = foldl (\p ((g,k),v) -> if M.member (g,v) p
then error $ "irrefutable error in invertMap, the values are not unique"
else M.insert (g,v) k p
) M.empty (M.toList m)
| 357
|
invertMap :: M.Map (I.Gname, A.LabelId) H.Label -> M.Map (I.Gname, H.Label) A.LabelId
invertMap m = foldl (\p ((g,k),v) -> if M.member (g,v) p
then error $ "irrefutable error in invertMap, the values are not unique"
else M.insert (g,v) k p
) M.empty (M.toList m)
| 357
|
invertMap m = foldl (\p ((g,k),v) -> if M.member (g,v) p
then error $ "irrefutable error in invertMap, the values are not unique"
else M.insert (g,v) k p
) M.empty (M.toList m)
| 271
| false
| true
| 0
| 10
| 137
| 135
| 73
| 62
| null | null |
DougBurke/swish
|
src/Swish/RDF/Parser/Turtle.hs
|
lgpl-2.1
|
findPrefixNamespace Nothing = getDefaultPrefix
| 47
|
findPrefixNamespace Nothing = getDefaultPrefix
| 47
|
findPrefixNamespace Nothing = getDefaultPrefix
| 47
| false
| false
| 0
| 5
| 4
| 9
| 4
| 5
| null | null |
waldheinz/ads
|
src/lib/Freenet/Metadata.hs
|
gpl-3.0
|
getArchiveInternalRedirect :: Get Metadata
getArchiveInternalRedirect = do
flags <- getWord16be
-- only NoMime / CompressedMime / (nothing) has ever been seen
unless (flags == 8 || flags == 4 || flags == 0) $ fail $ "unexpected flags on archive internal redirect " ++ show flags
mime <- getMime flags
tgt <- getText
return $ ArchiveInternalRedirect tgt mime
| 372
|
getArchiveInternalRedirect :: Get Metadata
getArchiveInternalRedirect = do
flags <- getWord16be
-- only NoMime / CompressedMime / (nothing) has ever been seen
unless (flags == 8 || flags == 4 || flags == 0) $ fail $ "unexpected flags on archive internal redirect " ++ show flags
mime <- getMime flags
tgt <- getText
return $ ArchiveInternalRedirect tgt mime
| 372
|
getArchiveInternalRedirect = do
flags <- getWord16be
-- only NoMime / CompressedMime / (nothing) has ever been seen
unless (flags == 8 || flags == 4 || flags == 0) $ fail $ "unexpected flags on archive internal redirect " ++ show flags
mime <- getMime flags
tgt <- getText
return $ ArchiveInternalRedirect tgt mime
| 329
| false
| true
| 0
| 16
| 72
| 95
| 44
| 51
| null | null |
dblia/nosql-ganeti
|
src/Ganeti/Logging.hs
|
gpl-2.0
|
-- | Builds the log formatter.
logFormatter :: String -- ^ Program
-> Bool -- ^ Multithreaded
-> Bool -- ^ Syslog
-> LogFormatter a
logFormatter prog mt syslog =
let parts = [ if syslog
then "[$pid]:"
else "$time: " ++ prog ++ " pid=$pid"
, if mt then if syslog then " ($tid)" else "/$tid"
else ""
, " $prio $msg"
]
in tfLogFormatter "%F %X,%q %Z" $ concat parts
| 508
|
logFormatter :: String -- ^ Program
-> Bool -- ^ Multithreaded
-> Bool -- ^ Syslog
-> LogFormatter a
logFormatter prog mt syslog =
let parts = [ if syslog
then "[$pid]:"
else "$time: " ++ prog ++ " pid=$pid"
, if mt then if syslog then " ($tid)" else "/$tid"
else ""
, " $prio $msg"
]
in tfLogFormatter "%F %X,%q %Z" $ concat parts
| 477
|
logFormatter prog mt syslog =
let parts = [ if syslog
then "[$pid]:"
else "$time: " ++ prog ++ " pid=$pid"
, if mt then if syslog then " ($tid)" else "/$tid"
else ""
, " $prio $msg"
]
in tfLogFormatter "%F %X,%q %Z" $ concat parts
| 330
| true
| true
| 0
| 12
| 217
| 99
| 54
| 45
| null | null |
dmbarbour/Sirea
|
src/Sirea/Internal/B0Dynamic.hs
|
bsd-3-clause
|
deliverS tS (lo:r@(hi:_)) =
ln_idle (snd lo) (finalStability tS (fst hi)) >>
deliverS tS r
| 99
|
deliverS tS (lo:r@(hi:_)) =
ln_idle (snd lo) (finalStability tS (fst hi)) >>
deliverS tS r
| 99
|
deliverS tS (lo:r@(hi:_)) =
ln_idle (snd lo) (finalStability tS (fst hi)) >>
deliverS tS r
| 99
| false
| false
| 0
| 10
| 23
| 62
| 31
| 31
| null | null |
frantisekfarka/ghc-dsi
|
ghc/Main.hs
|
bsd-3-clause
|
showBanner :: PostLoadMode -> DynFlags -> IO ()
showBanner _postLoadMode dflags = do
let verb = verbosity dflags
#ifdef GHCI
-- Show the GHCi banner
when (isInteractiveMode _postLoadMode && verb >= 1) $ putStrLn ghciWelcomeMsg
#endif
-- Display details of the configuration in verbose mode
when (verb >= 2) $
do hPutStr stderr "Glasgow Haskell Compiler, Version "
hPutStr stderr cProjectVersion
hPutStr stderr ", stage "
hPutStr stderr cStage
hPutStr stderr " booted by GHC version "
hPutStrLn stderr cBooterVersion
-- We print out a Read-friendly string, but a prettier one than the
-- Show instance gives us
| 666
|
showBanner :: PostLoadMode -> DynFlags -> IO ()
showBanner _postLoadMode dflags = do
let verb = verbosity dflags
#ifdef GHCI
-- Show the GHCi banner
when (isInteractiveMode _postLoadMode && verb >= 1) $ putStrLn ghciWelcomeMsg
#endif
-- Display details of the configuration in verbose mode
when (verb >= 2) $
do hPutStr stderr "Glasgow Haskell Compiler, Version "
hPutStr stderr cProjectVersion
hPutStr stderr ", stage "
hPutStr stderr cStage
hPutStr stderr " booted by GHC version "
hPutStrLn stderr cBooterVersion
-- We print out a Read-friendly string, but a prettier one than the
-- Show instance gives us
| 666
|
showBanner _postLoadMode dflags = do
let verb = verbosity dflags
#ifdef GHCI
-- Show the GHCi banner
when (isInteractiveMode _postLoadMode && verb >= 1) $ putStrLn ghciWelcomeMsg
#endif
-- Display details of the configuration in verbose mode
when (verb >= 2) $
do hPutStr stderr "Glasgow Haskell Compiler, Version "
hPutStr stderr cProjectVersion
hPutStr stderr ", stage "
hPutStr stderr cStage
hPutStr stderr " booted by GHC version "
hPutStrLn stderr cBooterVersion
-- We print out a Read-friendly string, but a prettier one than the
-- Show instance gives us
| 618
| false
| true
| 0
| 12
| 154
| 139
| 63
| 76
| null | null |
ethanpailes/bbc
|
src/GenC.hs
|
bsd-3-clause
|
byteSizeOf _ (SumTy {}) = Nothing
| 33
|
byteSizeOf _ (SumTy {}) = Nothing
| 33
|
byteSizeOf _ (SumTy {}) = Nothing
| 33
| false
| false
| 0
| 7
| 5
| 18
| 9
| 9
| null | null |
x-y-z/cabal
|
cabal-install/Distribution/Client/Config.hs
|
bsd-3-clause
|
commentSavedConfig :: IO SavedConfig
commentSavedConfig = do
userInstallDirs <- defaultInstallDirs defaultCompiler True True
globalInstallDirs <- defaultInstallDirs defaultCompiler False True
return SavedConfig {
savedGlobalFlags = defaultGlobalFlags,
savedInstallFlags = defaultInstallFlags,
savedConfigureExFlags = defaultConfigExFlags,
savedConfigureFlags = (defaultConfigFlags defaultProgramConfiguration) {
configUserInstall = toFlag defaultUserInstall
},
savedUserInstallDirs = fmap toFlag userInstallDirs,
savedGlobalInstallDirs = fmap toFlag globalInstallDirs,
savedUploadFlags = commandDefaultFlags uploadCommand,
savedReportFlags = commandDefaultFlags reportCommand,
savedHaddockFlags = defaultHaddockFlags
}
-- | All config file fields.
--
| 844
|
commentSavedConfig :: IO SavedConfig
commentSavedConfig = do
userInstallDirs <- defaultInstallDirs defaultCompiler True True
globalInstallDirs <- defaultInstallDirs defaultCompiler False True
return SavedConfig {
savedGlobalFlags = defaultGlobalFlags,
savedInstallFlags = defaultInstallFlags,
savedConfigureExFlags = defaultConfigExFlags,
savedConfigureFlags = (defaultConfigFlags defaultProgramConfiguration) {
configUserInstall = toFlag defaultUserInstall
},
savedUserInstallDirs = fmap toFlag userInstallDirs,
savedGlobalInstallDirs = fmap toFlag globalInstallDirs,
savedUploadFlags = commandDefaultFlags uploadCommand,
savedReportFlags = commandDefaultFlags reportCommand,
savedHaddockFlags = defaultHaddockFlags
}
-- | All config file fields.
--
| 844
|
commentSavedConfig = do
userInstallDirs <- defaultInstallDirs defaultCompiler True True
globalInstallDirs <- defaultInstallDirs defaultCompiler False True
return SavedConfig {
savedGlobalFlags = defaultGlobalFlags,
savedInstallFlags = defaultInstallFlags,
savedConfigureExFlags = defaultConfigExFlags,
savedConfigureFlags = (defaultConfigFlags defaultProgramConfiguration) {
configUserInstall = toFlag defaultUserInstall
},
savedUserInstallDirs = fmap toFlag userInstallDirs,
savedGlobalInstallDirs = fmap toFlag globalInstallDirs,
savedUploadFlags = commandDefaultFlags uploadCommand,
savedReportFlags = commandDefaultFlags reportCommand,
savedHaddockFlags = defaultHaddockFlags
}
-- | All config file fields.
--
| 807
| false
| true
| 0
| 13
| 163
| 145
| 76
| 69
| null | null |
diku-kmc/repg
|
src/KMC/Kleenex/Parser.hs
|
mit
|
-- | Parse a register identifier
regIdentifierP :: Parser RegIdent
regIdentifierP = RegIdent <$> lexeme regIdentifier
<?> "register"
| 146
|
regIdentifierP :: Parser RegIdent
regIdentifierP = RegIdent <$> lexeme regIdentifier
<?> "register"
| 113
|
regIdentifierP = RegIdent <$> lexeme regIdentifier
<?> "register"
| 79
| true
| true
| 3
| 6
| 31
| 31
| 13
| 18
| null | null |
Teaspot-Studio/Urho3D-Haskell
|
src/Graphics/Urho3D/Input/InputConstants.hs
|
mit
|
keyKPEquals :: Int
keyKPEquals = fromIntegral $ [C.pure| int {KEY_KP_EQUALS} |]
| 79
|
keyKPEquals :: Int
keyKPEquals = fromIntegral $ [C.pure| int {KEY_KP_EQUALS} |]
| 79
|
keyKPEquals = fromIntegral $ [C.pure| int {KEY_KP_EQUALS} |]
| 60
| false
| true
| 0
| 6
| 10
| 21
| 13
| 8
| null | null |
ben-schulz/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
annotationColour ist (AnnTextFmt fmt) = Just (colour fmt)
where colour BoldText = IdrisColour Nothing True False True False
colour UnderlineText = IdrisColour Nothing True True False False
colour ItalicText = IdrisColour Nothing True False False True
| 276
|
annotationColour ist (AnnTextFmt fmt) = Just (colour fmt)
where colour BoldText = IdrisColour Nothing True False True False
colour UnderlineText = IdrisColour Nothing True True False False
colour ItalicText = IdrisColour Nothing True False False True
| 276
|
annotationColour ist (AnnTextFmt fmt) = Just (colour fmt)
where colour BoldText = IdrisColour Nothing True False True False
colour UnderlineText = IdrisColour Nothing True True False False
colour ItalicText = IdrisColour Nothing True False False True
| 276
| false
| false
| 0
| 7
| 61
| 90
| 40
| 50
| null | null |
markus1189/xmonad-710
|
util/GenerateManpage.hs
|
bsd-3-clause
|
trim :: String -> String
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
| 89
|
trim :: String -> String
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
| 89
|
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
| 64
| false
| true
| 0
| 8
| 15
| 33
| 16
| 17
| null | null |
lambdageek/indentation
|
indentation-core/src/Text/Parser/Indentation/Implementation.hs
|
bsd-3-clause
|
absoluteIndentation :: LocalState a -> a -> a
absoluteIndentation localState = localState pre post where
pre i1 = i1 { absMode = True }
post i1 i2 = i2 { absMode = absMode i1 && absMode i2 }
| 200
|
absoluteIndentation :: LocalState a -> a -> a
absoluteIndentation localState = localState pre post where
pre i1 = i1 { absMode = True }
post i1 i2 = i2 { absMode = absMode i1 && absMode i2 }
| 200
|
absoluteIndentation localState = localState pre post where
pre i1 = i1 { absMode = True }
post i1 i2 = i2 { absMode = absMode i1 && absMode i2 }
| 154
| false
| true
| 0
| 10
| 47
| 76
| 38
| 38
| null | null |
jokusi/mso
|
src/Data/Formula.hs
|
apache-2.0
|
eval size v1 v2 (All (Var1 v) f) = all (\v1upd -> eval size v1upd v2 f)
[ update v1 v res | res <- gen1 size]
| 111
|
eval size v1 v2 (All (Var1 v) f) = all (\v1upd -> eval size v1upd v2 f)
[ update v1 v res | res <- gen1 size]
| 111
|
eval size v1 v2 (All (Var1 v) f) = all (\v1upd -> eval size v1upd v2 f)
[ update v1 v res | res <- gen1 size]
| 111
| false
| false
| 0
| 9
| 28
| 73
| 35
| 38
| null | null |
hce/yanas
|
src/Network.hs
|
gpl-2.0
|
parseWaypoint :: ATCParser Waypoint
parseWaypoint = undefined
| 61
|
parseWaypoint :: ATCParser Waypoint
parseWaypoint = undefined
| 61
|
parseWaypoint = undefined
| 25
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
akc/gfscript
|
HOPS/GF.hs
|
bsd-3-clause
|
-- | The list of variables in a program.
vars :: Core -> [Name]
vars = nub . varsCore
| 85
|
vars :: Core -> [Name]
vars = nub . varsCore
| 44
|
vars = nub . varsCore
| 21
| true
| true
| 0
| 8
| 18
| 30
| 14
| 16
| null | null |
seereason/wl-pprint-text
|
Text/PrettyPrint/Leijen/Text.hs
|
bsd-3-clause
|
-- | The document @rbrace@ contains a right brace, \"}\".
rbrace :: Doc
rbrace = char '}'
| 89
|
rbrace :: Doc
rbrace = char '}'
| 31
|
rbrace = char '}'
| 17
| true
| true
| 0
| 6
| 16
| 21
| 9
| 12
| null | null |
rahulmutt/ghcvm
|
libraries/eta-meta/Language/Eta/Meta/PprLib.hs
|
bsd-3-clause
|
integer = return . HPJ.integer
| 30
|
integer = return . HPJ.integer
| 30
|
integer = return . HPJ.integer
| 30
| false
| false
| 1
| 7
| 4
| 16
| 6
| 10
| null | null |
thielema/wxhaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs
|
lgpl-2.1
|
-- marshalling
withCSize :: Size -> (CInt -> CInt -> IO a) -> IO a
withCSize (Size w h) f
= f (toCInt w) (toCInt h)
| 117
|
withCSize :: Size -> (CInt -> CInt -> IO a) -> IO a
withCSize (Size w h) f
= f (toCInt w) (toCInt h)
| 102
|
withCSize (Size w h) f
= f (toCInt w) (toCInt h)
| 50
| true
| true
| 0
| 10
| 27
| 68
| 33
| 35
| null | null |
tdox/hcholmod
|
lib/Numeric/LinearAlgebra/CHOLMOD/CholmodXFace.hs
|
mit
|
startC :: ForeignPtr Common -> IO ()
startC cfp = withForeignPtr cfp start
| 74
|
startC :: ForeignPtr Common -> IO ()
startC cfp = withForeignPtr cfp start
| 74
|
startC cfp = withForeignPtr cfp start
| 37
| false
| true
| 0
| 8
| 12
| 37
| 15
| 22
| null | null |
nikki-and-the-robots/nikki
|
src/Base/Renderable/Scrollable.hs
|
lgpl-3.0
|
scrollable :: Application -> [Prose] -> IO (RenderableInstance, (Int -> Int) -> IO ())
scrollable app children = do
chan <- newChan
scrollDownRef <- newIORef 0
let r = MenuBackground |:>
(addKeysHint scrollableKeysHint $
centered $
parentSpacer (\ (Size _w h) -> Size textWidth h) $
Scrollable children chan scrollDownRef)
send fun = do
writeChan chan fun
updateMainWindow (window app)
return (renderable r, send)
| 509
|
scrollable :: Application -> [Prose] -> IO (RenderableInstance, (Int -> Int) -> IO ())
scrollable app children = do
chan <- newChan
scrollDownRef <- newIORef 0
let r = MenuBackground |:>
(addKeysHint scrollableKeysHint $
centered $
parentSpacer (\ (Size _w h) -> Size textWidth h) $
Scrollable children chan scrollDownRef)
send fun = do
writeChan chan fun
updateMainWindow (window app)
return (renderable r, send)
| 509
|
scrollable app children = do
chan <- newChan
scrollDownRef <- newIORef 0
let r = MenuBackground |:>
(addKeysHint scrollableKeysHint $
centered $
parentSpacer (\ (Size _w h) -> Size textWidth h) $
Scrollable children chan scrollDownRef)
send fun = do
writeChan chan fun
updateMainWindow (window app)
return (renderable r, send)
| 422
| false
| true
| 0
| 19
| 159
| 179
| 84
| 95
| null | null |
phylake/avm3
|
abc/util.hs
|
mit
|
toBytes {- 0x6E -} (GetGlobalSlot u30) = 1 + u30Bytes u30
| 57
|
toBytes {- 0x6E -} (GetGlobalSlot u30) = 1 + u30Bytes u30
| 57
|
toBytes {- 0x6E -} (GetGlobalSlot u30) = 1 + u30Bytes u30
| 57
| false
| false
| 0
| 7
| 10
| 23
| 11
| 12
| null | null |
batebobo/fp1718
|
exam-solutions/homework.hs
|
mit
|
slice start end (_:xs) = slice (start - 1) (end - 1) xs
| 55
|
slice start end (_:xs) = slice (start - 1) (end - 1) xs
| 55
|
slice start end (_:xs) = slice (start - 1) (end - 1) xs
| 55
| false
| false
| 0
| 7
| 12
| 42
| 21
| 21
| null | null |
acowley/ghc
|
compiler/deSugar/DsUtils.hs
|
bsd-3-clause
|
mkCoreAppDs fun arg = mkCoreApp fun arg
| 39
|
mkCoreAppDs fun arg = mkCoreApp fun arg
| 39
|
mkCoreAppDs fun arg = mkCoreApp fun arg
| 39
| false
| false
| 1
| 5
| 6
| 22
| 7
| 15
| null | null |
CloudI/CloudI
|
src/api/haskell/external/bytestring-0.10.10.0/Data/ByteString.hs
|
mit
|
-- ---------------------------------------------------------------------
-- Reducing 'ByteString's
-- | 'foldl', applied to a binary operator, a starting value (typically
-- the left-identity of the operator), and a ByteString, reduces the
-- ByteString using the binary operator, from left to right.
--
foldl :: (a -> Word8 -> a) -> a -> ByteString -> a
foldl f z (PS fp off len) =
let p = unsafeForeignPtrToPtr fp
in go (p `plusPtr` (off+len-1)) (p `plusPtr` (off-1))
where
-- not tail recursive; traverses array right to left
go !p !q | p == q = z
| otherwise = let !x = accursedUnutterablePerformIO $ do
x' <- peek p
touchForeignPtr fp
return x'
in f (go (p `plusPtr` (-1)) q) x
| 880
|
foldl :: (a -> Word8 -> a) -> a -> ByteString -> a
foldl f z (PS fp off len) =
let p = unsafeForeignPtrToPtr fp
in go (p `plusPtr` (off+len-1)) (p `plusPtr` (off-1))
where
-- not tail recursive; traverses array right to left
go !p !q | p == q = z
| otherwise = let !x = accursedUnutterablePerformIO $ do
x' <- peek p
touchForeignPtr fp
return x'
in f (go (p `plusPtr` (-1)) q) x
| 575
|
foldl f z (PS fp off len) =
let p = unsafeForeignPtrToPtr fp
in go (p `plusPtr` (off+len-1)) (p `plusPtr` (off-1))
where
-- not tail recursive; traverses array right to left
go !p !q | p == q = z
| otherwise = let !x = accursedUnutterablePerformIO $ do
x' <- peek p
touchForeignPtr fp
return x'
in f (go (p `plusPtr` (-1)) q) x
| 524
| true
| true
| 0
| 14
| 314
| 225
| 110
| 115
| null | null |
roberth/uu-helium
|
test/benchmarks/Parser.hs
|
gpl-3.0
|
leTakeLitChars d l n ('\t':cs)
= leFail l n "Literal contains tab"
| 68
|
leTakeLitChars d l n ('\t':cs)
= leFail l n "Literal contains tab"
| 68
|
leTakeLitChars d l n ('\t':cs)
= leFail l n "Literal contains tab"
| 68
| false
| false
| 0
| 6
| 13
| 35
| 14
| 21
| null | null |
shlevy/ghc
|
compiler/prelude/THNames.hs
|
bsd-3-clause
|
varPIdKey = mkPreludeMiscIdUnique 241
| 45
|
varPIdKey = mkPreludeMiscIdUnique 241
| 45
|
varPIdKey = mkPreludeMiscIdUnique 241
| 45
| false
| false
| 0
| 5
| 11
| 9
| 4
| 5
| null | null |
uduki/hsQt
|
Qtc/Enums/Gui/QAbstractPrintDialog.hs
|
bsd-2-clause
|
iePrintDialogOption :: Int -> PrintDialogOption
iePrintDialogOption x = QEnum (CPrintDialogOption x)
| 100
|
iePrintDialogOption :: Int -> PrintDialogOption
iePrintDialogOption x = QEnum (CPrintDialogOption x)
| 100
|
iePrintDialogOption x = QEnum (CPrintDialogOption x)
| 52
| false
| true
| 0
| 7
| 10
| 27
| 13
| 14
| null | null |
phaazon/OpenGLRawgen
|
src/Modules/Compatibility.hs
|
bsd-3-clause
|
addOldCoreTypes :: Builder ()
addOldCoreTypes = do
let modName = ModuleName "Graphics.Rendering.OpenGL.Raw.Core31.Types"
warning = DeprText "\"The OpenGL types are moved to Graphics.Rendering.OpenGL.Raw.Types .\""
typesModule <- askTypesModule
addModuleWithWarning modName
Compatibility warning $ tellReExportModule typesModule
-- | Creates the ARB.Compatibility module.
| 399
|
addOldCoreTypes :: Builder ()
addOldCoreTypes = do
let modName = ModuleName "Graphics.Rendering.OpenGL.Raw.Core31.Types"
warning = DeprText "\"The OpenGL types are moved to Graphics.Rendering.OpenGL.Raw.Types .\""
typesModule <- askTypesModule
addModuleWithWarning modName
Compatibility warning $ tellReExportModule typesModule
-- | Creates the ARB.Compatibility module.
| 399
|
addOldCoreTypes = do
let modName = ModuleName "Graphics.Rendering.OpenGL.Raw.Core31.Types"
warning = DeprText "\"The OpenGL types are moved to Graphics.Rendering.OpenGL.Raw.Types .\""
typesModule <- askTypesModule
addModuleWithWarning modName
Compatibility warning $ tellReExportModule typesModule
-- | Creates the ARB.Compatibility module.
| 369
| false
| true
| 0
| 11
| 67
| 67
| 29
| 38
| null | null |
lpeterse/koka
|
src/Lib/Scc.hs
|
apache-2.0
|
dfs :: Ord v => Graph v -> [v] -> Forest v
dfs g vs
= prune (map (tree g) vs)
| 79
|
dfs :: Ord v => Graph v -> [v] -> Forest v
dfs g vs
= prune (map (tree g) vs)
| 79
|
dfs g vs
= prune (map (tree g) vs)
| 36
| false
| true
| 0
| 9
| 22
| 57
| 27
| 30
| null | null |
beni55/texmath
|
src/Text/TeXMath/Readers/TeX.hs
|
gpl-2.0
|
circ 'e' = "ê"
| 14
|
circ 'e' = "ê"
| 14
|
circ 'e' = "ê"
| 14
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
fmapfmapfmap/amazonka
|
amazonka-workspaces/gen/Network/AWS/WorkSpaces/Types/Product.hs
|
mpl-2.0
|
-- | The user name for the service account.
wdCustomerUserName :: Lens' WorkspaceDirectory (Maybe Text)
wdCustomerUserName = lens _wdCustomerUserName (\ s a -> s{_wdCustomerUserName = a})
| 187
|
wdCustomerUserName :: Lens' WorkspaceDirectory (Maybe Text)
wdCustomerUserName = lens _wdCustomerUserName (\ s a -> s{_wdCustomerUserName = a})
| 143
|
wdCustomerUserName = lens _wdCustomerUserName (\ s a -> s{_wdCustomerUserName = a})
| 83
| true
| true
| 1
| 9
| 25
| 51
| 25
| 26
| null | null |
lambdatoast/fpac
|
src/Schema/Parser.hs
|
mit
|
simpleVal :: Parser Val
simpleVal = SVal <$> (concat . L.intersperse "." <$> ((P.many1 alphaNum) `sepBy` char '.'))
| 115
|
simpleVal :: Parser Val
simpleVal = SVal <$> (concat . L.intersperse "." <$> ((P.many1 alphaNum) `sepBy` char '.'))
| 115
|
simpleVal = SVal <$> (concat . L.intersperse "." <$> ((P.many1 alphaNum) `sepBy` char '.'))
| 91
| false
| true
| 2
| 12
| 17
| 61
| 29
| 32
| null | null |
fmapfmapfmap/amazonka
|
amazonka-datapipeline/gen/Network/AWS/DataPipeline/DescribePipelines.hs
|
mpl-2.0
|
-- | An array of descriptions for the specified pipelines.
dprsPipelineDescriptionList :: Lens' DescribePipelinesResponse [PipelineDescription]
dprsPipelineDescriptionList = lens _dprsPipelineDescriptionList (\ s a -> s{_dprsPipelineDescriptionList = a}) . _Coerce
| 264
|
dprsPipelineDescriptionList :: Lens' DescribePipelinesResponse [PipelineDescription]
dprsPipelineDescriptionList = lens _dprsPipelineDescriptionList (\ s a -> s{_dprsPipelineDescriptionList = a}) . _Coerce
| 205
|
dprsPipelineDescriptionList = lens _dprsPipelineDescriptionList (\ s a -> s{_dprsPipelineDescriptionList = a}) . _Coerce
| 120
| true
| true
| 0
| 10
| 27
| 47
| 26
| 21
| null | null |
alexvong1995/pandoc
|
src/Text/Pandoc/Readers/Docx/Parse.hs
|
gpl-2.0
|
absNumElemToAbsNum :: NameSpaces -> Element -> Maybe AbstractNumb
absNumElemToAbsNum ns element |
qName (elName element) == "abstractNum" &&
qURI (elName element) == (lookup "w" ns) = do
absNumId <- findAttr
(QName "abstractNumId" (lookup "w" ns) (Just "w"))
element
let levelElems = findChildren
(QName "lvl" (lookup "w" ns) (Just "w"))
element
levels = mapMaybe (levelElemToLevel ns) levelElems
return $ AbstractNumb absNumId levels
| 524
|
absNumElemToAbsNum :: NameSpaces -> Element -> Maybe AbstractNumb
absNumElemToAbsNum ns element |
qName (elName element) == "abstractNum" &&
qURI (elName element) == (lookup "w" ns) = do
absNumId <- findAttr
(QName "abstractNumId" (lookup "w" ns) (Just "w"))
element
let levelElems = findChildren
(QName "lvl" (lookup "w" ns) (Just "w"))
element
levels = mapMaybe (levelElemToLevel ns) levelElems
return $ AbstractNumb absNumId levels
| 524
|
absNumElemToAbsNum ns element |
qName (elName element) == "abstractNum" &&
qURI (elName element) == (lookup "w" ns) = do
absNumId <- findAttr
(QName "abstractNumId" (lookup "w" ns) (Just "w"))
element
let levelElems = findChildren
(QName "lvl" (lookup "w" ns) (Just "w"))
element
levels = mapMaybe (levelElemToLevel ns) levelElems
return $ AbstractNumb absNumId levels
| 458
| false
| true
| 0
| 15
| 150
| 173
| 81
| 92
| null | null |
jtdaugherty/vty
|
src/Graphics/Vty/Image/Internal.hs
|
bsd-3-clause
|
vertJoin i0 i1
-- If the images are of the same width then no background padding is
-- required
| w0 == w1 = VertJoin i0 i1 w0 h
-- Otherwise one of the images needs to be padded to the size of the
-- other image.
| w0 < w1
= let padAmount = w1 - w0
in VertJoin (HorizJoin i0 (BGFill padAmount h0) w1 h0) i1 w1 h
| w0 > w1
= let padAmount = w0 - w1
in VertJoin i0 (HorizJoin i1 (BGFill padAmount h1) w0 h1) w0 h
where
w0 = imageWidth i0
w1 = imageWidth i1
h0 = imageHeight i0
h1 = imageHeight i1
h = h0 + h1
| 617
|
vertJoin i0 i1
-- If the images are of the same width then no background padding is
-- required
| w0 == w1 = VertJoin i0 i1 w0 h
-- Otherwise one of the images needs to be padded to the size of the
-- other image.
| w0 < w1
= let padAmount = w1 - w0
in VertJoin (HorizJoin i0 (BGFill padAmount h0) w1 h0) i1 w1 h
| w0 > w1
= let padAmount = w0 - w1
in VertJoin i0 (HorizJoin i1 (BGFill padAmount h1) w0 h1) w0 h
where
w0 = imageWidth i0
w1 = imageWidth i1
h0 = imageHeight i0
h1 = imageHeight i1
h = h0 + h1
| 617
|
vertJoin i0 i1
-- If the images are of the same width then no background padding is
-- required
| w0 == w1 = VertJoin i0 i1 w0 h
-- Otherwise one of the images needs to be padded to the size of the
-- other image.
| w0 < w1
= let padAmount = w1 - w0
in VertJoin (HorizJoin i0 (BGFill padAmount h0) w1 h0) i1 w1 h
| w0 > w1
= let padAmount = w0 - w1
in VertJoin i0 (HorizJoin i1 (BGFill padAmount h1) w0 h1) w0 h
where
w0 = imageWidth i0
w1 = imageWidth i1
h0 = imageHeight i0
h1 = imageHeight i1
h = h0 + h1
| 617
| false
| false
| 6
| 11
| 224
| 194
| 93
| 101
| null | null |
aztek/voogie
|
src/Voogie/TPTP/Syntax.hs
|
gpl-3.0
|
boolName = "$o"
| 15
|
boolName = "$o"
| 15
|
boolName = "$o"
| 15
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
nevrenato/Hets_Fork
|
Temporal/ModalCaslToMu.hs
|
gpl-2.0
|
convert (Casl.A phi) = liftM Mu.A (convert' phi)
| 74
|
convert (Casl.A phi) = liftM Mu.A (convert' phi)
| 74
|
convert (Casl.A phi) = liftM Mu.A (convert' phi)
| 74
| false
| false
| 0
| 8
| 33
| 30
| 14
| 16
| null | null |
jaanos/TPJ-2015-16
|
microhaskell/MH_Evaluator.hs
|
mit
|
evaluate env (Op("-", exp1, exp2)) =
let val1 = evaluate env exp1
val2 = evaluate env exp2
in case (val1, val2) of
(Num m, Num n) -> Num (m-n)
_ -> error "Runtime type error"
| 201
|
evaluate env (Op("-", exp1, exp2)) =
let val1 = evaluate env exp1
val2 = evaluate env exp2
in case (val1, val2) of
(Num m, Num n) -> Num (m-n)
_ -> error "Runtime type error"
| 201
|
evaluate env (Op("-", exp1, exp2)) =
let val1 = evaluate env exp1
val2 = evaluate env exp2
in case (val1, val2) of
(Num m, Num n) -> Num (m-n)
_ -> error "Runtime type error"
| 201
| false
| false
| 0
| 12
| 61
| 99
| 50
| 49
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.