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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dmvianna/haskellbook | src/notes.hs | unlicense | showIfJust Nothing = Nothing | 28 | showIfJust Nothing = Nothing | 28 | showIfJust Nothing = Nothing | 28 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
benkolera/haskell-opaleye | src/Opaleye/Internal/HaskellDB/Sql/Default.hs | bsd-3-clause | showBinOp OpBitXor = "^" | 29 | showBinOp OpBitXor = "^" | 29 | showBinOp OpBitXor = "^" | 29 | false | false | 0 | 4 | 8 | 10 | 4 | 6 | null | null |
dysinger/amazonka | core/src/Network/AWS/Types.hs | mpl-2.0 | sgMeta :: Lens' (Signed a v) (Meta v)
sgMeta f (Signed m rq) = f m <&> \y -> Signed y rq | 88 | sgMeta :: Lens' (Signed a v) (Meta v)
sgMeta f (Signed m rq) = f m <&> \y -> Signed y rq | 88 | sgMeta f (Signed m rq) = f m <&> \y -> Signed y rq | 50 | false | true | 0 | 7 | 21 | 60 | 29 | 31 | null | null |
RobertFischer/real-world-haskell | ch03/Ex.hs | unlicense | -- Exercise 5
-- (I realized I wanted this method for Exercise 4, so I did it first.)
is_palindrome :: Eq a => [a] -> Bool
is_palindrome [] = True | 146 | is_palindrome :: Eq a => [a] -> Bool
is_palindrome [] = True | 60 | is_palindrome [] = True | 23 | true | true | 0 | 7 | 29 | 32 | 17 | 15 | null | null |
joelburget/daily-typecheckers | src/Day9.hs | bsd-3-clause | close_var_rename :: Term -> String -> String -> Bool
close_var_rename t x y = if y `isFresh` t
then closeOuter x t == closeOuter y (subst x (FVar y) t)
else error "y isn't fresh in t so this isn't really meaningful" | 219 | close_var_rename :: Term -> String -> String -> Bool
close_var_rename t x y = if y `isFresh` t
then closeOuter x t == closeOuter y (subst x (FVar y) t)
else error "y isn't fresh in t so this isn't really meaningful" | 219 | close_var_rename t x y = if y `isFresh` t
then closeOuter x t == closeOuter y (subst x (FVar y) t)
else error "y isn't fresh in t so this isn't really meaningful" | 166 | false | true | 0 | 11 | 45 | 77 | 39 | 38 | null | null |
adinapoli/xmonad-contrib | XMonad/Hooks/ManageHelpers.hs | bsd-3-clause | -- | A predicate to check whether a window is a KDE system tray icon.
isKDETrayWindow :: Query Bool
isKDETrayWindow = ask >>= \w -> liftX $ do
r <- getProp32s "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR" w
return $ case r of
Just [_] -> True
_ -> False
-- | Helper to check if a window property contains certain value. | 335 | isKDETrayWindow :: Query Bool
isKDETrayWindow = ask >>= \w -> liftX $ do
r <- getProp32s "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR" w
return $ case r of
Just [_] -> True
_ -> False
-- | Helper to check if a window property contains certain value. | 265 | isKDETrayWindow = ask >>= \w -> liftX $ do
r <- getProp32s "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR" w
return $ case r of
Just [_] -> True
_ -> False
-- | Helper to check if a window property contains certain value. | 235 | true | true | 0 | 15 | 81 | 70 | 35 | 35 | null | null |
kwrooijen/sdl-game | End/Header/Tile.hs | gpl-3.0 | getColl 29 = Rect 16 16 16 16 | 29 | getColl 29 = Rect 16 16 16 16 | 29 | getColl 29 = Rect 16 16 16 16 | 29 | false | false | 0 | 5 | 7 | 18 | 8 | 10 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Erlang.hs | gpl-2.0 | -- | Highlight source code using this syntax definition.
highlight :: String -> [SourceLine]
highlight input = evalState (mapM parseSourceLine $ lines input) startingState | 171 | highlight :: String -> [SourceLine]
highlight input = evalState (mapM parseSourceLine $ lines input) startingState | 114 | highlight input = evalState (mapM parseSourceLine $ lines input) startingState | 78 | true | true | 0 | 8 | 23 | 40 | 20 | 20 | null | null |
unhammer/bytestring-trie-0.2.4 | src/Data/Trie/Internal.hs | bsd-3-clause | maxAssoc :: Trie a -> Maybe (ByteString, a)
maxAssoc = go S.empty
where
go _ Empty = Nothing
go q (Arc k (Just v) Empty) = Just (S.append q k,v)
go q (Arc k _ t) = go (S.append q k) t
go q (Branch _ _ _ r) = go q r | 270 | maxAssoc :: Trie a -> Maybe (ByteString, a)
maxAssoc = go S.empty
where
go _ Empty = Nothing
go q (Arc k (Just v) Empty) = Just (S.append q k,v)
go q (Arc k _ t) = go (S.append q k) t
go q (Branch _ _ _ r) = go q r | 270 | maxAssoc = go S.empty
where
go _ Empty = Nothing
go q (Arc k (Just v) Empty) = Just (S.append q k,v)
go q (Arc k _ t) = go (S.append q k) t
go q (Branch _ _ _ r) = go q r | 226 | false | true | 0 | 9 | 108 | 149 | 73 | 76 | null | null |
carliros/lsystem | src/SistemaL.hs | bsd-3-clause | emplo2 = SistemaL "Koch" alfaK2 initK2 prodK2
a | 47 | ejemplo2 = SistemaL "Koch" alfaK2 initK2 prodK2 | 47 | ejemplo2 = SistemaL "Koch" alfaK2 initK2 prodK2 | 47 | false | false | 0 | 5 | 7 | 18 | 8 | 10 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Input/InputConstants.hs | mit | toUrhoControllerAxis :: Int -> ControllerAxis
toUrhoControllerAxis i
| i == controllerAxisLeftx = ControllerAxisLeftX
| i == controllerAxisLefty = ControllerAxisLeftY
| i == controllerAxisRightx = ControllerAxisRightX
| i == controllerAxisRighty = ControllerAxisRightY
| i == controllerAxisTriggerleft = ControllerAxisTriggerLeft
| i == controllerAxisTriggerright = ControllerAxisTriggerRight
| otherwise = ControllerAxisLeftX | 440 | toUrhoControllerAxis :: Int -> ControllerAxis
toUrhoControllerAxis i
| i == controllerAxisLeftx = ControllerAxisLeftX
| i == controllerAxisLefty = ControllerAxisLeftY
| i == controllerAxisRightx = ControllerAxisRightX
| i == controllerAxisRighty = ControllerAxisRightY
| i == controllerAxisTriggerleft = ControllerAxisTriggerLeft
| i == controllerAxisTriggerright = ControllerAxisTriggerRight
| otherwise = ControllerAxisLeftX | 440 | toUrhoControllerAxis i
| i == controllerAxisLeftx = ControllerAxisLeftX
| i == controllerAxisLefty = ControllerAxisLeftY
| i == controllerAxisRightx = ControllerAxisRightX
| i == controllerAxisRighty = ControllerAxisRightY
| i == controllerAxisTriggerleft = ControllerAxisTriggerLeft
| i == controllerAxisTriggerright = ControllerAxisTriggerRight
| otherwise = ControllerAxisLeftX | 394 | false | true | 6 | 8 | 60 | 101 | 47 | 54 | null | null |
shicks/shsh | System/Console/ShSh/Shell.hs | bsd-3-clause | parseFlags :: IO String
parseFlags = return "" | 46 | parseFlags :: IO String
parseFlags = return "" | 46 | parseFlags = return "" | 22 | false | true | 0 | 6 | 7 | 23 | 9 | 14 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/Skel/FastVector/Matrix.hs | bsd-3-clause | farm11 :: (a -> b)
-> Matrix a -- ^ /size/ = @(xa,ya)@
-> Matrix b -- ^ /size/ = @(xa,ya)@
farm11 = V.farm11 . V.farm11 | 133 | farm11 :: (a -> b)
-> Matrix a -- ^ /size/ = @(xa,ya)@
-> Matrix b
farm11 = V.farm11 . V.farm11 | 109 | farm11 = V.farm11 . V.farm11 | 28 | true | true | 0 | 7 | 39 | 42 | 22 | 20 | null | null |
KommuSoft/vty-ui | src/Graphics/Vty/Widgets/DirBrowser.hs | bsd-3-clause | -- |Apply annotations to a browser skin.
withAnnotations :: BrowserSkin
-> [(FilePath -> FileStatus -> Bool, FilePath -> FileStatus -> IO T.Text, Attr)]
-> BrowserSkin
withAnnotations sk as = sk { browserCustomAnnotations = browserCustomAnnotations sk ++ as } | 291 | withAnnotations :: BrowserSkin
-> [(FilePath -> FileStatus -> Bool, FilePath -> FileStatus -> IO T.Text, Attr)]
-> BrowserSkin
withAnnotations sk as = sk { browserCustomAnnotations = browserCustomAnnotations sk ++ as } | 250 | withAnnotations sk as = sk { browserCustomAnnotations = browserCustomAnnotations sk ++ as } | 91 | true | true | 0 | 12 | 69 | 73 | 39 | 34 | null | null |
SKA-ScienceDataProcessor/RC | MS4/lib/DNA/SlurmBackend.hs | apache-2.0 | startSlave :: Backend -> IO ()
startSlave backend = do
node <- newLocalNode backend
Node.runProcess node slaveController
-- | The slave controller interprets 'SlaveControllerMsg's | 184 | startSlave :: Backend -> IO ()
startSlave backend = do
node <- newLocalNode backend
Node.runProcess node slaveController
-- | The slave controller interprets 'SlaveControllerMsg's | 184 | startSlave backend = do
node <- newLocalNode backend
Node.runProcess node slaveController
-- | The slave controller interprets 'SlaveControllerMsg's | 153 | false | true | 0 | 8 | 28 | 44 | 20 | 24 | null | null |
bitemyapp/haskell-vcache | hsrc_lib/Database/VCache/Refct.hs | bsd-2-clause | oRefctBytes :: Refct -> [Word8]
toRefctBytes = rcb [] . subtract 1 . assertPositive where
rcb l 0 = l
rcb l rc = rcb (fromIntegral rc : l) (rc `shiftR` 8)
assertPositive n = assert (n > 0) n
-- write a reference variable-width count into an MDB_val.
--
-- Note: given buffer should be large enough for any reference count.
| 337 | toRefctBytes :: Refct -> [Word8]
toRefctBytes = rcb [] . subtract 1 . assertPositive where
rcb l 0 = l
rcb l rc = rcb (fromIntegral rc : l) (rc `shiftR` 8)
assertPositive n = assert (n > 0) n
-- write a reference variable-width count into an MDB_val.
--
-- Note: given buffer should be large enough for any reference count. | 337 | toRefctBytes = rcb [] . subtract 1 . assertPositive where
rcb l 0 = l
rcb l rc = rcb (fromIntegral rc : l) (rc `shiftR` 8)
assertPositive n = assert (n > 0) n
-- write a reference variable-width count into an MDB_val.
--
-- Note: given buffer should be large enough for any reference count. | 304 | false | true | 4 | 8 | 76 | 119 | 55 | 64 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/GT_7.hs | mit | gtOrdering :: Ordering -> Ordering -> MyBool
gtOrdering x y = esEsOrdering (compareOrdering x y) GT | 103 | gtOrdering :: Ordering -> Ordering -> MyBool
gtOrdering x y = esEsOrdering (compareOrdering x y) GT | 103 | gtOrdering x y = esEsOrdering (compareOrdering x y) GT | 54 | false | true | 0 | 8 | 19 | 43 | 19 | 24 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | buildTime ProtossTemplarArchives = 900 | 38 | buildTime ProtossTemplarArchives = 900 | 38 | buildTime ProtossTemplarArchives = 900 | 38 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
zakharvoit/lambda-util | src/Math/LambdaUtil/Parser.hs | gpl-3.0 | parseMultiApp = try parseMultiApp' | 34 | parseMultiApp = try parseMultiApp' | 34 | parseMultiApp = try parseMultiApp' | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
sheganinans/UAO | src/UAO.hs | mit | -- Better nub over Vectors.
nubV :: (Ord a) => V.Vector a -> V.Vector a
nubV = V.fromList . nub' . V.toList | 107 | nubV :: (Ord a) => V.Vector a -> V.Vector a
nubV = V.fromList . nub' . V.toList | 79 | nubV = V.fromList . nub' . V.toList | 35 | true | true | 2 | 9 | 21 | 55 | 25 | 30 | null | null |
ekr/tamarin-prover | lib/utils/src/Control/Monad/Bind.hs | gpl-3.0 | -- | Evaluate a binding context computation.
evalBindT :: Monad m => BindT k v m a -> Bindings k v -> m a
evalBindT = evalStateT | 128 | evalBindT :: Monad m => BindT k v m a -> Bindings k v -> m a
evalBindT = evalStateT | 83 | evalBindT = evalStateT | 22 | true | true | 0 | 8 | 26 | 44 | 21 | 23 | null | null |
jlubi333/Camille | camille/hs/TypeChecker.hs | mit | isPolymorphic :: String -> Bool
isPolymorphic s = s `elem` ["print", "printType"] | 81 | isPolymorphic :: String -> Bool
isPolymorphic s = s `elem` ["print", "printType"] | 81 | isPolymorphic s = s `elem` ["print", "printType"] | 49 | false | true | 0 | 6 | 11 | 30 | 17 | 13 | null | null |
brendanhay/gogol | gogol-drive/gen/Network/Google/Drive/Types/Product.hs | mpl-2.0 | -- | The page token for the next page of permissions. This field will be
-- absent if the end of the permissions list has been reached. If the token
-- is rejected for any reason, it should be discarded, and pagination
-- should be restarted from the first page of results.
plNextPageToken :: Lens' PermissionList (Maybe Text)
plNextPageToken
= lens _plNextPageToken
(\ s a -> s{_plNextPageToken = a}) | 409 | plNextPageToken :: Lens' PermissionList (Maybe Text)
plNextPageToken
= lens _plNextPageToken
(\ s a -> s{_plNextPageToken = a}) | 135 | plNextPageToken
= lens _plNextPageToken
(\ s a -> s{_plNextPageToken = a}) | 82 | true | true | 0 | 9 | 76 | 51 | 28 | 23 | null | null |
vdweegen/UvA-Software_Testing | Lab5/Jordan/Lecture5.hs | gpl-3.0 | colInjective :: Sudoku -> Column -> Bool
colInjective s c = injective vs where
vs = filter (/= 0) [ s (i,c) | i <- positions ] | 130 | colInjective :: Sudoku -> Column -> Bool
colInjective s c = injective vs where
vs = filter (/= 0) [ s (i,c) | i <- positions ] | 130 | colInjective s c = injective vs where
vs = filter (/= 0) [ s (i,c) | i <- positions ] | 89 | false | true | 1 | 8 | 30 | 74 | 34 | 40 | null | null |
input-output-hk/pos-haskell-prototype | infra/src/Pos/Infra/Communication/Protocol.hs | mit | mapListener'
:: (forall snd rcv. Message rcv => N.NodeId
-> N.ConversationActions snd rcv
-> N.ConversationActions snd rcv)
-> (forall t. IO t -> IO t) -> Listener -> Listener
mapListener' caMapper mapper (N.Listener f) =
N.Listener $ \d nId -> mapper . f d nId . caMapper nId | 308 | mapListener'
:: (forall snd rcv. Message rcv => N.NodeId
-> N.ConversationActions snd rcv
-> N.ConversationActions snd rcv)
-> (forall t. IO t -> IO t) -> Listener -> Listener
mapListener' caMapper mapper (N.Listener f) =
N.Listener $ \d nId -> mapper . f d nId . caMapper nId | 308 | mapListener' caMapper mapper (N.Listener f) =
N.Listener $ \d nId -> mapper . f d nId . caMapper nId | 104 | false | true | 0 | 13 | 79 | 130 | 63 | 67 | null | null |
kindl/Hypatia | src/Typechecker.hs | mit | -- extract free variables
freeVars ty =
let
f (ForAll vars _) cs = excluding vars (concat cs)
f (TypeVariable v) _ = [v]
f _ cs = concat cs
in para f ty | 184 | freeVars ty =
let
f (ForAll vars _) cs = excluding vars (concat cs)
f (TypeVariable v) _ = [v]
f _ cs = concat cs
in para f ty | 158 | freeVars ty =
let
f (ForAll vars _) cs = excluding vars (concat cs)
f (TypeVariable v) _ = [v]
f _ cs = concat cs
in para f ty | 158 | true | false | 1 | 11 | 65 | 87 | 39 | 48 | null | null |
kmate/parallella-dsp-demo | src/Main.hs | bsd-3-clause | numPosBins :: Data Length
numPosBins = value numPosBins' | 56 | numPosBins :: Data Length
numPosBins = value numPosBins' | 56 | numPosBins = value numPosBins' | 30 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
brendanhay/gogol | gogol-chat/gen/Network/Google/Chat/Types/Product.hs | mpl-2.0 | -- | Output only. The thumbnail URL which should be used to preview the
-- attachment to a human user. Bots should not use this URL to download
-- attachment content.
aThumbnailURI :: Lens' Attachment (Maybe Text)
aThumbnailURI
= lens _aThumbnailURI
(\ s a -> s{_aThumbnailURI = a}) | 290 | aThumbnailURI :: Lens' Attachment (Maybe Text)
aThumbnailURI
= lens _aThumbnailURI
(\ s a -> s{_aThumbnailURI = a}) | 123 | aThumbnailURI
= lens _aThumbnailURI
(\ s a -> s{_aThumbnailURI = a}) | 76 | true | true | 1 | 9 | 55 | 53 | 27 | 26 | null | null |
ekmett/wl-pprint-extras | src/Text/PrettyPrint/Free/Internal.hs | bsd-2-clause | fillBreak :: Int -> Doc a e -> Doc a e
fillBreak f x = width x $ \w ->
if (w > f) then nest f linebreak
else text (spaces (f - w)) | 179 | fillBreak :: Int -> Doc a e -> Doc a e
fillBreak f x = width x $ \w ->
if (w > f) then nest f linebreak
else text (spaces (f - w)) | 179 | fillBreak f x = width x $ \w ->
if (w > f) then nest f linebreak
else text (spaces (f - w)) | 140 | false | true | 0 | 12 | 82 | 82 | 41 | 41 | null | null |
alang9/deque | Data/Deque/NonCat.hs | bsd-3-clause | fixup2' (BigR (RX B0 (B5 n o p q r)) N (TinyL B0)) = go5 n o p q r | 104 | fixup2' (BigR (RX B0 (B5 n o p q r)) N (TinyL B0)) = go5 n o p q r | 104 | fixup2' (BigR (RX B0 (B5 n o p q r)) N (TinyL B0)) = go5 n o p q r | 104 | false | false | 0 | 10 | 57 | 59 | 28 | 31 | null | null |
asib/cryptopals-haskell | Crypto.hs | mit | untemper :: W.Word32 -> W.Word32
untemper w = fromIntegral d'
where w' = fromIntegral w :: Int
w0 = w' `BTS.xor` ( w' `BTS.shiftR` 18)
w1 = w0 `BTS.xor` ((w0 `BTS.shiftL` 15) BTS..&. 0xefc60000)
w2 = w1 `BTS.xor` ((w1 `BTS.shiftL` 7 ) BTS..&. 0x9d2c5680)
a = w1 `BTS.shiftL` 7
b = w1 `BTS.xor` (a BTS..&. 0x9d2c5680)
c = b `BTS.shiftL` 7
d = w1 `BTS.xor` (c BTS..&. 0x9d2c5680)
e = d `BTS.shiftL` 7
f = w1 `BTS.xor` (e BTS..&. 0x9d2c5680)
g = f `BTS.shiftL` 7
h = w1 `BTS.xor` (g BTS..&. 0x9d2c5680)
i = h `BTS.shiftL` 7
j = w1 `BTS.xor` (i BTS..&. 0x9d2c5680)
a' = j `BTS.shiftR` 11
b' = j `BTS.xor` a'
c' = b' `BTS.shiftR` 11
d' = j `BTS.xor` c' | 802 | untemper :: W.Word32 -> W.Word32
untemper w = fromIntegral d'
where w' = fromIntegral w :: Int
w0 = w' `BTS.xor` ( w' `BTS.shiftR` 18)
w1 = w0 `BTS.xor` ((w0 `BTS.shiftL` 15) BTS..&. 0xefc60000)
w2 = w1 `BTS.xor` ((w1 `BTS.shiftL` 7 ) BTS..&. 0x9d2c5680)
a = w1 `BTS.shiftL` 7
b = w1 `BTS.xor` (a BTS..&. 0x9d2c5680)
c = b `BTS.shiftL` 7
d = w1 `BTS.xor` (c BTS..&. 0x9d2c5680)
e = d `BTS.shiftL` 7
f = w1 `BTS.xor` (e BTS..&. 0x9d2c5680)
g = f `BTS.shiftL` 7
h = w1 `BTS.xor` (g BTS..&. 0x9d2c5680)
i = h `BTS.shiftL` 7
j = w1 `BTS.xor` (i BTS..&. 0x9d2c5680)
a' = j `BTS.shiftR` 11
b' = j `BTS.xor` a'
c' = b' `BTS.shiftR` 11
d' = j `BTS.xor` c' | 802 | untemper w = fromIntegral d'
where w' = fromIntegral w :: Int
w0 = w' `BTS.xor` ( w' `BTS.shiftR` 18)
w1 = w0 `BTS.xor` ((w0 `BTS.shiftL` 15) BTS..&. 0xefc60000)
w2 = w1 `BTS.xor` ((w1 `BTS.shiftL` 7 ) BTS..&. 0x9d2c5680)
a = w1 `BTS.shiftL` 7
b = w1 `BTS.xor` (a BTS..&. 0x9d2c5680)
c = b `BTS.shiftL` 7
d = w1 `BTS.xor` (c BTS..&. 0x9d2c5680)
e = d `BTS.shiftL` 7
f = w1 `BTS.xor` (e BTS..&. 0x9d2c5680)
g = f `BTS.shiftL` 7
h = w1 `BTS.xor` (g BTS..&. 0x9d2c5680)
i = h `BTS.shiftL` 7
j = w1 `BTS.xor` (i BTS..&. 0x9d2c5680)
a' = j `BTS.shiftR` 11
b' = j `BTS.xor` a'
c' = b' `BTS.shiftR` 11
d' = j `BTS.xor` c' | 769 | false | true | 35 | 6 | 278 | 191 | 140 | 51 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F04.hs | bsd-3-clause | ptr_glConvolutionParameterfEXT :: FunPtr (GLenum -> GLenum -> GLfloat -> IO ())
ptr_glConvolutionParameterfEXT = unsafePerformIO $ getCommand "glConvolutionParameterfEXT" | 170 | ptr_glConvolutionParameterfEXT :: FunPtr (GLenum -> GLenum -> GLfloat -> IO ())
ptr_glConvolutionParameterfEXT = unsafePerformIO $ getCommand "glConvolutionParameterfEXT" | 170 | ptr_glConvolutionParameterfEXT = unsafePerformIO $ getCommand "glConvolutionParameterfEXT" | 90 | false | true | 0 | 11 | 16 | 41 | 20 | 21 | null | null |
MarcusVoelker/Recolang | Utils.hs | mit | escape x = x | 12 | escape x = x | 12 | escape x = x | 12 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
rueshyna/gogol | gogol-civicinfo/gen/Network/Google/CivicInfo/Types/Product.hs | mpl-2.0 | -- | Specifies what effect abstaining (not voting) on the proposition will
-- have (i.e. whether abstaining is considered a vote against it). This
-- field is only populated for contests of type \'Referendum\'.
conReferendumEffectOfAbstain :: Lens' Contest (Maybe Text)
conReferendumEffectOfAbstain
= lens _conReferendumEffectOfAbstain
(\ s a -> s{_conReferendumEffectOfAbstain = a}) | 391 | conReferendumEffectOfAbstain :: Lens' Contest (Maybe Text)
conReferendumEffectOfAbstain
= lens _conReferendumEffectOfAbstain
(\ s a -> s{_conReferendumEffectOfAbstain = a}) | 180 | conReferendumEffectOfAbstain
= lens _conReferendumEffectOfAbstain
(\ s a -> s{_conReferendumEffectOfAbstain = a}) | 121 | true | true | 0 | 8 | 58 | 51 | 27 | 24 | null | null |
snoyberg/ghc | compiler/basicTypes/Lexeme.hs | bsd-3-clause | -- | Is this an acceptable alphanumeric constructor name, assuming it
-- starts with an acceptable letter?
okConIdOcc :: String -> Bool
okConIdOcc str = okIdOcc str ||
is_tuple_name1 True str ||
-- Is it a boxed tuple...
is_tuple_name1 False str
-- ...or an unboxed tuple (Trac #12407)?
where
-- check for tuple name, starting at the beginning
is_tuple_name1 True ('(' : rest) = is_tuple_name2 True rest
is_tuple_name1 False ('(' : '#' : rest) = is_tuple_name2 False rest
is_tuple_name1 _ _ = False
-- check for tuple tail
is_tuple_name2 True ")" = True
is_tuple_name2 False "#)" = True
is_tuple_name2 boxed (',' : rest) = is_tuple_name2 boxed rest
is_tuple_name2 boxed (ws : rest)
| isSpace ws = is_tuple_name2 boxed rest
is_tuple_name2 _ _ = False
-- | Is this an acceptable symbolic constructor name, assuming it
-- starts with an acceptable character? | 1,060 | okConIdOcc :: String -> Bool
okConIdOcc str = okIdOcc str ||
is_tuple_name1 True str ||
-- Is it a boxed tuple...
is_tuple_name1 False str
-- ...or an unboxed tuple (Trac #12407)?
where
-- check for tuple name, starting at the beginning
is_tuple_name1 True ('(' : rest) = is_tuple_name2 True rest
is_tuple_name1 False ('(' : '#' : rest) = is_tuple_name2 False rest
is_tuple_name1 _ _ = False
-- check for tuple tail
is_tuple_name2 True ")" = True
is_tuple_name2 False "#)" = True
is_tuple_name2 boxed (',' : rest) = is_tuple_name2 boxed rest
is_tuple_name2 boxed (ws : rest)
| isSpace ws = is_tuple_name2 boxed rest
is_tuple_name2 _ _ = False
-- | Is this an acceptable symbolic constructor name, assuming it
-- starts with an acceptable character? | 953 | okConIdOcc str = okIdOcc str ||
is_tuple_name1 True str ||
-- Is it a boxed tuple...
is_tuple_name1 False str
-- ...or an unboxed tuple (Trac #12407)?
where
-- check for tuple name, starting at the beginning
is_tuple_name1 True ('(' : rest) = is_tuple_name2 True rest
is_tuple_name1 False ('(' : '#' : rest) = is_tuple_name2 False rest
is_tuple_name1 _ _ = False
-- check for tuple tail
is_tuple_name2 True ")" = True
is_tuple_name2 False "#)" = True
is_tuple_name2 boxed (',' : rest) = is_tuple_name2 boxed rest
is_tuple_name2 boxed (ws : rest)
| isSpace ws = is_tuple_name2 boxed rest
is_tuple_name2 _ _ = False
-- | Is this an acceptable symbolic constructor name, assuming it
-- starts with an acceptable character? | 924 | true | true | 8 | 8 | 345 | 184 | 96 | 88 | null | null |
DavidAlphaFox/darcs | harness/test.hs | gpl-2.0 | hasPrefix :: B.ByteString -> B.ByteString -> Maybe B.ByteString
hasPrefix prefix =
let len = B.length prefix in
\str -> if B.take len str == prefix then Just (B.drop len str) else Nothing | 195 | hasPrefix :: B.ByteString -> B.ByteString -> Maybe B.ByteString
hasPrefix prefix =
let len = B.length prefix in
\str -> if B.take len str == prefix then Just (B.drop len str) else Nothing | 195 | hasPrefix prefix =
let len = B.length prefix in
\str -> if B.take len str == prefix then Just (B.drop len str) else Nothing | 131 | false | true | 0 | 12 | 39 | 89 | 42 | 47 | null | null |
oldmanmike/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | sappendName = varQual dATA_SEMIGROUP (fsLit "<>") sappendClassOpKey | 81 | sappendName = varQual dATA_SEMIGROUP (fsLit "<>") sappendClassOpKey | 81 | sappendName = varQual dATA_SEMIGROUP (fsLit "<>") sappendClassOpKey | 81 | false | false | 0 | 7 | 20 | 19 | 9 | 10 | null | null |
paulolieuthier/haskell-concurrent-lists | src/STM.hs | lgpl-2.1 | updateNextPointer :: (Pointer a) -> (Pointer a) -> STM ()
updateNextPointer firstPtr newPtr = do
node <- readTVar firstPtr
writeTVar firstPtr (node { next = newPtr }) | 174 | updateNextPointer :: (Pointer a) -> (Pointer a) -> STM ()
updateNextPointer firstPtr newPtr = do
node <- readTVar firstPtr
writeTVar firstPtr (node { next = newPtr }) | 174 | updateNextPointer firstPtr newPtr = do
node <- readTVar firstPtr
writeTVar firstPtr (node { next = newPtr }) | 116 | false | true | 0 | 10 | 34 | 70 | 34 | 36 | null | null |
green-haskell/ghc | libraries/base/tests/enum03.hs | bsd-3-clause | testEnumWord64 :: IO ()
testEnumWord64 = do
-- succ
printTest ((succ (0::Word64)))
printTest ((succ (minBound::Word64)))
mayBomb (printTest ((succ (maxBound::Word64))))
-- pred
printTest (pred (1::Word64))
printTest (pred (maxBound::Word64))
mayBomb (printTest (pred (minBound::Word64)))
-- toEnum
mayBomb (printTest ((map (toEnum::Int->Word64) [1, fromIntegral (minBound::Word64)::Int, maxBound::Int])))
mayBomb (printTest ((toEnum (maxBound::Int))::Word64))
-- fromEnum
printTest ((map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)]))
mayBomb (printTest (fromEnum (maxBound::Word64)))
-- [x..] aka enumFrom
printTest ((take 7 [(1::Word64)..]))
printTest ((take 7 [((maxBound::Word64)-5)..])) -- just in case it doesn't catch the upper bound..
-- [x,y..] aka enumFromThen
printTest ((take 7 [(1::Word64),2..]))
printTest ((take 7 [(1::Word64),7..]))
printTest ((take 7 [(1::Word64),1..]))
printTest ((take 7 [(1::Word64),0..]))
printTest ((take 7 [(5::Word64),2..]))
let x = (minBound::Word64) + 1
printTest ((take 7 [x, x-1 ..]))
let x = (minBound::Word64) + 5
printTest ((take 7 [x, x-1 ..]))
let x = (maxBound::Word64) - 5
printTest ((take 7 [x, (x+1) ..]))
-- [x..y] aka enumFromTo
printTest ((take 7 ([(1::Word64) .. 5])))
printTest ((take 4 ([(1::Word64) .. 1])))
printTest ((take 7 ([(1::Word64) .. 0])))
printTest ((take 7 ([(5::Word64) .. 0])))
printTest ((take 7 ([(maxBound-(5::Word64)) .. maxBound])))
printTest ((take 7 ([(minBound+(5::Word64)) .. minBound])))
-- [x,y..z] aka enumFromThenTo
printTest ((take 7 [(5::Word64),4..1]))
printTest ((take 7 [(5::Word64),3..1]))
printTest ((take 7 [(5::Word64),3..2]))
printTest ((take 7 [(1::Word64),2..1]))
printTest ((take 7 [(2::Word64),1..2]))
printTest ((take 7 [(2::Word64),1..1]))
printTest ((take 7 [(2::Word64),3..1]))
let x = (maxBound::Word64) - 4
printTest ((take 7 [x,(x+1)..maxBound]))
let x = (minBound::Word64) + 5
printTest ((take 7 [x,(x-1)..minBound]))
--
--
-- Utils
--
-- | 2,106 | testEnumWord64 :: IO ()
testEnumWord64 = do
-- succ
printTest ((succ (0::Word64)))
printTest ((succ (minBound::Word64)))
mayBomb (printTest ((succ (maxBound::Word64))))
-- pred
printTest (pred (1::Word64))
printTest (pred (maxBound::Word64))
mayBomb (printTest (pred (minBound::Word64)))
-- toEnum
mayBomb (printTest ((map (toEnum::Int->Word64) [1, fromIntegral (minBound::Word64)::Int, maxBound::Int])))
mayBomb (printTest ((toEnum (maxBound::Int))::Word64))
-- fromEnum
printTest ((map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)]))
mayBomb (printTest (fromEnum (maxBound::Word64)))
-- [x..] aka enumFrom
printTest ((take 7 [(1::Word64)..]))
printTest ((take 7 [((maxBound::Word64)-5)..])) -- just in case it doesn't catch the upper bound..
-- [x,y..] aka enumFromThen
printTest ((take 7 [(1::Word64),2..]))
printTest ((take 7 [(1::Word64),7..]))
printTest ((take 7 [(1::Word64),1..]))
printTest ((take 7 [(1::Word64),0..]))
printTest ((take 7 [(5::Word64),2..]))
let x = (minBound::Word64) + 1
printTest ((take 7 [x, x-1 ..]))
let x = (minBound::Word64) + 5
printTest ((take 7 [x, x-1 ..]))
let x = (maxBound::Word64) - 5
printTest ((take 7 [x, (x+1) ..]))
-- [x..y] aka enumFromTo
printTest ((take 7 ([(1::Word64) .. 5])))
printTest ((take 4 ([(1::Word64) .. 1])))
printTest ((take 7 ([(1::Word64) .. 0])))
printTest ((take 7 ([(5::Word64) .. 0])))
printTest ((take 7 ([(maxBound-(5::Word64)) .. maxBound])))
printTest ((take 7 ([(minBound+(5::Word64)) .. minBound])))
-- [x,y..z] aka enumFromThenTo
printTest ((take 7 [(5::Word64),4..1]))
printTest ((take 7 [(5::Word64),3..1]))
printTest ((take 7 [(5::Word64),3..2]))
printTest ((take 7 [(1::Word64),2..1]))
printTest ((take 7 [(2::Word64),1..2]))
printTest ((take 7 [(2::Word64),1..1]))
printTest ((take 7 [(2::Word64),3..1]))
let x = (maxBound::Word64) - 4
printTest ((take 7 [x,(x+1)..maxBound]))
let x = (minBound::Word64) + 5
printTest ((take 7 [x,(x-1)..minBound]))
--
--
-- Utils
--
-- | 2,106 | testEnumWord64 = do
-- succ
printTest ((succ (0::Word64)))
printTest ((succ (minBound::Word64)))
mayBomb (printTest ((succ (maxBound::Word64))))
-- pred
printTest (pred (1::Word64))
printTest (pred (maxBound::Word64))
mayBomb (printTest (pred (minBound::Word64)))
-- toEnum
mayBomb (printTest ((map (toEnum::Int->Word64) [1, fromIntegral (minBound::Word64)::Int, maxBound::Int])))
mayBomb (printTest ((toEnum (maxBound::Int))::Word64))
-- fromEnum
printTest ((map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)]))
mayBomb (printTest (fromEnum (maxBound::Word64)))
-- [x..] aka enumFrom
printTest ((take 7 [(1::Word64)..]))
printTest ((take 7 [((maxBound::Word64)-5)..])) -- just in case it doesn't catch the upper bound..
-- [x,y..] aka enumFromThen
printTest ((take 7 [(1::Word64),2..]))
printTest ((take 7 [(1::Word64),7..]))
printTest ((take 7 [(1::Word64),1..]))
printTest ((take 7 [(1::Word64),0..]))
printTest ((take 7 [(5::Word64),2..]))
let x = (minBound::Word64) + 1
printTest ((take 7 [x, x-1 ..]))
let x = (minBound::Word64) + 5
printTest ((take 7 [x, x-1 ..]))
let x = (maxBound::Word64) - 5
printTest ((take 7 [x, (x+1) ..]))
-- [x..y] aka enumFromTo
printTest ((take 7 ([(1::Word64) .. 5])))
printTest ((take 4 ([(1::Word64) .. 1])))
printTest ((take 7 ([(1::Word64) .. 0])))
printTest ((take 7 ([(5::Word64) .. 0])))
printTest ((take 7 ([(maxBound-(5::Word64)) .. maxBound])))
printTest ((take 7 ([(minBound+(5::Word64)) .. minBound])))
-- [x,y..z] aka enumFromThenTo
printTest ((take 7 [(5::Word64),4..1]))
printTest ((take 7 [(5::Word64),3..1]))
printTest ((take 7 [(5::Word64),3..2]))
printTest ((take 7 [(1::Word64),2..1]))
printTest ((take 7 [(2::Word64),1..2]))
printTest ((take 7 [(2::Word64),1..1]))
printTest ((take 7 [(2::Word64),3..1]))
let x = (maxBound::Word64) - 4
printTest ((take 7 [x,(x+1)..maxBound]))
let x = (minBound::Word64) + 5
printTest ((take 7 [x,(x-1)..minBound]))
--
--
-- Utils
--
-- | 2,082 | false | true | 0 | 15 | 377 | 1,184 | 649 | 535 | null | null |
uroboros/haskell_design_patterns | chapter2/1_first_class_io.hs | mit | main2 = do
h <- openFile "jabberwocky.txt" ReadMode
hGetLine h >>= print . words
-- ["'Twas","brillig,","and","the","slithy","toves"]
hClose h
-- IO as FUNCTOR | 174 | main2 = do
h <- openFile "jabberwocky.txt" ReadMode
hGetLine h >>= print . words
-- ["'Twas","brillig,","and","the","slithy","toves"]
hClose h
-- IO as FUNCTOR | 174 | main2 = do
h <- openFile "jabberwocky.txt" ReadMode
hGetLine h >>= print . words
-- ["'Twas","brillig,","and","the","slithy","toves"]
hClose h
-- IO as FUNCTOR | 174 | false | false | 0 | 9 | 36 | 40 | 18 | 22 | null | null |
agrafix/hackage-server | Distribution/Server/Features/Security/Migration.hs | bsd-3-clause | -- | Read precomputed hashes (if any)
--
-- The result is guaranteed to be in normal form.
readPrecomputedHashes :: ServerEnv -> IO Precomputed
readPrecomputedHashes env@ServerEnv{ serverVerbosity = verbosity } = do
precomputed <- handle emptyOnError $
withFile (onDiskPrecomputedHashes env) ReadMode $ \h -> do
hashes <- Map.fromList . map parseEntry . lines <$> hGetContents h
evaluate $ rnf hashes
return hashes
loginfo verbosity $ "Found " ++ show (Map.size precomputed)
++ " precomputed hashes"
return precomputed
where
emptyOnError :: IOException -> IO Precomputed
emptyOnError err = if isDoesNotExistError err then return Map.empty
else throwIO err
parseEntry :: String -> (MD5, (SHA256, Length))
parseEntry line = let [md5, sha256, len] = words line
in (md5, (sha256, read len))
{-------------------------------------------------------------------------------
Migration infrastructure
-------------------------------------------------------------------------------} | 1,130 | readPrecomputedHashes :: ServerEnv -> IO Precomputed
readPrecomputedHashes env@ServerEnv{ serverVerbosity = verbosity } = do
precomputed <- handle emptyOnError $
withFile (onDiskPrecomputedHashes env) ReadMode $ \h -> do
hashes <- Map.fromList . map parseEntry . lines <$> hGetContents h
evaluate $ rnf hashes
return hashes
loginfo verbosity $ "Found " ++ show (Map.size precomputed)
++ " precomputed hashes"
return precomputed
where
emptyOnError :: IOException -> IO Precomputed
emptyOnError err = if isDoesNotExistError err then return Map.empty
else throwIO err
parseEntry :: String -> (MD5, (SHA256, Length))
parseEntry line = let [md5, sha256, len] = words line
in (md5, (sha256, read len))
{-------------------------------------------------------------------------------
Migration infrastructure
-------------------------------------------------------------------------------} | 1,039 | readPrecomputedHashes env@ServerEnv{ serverVerbosity = verbosity } = do
precomputed <- handle emptyOnError $
withFile (onDiskPrecomputedHashes env) ReadMode $ \h -> do
hashes <- Map.fromList . map parseEntry . lines <$> hGetContents h
evaluate $ rnf hashes
return hashes
loginfo verbosity $ "Found " ++ show (Map.size precomputed)
++ " precomputed hashes"
return precomputed
where
emptyOnError :: IOException -> IO Precomputed
emptyOnError err = if isDoesNotExistError err then return Map.empty
else throwIO err
parseEntry :: String -> (MD5, (SHA256, Length))
parseEntry line = let [md5, sha256, len] = words line
in (md5, (sha256, read len))
{-------------------------------------------------------------------------------
Migration infrastructure
-------------------------------------------------------------------------------} | 986 | true | true | 0 | 16 | 278 | 259 | 128 | 131 | null | null |
spechub/Hets | Common/Doc.hs | gpl-2.0 | doubleQuotes :: Doc -> Doc -- ^ Wrap document in @\"...\"@
doubleQuotes d = hcat [doubleQuote, d, doubleQuote] | 114 | doubleQuotes :: Doc -> Doc
doubleQuotes d = hcat [doubleQuote, d, doubleQuote] | 78 | doubleQuotes d = hcat [doubleQuote, d, doubleQuote] | 51 | true | true | 0 | 6 | 21 | 31 | 17 | 14 | null | null |
ezyang/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | mkHsDictLet :: TcEvBinds -> LHsExpr GhcTc -> LHsExpr GhcTc
mkHsDictLet ev_binds expr = mkLHsWrap (mkWpLet ev_binds) expr | 120 | mkHsDictLet :: TcEvBinds -> LHsExpr GhcTc -> LHsExpr GhcTc
mkHsDictLet ev_binds expr = mkLHsWrap (mkWpLet ev_binds) expr | 120 | mkHsDictLet ev_binds expr = mkLHsWrap (mkWpLet ev_binds) expr | 61 | false | true | 0 | 7 | 16 | 41 | 19 | 22 | null | null |
dolio/vector | Data/Vector/Generic.hs | bsd-3-clause | izipWith3 f = \as bs cs ->
unstream (Bundle.zipWith3 (uncurry f) (Bundle.indexed (stream as))
(stream bs)
(stream cs)) | 238 | izipWith3 f = \as bs cs ->
unstream (Bundle.zipWith3 (uncurry f) (Bundle.indexed (stream as))
(stream bs)
(stream cs)) | 238 | izipWith3 f = \as bs cs ->
unstream (Bundle.zipWith3 (uncurry f) (Bundle.indexed (stream as))
(stream bs)
(stream cs)) | 238 | false | false | 0 | 12 | 137 | 67 | 33 | 34 | null | null |
duairc/opaleye-x | src/Opaleye/X/Join.hs | mpl-2.0 | ------------------------------------------------------------------------------
leftJoin :: Join ls rs
=> Query ls
-> Query rs
-> (ls -> rs -> Column PGBool)
-> Query (ls, PGMaybe rs)
leftJoin l r j = leftJoinF ((. pgJust) . (,)) (flip (,) pgNothing) j l r | 271 | leftJoin :: Join ls rs
=> Query ls
-> Query rs
-> (ls -> rs -> Column PGBool)
-> Query (ls, PGMaybe rs)
leftJoin l r j = leftJoinF ((. pgJust) . (,)) (flip (,) pgNothing) j l r | 192 | leftJoin l r j = leftJoinF ((. pgJust) . (,)) (flip (,) pgNothing) j l r | 72 | true | true | 0 | 13 | 55 | 109 | 55 | 54 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_MAKE_TARGET :: Int
wxSTC_MAKE_TARGET = 5 | 46 | wxSTC_MAKE_TARGET :: Int
wxSTC_MAKE_TARGET = 5 | 46 | wxSTC_MAKE_TARGET = 5 | 21 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
flocc-net/flocc | v0.1/Compiler/Back/ShowGraph.hs | apache-2.0 | -- |showNodeFrom map is a ShowNodeFunc that takes a map of idx's to strings
-- |and returns that string for every node in the map.
showNodeFromMap :: Monad m => ShowNodeFunc Node (StateT (NodeEnv String) m)
showNodeFromMap n = do
let id = nodeId n
mp <- get
let s = lookupIntOrValue id mp "<error not in map>"
return $ dotDrawLabel n s
-- |showNodeNothing is the default ShowNodeFunc that just calles the dotDraw function for
-- |the node it is passed. | 463 | showNodeFromMap :: Monad m => ShowNodeFunc Node (StateT (NodeEnv String) m)
showNodeFromMap n = do
let id = nodeId n
mp <- get
let s = lookupIntOrValue id mp "<error not in map>"
return $ dotDrawLabel n s
-- |showNodeNothing is the default ShowNodeFunc that just calles the dotDraw function for
-- |the node it is passed. | 332 | showNodeFromMap n = do
let id = nodeId n
mp <- get
let s = lookupIntOrValue id mp "<error not in map>"
return $ dotDrawLabel n s
-- |showNodeNothing is the default ShowNodeFunc that just calles the dotDraw function for
-- |the node it is passed. | 256 | true | true | 0 | 10 | 92 | 91 | 43 | 48 | null | null |
sopvop/validator | src/Validator/Aeson.hs | bsd-3-clause | reqField :: (Monad m, FromJSON a) => Text -> JsonProof err m a
reqField key = do
JsonState path hm <- get
case HM.lookup key hm of
Nothing -> throwE [(path++[PathKey key], JsonMissing)]
Just v -> case parseEither parseJSON v of
Left e -> throwE [(path++[PathKey key], JsonParsingError e)]
Right r -> pure r
| 342 | reqField :: (Monad m, FromJSON a) => Text -> JsonProof err m a
reqField key = do
JsonState path hm <- get
case HM.lookup key hm of
Nothing -> throwE [(path++[PathKey key], JsonMissing)]
Just v -> case parseEither parseJSON v of
Left e -> throwE [(path++[PathKey key], JsonParsingError e)]
Right r -> pure r
| 342 | reqField key = do
JsonState path hm <- get
case HM.lookup key hm of
Nothing -> throwE [(path++[PathKey key], JsonMissing)]
Just v -> case parseEither parseJSON v of
Left e -> throwE [(path++[PathKey key], JsonParsingError e)]
Right r -> pure r
| 279 | false | true | 0 | 18 | 89 | 162 | 77 | 85 | null | null |
prowdsponsor/country-codes | src/Data/CountryCodes/ISO31661.hs | bsd-3-clause | toText BI = "BI" | 16 | toText BI = "BI" | 16 | toText BI = "BI" | 16 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
arianvp/binary-serialise-cbor | Data/Binary/Serialise/CBOR/FlatTerm.hs | bsd-3-clause | tokenTypeOf TkFloat16{} = TypeFloat16 | 41 | tokenTypeOf TkFloat16{} = TypeFloat16 | 41 | tokenTypeOf TkFloat16{} = TypeFloat16 | 41 | false | false | 0 | 6 | 7 | 13 | 6 | 7 | null | null |
Sventimir/turniejowo | src/TournamentList/Routes.hs | apache-2.0 | returnTournaments (Just (Aeson.Object o)) = do
liftIO $ print o
tournaments <- liftIO (Model.all :: IO [Tournament])
json $ Aeson.object [ "tournaments" .= tournaments ] | 205 | returnTournaments (Just (Aeson.Object o)) = do
liftIO $ print o
tournaments <- liftIO (Model.all :: IO [Tournament])
json $ Aeson.object [ "tournaments" .= tournaments ] | 205 | returnTournaments (Just (Aeson.Object o)) = do
liftIO $ print o
tournaments <- liftIO (Model.all :: IO [Tournament])
json $ Aeson.object [ "tournaments" .= tournaments ] | 205 | false | false | 0 | 11 | 60 | 76 | 36 | 40 | null | null |
dysinger/amazonka | amazonka-ec2/gen/Network/AWS/EC2/RunInstances.hs | mpl-2.0 | -- | The ID of the AWS account that owns the reservation.
rirOwnerId :: Lens' RunInstancesResponse Text
rirOwnerId = lens _rirOwnerId (\s a -> s { _rirOwnerId = a }) | 165 | rirOwnerId :: Lens' RunInstancesResponse Text
rirOwnerId = lens _rirOwnerId (\s a -> s { _rirOwnerId = a }) | 107 | rirOwnerId = lens _rirOwnerId (\s a -> s { _rirOwnerId = a }) | 61 | true | true | 0 | 9 | 29 | 40 | 22 | 18 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp FloatSinhOp = _ILIT(133) | 37 | tagOf_PrimOp FloatSinhOp = _ILIT(133) | 37 | tagOf_PrimOp FloatSinhOp = _ILIT(133) | 37 | false | false | 0 | 6 | 3 | 15 | 7 | 8 | null | null |
MgaMPKAy/language-sh | Language/Sh/Parser.hs | bsd-3-clause | -- |This is the main export here. We take a list of aliases for the
-- environment and a @String@ to parse. The return type is @Right
-- [Command]@ if parsing succeeded and @Left (String,Bool)@ upon
-- failure. The @Bool@ is @True@ when the error was fatal/unrecoverable.
parse :: [(String,String)] -- ^list of alises to expand
-> String -- ^input string
-> Either (String,Bool) [Command]
parse as s = case parse' as (only commands >>= expandHereDocs) s of
Left err -> case getFatal err of
Just f -> Left (f,True)
Nothing -> Left (show err,False)
Right cs -> Right cs | 684 | parse :: [(String,String)] -- ^list of alises to expand
-> String -- ^input string
-> Either (String,Bool) [Command]
parse as s = case parse' as (only commands >>= expandHereDocs) s of
Left err -> case getFatal err of
Just f -> Left (f,True)
Nothing -> Left (show err,False)
Right cs -> Right cs | 409 | parse as s = case parse' as (only commands >>= expandHereDocs) s of
Left err -> case getFatal err of
Just f -> Left (f,True)
Nothing -> Left (show err,False)
Right cs -> Right cs | 267 | true | true | 0 | 13 | 216 | 142 | 73 | 69 | null | null |
jascase901/Haskell-Midpoint-Displacement | main.hs | mit | egmentsToPoints :: [LineSegment] -> Path
segmentsToPoints [] = []
| 66 | segmentsToPoints :: [LineSegment] -> Path
segmentsToPoints [] = [] | 66 | segmentsToPoints [] = [] | 24 | false | true | 0 | 8 | 9 | 30 | 14 | 16 | null | null |
HIPERFIT/futhark | src/Futhark/Pass/ExplicitAllocations.hs | isc | subExpIxFun ::
(Allocable fromrep torep inner) =>
SubExp ->
AllocM fromrep torep (Maybe IxFun)
subExpIxFun Constant {} = return Nothing | 141 | subExpIxFun ::
(Allocable fromrep torep inner) =>
SubExp ->
AllocM fromrep torep (Maybe IxFun)
subExpIxFun Constant {} = return Nothing | 141 | subExpIxFun Constant {} = return Nothing | 40 | false | true | 0 | 9 | 25 | 51 | 25 | 26 | null | null |
seppeljordan/geimskell | Geimskell/Sound.hs | gpl-3.0 | sendCommand :: SoundServer -> ServerMessage -> IO ()
sendCommand EmptySoundServer _ = return () | 95 | sendCommand :: SoundServer -> ServerMessage -> IO ()
sendCommand EmptySoundServer _ = return () | 95 | sendCommand EmptySoundServer _ = return () | 42 | false | true | 0 | 8 | 13 | 34 | 16 | 18 | null | null |
SAdams601/ParRegexSearch | test/HaRe/src/Language/Haskell/Refact/Utils/MonadFunctions.hs | mit | logDataWithAnns :: (SYB.Data a) => String -> a -> RefactGhc ()
logDataWithAnns str ast = do
anns <- getRefactAnns
logm $ str ++ showAnnData anns 0 ast
-- --------------------------------------------------------------------- | 228 | logDataWithAnns :: (SYB.Data a) => String -> a -> RefactGhc ()
logDataWithAnns str ast = do
anns <- getRefactAnns
logm $ str ++ showAnnData anns 0 ast
-- --------------------------------------------------------------------- | 228 | logDataWithAnns str ast = do
anns <- getRefactAnns
logm $ str ++ showAnnData anns 0 ast
-- --------------------------------------------------------------------- | 165 | false | true | 0 | 10 | 33 | 71 | 33 | 38 | null | null |
tismith/tlisp | src/Primitives.hs | mit | lambdaProc :: [LispVal] -> LispEval
lambdaProc (List p : b) = makeNormalFunc p b | 80 | lambdaProc :: [LispVal] -> LispEval
lambdaProc (List p : b) = makeNormalFunc p b | 80 | lambdaProc (List p : b) = makeNormalFunc p b | 44 | false | true | 0 | 7 | 13 | 40 | 19 | 21 | null | null |
potomak/haskell-player | src/Sound/Player.hs | bsd-3-clause | stop app@(PlayerApp _ _ _ (Just pb@(Playback playPos _ _ _ _))) = do
liftIO $ stopPlayingSong pb
return (updateAppStatus app Stop playPos) { playback = Nothing }
where
stopPlayingSong (Playback _ playProc _ _ threadId) = do
AP.stop playProc
killThread threadId
-- | Fetches song info, plays it, and starts a thread to advance the playhead. | 363 | stop app@(PlayerApp _ _ _ (Just pb@(Playback playPos _ _ _ _))) = do
liftIO $ stopPlayingSong pb
return (updateAppStatus app Stop playPos) { playback = Nothing }
where
stopPlayingSong (Playback _ playProc _ _ threadId) = do
AP.stop playProc
killThread threadId
-- | Fetches song info, plays it, and starts a thread to advance the playhead. | 363 | stop app@(PlayerApp _ _ _ (Just pb@(Playback playPos _ _ _ _))) = do
liftIO $ stopPlayingSong pb
return (updateAppStatus app Stop playPos) { playback = Nothing }
where
stopPlayingSong (Playback _ playProc _ _ threadId) = do
AP.stop playProc
killThread threadId
-- | Fetches song info, plays it, and starts a thread to advance the playhead. | 363 | false | false | 0 | 13 | 80 | 121 | 58 | 63 | null | null |
sol/test-framework-spec | src/Test/Spec.hs | mit | describe :: String -> Spec -> Spec
describe label = add . testGroup label . runSpec | 83 | describe :: String -> Spec -> Spec
describe label = add . testGroup label . runSpec | 83 | describe label = add . testGroup label . runSpec | 48 | false | true | 1 | 8 | 15 | 39 | 17 | 22 | null | null |
Alasdair/Mella | Lang/TopLevel/Command/Base.hs | bsd-3-clause | implDescribe :: CommandImpl
implDescribe = Impl { implName = "describe"
, implFun = describe
, implDoc = "Display the implementation and type of an identifer"
} | 222 | implDescribe :: CommandImpl
implDescribe = Impl { implName = "describe"
, implFun = describe
, implDoc = "Display the implementation and type of an identifer"
} | 222 | implDescribe = Impl { implName = "describe"
, implFun = describe
, implDoc = "Display the implementation and type of an identifer"
} | 194 | false | true | 0 | 6 | 87 | 31 | 19 | 12 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/xml/chris-done-xeno/src/Lib.hs | unlicense | opa :: BS.ByteString
opa =
[r|<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<data>
<userid>1.0</userid>
<caseid>11.0</caseid>
<read>
<global0:loan_amount>300000.0</global0:loan_amount>
<global0:customer_name>Chris</global0:customer_name>
<global0:customer_resident>true</global0:customer_resident>
<global0:income_source0:income_amount>1500.0</global0:income_source0:income_amount>
<global0:loan_asset_value>500000.0</global0:loan_asset_value>
<global0:customer_previous_job>Professional</global0:customer_previous_job>
<global0:asset0:asset_value>15000.0</global0:asset0:asset_value>
<global0:asset0:asset>Car</global0:asset0:asset>
<global0:income_source0:income_source>Salary</global0:income_source0:income_source>
<global0:customer_employed>true</global0:customer_employed>
<global0:customer_age>32.0</global0:customer_age>
<global0:customer_previous_job_start_date>2000-01-01</global0:customer_previous_job_start_date>
</read>
<write>
<global0:customer_minimum_eligibility>true</global0:customer_minimum_eligibility>
<global0:customer_total_assets>15000.0</global0:customer_total_assets>
<global0:maximum_loan_amount>500000.0</global0:maximum_loan_amount>
<global0:customer_supplied_sufficient_supporting_documentation>true</global0:customer_supplied_sufficient_supporting_documentation>
<global0:customer_weekly_income>1500.0</global0:customer_weekly_income>
<global0:loan_value_ratio>60.0</global0:loan_value_ratio>
<global0:loan_within_thresholds>true</global0:loan_within_thresholds>
<global0:customer_eligible_loan>true</global0:customer_eligible_loan>
<global0:minimum_loan_amount>5000.0</global0:minimum_loan_amount>
<global0:maximum_loan_value_ratio>95.0</global0:maximum_loan_value_ratio>
<global0:customer_offer_sufficient_security>true</global0:customer_offer_sufficient_security>
<global0:customer_passes_employment_tests>true</global0:customer_passes_employment_tests>
<global0:customer_meets_loan_serviceability_tests>true</global0:customer_meets_loan_serviceability_tests>
<global0:weekly_loan_repayment_amount>300.0</global0:weekly_loan_repayment_amount>
<global0:customer_passes_credit_history_tests_applicable>true</global0:customer_passes_credit_history_tests_applicable>
<global0:minimum_age>18.0</global0:minimum_age>
<global0:credit_history_test_waived>true</global0:credit_history_test_waived>
<global0:customer_earnings_sufficient>true</global0:customer_earnings_sufficient>
<global0:residency_tests_waived>false</global0:residency_tests_waived>
</write>
</data>|] | 2,572 | opa :: BS.ByteString
opa =
[r|<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<data>
<userid>1.0</userid>
<caseid>11.0</caseid>
<read>
<global0:loan_amount>300000.0</global0:loan_amount>
<global0:customer_name>Chris</global0:customer_name>
<global0:customer_resident>true</global0:customer_resident>
<global0:income_source0:income_amount>1500.0</global0:income_source0:income_amount>
<global0:loan_asset_value>500000.0</global0:loan_asset_value>
<global0:customer_previous_job>Professional</global0:customer_previous_job>
<global0:asset0:asset_value>15000.0</global0:asset0:asset_value>
<global0:asset0:asset>Car</global0:asset0:asset>
<global0:income_source0:income_source>Salary</global0:income_source0:income_source>
<global0:customer_employed>true</global0:customer_employed>
<global0:customer_age>32.0</global0:customer_age>
<global0:customer_previous_job_start_date>2000-01-01</global0:customer_previous_job_start_date>
</read>
<write>
<global0:customer_minimum_eligibility>true</global0:customer_minimum_eligibility>
<global0:customer_total_assets>15000.0</global0:customer_total_assets>
<global0:maximum_loan_amount>500000.0</global0:maximum_loan_amount>
<global0:customer_supplied_sufficient_supporting_documentation>true</global0:customer_supplied_sufficient_supporting_documentation>
<global0:customer_weekly_income>1500.0</global0:customer_weekly_income>
<global0:loan_value_ratio>60.0</global0:loan_value_ratio>
<global0:loan_within_thresholds>true</global0:loan_within_thresholds>
<global0:customer_eligible_loan>true</global0:customer_eligible_loan>
<global0:minimum_loan_amount>5000.0</global0:minimum_loan_amount>
<global0:maximum_loan_value_ratio>95.0</global0:maximum_loan_value_ratio>
<global0:customer_offer_sufficient_security>true</global0:customer_offer_sufficient_security>
<global0:customer_passes_employment_tests>true</global0:customer_passes_employment_tests>
<global0:customer_meets_loan_serviceability_tests>true</global0:customer_meets_loan_serviceability_tests>
<global0:weekly_loan_repayment_amount>300.0</global0:weekly_loan_repayment_amount>
<global0:customer_passes_credit_history_tests_applicable>true</global0:customer_passes_credit_history_tests_applicable>
<global0:minimum_age>18.0</global0:minimum_age>
<global0:credit_history_test_waived>true</global0:credit_history_test_waived>
<global0:customer_earnings_sufficient>true</global0:customer_earnings_sufficient>
<global0:residency_tests_waived>false</global0:residency_tests_waived>
</write>
</data>|] | 2,572 | opa =
[r|<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<data>
<userid>1.0</userid>
<caseid>11.0</caseid>
<read>
<global0:loan_amount>300000.0</global0:loan_amount>
<global0:customer_name>Chris</global0:customer_name>
<global0:customer_resident>true</global0:customer_resident>
<global0:income_source0:income_amount>1500.0</global0:income_source0:income_amount>
<global0:loan_asset_value>500000.0</global0:loan_asset_value>
<global0:customer_previous_job>Professional</global0:customer_previous_job>
<global0:asset0:asset_value>15000.0</global0:asset0:asset_value>
<global0:asset0:asset>Car</global0:asset0:asset>
<global0:income_source0:income_source>Salary</global0:income_source0:income_source>
<global0:customer_employed>true</global0:customer_employed>
<global0:customer_age>32.0</global0:customer_age>
<global0:customer_previous_job_start_date>2000-01-01</global0:customer_previous_job_start_date>
</read>
<write>
<global0:customer_minimum_eligibility>true</global0:customer_minimum_eligibility>
<global0:customer_total_assets>15000.0</global0:customer_total_assets>
<global0:maximum_loan_amount>500000.0</global0:maximum_loan_amount>
<global0:customer_supplied_sufficient_supporting_documentation>true</global0:customer_supplied_sufficient_supporting_documentation>
<global0:customer_weekly_income>1500.0</global0:customer_weekly_income>
<global0:loan_value_ratio>60.0</global0:loan_value_ratio>
<global0:loan_within_thresholds>true</global0:loan_within_thresholds>
<global0:customer_eligible_loan>true</global0:customer_eligible_loan>
<global0:minimum_loan_amount>5000.0</global0:minimum_loan_amount>
<global0:maximum_loan_value_ratio>95.0</global0:maximum_loan_value_ratio>
<global0:customer_offer_sufficient_security>true</global0:customer_offer_sufficient_security>
<global0:customer_passes_employment_tests>true</global0:customer_passes_employment_tests>
<global0:customer_meets_loan_serviceability_tests>true</global0:customer_meets_loan_serviceability_tests>
<global0:weekly_loan_repayment_amount>300.0</global0:weekly_loan_repayment_amount>
<global0:customer_passes_credit_history_tests_applicable>true</global0:customer_passes_credit_history_tests_applicable>
<global0:minimum_age>18.0</global0:minimum_age>
<global0:credit_history_test_waived>true</global0:credit_history_test_waived>
<global0:customer_earnings_sufficient>true</global0:customer_earnings_sufficient>
<global0:residency_tests_waived>false</global0:residency_tests_waived>
</write>
</data>|] | 2,551 | false | true | 0 | 7 | 117 | 24 | 12 | 12 | null | null |
boj/garbage | src/NaiveGame2.hs | bsd-3-clause | nloops :: World -> Int64 -> World
nloops !w 0 = w | 49 | nloops :: World -> Int64 -> World
nloops !w 0 = w | 49 | nloops !w 0 = w | 15 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
comonoidial/ALFIN | Backend/OptimizeAsm.hs | mit | --readVarsS (_ :<-?: (RunLogicOp _ a b)) = [a, b]
readVarsS (_ :<=: (c, cc)) = readVarsCCC (c,cc) | 109 | readVarsS (_ :<=: (c, cc)) = readVarsCCC (c,cc) | 59 | readVarsS (_ :<=: (c, cc)) = readVarsCCC (c,cc) | 59 | true | false | 0 | 7 | 29 | 33 | 18 | 15 | null | null |
ingemaradahl/bilder | src/TypeChecker/Scope.hs | lgpl-3.0 | setAssigned ∷ String → [Scope] → [Scope]
setAssigned _ [] = [] | 62 | setAssigned ∷ String → [Scope] → [Scope]
setAssigned _ [] = [] | 62 | setAssigned _ [] = [] | 21 | false | true | 0 | 9 | 11 | 40 | 19 | 21 | null | null |
grayjay/json-rpc-client | tests/Tests.hs | mit | responseModifyingServer :: (A.Value -> A.Value) -> Connection RequestCount
responseModifyingServer f rq = modifyResponse <$> myServer rq
where modifyResponse rsp = A.encode . f . fromJust . A.decode <$> rsp | 210 | responseModifyingServer :: (A.Value -> A.Value) -> Connection RequestCount
responseModifyingServer f rq = modifyResponse <$> myServer rq
where modifyResponse rsp = A.encode . f . fromJust . A.decode <$> rsp | 210 | responseModifyingServer f rq = modifyResponse <$> myServer rq
where modifyResponse rsp = A.encode . f . fromJust . A.decode <$> rsp | 135 | false | true | 0 | 11 | 32 | 71 | 35 | 36 | null | null |
ryantm/ghc | testsuite/tests/perf/should_run/T3245.hs | bsd-3-clause | int_type, int_list_type :: TypeRep
int_type = typeOf (undefined :: Int) | 71 | int_type, int_list_type :: TypeRep
int_type = typeOf (undefined :: Int) | 71 | int_type = typeOf (undefined :: Int) | 36 | false | true | 0 | 6 | 9 | 22 | 13 | 9 | null | null |
pasberth/binal1 | Language/Binal/Verifier.hs | mit | freshPoly' BoolTy = return BoolTy | 33 | freshPoly' BoolTy = return BoolTy | 33 | freshPoly' BoolTy = return BoolTy | 33 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
mcmaniac/ghc | compiler/llvmGen/Llvm/Types.hs | bsd-3-clause | -- | Test if the given 'LlvmType' is a floating point type
isFloat :: LlvmType -> Bool
isFloat LMFloat = True | 112 | isFloat :: LlvmType -> Bool
isFloat LMFloat = True | 53 | isFloat LMFloat = True | 25 | true | true | 0 | 5 | 23 | 19 | 10 | 9 | null | null |
diflying/logitext | ClassicalFOL.hs | bsd-3-clause | conjList :: [L] -> L
conjList [] = Top | 38 | conjList :: [L] -> L
conjList [] = Top | 38 | conjList [] = Top | 17 | false | true | 0 | 8 | 8 | 29 | 13 | 16 | null | null |
CindyLinz/Haskell.js | trans/src/Desugar/LambdaCase.hs | mit | deLambdaCaseStmt (RecStmt l stmt) = RecStmt (id l) (fmap (deLambdaCaseStmt) stmt) | 81 | deLambdaCaseStmt (RecStmt l stmt) = RecStmt (id l) (fmap (deLambdaCaseStmt) stmt) | 81 | deLambdaCaseStmt (RecStmt l stmt) = RecStmt (id l) (fmap (deLambdaCaseStmt) stmt) | 81 | false | false | 0 | 8 | 10 | 39 | 19 | 20 | null | null |
ben-schulz/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | ctype (FIO t) = ctype t | 23 | ctype (FIO t) = ctype t | 23 | ctype (FIO t) = ctype t | 23 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
39aldo39/klfc | src/PklParse.hs | gpl-3.0 | parseLetter s' = maybe (LNothing <$ tell ["unknown letter ‘" ⊕ s' ⊕ "’"]) pure $ asum
[ parseSpace s
, parseDead s
, parseAction s
, parseChars s
]
where
s = fromMaybe s' (drop 1 >>> stripPrefix "{" >=> stripSuffix "}" $ s')
parseSpace "space" = Just (Char ' ')
parseSpace "Space" = Just (Char ' ')
parseSpace _ = Nothing
parseChars [] = Just LNothing
parseChars [x] = Just (Char x)
parseChars xs = Just (Ligature Nothing xs)
parseDead ('d':'k':xs) = CustomDead ∘ Just <$> readMaybe xs <*> pure (DeadKey "" BaseNo [])
parseDead _ = Nothing
parseAction = fmap Action ∘ asum ∘ map (`lookupR` actionAndPklAction) ∘ ap [Simple] ∘ pure | 700 | parseLetter s' = maybe (LNothing <$ tell ["unknown letter ‘" ⊕ s' ⊕ "’"]) pure $ asum
[ parseSpace s
, parseDead s
, parseAction s
, parseChars s
]
where
s = fromMaybe s' (drop 1 >>> stripPrefix "{" >=> stripSuffix "}" $ s')
parseSpace "space" = Just (Char ' ')
parseSpace "Space" = Just (Char ' ')
parseSpace _ = Nothing
parseChars [] = Just LNothing
parseChars [x] = Just (Char x)
parseChars xs = Just (Ligature Nothing xs)
parseDead ('d':'k':xs) = CustomDead ∘ Just <$> readMaybe xs <*> pure (DeadKey "" BaseNo [])
parseDead _ = Nothing
parseAction = fmap Action ∘ asum ∘ map (`lookupR` actionAndPklAction) ∘ ap [Simple] ∘ pure | 700 | parseLetter s' = maybe (LNothing <$ tell ["unknown letter ‘" ⊕ s' ⊕ "’"]) pure $ asum
[ parseSpace s
, parseDead s
, parseAction s
, parseChars s
]
where
s = fromMaybe s' (drop 1 >>> stripPrefix "{" >=> stripSuffix "}" $ s')
parseSpace "space" = Just (Char ' ')
parseSpace "Space" = Just (Char ' ')
parseSpace _ = Nothing
parseChars [] = Just LNothing
parseChars [x] = Just (Char x)
parseChars xs = Just (Ligature Nothing xs)
parseDead ('d':'k':xs) = CustomDead ∘ Just <$> readMaybe xs <*> pure (DeadKey "" BaseNo [])
parseDead _ = Nothing
parseAction = fmap Action ∘ asum ∘ map (`lookupR` actionAndPklAction) ∘ ap [Simple] ∘ pure | 700 | false | false | 0 | 12 | 184 | 293 | 143 | 150 | null | null |
ChrisBlom/Signs | src/Signs/Inference.hs | mit | typeOfE :: Term -> Either TypeError Type
typeOfE term = fst $ runTI $ (typeInference Map.empty term) | 100 | typeOfE :: Term -> Either TypeError Type
typeOfE term = fst $ runTI $ (typeInference Map.empty term) | 100 | typeOfE term = fst $ runTI $ (typeInference Map.empty term) | 59 | false | true | 0 | 8 | 16 | 41 | 20 | 21 | null | null |
tibbe/ghc | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | bsd-3-clause | genLit _ (CmmFloat r w)
= return (LMLitVar $ LMFloatLit (fromRational r) (widthToLlvmFloat w),
nilOL, []) | 121 | genLit _ (CmmFloat r w)
= return (LMLitVar $ LMFloatLit (fromRational r) (widthToLlvmFloat w),
nilOL, []) | 121 | genLit _ (CmmFloat r w)
= return (LMLitVar $ LMFloatLit (fromRational r) (widthToLlvmFloat w),
nilOL, []) | 121 | false | false | 1 | 10 | 31 | 57 | 27 | 30 | null | null |
yliu120/K3 | src/Language/K3/Stages.hs | apache-2.0 | transformSE :: TrSE a -> ProgramTransformSt a
transformSE f z p = liftEitherM $ f z p | 85 | transformSE :: TrSE a -> ProgramTransformSt a
transformSE f z p = liftEitherM $ f z p | 85 | transformSE f z p = liftEitherM $ f z p | 39 | false | true | 0 | 6 | 16 | 37 | 17 | 20 | null | null |
mhuesch/scheme_compiler | src/Liveness/Liveness.hs | bsd-3-clause | costSortedVars :: [InstructionInfo] -> [Variable]
costSortedVars infos = map fst . sortBy (compare `on` snd) $ weightedAssocs
where
weightedAssocs = computeWeighting interferingVars
interferingVars = map (concatMap getVars . intrfr) infos
getVars (Wcx (Var v)) = [v]
getVars _ = [] | 317 | costSortedVars :: [InstructionInfo] -> [Variable]
costSortedVars infos = map fst . sortBy (compare `on` snd) $ weightedAssocs
where
weightedAssocs = computeWeighting interferingVars
interferingVars = map (concatMap getVars . intrfr) infos
getVars (Wcx (Var v)) = [v]
getVars _ = [] | 317 | costSortedVars infos = map fst . sortBy (compare `on` snd) $ weightedAssocs
where
weightedAssocs = computeWeighting interferingVars
interferingVars = map (concatMap getVars . intrfr) infos
getVars (Wcx (Var v)) = [v]
getVars _ = [] | 267 | false | true | 3 | 9 | 75 | 111 | 57 | 54 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-printers/Language/Drasil/HTML/Print.hs | bsd-2-clause | symbol (L.Atop L.Vector s) = "<b>" ++ symbol s ++ "</b>" | 63 | symbol (L.Atop L.Vector s) = "<b>" ++ symbol s ++ "</b>" | 63 | symbol (L.Atop L.Vector s) = "<b>" ++ symbol s ++ "</b>" | 63 | false | false | 0 | 7 | 17 | 33 | 15 | 18 | null | null |
isomorphism/webgl | src/Graphics/Rendering/WebGL.hs | mit | createRenderbuffer :: (MonadGL m) => m WebGLRenderbuffer
createRenderbuffer = liftGL js_createRenderbuffer | 106 | createRenderbuffer :: (MonadGL m) => m WebGLRenderbuffer
createRenderbuffer = liftGL js_createRenderbuffer | 106 | createRenderbuffer = liftGL js_createRenderbuffer | 49 | false | true | 0 | 7 | 10 | 32 | 14 | 18 | null | null |
robstewart57/stack | src/main/Main.hs | bsd-3-clause | withBuildConfigExt
:: GlobalOpts
-> Maybe (StackT Config IO ())
-- ^ Action to perform after before build. This will be run on the host
-- OS even if Docker is enabled for builds. The build config is not
-- available in this action, since that would require build tools to be
-- installed on the host OS.
-> (Maybe FileLock -> StackT EnvConfig IO ())
-- ^ Action that uses the build config. If Docker is enabled for builds,
-- this will be run in a Docker container.
-> Maybe (StackT Config IO ())
-- ^ Action to perform after the build. This will be run on the host
-- OS even if Docker is enabled for builds. The build config is not
-- available in this action, since that would require build tools to be
-- installed on the host OS.
-> IO ()
withBuildConfigExt go@GlobalOpts{..} mbefore inner mafter = do
(manager, lc) <- loadConfigWithOpts go
withUserFileLock (configStackRoot $ lcConfig lc) $ \lk0 -> do
-- A local bit of state for communication between callbacks:
curLk <- newIORef lk0
let inner' lk =
-- Locking policy: This is only used for build commands, which
-- only need to lock the snapshot, not the global lock. We
-- trade in the lock here.
do dir <- installationRootDeps
-- Hand-over-hand locking:
withUserFileLock dir $ \lk2 -> do
liftIO $ writeIORef curLk lk2
liftIO $ munlockFile lk
inner lk2
let inner'' lk = do
bconfig <- runStackLoggingTGlobal manager go $
lcLoadBuildConfig lc globalResolver
envConfig <-
runStackTGlobal
manager bconfig go
(setupEnv Nothing)
runStackTGlobal
manager
envConfig
go
(inner' lk)
runStackTGlobal manager (lcConfig lc) go $
Docker.reexecWithOptionalContainer (lcProjectRoot lc) mbefore (inner'' lk0) mafter
(Just $ liftIO $
do lk' <- readIORef curLk
munlockFile lk') | 2,291 | withBuildConfigExt
:: GlobalOpts
-> Maybe (StackT Config IO ())
-- ^ Action to perform after before build. This will be run on the host
-- OS even if Docker is enabled for builds. The build config is not
-- available in this action, since that would require build tools to be
-- installed on the host OS.
-> (Maybe FileLock -> StackT EnvConfig IO ())
-- ^ Action that uses the build config. If Docker is enabled for builds,
-- this will be run in a Docker container.
-> Maybe (StackT Config IO ())
-- ^ Action to perform after the build. This will be run on the host
-- OS even if Docker is enabled for builds. The build config is not
-- available in this action, since that would require build tools to be
-- installed on the host OS.
-> IO ()
withBuildConfigExt go@GlobalOpts{..} mbefore inner mafter = do
(manager, lc) <- loadConfigWithOpts go
withUserFileLock (configStackRoot $ lcConfig lc) $ \lk0 -> do
-- A local bit of state for communication between callbacks:
curLk <- newIORef lk0
let inner' lk =
-- Locking policy: This is only used for build commands, which
-- only need to lock the snapshot, not the global lock. We
-- trade in the lock here.
do dir <- installationRootDeps
-- Hand-over-hand locking:
withUserFileLock dir $ \lk2 -> do
liftIO $ writeIORef curLk lk2
liftIO $ munlockFile lk
inner lk2
let inner'' lk = do
bconfig <- runStackLoggingTGlobal manager go $
lcLoadBuildConfig lc globalResolver
envConfig <-
runStackTGlobal
manager bconfig go
(setupEnv Nothing)
runStackTGlobal
manager
envConfig
go
(inner' lk)
runStackTGlobal manager (lcConfig lc) go $
Docker.reexecWithOptionalContainer (lcProjectRoot lc) mbefore (inner'' lk0) mafter
(Just $ liftIO $
do lk' <- readIORef curLk
munlockFile lk') | 2,291 | withBuildConfigExt go@GlobalOpts{..} mbefore inner mafter = do
(manager, lc) <- loadConfigWithOpts go
withUserFileLock (configStackRoot $ lcConfig lc) $ \lk0 -> do
-- A local bit of state for communication between callbacks:
curLk <- newIORef lk0
let inner' lk =
-- Locking policy: This is only used for build commands, which
-- only need to lock the snapshot, not the global lock. We
-- trade in the lock here.
do dir <- installationRootDeps
-- Hand-over-hand locking:
withUserFileLock dir $ \lk2 -> do
liftIO $ writeIORef curLk lk2
liftIO $ munlockFile lk
inner lk2
let inner'' lk = do
bconfig <- runStackLoggingTGlobal manager go $
lcLoadBuildConfig lc globalResolver
envConfig <-
runStackTGlobal
manager bconfig go
(setupEnv Nothing)
runStackTGlobal
manager
envConfig
go
(inner' lk)
runStackTGlobal manager (lcConfig lc) go $
Docker.reexecWithOptionalContainer (lcProjectRoot lc) mbefore (inner'' lk0) mafter
(Just $ liftIO $
do lk' <- readIORef curLk
munlockFile lk') | 1,481 | false | true | 11 | 14 | 862 | 360 | 179 | 181 | null | null |
sdiehl/ghc | compiler/main/DynFlags.hs | bsd-3-clause | setDepIncludePkgDeps :: Bool -> DynFlags -> DynFlags
setDepIncludePkgDeps b d = d { depIncludePkgDeps = b } | 107 | setDepIncludePkgDeps :: Bool -> DynFlags -> DynFlags
setDepIncludePkgDeps b d = d { depIncludePkgDeps = b } | 107 | setDepIncludePkgDeps b d = d { depIncludePkgDeps = b } | 54 | false | true | 0 | 6 | 16 | 32 | 17 | 15 | null | null |
lexml/lexml-linker | src/main/haskell/LexML/Linker.hs | gpl-2.0 | toComponents lo =
includeIf loDebugTokens LC_Tokens $
includeIf loDebugRegras LC_Regras $
includeIf loDebugOther LC_Other []
where
includeIf f c l
| f lo = c : l
| otherwise = l | 210 | toComponents lo =
includeIf loDebugTokens LC_Tokens $
includeIf loDebugRegras LC_Regras $
includeIf loDebugOther LC_Other []
where
includeIf f c l
| f lo = c : l
| otherwise = l | 210 | toComponents lo =
includeIf loDebugTokens LC_Tokens $
includeIf loDebugRegras LC_Regras $
includeIf loDebugOther LC_Other []
where
includeIf f c l
| f lo = c : l
| otherwise = l | 210 | false | false | 1 | 8 | 63 | 72 | 32 | 40 | null | null |
vTurbine/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | isActive :: CompilerPhase -> Activation -> Bool
isActive InitialPhase AlwaysActive = True | 94 | isActive :: CompilerPhase -> Activation -> Bool
isActive InitialPhase AlwaysActive = True | 94 | isActive InitialPhase AlwaysActive = True | 46 | false | true | 0 | 8 | 16 | 30 | 13 | 17 | null | null |
keera-studios/hsQt | Qtc/Gui/QTreeWidget.hs | bsd-2-clause | expandItem :: QTreeWidget a -> ((QTreeWidgetItem t1)) -> IO ()
expandItem x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QTreeWidget_expandItem cobj_x0 cobj_x1 | 198 | expandItem :: QTreeWidget a -> ((QTreeWidgetItem t1)) -> IO ()
expandItem x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QTreeWidget_expandItem cobj_x0 cobj_x1 | 198 | expandItem x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QTreeWidget_expandItem cobj_x0 cobj_x1 | 135 | false | true | 0 | 9 | 36 | 73 | 36 | 37 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/Images/Deprecate.hs | mpl-2.0 | -- | An optional request ID to identify requests. Specify a unique request ID
-- so that if you must retry your request, the server will know to ignore
-- the request if it has already been completed. For example, consider a
-- situation where you make an initial request and the request times out.
-- If you make the request again with the same request ID, the server can
-- check if original operation with the same request ID was received, and
-- if so, will ignore the second request. This prevents clients from
-- accidentally creating duplicate commitments. The request ID must be a
-- valid UUID with the exception that zero UUID is not supported
-- (00000000-0000-0000-0000-000000000000).
id1RequestId :: Lens' ImagesDeprecate (Maybe Text)
id1RequestId
= lens _id1RequestId (\ s a -> s{_id1RequestId = a}) | 815 | id1RequestId :: Lens' ImagesDeprecate (Maybe Text)
id1RequestId
= lens _id1RequestId (\ s a -> s{_id1RequestId = a}) | 118 | id1RequestId
= lens _id1RequestId (\ s a -> s{_id1RequestId = a}) | 67 | true | true | 0 | 9 | 138 | 57 | 34 | 23 | null | null |
vikraman/ghc | compiler/basicTypes/DataCon.hs | bsd-3-clause | -- | Equalities derived from the result type of the data constructor, as written
-- by the programmer in any GADT declaration. This includes *all* GADT-like
-- equalities, including those written in by hand by the programmer.
dataConEqSpec :: DataCon -> [EqSpec]
dataConEqSpec (MkData { dcEqSpec = eq_spec, dcOtherTheta = theta })
= eq_spec ++
[ spec -- heterogeneous equality
| Just (tc, [_k1, _k2, ty1, ty2]) <- map splitTyConApp_maybe theta
, tc `hasKey` heqTyConKey
, spec <- case (getTyVar_maybe ty1, getTyVar_maybe ty2) of
(Just tv1, _) -> [mkEqSpec tv1 ty2]
(_, Just tv2) -> [mkEqSpec tv2 ty1]
_ -> []
] ++
[ spec -- homogeneous equality
| Just (tc, [_k, ty1, ty2]) <- map splitTyConApp_maybe theta
, tc `hasKey` eqTyConKey
, spec <- case (getTyVar_maybe ty1, getTyVar_maybe ty2) of
(Just tv1, _) -> [mkEqSpec tv1 ty2]
(_, Just tv2) -> [mkEqSpec tv2 ty1]
_ -> []
] | 1,061 | dataConEqSpec :: DataCon -> [EqSpec]
dataConEqSpec (MkData { dcEqSpec = eq_spec, dcOtherTheta = theta })
= eq_spec ++
[ spec -- heterogeneous equality
| Just (tc, [_k1, _k2, ty1, ty2]) <- map splitTyConApp_maybe theta
, tc `hasKey` heqTyConKey
, spec <- case (getTyVar_maybe ty1, getTyVar_maybe ty2) of
(Just tv1, _) -> [mkEqSpec tv1 ty2]
(_, Just tv2) -> [mkEqSpec tv2 ty1]
_ -> []
] ++
[ spec -- homogeneous equality
| Just (tc, [_k, ty1, ty2]) <- map splitTyConApp_maybe theta
, tc `hasKey` eqTyConKey
, spec <- case (getTyVar_maybe ty1, getTyVar_maybe ty2) of
(Just tv1, _) -> [mkEqSpec tv1 ty2]
(_, Just tv2) -> [mkEqSpec tv2 ty1]
_ -> []
] | 835 | dataConEqSpec (MkData { dcEqSpec = eq_spec, dcOtherTheta = theta })
= eq_spec ++
[ spec -- heterogeneous equality
| Just (tc, [_k1, _k2, ty1, ty2]) <- map splitTyConApp_maybe theta
, tc `hasKey` heqTyConKey
, spec <- case (getTyVar_maybe ty1, getTyVar_maybe ty2) of
(Just tv1, _) -> [mkEqSpec tv1 ty2]
(_, Just tv2) -> [mkEqSpec tv2 ty1]
_ -> []
] ++
[ spec -- homogeneous equality
| Just (tc, [_k, ty1, ty2]) <- map splitTyConApp_maybe theta
, tc `hasKey` eqTyConKey
, spec <- case (getTyVar_maybe ty1, getTyVar_maybe ty2) of
(Just tv1, _) -> [mkEqSpec tv1 ty2]
(_, Just tv2) -> [mkEqSpec tv2 ty1]
_ -> []
] | 798 | true | true | 0 | 14 | 338 | 299 | 163 | 136 | null | null |
alios/nauticlib | src/Data/ISO8211/Parser.hs | bsd-3-clause | dataFormatToParser _ (SubFieldLabel _) = error $ "@ subfield label not implemented" | 83 | dataFormatToParser _ (SubFieldLabel _) = error $ "@ subfield label not implemented" | 83 | dataFormatToParser _ (SubFieldLabel _) = error $ "@ subfield label not implemented" | 83 | false | false | 0 | 7 | 11 | 21 | 10 | 11 | null | null |
ruud-v-a/hakyll | src/Hakyll/Web/Template/Context.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- | Constructs a 'field' that contains the body of the item.
bodyField :: String -> Context String
bodyField key = field key $ return . itemBody | 226 | bodyField :: String -> Context String
bodyField key = field key $ return . itemBody | 83 | bodyField key = field key $ return . itemBody | 45 | true | true | 0 | 7 | 27 | 34 | 17 | 17 | null | null |
kaoskorobase/hsc3-mixer | Sound/SC3/Server/Monad/Command.hs | gpl-2.0 | -- | Set a node's control values.
n_set :: (Node a, Monad m) => a -> [(String, Double)] -> SendT m ()
n_set n = send . C.n_set (fromIntegral (nodeId n)) | 152 | n_set :: (Node a, Monad m) => a -> [(String, Double)] -> SendT m ()
n_set n = send . C.n_set (fromIntegral (nodeId n)) | 118 | n_set n = send . C.n_set (fromIntegral (nodeId n)) | 50 | true | true | 1 | 10 | 30 | 81 | 40 | 41 | null | null |
honux77/practice | haskell/day4/ex5.hs | mit | length2 xs = 1 + (tail xs) | 26 | length2 xs = 1 + (tail xs) | 26 | length2 xs = 1 + (tail xs) | 26 | false | false | 3 | 7 | 6 | 24 | 9 | 15 | null | null |
urbanslug/ghc | compiler/main/DynFlags.hs | bsd-3-clause | unsafeFlagsForInfer = unsafeFlags | 33 | unsafeFlagsForInfer = unsafeFlags | 33 | unsafeFlagsForInfer = unsafeFlags | 33 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
ceefour/atomspace | opencog/haskell/OpenCog/AtomSpace/Internal.hs | agpl-3.0 | toTVRaw (IndefTV a b c d e) = TVRaw INDEFINITE_TRUTH_VALUE [a,b,c,d,e] | 70 | toTVRaw (IndefTV a b c d e) = TVRaw INDEFINITE_TRUTH_VALUE [a,b,c,d,e] | 70 | toTVRaw (IndefTV a b c d e) = TVRaw INDEFINITE_TRUTH_VALUE [a,b,c,d,e] | 70 | false | false | 0 | 7 | 10 | 43 | 23 | 20 | null | null |
apyrgio/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | hvCpuCores :: String
hvCpuCores = "cpu_cores" | 45 | hvCpuCores :: String
hvCpuCores = "cpu_cores" | 45 | hvCpuCores = "cpu_cores" | 24 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
mariefarrell/Hets | OWL2/OWL22CASL.hs | gpl-2.0 | mapCharact :: CASLSign -> ObjectPropertyExpression -> Character
-> Result CASLFORMULA
mapCharact cSig ope c = case c of
Functional -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 1 3
return $ mkFIE [1, 2, 3] [so1, so2] 2 3
InverseFunctional -> do
so1 <- mapObjProp cSig ope 1 3
so2 <- mapObjProp cSig ope 2 3
return $ mkFIE [1, 2, 3] [so1, so2] 1 2
Reflexive -> do
so <- mapObjProp cSig ope 1 1
return $ mkRI [1] 1 so
Irreflexive -> do
so <- mapObjProp cSig ope 1 1
return $ mkRI [1] 1 $ mkNeg so
Symmetric -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 1
return $ mkVDecl [1, 2] $ mkImpl so1 so2
Asymmetric -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 1
return $ mkVDecl [1, 2] $ mkImpl so1 $ mkNeg so2
Antisymmetric -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 1
return $ mkFIE [1, 2] [so1, so2] 1 2
Transitive -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 3
so3 <- mapObjProp cSig ope 1 3
return $ mkVDecl [1, 2, 3] $ implConj [so1, so2] so3
-- | Mapping of ObjectSubPropertyChain | 1,309 | mapCharact :: CASLSign -> ObjectPropertyExpression -> Character
-> Result CASLFORMULA
mapCharact cSig ope c = case c of
Functional -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 1 3
return $ mkFIE [1, 2, 3] [so1, so2] 2 3
InverseFunctional -> do
so1 <- mapObjProp cSig ope 1 3
so2 <- mapObjProp cSig ope 2 3
return $ mkFIE [1, 2, 3] [so1, so2] 1 2
Reflexive -> do
so <- mapObjProp cSig ope 1 1
return $ mkRI [1] 1 so
Irreflexive -> do
so <- mapObjProp cSig ope 1 1
return $ mkRI [1] 1 $ mkNeg so
Symmetric -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 1
return $ mkVDecl [1, 2] $ mkImpl so1 so2
Asymmetric -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 1
return $ mkVDecl [1, 2] $ mkImpl so1 $ mkNeg so2
Antisymmetric -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 1
return $ mkFIE [1, 2] [so1, so2] 1 2
Transitive -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 3
so3 <- mapObjProp cSig ope 1 3
return $ mkVDecl [1, 2, 3] $ implConj [so1, so2] so3
-- | Mapping of ObjectSubPropertyChain | 1,309 | mapCharact cSig ope c = case c of
Functional -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 1 3
return $ mkFIE [1, 2, 3] [so1, so2] 2 3
InverseFunctional -> do
so1 <- mapObjProp cSig ope 1 3
so2 <- mapObjProp cSig ope 2 3
return $ mkFIE [1, 2, 3] [so1, so2] 1 2
Reflexive -> do
so <- mapObjProp cSig ope 1 1
return $ mkRI [1] 1 so
Irreflexive -> do
so <- mapObjProp cSig ope 1 1
return $ mkRI [1] 1 $ mkNeg so
Symmetric -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 1
return $ mkVDecl [1, 2] $ mkImpl so1 so2
Asymmetric -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 1
return $ mkVDecl [1, 2] $ mkImpl so1 $ mkNeg so2
Antisymmetric -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 1
return $ mkFIE [1, 2] [so1, so2] 1 2
Transitive -> do
so1 <- mapObjProp cSig ope 1 2
so2 <- mapObjProp cSig ope 2 3
so3 <- mapObjProp cSig ope 1 3
return $ mkVDecl [1, 2, 3] $ implConj [so1, so2] so3
-- | Mapping of ObjectSubPropertyChain | 1,211 | false | true | 8 | 12 | 454 | 559 | 259 | 300 | null | null |
markuspf/Idris-dev | src/Idris/IBC.hs | bsd-3-clause | ibc i (IBCNameHint (n, ty)) f
= return f { ibc_namehints = (n, ty) : ibc_namehints f } | 91 | ibc i (IBCNameHint (n, ty)) f
= return f { ibc_namehints = (n, ty) : ibc_namehints f } | 91 | ibc i (IBCNameHint (n, ty)) f
= return f { ibc_namehints = (n, ty) : ibc_namehints f } | 91 | false | false | 1 | 9 | 22 | 58 | 27 | 31 | null | null |
pparkkin/eta | compiler/ETA/Prelude/TysPrim.hs | bsd-3-clause | mkMVarPrimTy :: Type -> Type -> Type
mkMVarPrimTy s elt = TyConApp mVarPrimTyCon [s, elt] | 98 | mkMVarPrimTy :: Type -> Type -> Type
mkMVarPrimTy s elt = TyConApp mVarPrimTyCon [s, elt] | 98 | mkMVarPrimTy s elt = TyConApp mVarPrimTyCon [s, elt] | 61 | false | true | 0 | 8 | 23 | 40 | 19 | 21 | null | null |
rgaiacs/pandoc | src/Text/Pandoc/Writers/Docx.hs | gpl-2.0 | parseXml :: Archive -> Archive -> String -> IO Element
parseXml refArchive distArchive relpath =
case ((findEntryByPath relpath refArchive `mplus`
findEntryByPath relpath distArchive)
>>= parseXMLDoc . UTF8.toStringLazy . fromEntry) of
Just d -> return d
Nothing -> fail $ relpath ++ " corrupt or missing in reference docx"
-- | Scales the image to fit the page
-- sizes are passed in emu | 434 | parseXml :: Archive -> Archive -> String -> IO Element
parseXml refArchive distArchive relpath =
case ((findEntryByPath relpath refArchive `mplus`
findEntryByPath relpath distArchive)
>>= parseXMLDoc . UTF8.toStringLazy . fromEntry) of
Just d -> return d
Nothing -> fail $ relpath ++ " corrupt or missing in reference docx"
-- | Scales the image to fit the page
-- sizes are passed in emu | 434 | parseXml refArchive distArchive relpath =
case ((findEntryByPath relpath refArchive `mplus`
findEntryByPath relpath distArchive)
>>= parseXMLDoc . UTF8.toStringLazy . fromEntry) of
Just d -> return d
Nothing -> fail $ relpath ++ " corrupt or missing in reference docx"
-- | Scales the image to fit the page
-- sizes are passed in emu | 379 | false | true | 0 | 12 | 108 | 106 | 52 | 54 | null | null |
patrikja/progolymp | open/towers/Main.hs | bsd-3-clause | merge xs [] = xs | 16 | merge xs [] = xs | 16 | merge xs [] = xs | 16 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
lambdageek/insomnia | src/FOmega/Eval.hs | bsd-3-clause | embedUnitV :: Value
embedUnitV = RecordV [] | 43 | embedUnitV :: Value
embedUnitV = RecordV [] | 43 | embedUnitV = RecordV [] | 23 | false | true | 0 | 6 | 6 | 16 | 8 | 8 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.