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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23Skidoo/parsec | Text/Parsec/Combinator.hs | bsd-2-clause | -- | @sepEndBy1 p sep@ parses /one/ or more occurrences of @p@,
-- separated and optionally ended by @sep@. Returns a list of values
-- returned by @p@.
sepEndBy1 :: (Stream s m t) => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a]
sepEndBy1 p sep = do{ x <- p
; do{ sep
... | 502 | sepEndBy1 :: (Stream s m t) => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a]
sepEndBy1 p sep = do{ x <- p
; do{ sep
; xs <- sepEndBy p sep
; return (x:xs)
}
<|> return [x... | 347 | sepEndBy1 p sep = do{ x <- p
; do{ sep
; xs <- sepEndBy p sep
; return (x:xs)
}
<|> return [x]
} | 258 | true | true | 0 | 12 | 240 | 125 | 64 | 61 | null | null |
diku-dk/futhark | src/Language/Futhark/Prop.hs | isc | typeOf (StringLit vs _) =
Array
mempty
Unique
(Prim (Unsigned Int8))
(ShapeDecl [ConstDim $ genericLength vs]) | 128 | typeOf (StringLit vs _) =
Array
mempty
Unique
(Prim (Unsigned Int8))
(ShapeDecl [ConstDim $ genericLength vs]) | 128 | typeOf (StringLit vs _) =
Array
mempty
Unique
(Prim (Unsigned Int8))
(ShapeDecl [ConstDim $ genericLength vs]) | 128 | false | false | 0 | 10 | 33 | 54 | 26 | 28 | null | null |
jjingram/satori | src/Emit.hs | bsd-3-clause | cgen tys globals (If cond tr fl) = do
ifthen <- addBlock "if.then"
ifelse <- addBlock "if.else"
ifexit <- addBlock "if.exit"
condSum <- cgen tys globals cond
condDatumPtr <- gep (T.ptr Codegen.unit) condSum (indices [0, 1])
condDatum <- load Codegen.unit condDatumPtr
condDatumBitCast <- bitCast (T.ptr T.i... | 698 | cgen tys globals (If cond tr fl) = do
ifthen <- addBlock "if.then"
ifelse <- addBlock "if.else"
ifexit <- addBlock "if.exit"
condSum <- cgen tys globals cond
condDatumPtr <- gep (T.ptr Codegen.unit) condSum (indices [0, 1])
condDatum <- load Codegen.unit condDatumPtr
condDatumBitCast <- bitCast (T.ptr T.i... | 698 | cgen tys globals (If cond tr fl) = do
ifthen <- addBlock "if.then"
ifelse <- addBlock "if.else"
ifexit <- addBlock "if.exit"
condSum <- cgen tys globals cond
condDatumPtr <- gep (T.ptr Codegen.unit) condSum (indices [0, 1])
condDatum <- load Codegen.unit condDatumPtr
condDatumBitCast <- bitCast (T.ptr T.i... | 698 | false | false | 0 | 11 | 148 | 305 | 137 | 168 | null | null |
urbanslug/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | stableNameDataConKey = mkPreludeDataConUnique 14 | 67 | stableNameDataConKey = mkPreludeDataConUnique 14 | 67 | stableNameDataConKey = mkPreludeDataConUnique 14 | 67 | false | false | 0 | 5 | 22 | 9 | 4 | 5 | null | null |
beni55/haste-compiler | libraries/ghc-7.10/ghc-prim/GHC/Prim.hs | bsd-3-clause | -- | Reads vector; offset in scalar elements.
indexFloatOffAddrAsFloatX8# :: Addr# -> Int# -> FloatX8#
indexFloatOffAddrAsFloatX8# = let x = x in x | 149 | indexFloatOffAddrAsFloatX8# :: Addr# -> Int# -> FloatX8#
indexFloatOffAddrAsFloatX8# = let x = x in x | 101 | indexFloatOffAddrAsFloatX8# = let x = x in x | 44 | true | true | 0 | 8 | 24 | 38 | 17 | 21 | null | null |
zoep/jebus | src/Parser.hs | mit | abstraction =
do
reservedOp "\\"
v <- identifier
reservedOp "."
t <- expr
return (SAbs v t) | 113 | abstraction =
do
reservedOp "\\"
v <- identifier
reservedOp "."
t <- expr
return (SAbs v t) | 113 | abstraction =
do
reservedOp "\\"
v <- identifier
reservedOp "."
t <- expr
return (SAbs v t) | 113 | false | false | 0 | 9 | 38 | 46 | 19 | 27 | null | null |
KaneTW/network-raw | third-party/ioctl/src-unix/System/Posix/IOCtl.hs | mit | ioctl :: IOControl req d
=> Fd -- ^ The file descriptor
-> req -- ^ The request
-> d -- ^ The data
-> IO d -- ^ The data after the call
ioctl f req d = with d $ \p -> c_ioctl' f req p >> peek p | 218 | ioctl :: IOControl req d
=> Fd -- ^ The file descriptor
-> req -- ^ The request
-> d -- ^ The data
-> IO d
ioctl f req d = with d $ \p -> c_ioctl' f req p >> peek p | 189 | ioctl f req d = with d $ \p -> c_ioctl' f req p >> peek p | 57 | true | true | 0 | 10 | 75 | 76 | 37 | 39 | null | null |
stefan-j/codeworld | codeworld-api/src/CodeWorld/Picture.hs | apache-2.0 | -- | A picture drawn entirely in this color.
colored :: Color -> Picture -> Picture
colored = Color | 99 | colored :: Color -> Picture -> Picture
colored = Color | 54 | colored = Color | 15 | true | true | 0 | 8 | 18 | 27 | 12 | 15 | null | null |
brendanhay/gogol | gogol-vision/gen/Network/Google/Resource/Vision/Projects/Files/AsyncBatchAnnotate.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pfabaUploadProtocol :: Lens' ProjectsFilesAsyncBatchAnnotate (Maybe Text)
pfabaUploadProtocol
= lens _pfabaUploadProtocol
(\ s a -> s{_pfabaUploadProtocol = a}) | 230 | pfabaUploadProtocol :: Lens' ProjectsFilesAsyncBatchAnnotate (Maybe Text)
pfabaUploadProtocol
= lens _pfabaUploadProtocol
(\ s a -> s{_pfabaUploadProtocol = a}) | 168 | pfabaUploadProtocol
= lens _pfabaUploadProtocol
(\ s a -> s{_pfabaUploadProtocol = a}) | 94 | true | true | 1 | 9 | 33 | 51 | 25 | 26 | null | null |
jlamothe/ru-deposit | ru-deposit.hs | gpl-3.0 | yesNo :: String -> IO Bool
yesNo prompt = do
cachedMode <- pushControlMode NoBuffering NoBuffering True
putStr $ prompt ++ " (Y/N): "
ans <- getChar
putChar '\n'
restoreControlMode cachedMode
case toUpper ans of
'Y' -> return True
'N' -> return False
_ -> do
putStrLn "Please answer yes o... | 345 | yesNo :: String -> IO Bool
yesNo prompt = do
cachedMode <- pushControlMode NoBuffering NoBuffering True
putStr $ prompt ++ " (Y/N): "
ans <- getChar
putChar '\n'
restoreControlMode cachedMode
case toUpper ans of
'Y' -> return True
'N' -> return False
_ -> do
putStrLn "Please answer yes o... | 345 | yesNo prompt = do
cachedMode <- pushControlMode NoBuffering NoBuffering True
putStr $ prompt ++ " (Y/N): "
ans <- getChar
putChar '\n'
restoreControlMode cachedMode
case toUpper ans of
'Y' -> return True
'N' -> return False
_ -> do
putStrLn "Please answer yes or no."
yesNo prompt | 318 | false | true | 0 | 12 | 90 | 111 | 47 | 64 | null | null |
ankhers/haskell-ide-engine | src/Haskell/Ide/Engine/Utils.hs | bsd-3-clause | -- |Find all the parameters within the CommandDescriptor that goes by the given ParamName
paramsByName :: UntaggedCommandDescriptor -> ParamName -> [ParamOccurence]
paramsByName cmdDescriptor paramName =
let matchingParamName param = pName param == paramName
additionalParams = map AdditionalParam $ filter match... | 842 | paramsByName :: UntaggedCommandDescriptor -> ParamName -> [ParamOccurence]
paramsByName cmdDescriptor paramName =
let matchingParamName param = pName param == paramName
additionalParams = map AdditionalParam $ filter matchingParamName (cmdAdditionalParams cmdDescriptor)
cmdContextParams = concatMap
... | 752 | paramsByName cmdDescriptor paramName =
let matchingParamName param = pName param == paramName
additionalParams = map AdditionalParam $ filter matchingParamName (cmdAdditionalParams cmdDescriptor)
cmdContextParams = concatMap
(\accContext -> map
... | 677 | true | true | 0 | 15 | 235 | 165 | 85 | 80 | null | null |
elieux/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | isListCompExpr MonadComp = True | 39 | isListCompExpr MonadComp = True | 39 | isListCompExpr MonadComp = True | 39 | false | false | 0 | 4 | 11 | 10 | 4 | 6 | null | null |
mikegehard/haskellBookExercises | chapter5/typeKwanDo.hs | mit | e :: A -> C
e = w . q | 21 | e :: A -> C
e = w . q | 21 | e = w . q | 9 | false | true | 1 | 7 | 9 | 27 | 11 | 16 | null | null |
mb21/qua-kit | apps/hs/qua-server/src/Handler/Mooc/SubmitProposal.hs | mit | -- | Submit a design proposal
-- session params:
-- * qua_view_mode=edit -- means a user works on a scenario in edit mode => can save something
-- * scenario_id -- id of previous submission
-- post params:
-- * geometry -- geoJSON, obligatory
-- * preview -- image, obligatory
-- * descrip... | 3,327 | postSubmitProposalR :: Handler Html
postSubmitProposalR = do
Entity uId user <- requireAuth
geometry <- encodeUtf8
<$> requirePostParam "geometry" "Geometry input is not found!"
preview <- BSB.decodeLenient . encodeUtf8 . drop 1 . dropWhile (',' /=)
<$> requirePostParam "preview" "Preview i... | 2,983 | postSubmitProposalR = do
Entity uId user <- requireAuth
geometry <- encodeUtf8
<$> requirePostParam "geometry" "Geometry input is not found!"
preview <- BSB.decodeLenient . encodeUtf8 . drop 1 . dropWhile (',' /=)
<$> requirePostParam "preview" "Preview input is not found!"
description ... | 2,947 | true | true | 0 | 22 | 990 | 556 | 264 | 292 | null | null |
sonyandy/fd | src/Control/Monad/FD/Internal.hs | bsd-3-clause | runFDT :: Monad m => (forall s . FDT s m a) -> m [a]
runFDT m = observeAllT $ evalStateT (unFDT m) initS | 104 | runFDT :: Monad m => (forall s . FDT s m a) -> m [a]
runFDT m = observeAllT $ evalStateT (unFDT m) initS | 104 | runFDT m = observeAllT $ evalStateT (unFDT m) initS | 51 | false | true | 0 | 10 | 23 | 65 | 31 | 34 | null | null |
sdiehl/ghc | libraries/base/GHC/Word.hs | bsd-3-clause | byteSwap32 :: Word32 -> Word32
byteSwap32 (W32# w#) = W32# (narrow32Word# (byteSwap32# w#)) | 91 | byteSwap32 :: Word32 -> Word32
byteSwap32 (W32# w#) = W32# (narrow32Word# (byteSwap32# w#)) | 91 | byteSwap32 (W32# w#) = W32# (narrow32Word# (byteSwap32# w#)) | 60 | false | true | 0 | 9 | 12 | 39 | 19 | 20 | null | null |
Fuuzetsu/haddock | haddock-api/src/Haddock/Interface/Specialize.hs | bsd-2-clause | sugarOperators typ = typ | 24 | sugarOperators typ = typ | 24 | sugarOperators typ = typ | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
unsw-comp4181/accelerate-c-stub | Data/Array/Accelerate/C/Exp.hs | bsd-3-clause | primToC (PrimEq _) [a,b] = [cexp|$exp:a == $exp:b|] | 65 | primToC (PrimEq _) [a,b] = [cexp|$exp:a == $exp:b|] | 65 | primToC (PrimEq _) [a,b] = [cexp|$exp:a == $exp:b|] | 65 | false | false | 0 | 7 | 21 | 31 | 17 | 14 | null | null |
andir/ganeti | test/hs/Test/Ganeti/TestHelper.hs | bsd-2-clause | -- | Test case prefix.
casePrefix :: String
casePrefix = "case_" | 64 | casePrefix :: String
casePrefix = "case_" | 41 | casePrefix = "case_" | 20 | true | true | 0 | 4 | 10 | 12 | 7 | 5 | null | null |
gust/feature-creature | feature-creature/backend/src/Config/AppConfig.hs | mit | logEntriesConfig :: IO LE.Config
logEntriesConfig = do
hostname <- Env.getEnv "APP_LOGENTRIES_DATA_DOMAIN"
port <- read <$> Env.getEnv "APP_LOGENTRIES_DATA_PORT"
token <- (fromJust . LE.fromString) <$> Env.getEnv "APP_LOGENTRIES_LOG_KEY"
return $ LE.Config hostname port token | 291 | logEntriesConfig :: IO LE.Config
logEntriesConfig = do
hostname <- Env.getEnv "APP_LOGENTRIES_DATA_DOMAIN"
port <- read <$> Env.getEnv "APP_LOGENTRIES_DATA_PORT"
token <- (fromJust . LE.fromString) <$> Env.getEnv "APP_LOGENTRIES_LOG_KEY"
return $ LE.Config hostname port token | 291 | logEntriesConfig = do
hostname <- Env.getEnv "APP_LOGENTRIES_DATA_DOMAIN"
port <- read <$> Env.getEnv "APP_LOGENTRIES_DATA_PORT"
token <- (fromJust . LE.fromString) <$> Env.getEnv "APP_LOGENTRIES_LOG_KEY"
return $ LE.Config hostname port token | 258 | false | true | 0 | 11 | 45 | 85 | 39 | 46 | null | null |
romanb/amazonka | amazonka-kinesis/gen/Network/AWS/Kinesis/Types.hs | mpl-2.0 | -- | The sequence number for an individual record result.
prreSequenceNumber :: Lens' PutRecordsResultEntry (Maybe Text)
prreSequenceNumber =
lens _prreSequenceNumber (\s a -> s { _prreSequenceNumber = a }) | 210 | prreSequenceNumber :: Lens' PutRecordsResultEntry (Maybe Text)
prreSequenceNumber =
lens _prreSequenceNumber (\s a -> s { _prreSequenceNumber = a }) | 152 | prreSequenceNumber =
lens _prreSequenceNumber (\s a -> s { _prreSequenceNumber = a }) | 89 | true | true | 0 | 9 | 32 | 46 | 25 | 21 | null | null |
avh4/elm-format | elm-format-lib/src/Parse/Number.hs | bsd-3-clause | chompHex :: (Integral i) => Ptr Word8 -> Ptr Word8 -> (# Ptr Word8, i #)
chompHex pos end =
chompHexHelp pos end (-1) 0 | 121 | chompHex :: (Integral i) => Ptr Word8 -> Ptr Word8 -> (# Ptr Word8, i #)
chompHex pos end =
chompHexHelp pos end (-1) 0 | 121 | chompHex pos end =
chompHexHelp pos end (-1) 0 | 48 | false | true | 0 | 9 | 26 | 61 | 30 | 31 | null | null |
dbanerjee1979/dirc | IrcMessage.hs | mit | generate (Join sender channel) = makeMsg ["JOIN", channel] | 68 | generate (Join sender channel) = makeMsg ["JOIN", channel] | 68 | generate (Join sender channel) = makeMsg ["JOIN", channel] | 68 | false | false | 0 | 7 | 17 | 26 | 13 | 13 | null | null |
firefrorefiddle/hssh | src/Run.hs | bsd-3-clause | executeInFork :: RawFilePath -> Bool -> [ByteString] ->
Maybe [(ByteString, ByteString)] ->
Maybe (Fd, Fd) -> -- stdin
Maybe (Fd, Fd) -> -- stdout
IO ProcessID
executeInFork file searchPath args env stdin stdout = do
forkProcess $ do
case stdin... | 660 | executeInFork :: RawFilePath -> Bool -> [ByteString] ->
Maybe [(ByteString, ByteString)] ->
Maybe (Fd, Fd) -> -- stdin
Maybe (Fd, Fd) -> -- stdout
IO ProcessID
executeInFork file searchPath args env stdin stdout = do
forkProcess $ do
case stdin... | 660 | executeInFork file searchPath args env stdin stdout = do
forkProcess $ do
case stdin of
Nothing -> return ()
Just (readfd, writefd) -> do dupTo readfd stdInput
closeFd writefd
case stdout of
Nothing -> return ()
Just (readfd, writefd) -> do dupTo wr... | 432 | false | true | 0 | 16 | 260 | 204 | 97 | 107 | null | null |
jeyoor/haskell-learning-challenge | learn_haskell_github_courses/Cis194/src/Homework03.hs | bsd-3-clause | --localMaxima (x:y:[]) | trace ("localMaxima x:y:[] " ++ show x ++ " " ++ show y) False = undefined
localMaxima (_:_:[]) = [] | 125 | localMaxima (_:_:[]) = [] | 25 | localMaxima (_:_:[]) = [] | 25 | true | false | 0 | 9 | 22 | 25 | 13 | 12 | null | null |
LambdaHack/LambdaHack | definition-src/Game/LambdaHack/Definition/Ability.hs | bsd-3-clause | doctrineSkills :: Doctrine -> Skills
doctrineSkills TExplore = zeroSkills | 73 | doctrineSkills :: Doctrine -> Skills
doctrineSkills TExplore = zeroSkills | 73 | doctrineSkills TExplore = zeroSkills | 36 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
nyorem/cghs | Cghs/Types/Line2.hs | mit | -- | Computes the line which is perpendicular to the current one.
perpendicularLine2 :: (Num a) => Line2 a -> Line2 a
perpendicularLine2 (o, dir) = (o, perpendicularDir)
where perpendicularDir = Vector2 $ (- (yv dir), xv dir)
-- | Predicate that determines if a point lies on a line. | 288 | perpendicularLine2 :: (Num a) => Line2 a -> Line2 a
perpendicularLine2 (o, dir) = (o, perpendicularDir)
where perpendicularDir = Vector2 $ (- (yv dir), xv dir)
-- | Predicate that determines if a point lies on a line. | 222 | perpendicularLine2 (o, dir) = (o, perpendicularDir)
where perpendicularDir = Vector2 $ (- (yv dir), xv dir)
-- | Predicate that determines if a point lies on a line. | 170 | true | true | 0 | 11 | 54 | 75 | 41 | 34 | null | null |
ozataman/simple-mapreduce | src/Data/MapReduce.hs | bsd-3-clause | dec = decode . decompress | 25 | dec = decode . decompress | 25 | dec = decode . decompress | 25 | false | false | 1 | 5 | 4 | 13 | 5 | 8 | null | null |
pbv/codex | src/Codex/Quiz.hs | mit | questionHeader :: Question -> P.Block
questionHeader Question{..} = head description | 84 | questionHeader :: Question -> P.Block
questionHeader Question{..} = head description | 84 | questionHeader Question{..} = head description | 46 | false | true | 0 | 7 | 9 | 29 | 14 | 15 | null | null |
valderman/selda | selda-tests/test/Tests/Mutable.hs | mit | migrationTable3 :: Table (Only Int)
migrationTable3 = table "table3" [Single mt3_1 :- primary] | 94 | migrationTable3 :: Table (Only Int)
migrationTable3 = table "table3" [Single mt3_1 :- primary] | 94 | migrationTable3 = table "table3" [Single mt3_1 :- primary] | 58 | false | true | 0 | 8 | 12 | 35 | 17 | 18 | null | null |
relrod/fedora-packages-hs | src/Fedora/Packages/Builds.hs | bsd-3-clause | builds :: PackagesConfig -- ^ The configuration to use.
-> Query BuildsFilter -- ^ The search query to send.
-> IO (StandardResults Build)
builds c s =
apiGet ("koji/query/query_builds/" <> LS.toStrict (encode s)) c | 235 | builds :: PackagesConfig -- ^ The configuration to use.
-> Query BuildsFilter -- ^ The search query to send.
-> IO (StandardResults Build)
builds c s =
apiGet ("koji/query/query_builds/" <> LS.toStrict (encode s)) c | 235 | builds c s =
apiGet ("koji/query/query_builds/" <> LS.toStrict (encode s)) c | 78 | false | true | 0 | 10 | 53 | 61 | 30 | 31 | null | null |
zblz/dotfiles | tag-xmonad/xmonad/xmonad.hs | isc | --- Ws Stuff
myCurrentWsFgColor = myHighlightedFgColor | 54 | myCurrentWsFgColor = myHighlightedFgColor | 41 | myCurrentWsFgColor = myHighlightedFgColor | 41 | true | false | 0 | 4 | 5 | 7 | 4 | 3 | null | null |
XinhuaZhang/PetaVisionHaskell | PetaVision/Data/KMeans.hs | gpl-3.0 | meanList2ClusterCenter :: [V.Vector (VU.Vector Double)]
-> [V.Vector (VU.Vector Double)]
-> IO ClusterCenter
meanList2ClusterCenter vecs xss =
M.liftM V.fromList .
randomClusterCenterPP zs
(k - L.length zs) $
xss
where xs =
L.map (V... | 1,071 | meanList2ClusterCenter :: [V.Vector (VU.Vector Double)]
-> [V.Vector (VU.Vector Double)]
-> IO ClusterCenter
meanList2ClusterCenter vecs xss =
M.liftM V.fromList .
randomClusterCenterPP zs
(k - L.length zs) $
xss
where xs =
L.map (V... | 1,071 | meanList2ClusterCenter vecs xss =
M.liftM V.fromList .
randomClusterCenterPP zs
(k - L.length zs) $
xss
where xs =
L.map (V.map (\x ->
if VU.any isNaN x
then (undefined,0)
else (x,1)))
... | 916 | false | true | 4 | 22 | 543 | 381 | 202 | 179 | null | null |
leksah/yi | src/library/Yi/Keymap/Vim/NormalMap.hs | gpl-2.0 | mkDigitBinding :: Char -> VimBinding
mkDigitBinding c = mkBindingE Normal Continue (char c, return (), mutate)
where
mutate vs@(VimState {vsCount = Nothing}) = vs { vsCount = Just d }
mutate vs@(VimState {vsCount = Just count}) =
vs { vsCount = Just $ count * 10 + d }
d = ord c - ord '0' | 308 | mkDigitBinding :: Char -> VimBinding
mkDigitBinding c = mkBindingE Normal Continue (char c, return (), mutate)
where
mutate vs@(VimState {vsCount = Nothing}) = vs { vsCount = Just d }
mutate vs@(VimState {vsCount = Just count}) =
vs { vsCount = Just $ count * 10 + d }
d = ord c - ord '0' | 308 | mkDigitBinding c = mkBindingE Normal Continue (char c, return (), mutate)
where
mutate vs@(VimState {vsCount = Nothing}) = vs { vsCount = Just d }
mutate vs@(VimState {vsCount = Just count}) =
vs { vsCount = Just $ count * 10 + d }
d = ord c - ord '0' | 271 | false | true | 13 | 8 | 75 | 139 | 68 | 71 | null | null |
shlevy/ghc | compiler/basicTypes/DataCon.hs | bsd-3-clause | isMarkedStrict _ = True | 37 | isMarkedStrict _ = True | 37 | isMarkedStrict _ = True | 37 | false | false | 0 | 4 | 17 | 10 | 4 | 6 | null | null |
axhav/AFPLAB3 | Vector.hs | bsd-3-clause | -- | Function to calculate the length of a vector
vLength :: DoubleVector -> Double
vLength v = sqrt $ pow2 0 + pow2 1 + pow2 2
where pow2 i = (v R.! (R.Z R.:. i) )*(v R.! (R.Z R.:. i) )
-- | Function to normalize a vector | 228 | vLength :: DoubleVector -> Double
vLength v = sqrt $ pow2 0 + pow2 1 + pow2 2
where pow2 i = (v R.! (R.Z R.:. i) )*(v R.! (R.Z R.:. i) )
-- | Function to normalize a vector | 178 | vLength v = sqrt $ pow2 0 + pow2 1 + pow2 2
where pow2 i = (v R.! (R.Z R.:. i) )*(v R.! (R.Z R.:. i) )
-- | Function to normalize a vector | 144 | true | true | 0 | 12 | 55 | 95 | 49 | 46 | null | null |
synsem/texhs | test/Text/Doc/Filter/MultiFileSpec.hs | gpl-3.0 | -------------------- helpers
-- Create a section anchor for a numbered mainmatter heading
mkSecAnc :: Int -> Int -> Int -> Int -> InternalAnchor
mkSecAnc pt ch se sb = SectionAnchor $
SectionInfo Mainmatter (SectionRegular (pt,ch,se,sb,0,0,0)) | 246 | mkSecAnc :: Int -> Int -> Int -> Int -> InternalAnchor
mkSecAnc pt ch se sb = SectionAnchor $
SectionInfo Mainmatter (SectionRegular (pt,ch,se,sb,0,0,0)) | 155 | mkSecAnc pt ch se sb = SectionAnchor $
SectionInfo Mainmatter (SectionRegular (pt,ch,se,sb,0,0,0)) | 100 | true | true | 0 | 9 | 37 | 74 | 41 | 33 | null | null |
mstksg/tensor-ops | src/TensorOps/Learn/NeuralNet/Recurrent.hs | bsd-3-clause | rollup
:: forall k (ss :: [[k]]) (ps :: [[k]]) (o :: k) (n :: N). ()
=> Length ss
-> Length ps
-> TOp '[ '[o], '[o] ] '[ '[] ]
-> Nat n
-> TOp (Replicate n '[o] ++ Replicate n '[o]) '[ '[] ]
rollup lS lP loss = \case
Z_ -> TO.konst (US UØ) 0
S_ Z_ -> ... | 1,258 | rollup
:: forall k (ss :: [[k]]) (ps :: [[k]]) (o :: k) (n :: N). ()
=> Length ss
-> Length ps
-> TOp '[ '[o], '[o] ] '[ '[] ]
-> Nat n
-> TOp (Replicate n '[o] ++ Replicate n '[o]) '[ '[] ]
rollup lS lP loss = \case
Z_ -> TO.konst (US UØ) 0
S_ Z_ -> ... | 1,258 | rollup lS lP loss = \case
Z_ -> TO.konst (US UØ) 0
S_ Z_ -> loss
S_ (m@(S_ _) :: Nat m) ->
let lO :: Length (Replicate m '[o])
lO = replicateLength @'[o] m
in (\\ (unsafeCoerce Refl :: Replicate m '[o] ++ '[o] ': '[o] ': Replicate m '[o]
... | 1,043 | false | true | 0 | 28 | 526 | 748 | 398 | 350 | null | null |
tdfirth/lambda | src/Lambda/ReadExpression.hs | mit | eval env (List (Atom "define" : DottedList (Atom var : params) varargs : body)) =
makeVarArgs varargs env params body >>= defineVar env var | 141 | eval env (List (Atom "define" : DottedList (Atom var : params) varargs : body)) =
makeVarArgs varargs env params body >>= defineVar env var | 141 | eval env (List (Atom "define" : DottedList (Atom var : params) varargs : body)) =
makeVarArgs varargs env params body >>= defineVar env var | 141 | false | false | 0 | 13 | 25 | 68 | 30 | 38 | null | null |
bergmark/hakyll | tests/Hakyll/Web/Template/Tests.hs | bsd-3-clause | --------------------------------------------------------------------------------
tests :: Test
tests = testGroup "Hakyll.Core.Template.Tests"
[ testCase "case01" case01
, testCase "applyJoinTemplateList" testApplyJoinTemplateList
] | 258 | tests :: Test
tests = testGroup "Hakyll.Core.Template.Tests"
[ testCase "case01" case01
, testCase "applyJoinTemplateList" testApplyJoinTemplateList
] | 177 | tests = testGroup "Hakyll.Core.Template.Tests"
[ testCase "case01" case01
, testCase "applyJoinTemplateList" testApplyJoinTemplateList
] | 163 | true | true | 0 | 7 | 43 | 41 | 18 | 23 | null | null |
jmitchell/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | mapPTermFC f g (PConstant fc c) = PConstant (f fc) c | 66 | mapPTermFC f g (PConstant fc c) = PConstant (f fc) c | 66 | mapPTermFC f g (PConstant fc c) = PConstant (f fc) c | 66 | false | false | 0 | 7 | 24 | 32 | 15 | 17 | null | null |
wavewave/MSSMType | src/HEP/Physics/MSSM/OutputPhys.hs | bsd-2-clause | isColored SdownL = True | 26 | isColored SdownL = True | 26 | isColored SdownL = True | 26 | false | false | 0 | 5 | 6 | 9 | 4 | 5 | null | null |
jean-edouard/manager | xenmgr/Vm/Config.hs | gpl-2.0 | vmKernel = property "config.kernel" | 35 | vmKernel = property "config.kernel" | 35 | vmKernel = property "config.kernel" | 35 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
hesiod/OpenGL | src/Graphics/Rendering/OpenGL/GL/Evaluators.hs | bsd-3-clause | getMap2 :: (Map2 m, ControlPoint c, Domain d) => c d -> IO (m c d)
getMap2 dummyControlPoint = do
let target = map2Target dummyControlPoint
(uDomain, vDomain) <- allocaArray 4 $ \ptr -> do
glGetMapv target (marshalGetMapQuery Domain) ptr
peek4 (\u1 u2 v1 v2 -> ((u1, u2), (v1, v2))) ptr
(uOrder, vOr... | 733 | getMap2 :: (Map2 m, ControlPoint c, Domain d) => c d -> IO (m c d)
getMap2 dummyControlPoint = do
let target = map2Target dummyControlPoint
(uDomain, vDomain) <- allocaArray 4 $ \ptr -> do
glGetMapv target (marshalGetMapQuery Domain) ptr
peek4 (\u1 u2 v1 v2 -> ((u1, u2), (v1, v2))) ptr
(uOrder, vOr... | 733 | getMap2 dummyControlPoint = do
let target = map2Target dummyControlPoint
(uDomain, vDomain) <- allocaArray 4 $ \ptr -> do
glGetMapv target (marshalGetMapQuery Domain) ptr
peek4 (\u1 u2 v1 v2 -> ((u1, u2), (v1, v2))) ptr
(uOrder, vOrder) <- withArray [0,0] $ \ptr -> do
glGetMapiv target (marsh... | 666 | false | true | 0 | 16 | 162 | 287 | 142 | 145 | null | null |
alexvong1995/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | hacek 'o' = "ǒ" | 15 | hacek 'o' = "ǒ" | 15 | hacek 'o' = "ǒ" | 15 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
music-suite/music-pitch | src/Music/Pitch/Literal/Pitch.hs | bsd-3-clause | gb' = fromPitch $ viaPitchL (4, (-1), 1) | 46 | gb' = fromPitch $ viaPitchL (4, (-1), 1) | 46 | gb' = fromPitch $ viaPitchL (4, (-1), 1) | 46 | false | false | 0 | 9 | 13 | 27 | 15 | 12 | null | null |
zlqhem/crest-fcoverage | Fcoverage.hs | mit | readBranches :: String -> [(Fid, [Branch])]
readBranches contents =
split . (map read) . words $ contents
where split [] = []
split (fid:cnt:rest) = (fid, branches) : split others
where (branches, others) = splitAt (cnt * 2) rest | 259 | readBranches :: String -> [(Fid, [Branch])]
readBranches contents =
split . (map read) . words $ contents
where split [] = []
split (fid:cnt:rest) = (fid, branches) : split others
where (branches, others) = splitAt (cnt * 2) rest | 258 | readBranches contents =
split . (map read) . words $ contents
where split [] = []
split (fid:cnt:rest) = (fid, branches) : split others
where (branches, others) = splitAt (cnt * 2) rest | 213 | false | true | 1 | 9 | 68 | 121 | 64 | 57 | null | null |
vasily-kartashov/playground | 99-problems/problem-09.hs | apache-2.0 | main =
print $ pack ['a', 'a', 'a', 'a', 'b', 'c', 'c', 'a',
'a', 'd', 'e', 'e', 'e', 'e'] | 109 | main =
print $ pack ['a', 'a', 'a', 'a', 'b', 'c', 'c', 'a',
'a', 'd', 'e', 'e', 'e', 'e'] | 109 | main =
print $ pack ['a', 'a', 'a', 'a', 'b', 'c', 'c', 'a',
'a', 'd', 'e', 'e', 'e', 'e'] | 109 | false | false | 0 | 7 | 37 | 55 | 34 | 21 | null | null |
mdsteele/fallback | src/Fallback/State/Tags.hs | gpl-3.0 | questDescription DryIceForLucca = "Lucca, the apothecary in Tragorda, needs a\
\ piece of dry ice for potion she'd like to make. If you can find any of\
\ this alchemical ingredient somewhere in Svengaard and give it to her, she\
\ will make the potion and give some of it to you." | 288 | questDescription DryIceForLucca = "Lucca, the apothecary in Tragorda, needs a\
\ piece of dry ice for potion she'd like to make. If you can find any of\
\ this alchemical ingredient somewhere in Svengaard and give it to her, she\
\ will make the potion and give some of it to you." | 288 | questDescription DryIceForLucca = "Lucca, the apothecary in Tragorda, needs a\
\ piece of dry ice for potion she'd like to make. If you can find any of\
\ this alchemical ingredient somewhere in Svengaard and give it to her, she\
\ will make the potion and give some of it to you." | 288 | false | false | 0 | 4 | 58 | 10 | 4 | 6 | null | null |
creswick/cabal-query | src/Distribution/Query.hs | bsd-3-clause | loadDescr :: FilePath -> IO (Either String GenericPackageDescription)
loadDescr cabalFile = do
content <- readFile cabalFile
return $ case parsePackageDescription content of
ParseFailed err -> Left (show err)
ParseOk _ gpd -> Right gpd | 249 | loadDescr :: FilePath -> IO (Either String GenericPackageDescription)
loadDescr cabalFile = do
content <- readFile cabalFile
return $ case parsePackageDescription content of
ParseFailed err -> Left (show err)
ParseOk _ gpd -> Right gpd | 249 | loadDescr cabalFile = do
content <- readFile cabalFile
return $ case parsePackageDescription content of
ParseFailed err -> Left (show err)
ParseOk _ gpd -> Right gpd | 179 | false | true | 0 | 14 | 47 | 89 | 39 | 50 | null | null |
spacekitteh/smcghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | isVecExpr (CmmMachOp (MO_V_Add {}) _) = True | 49 | isVecExpr (CmmMachOp (MO_V_Add {}) _) = True | 49 | isVecExpr (CmmMachOp (MO_V_Add {}) _) = True | 49 | false | false | 0 | 9 | 11 | 24 | 12 | 12 | null | null |
hsyl20/haskell-hwloc | src/apps/HwLoc.hs | bsd-3-clause | buildTree :: Object -> IO (Tree Object)
buildTree root = do
Node root <$> forM (objectChildren root) (buildTree <=< peekObject) | 130 | buildTree :: Object -> IO (Tree Object)
buildTree root = do
Node root <$> forM (objectChildren root) (buildTree <=< peekObject) | 130 | buildTree root = do
Node root <$> forM (objectChildren root) (buildTree <=< peekObject) | 90 | false | true | 0 | 11 | 22 | 60 | 27 | 33 | null | null |
music-suite/music-score | src/Music/Time/Voice.hs | bsd-3-clause | -- TODO could also use (zipVoiceWith' max) or (zipVoiceWith' min)
-- | Whether two notes have exactly the same duration pattern.
-- Two empty voices are considered to have the same duration pattern.
-- Voices with an non-equal number of notes differ by default.
sameDurations :: Voice a -> Voice b -> Bool
sameDurations... | 365 | sameDurations :: Voice a -> Voice b -> Bool
sameDurations a b = view durationsV a == view durationsV b | 102 | sameDurations a b = view durationsV a == view durationsV b | 58 | true | true | 0 | 7 | 64 | 48 | 24 | 24 | null | null |
UU-ComputerScience/uu-cco | uu-cco/src/CCO/Feedback/Message.hs | bsd-3-clause | putMessages :: Handle -> [Message] -> IO ()
putMessages h = putMsgs
where
putMsgs [] = return ()
putMsgs [msg] = hPutStrLn h (render_ 79 (fromMessage msg))
putMsgs (msg : msgs) = do
let (s, height) = renderHeight_ 79 (fromMessage msg)
hPutStrLn h s
if height >= 0 then hP... | 366 | putMessages :: Handle -> [Message] -> IO ()
putMessages h = putMsgs
where
putMsgs [] = return ()
putMsgs [msg] = hPutStrLn h (render_ 79 (fromMessage msg))
putMsgs (msg : msgs) = do
let (s, height) = renderHeight_ 79 (fromMessage msg)
hPutStrLn h s
if height >= 0 then hP... | 366 | putMessages h = putMsgs
where
putMsgs [] = return ()
putMsgs [msg] = hPutStrLn h (render_ 79 (fromMessage msg))
putMsgs (msg : msgs) = do
let (s, height) = renderHeight_ 79 (fromMessage msg)
hPutStrLn h s
if height >= 0 then hPutStrLn h "" else return ()
putMsgs ms... | 322 | false | true | 1 | 13 | 111 | 169 | 77 | 92 | null | null |
davidfontenot/haskell-stuff | BasicArrays.hs | gpl-2.0 | getCol :: (Num a) => Array (Int, Int) a -> Int -> [a]
getCol a i = selectElems a (\((_,x),_) -> x == i) | 103 | getCol :: (Num a) => Array (Int, Int) a -> Int -> [a]
getCol a i = selectElems a (\((_,x),_) -> x == i) | 103 | getCol a i = selectElems a (\((_,x),_) -> x == i) | 49 | false | true | 0 | 9 | 23 | 76 | 42 | 34 | null | null |
tom-lpsd/tokyocabinet-haskell | Database/TokyoCabinet/TDB.hs | bsd-3-clause | -- | Get the next primary key of the iterator of a table database object.
iternext :: (Storable k) => TDB -> IO (Maybe k)
iternext = iternextHelper c_tctdbiternext unTCTDB | 171 | iternext :: (Storable k) => TDB -> IO (Maybe k)
iternext = iternextHelper c_tctdbiternext unTCTDB | 97 | iternext = iternextHelper c_tctdbiternext unTCTDB | 49 | true | true | 0 | 10 | 29 | 44 | 21 | 23 | null | null |
sras/html-to-lucid | src/Lib.hs | bsd-3-clause | getDescription (TGS.TagWarning _) _ = error "Unsupported tag type in document" | 78 | getDescription (TGS.TagWarning _) _ = error "Unsupported tag type in document" | 78 | getDescription (TGS.TagWarning _) _ = error "Unsupported tag type in document" | 78 | false | false | 0 | 8 | 10 | 22 | 10 | 12 | null | null |
ghc-android/ghc | testsuite/tests/ffi/should_fail/ccfail003.hs | bsd-3-clause | bar _ = 42# | 11 | bar _ = 42# | 11 | bar _ = 42# | 11 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
RobertFischer/real-world-haskell | ch03/Intersperse.hs | unlicense | intersperse separator (x:xs) = x ++ separator ++ (intersperse separator xs) | 75 | intersperse separator (x:xs) = x ++ separator ++ (intersperse separator xs) | 75 | intersperse separator (x:xs) = x ++ separator ++ (intersperse separator xs) | 75 | false | false | 0 | 7 | 10 | 36 | 17 | 19 | null | null |
cpettitt/haskell-todo | htd.hs | mit | empty :: TodoDB
empty = [] | 26 | empty :: TodoDB
empty = [] | 26 | empty = [] | 10 | false | true | 0 | 6 | 5 | 20 | 8 | 12 | null | null |
XxNocturnxX/ministeam | devel.hs | bsd-2-clause | loop :: IO ()
loop = do
threadDelay 100000
e <- doesFileExist "dist/devel-terminate"
if e then terminateDevel else loop | 125 | loop :: IO ()
loop = do
threadDelay 100000
e <- doesFileExist "dist/devel-terminate"
if e then terminateDevel else loop | 125 | loop = do
threadDelay 100000
e <- doesFileExist "dist/devel-terminate"
if e then terminateDevel else loop | 111 | false | true | 0 | 8 | 24 | 49 | 21 | 28 | null | null |
mainland/nikola | src/Data/Vector/CUDA/Storable.hs | bsd-3-clause | maximum = G.maximum | 19 | maximum = G.maximum | 19 | maximum = G.maximum | 19 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
GaloisInc/galua | galua-spec/src/Galua/Spec/CFG.hs | mit | getFinished :: M (Vector BasicBlock)
getFinished =
do RW { .. } <- M get
return (Vector.fromList (Map.elems finishedBlocks)) | 131 | getFinished :: M (Vector BasicBlock)
getFinished =
do RW { .. } <- M get
return (Vector.fromList (Map.elems finishedBlocks)) | 131 | getFinished =
do RW { .. } <- M get
return (Vector.fromList (Map.elems finishedBlocks)) | 94 | false | true | 0 | 12 | 25 | 58 | 27 | 31 | null | null |
ezyang/ghc | compiler/coreSyn/TrieMap.hs | bsd-3-clause | xtE (D env (Case e b ty as)) f m
| null as = m { cm_ecase = cm_ecase m |> xtG (D env e)
|>> xtG (D env ty) f }
| otherwise = m { cm_case = cm_case m |> xtG (D env e)
|>> let ... | 423 | xtE (D env (Case e b ty as)) f m
| null as = m { cm_ecase = cm_ecase m |> xtG (D env e)
|>> xtG (D env ty) f }
| otherwise = m { cm_case = cm_case m |> xtG (D env e)
|>> let ... | 423 | xtE (D env (Case e b ty as)) f m
| null as = m { cm_ecase = cm_ecase m |> xtG (D env e)
|>> xtG (D env ty) f }
| otherwise = m { cm_case = cm_case m |> xtG (D env e)
|>> let ... | 423 | false | false | 0 | 13 | 258 | 153 | 72 | 81 | null | null |
mattias-lundell/timber-llvm | src/Kind.hs | bsd-3-clause | kiType env t = do (cs,k) <- kiTExp env t
return ((k,Star) : cs) | 135 | kiType env t = do (cs,k) <- kiTExp env t
return ((k,Star) : cs) | 135 | kiType env t = do (cs,k) <- kiTExp env t
return ((k,Star) : cs) | 135 | false | false | 0 | 10 | 85 | 48 | 24 | 24 | null | null |
YoshikuniJujo/wxturtle | tests/testWX.hs | bsd-3-clause | action t "quit" = return False | 30 | action t "quit" = return False | 30 | action t "quit" = return False | 30 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
SamirTalwar/advent-of-code | 2015/AOC_09_2.hs | mit | sortedPairs :: Ord a => [a] -> [(a, a)]
sortedPairs [] = [] | 59 | sortedPairs :: Ord a => [a] -> [(a, a)]
sortedPairs [] = [] | 59 | sortedPairs [] = [] | 19 | false | true | 0 | 8 | 12 | 41 | 22 | 19 | null | null |
SkyBirdSoar/PlayerFight | main.hs | unlicense | weapA = Weapon "Sword" 3 12 ("strikes", 0, 7) | 45 | weapA = Weapon "Sword" 3 12 ("strikes", 0, 7) | 45 | weapA = Weapon "Sword" 3 12 ("strikes", 0, 7) | 45 | false | false | 0 | 6 | 8 | 24 | 13 | 11 | null | null |
keera-studios/hsQt | Qtc/Gui/QImage.hs | bsd-2-clause | setNumColors :: QImage a -> ((Int)) -> IO ()
setNumColors x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QImage_setNumColors cobj_x0 (toCInt x1) | 148 | setNumColors :: QImage a -> ((Int)) -> IO ()
setNumColors x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QImage_setNumColors cobj_x0 (toCInt x1) | 148 | setNumColors x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QImage_setNumColors cobj_x0 (toCInt x1) | 103 | false | true | 2 | 8 | 27 | 70 | 33 | 37 | null | null |
spechub/Hets | CSL/EvalSpec.hs | gpl-2.0 | -- main = runTool >> return ()
runMain :: Bool -> [String] -> IO (Maybe CASState)
runMain cl args =
case processArgs args of
Left msg -> do
putStrLn $ "Evaluation: " ++ msg ++ "\n\n" ++ esUsage
return Nothing
Right st -> liftM Just $ runProg cl st | 281 | runMain :: Bool -> [String] -> IO (Maybe CASState)
runMain cl args =
case processArgs args of
Left msg -> do
putStrLn $ "Evaluation: " ++ msg ++ "\n\n" ++ esUsage
return Nothing
Right st -> liftM Just $ runProg cl st | 249 | runMain cl args =
case processArgs args of
Left msg -> do
putStrLn $ "Evaluation: " ++ msg ++ "\n\n" ++ esUsage
return Nothing
Right st -> liftM Just $ runProg cl st | 198 | true | true | 0 | 13 | 82 | 103 | 47 | 56 | null | null |
abakst/liquidhaskell | benchmarks/text-0.11.2.3/Data/Text/Array.hs | bsd-3-clause | -- | Run an action in the ST monad and return an immutable array of
-- its result paired with whatever else the action returns.
{- run2 :: (forall s. GHC.ST.ST s (ma:Data.Text.Array.MArray s, a:a))
-> ({v:Data.Text.Array.Array | (alen v) = (malen ma)}, {v:a | v = a})
@-}
run2 :: (forall s. ST s (MArray s, a)... | 460 | run2 :: (forall s. ST s (MArray s, a)) -> (Array, a)
run2 k = runST (do
(marr,b) <- k
arr <- unsafeFreeze marr
return (arr,b)) | 177 | run2 k = runST (do
(marr,b) <- k
arr <- unsafeFreeze marr
return (arr,b)) | 124 | true | true | 0 | 11 | 136 | 96 | 49 | 47 | null | null |
bitemyapp/hpp | src/Hpp/Expr.hs | bsd-3-clause | renderBinOp BitXor = "^" | 24 | renderBinOp BitXor = "^" | 24 | renderBinOp BitXor = "^" | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
g0v/encoding-mashup-server | src/EncodingTable.hs | bsd-3-clause | -- | Unicode code point(s) to CNS-11643 code.
uniCharToCnsCode :: UniChar -> Handler b EncodingTable (Maybe CnsCode)
uniCharToCnsCode char = use $ uni2cnsTable.at char | 167 | uniCharToCnsCode :: UniChar -> Handler b EncodingTable (Maybe CnsCode)
uniCharToCnsCode char = use $ uni2cnsTable.at char | 121 | uniCharToCnsCode char = use $ uni2cnsTable.at char | 50 | true | true | 0 | 9 | 23 | 45 | 21 | 24 | null | null |
byteally/webapi | webapi-openapi/src/WebApi/OpenAPI.hs | bsd-3-clause | mkPkgConfig :: PkgConfig
mkPkgConfig = PkgConfig "\"Pankaj Singh Sijwali\"" "pankajsijwali1@gmail.com" | 102 | mkPkgConfig :: PkgConfig
mkPkgConfig = PkgConfig "\"Pankaj Singh Sijwali\"" "pankajsijwali1@gmail.com" | 102 | mkPkgConfig = PkgConfig "\"Pankaj Singh Sijwali\"" "pankajsijwali1@gmail.com" | 77 | false | true | 0 | 5 | 9 | 16 | 8 | 8 | null | null |
jsnajder/multext-east-msd | src/Data/MultextEastMsd.hs | bsd-3-clause | codes (Tense x_) = "pifsla" | 34 | codes (Tense x_) = "pifsla" | 34 | codes (Tense x_) = "pifsla" | 34 | false | false | 0 | 6 | 11 | 16 | 7 | 9 | null | null |
ml9951/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | coerceInt2FP :: Width -> Width -> CmmExpr -> NatM Register
coerceInt2FP from to x = if_sse2 coerce_sse2 coerce_x87
where
coerce_x87 = do
(x_reg, x_code) <- getSomeReg x
let
opc = case to of W32 -> GITOF; W64 -> GITOD;
n -> panic $ "coerceInt2FP.x87: unhandled width... | 1,047 | coerceInt2FP :: Width -> Width -> CmmExpr -> NatM Register
coerceInt2FP from to x = if_sse2 coerce_sse2 coerce_x87
where
coerce_x87 = do
(x_reg, x_code) <- getSomeReg x
let
opc = case to of W32 -> GITOF; W64 -> GITOD;
n -> panic $ "coerceInt2FP.x87: unhandled width... | 1,047 | coerceInt2FP from to x = if_sse2 coerce_sse2 coerce_x87
where
coerce_x87 = do
(x_reg, x_code) <- getSomeReg x
let
opc = case to of W32 -> GITOF; W64 -> GITOD;
n -> panic $ "coerceInt2FP.x87: unhandled width ("
++ show n ++ "... | 988 | false | true | 0 | 15 | 376 | 262 | 131 | 131 | null | null |
divipp/lensref | src/runtests.hs | bsd-3-clause | --message :: String -> RefCreator Prog ()
message = lift . message_ | 67 | message = lift . message_ | 25 | message = lift . message_ | 25 | true | false | 0 | 5 | 11 | 11 | 6 | 5 | null | null |
tjakway/ghcjvm | compiler/ghci/ByteCodeAsm.hs | bsd-3-clause | push_alts L = bci_PUSH_ALTS_L | 31 | push_alts L = bci_PUSH_ALTS_L | 31 | push_alts L = bci_PUSH_ALTS_L | 31 | false | false | 1 | 5 | 5 | 13 | 4 | 9 | null | null |
sopvop/heist | src/Heist/Compiled/Internal.hs | bsd-3-clause | parseAtt2 :: Monad n
=> (Text, Text)
-> HeistT n IO (RuntimeSplice n [(Text, Text)])
parseAtt2 (k,v) = do
mas <- getsHS (H.lookup k . _attrSpliceMap)
maybe doInline (return . doAttrSplice) mas
where
cvt (Literal x) = return $ return x
cvt (Ident x) =
localParamNode (const ... | 1,097 | parseAtt2 :: Monad n
=> (Text, Text)
-> HeistT n IO (RuntimeSplice n [(Text, Text)])
parseAtt2 (k,v) = do
mas <- getsHS (H.lookup k . _attrSpliceMap)
maybe doInline (return . doAttrSplice) mas
where
cvt (Literal x) = return $ return x
cvt (Ident x) =
localParamNode (const ... | 1,097 | parseAtt2 (k,v) = do
mas <- getsHS (H.lookup k . _attrSpliceMap)
maybe doInline (return . doAttrSplice) mas
where
cvt (Literal x) = return $ return x
cvt (Ident x) =
localParamNode (const $ X.Element x [] []) $ getAttributeSplice2 x
-- Handles inline parsing of $() splice syntax in attri... | 992 | false | true | 1 | 15 | 327 | 330 | 160 | 170 | null | null |
hansroland/reflex-dom-brownies | samples/alert.hs | bsd-3-clause | main :: IO ()
main = mainWidget $ do
el "h2" $ text "An alert example"
evClick <- button "Click"
el "br" blank
alertEvent (\_ -> "Hello I'm an alert") evClick
return () | 178 | main :: IO ()
main = mainWidget $ do
el "h2" $ text "An alert example"
evClick <- button "Click"
el "br" blank
alertEvent (\_ -> "Hello I'm an alert") evClick
return () | 178 | main = mainWidget $ do
el "h2" $ text "An alert example"
evClick <- button "Click"
el "br" blank
alertEvent (\_ -> "Hello I'm an alert") evClick
return () | 164 | false | true | 2 | 10 | 42 | 82 | 34 | 48 | null | null |
mcschroeder/ghc | compiler/prelude/PrelRules.hs | bsd-3-clause | dataToTagRule :: RuleM CoreExpr
dataToTagRule = a `mplus` b
where
a = do
[Type ty1, Var tag_to_enum `App` Type ty2 `App` tag] <- getArgs
guard $ tag_to_enum `hasKey` tagToEnumKey
guard $ ty1 `eqType` ty2
return tag -- dataToTag (tagToEnum x) ==> x
b = do
dflags <- getDynFlags... | 978 | dataToTagRule :: RuleM CoreExpr
dataToTagRule = a `mplus` b
where
a = do
[Type ty1, Var tag_to_enum `App` Type ty2 `App` tag] <- getArgs
guard $ tag_to_enum `hasKey` tagToEnumKey
guard $ ty1 `eqType` ty2
return tag -- dataToTag (tagToEnum x) ==> x
b = do
dflags <- getDynFlags... | 978 | dataToTagRule = a `mplus` b
where
a = do
[Type ty1, Var tag_to_enum `App` Type ty2 `App` tag] <- getArgs
guard $ tag_to_enum `hasKey` tagToEnumKey
guard $ ty1 `eqType` ty2
return tag -- dataToTag (tagToEnum x) ==> x
b = do
dflags <- getDynFlags
[_, val_arg] <- getArgs
... | 946 | false | true | 1 | 14 | 322 | 214 | 108 | 106 | null | null |
input-output-hk/cardano-sl | core/test/Test/Pos/Core/Gen.hs | apache-2.0 | genFlatSlotId :: Gen FlatSlotId
genFlatSlotId = Gen.word64 Range.constantBounded | 80 | genFlatSlotId :: Gen FlatSlotId
genFlatSlotId = Gen.word64 Range.constantBounded | 80 | genFlatSlotId = Gen.word64 Range.constantBounded | 48 | false | true | 0 | 6 | 7 | 21 | 10 | 11 | null | null |
mhwombat/numeral-wains | src/ALife/Creatur/Wain/ImageID/Universe.hs | bsd-3-clause | cReinforcementDeltasRange :: Setting (PM1Double, PM1Double)
cReinforcementDeltasRange = requiredSetting "reinforcementDeltasRange" | 130 | cReinforcementDeltasRange :: Setting (PM1Double, PM1Double)
cReinforcementDeltasRange = requiredSetting "reinforcementDeltasRange" | 130 | cReinforcementDeltasRange = requiredSetting "reinforcementDeltasRange" | 70 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
tonymorris/ircbrowse | src/Ircbrowse/Types/Import.hs | bsd-3-clause | showChanInt HaskellGame = 3 | 27 | showChanInt HaskellGame = 3 | 27 | showChanInt HaskellGame = 3 | 27 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mindriot101/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | umlaut 'I' = "Ï" | 16 | umlaut 'I' = "Ï" | 16 | umlaut 'I' = "Ï" | 16 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Tarrasch/Hong | Fal/Fal.hs | bsd-3-clause | ball2Sim = paint red (translate (x,y) (ell 0.08 0.08))
where g = -4
x = -3 + integral 0.7
y = 1.5 + integral v
v = integral g `switch` (hit `snapshot_` v =>> \v'->
lift0 (-v') + integral g)
hit = when (y <* -1.5) | 290 | ball2Sim = paint red (translate (x,y) (ell 0.08 0.08))
where g = -4
x = -3 + integral 0.7
y = 1.5 + integral v
v = integral g `switch` (hit `snapshot_` v =>> \v'->
lift0 (-v') + integral g)
hit = when (y <* -1.5) | 290 | ball2Sim = paint red (translate (x,y) (ell 0.08 0.08))
where g = -4
x = -3 + integral 0.7
y = 1.5 + integral v
v = integral g `switch` (hit `snapshot_` v =>> \v'->
lift0 (-v') + integral g)
hit = when (y <* -1.5) | 290 | false | false | 4 | 13 | 123 | 134 | 69 | 65 | null | null |
kmate/HaRe | old/testing/unfoldAsPatterns/D2.hs | bsd-3-clause | f :: String -> String
f newPat_2@((x : xs)) = newPat_2 | 54 | f :: String -> String
f newPat_2@((x : xs)) = newPat_2 | 54 | f newPat_2@((x : xs)) = newPat_2 | 32 | false | true | 2 | 8 | 10 | 37 | 18 | 19 | null | null |
matterhorn-chat/matterhorn | src/Matterhorn/Types/Messages.hs | bsd-3-clause | -- | Builds a message from a ClientPost and also returns the set of
-- usernames mentioned in the text of the message.
clientPostToMessage :: ClientPost -> (Message, S.Set MentionedUser)
clientPostToMessage cp = (m, mentions)
where
mentions =
S.fromList $
(UsernameMention <$> (F.... | 1,603 | clientPostToMessage :: ClientPost -> (Message, S.Set MentionedUser)
clientPostToMessage cp = (m, mentions)
where
mentions =
S.fromList $
(UsernameMention <$> (F.toList $ findUsernames $ cp^.cpText)) <>
(UserIdMention <$> (F.toList $ clientPostReactionUserIds cp))
... | 1,484 | clientPostToMessage cp = (m, mentions)
where
mentions =
S.fromList $
(UsernameMention <$> (F.toList $ findUsernames $ cp^.cpText)) <>
(UserIdMention <$> (F.toList $ clientPostReactionUserIds cp))
m = Message { _mText = cp^.cpText
, _mMa... | 1,416 | true | true | 4 | 17 | 682 | 380 | 201 | 179 | null | null |
ezrakilty/narc | Database/Narc/TermGen.hs | bsd-2-clause | pairGen :: Gen a -> Gen b -> Gen (a, b)
pairGen aGen bGen = do a <- aGen; b <- bGen; return (a, b) | 98 | pairGen :: Gen a -> Gen b -> Gen (a, b)
pairGen aGen bGen = do a <- aGen; b <- bGen; return (a, b) | 98 | pairGen aGen bGen = do a <- aGen; b <- bGen; return (a, b) | 58 | false | true | 0 | 8 | 24 | 67 | 33 | 34 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/Desugar710/DsBinds.hs | bsd-3-clause | dictArity :: [Var] -> Arity
-- Don't count coercion variables in arity
dictArity dicts = count isId dicts | 105 | dictArity :: [Var] -> Arity
dictArity dicts = count isId dicts | 62 | dictArity dicts = count isId dicts | 34 | true | true | 0 | 6 | 17 | 27 | 14 | 13 | null | null |
adzeitor/http-debug | src/Main.hs | mit | logEvent :: App -> Request -> IO Log
logEvent app rq = logEventWithFiles app rq Nothing | 87 | logEvent :: App -> Request -> IO Log
logEvent app rq = logEventWithFiles app rq Nothing | 87 | logEvent app rq = logEventWithFiles app rq Nothing | 50 | false | true | 0 | 7 | 15 | 34 | 16 | 18 | null | null |
samplecount/shake-language-c | src/Development/Shake/Language/C/Target/Windows.hs | apache-2.0 | toolChain LLVM =
set variant LLVM
$ set compilerCommand "gcc"
$ set archiverCommand "ar"
$ set linkerCommand "g++"
$ defaultToolChain | 145 | toolChain LLVM =
set variant LLVM
$ set compilerCommand "gcc"
$ set archiverCommand "ar"
$ set linkerCommand "g++"
$ defaultToolChain | 145 | toolChain LLVM =
set variant LLVM
$ set compilerCommand "gcc"
$ set archiverCommand "ar"
$ set linkerCommand "g++"
$ defaultToolChain | 145 | false | false | 8 | 5 | 31 | 55 | 20 | 35 | null | null |
ashgti/DTI | src/Language/Perl/Core.hs | mit | {- "Pure" primitive functions -}
primitives :: [(String, [PerlVal] -> ThrowsError PerlVal)]
primitives = [("&+", numAdd)
,("&-", numAdd)
,("&*", numAdd)
,("&/", numAdd)
] | 222 | primitives :: [(String, [PerlVal] -> ThrowsError PerlVal)]
primitives = [("&+", numAdd)
,("&-", numAdd)
,("&*", numAdd)
,("&/", numAdd)
] | 189 | primitives = [("&+", numAdd)
,("&-", numAdd)
,("&*", numAdd)
,("&/", numAdd)
] | 130 | true | true | 0 | 8 | 74 | 67 | 42 | 25 | null | null |
kc1212/enigma-hs | Crypto/Enigma/Helper.hs | mit | -- helper functions -----------------------------------------------------------
alphs :: String
alphs = ['A'..'Z'] | 114 | alphs :: String
alphs = ['A'..'Z'] | 34 | alphs = ['A'..'Z'] | 18 | true | true | 0 | 5 | 9 | 17 | 10 | 7 | null | null |
ksaveljev/hake-2 | src/Client/KeyConstants.hs | bsd-3-clause | kF11 = 145 :: Int | 26 | kF11 = 145 :: Int | 26 | kF11 = 145 :: Int | 26 | false | false | 0 | 4 | 13 | 9 | 5 | 4 | null | null |
fhaust/bitcoin | src/Bitcoin/Network.hs | mit | dnsSeeds :: [HostName]
dnsSeeds = ["bitseed.xf2.org"
,"dnsseed.bluematt.me"
,"seed.bitcoin.sipa.be"
,"dnsseed.bitcoin.dashjr.org"
] | 175 | dnsSeeds :: [HostName]
dnsSeeds = ["bitseed.xf2.org"
,"dnsseed.bluematt.me"
,"seed.bitcoin.sipa.be"
,"dnsseed.bitcoin.dashjr.org"
] | 175 | dnsSeeds = ["bitseed.xf2.org"
,"dnsseed.bluematt.me"
,"seed.bitcoin.sipa.be"
,"dnsseed.bitcoin.dashjr.org"
] | 152 | false | true | 0 | 7 | 53 | 33 | 17 | 16 | null | null |
pparkkin/eta | compiler/ETA/Core/CoreSyn.hs | bsd-3-clause | isAutoRule (Rule { ru_auto = is_auto }) = is_auto | 49 | isAutoRule (Rule { ru_auto = is_auto }) = is_auto | 49 | isAutoRule (Rule { ru_auto = is_auto }) = is_auto | 49 | false | false | 0 | 9 | 8 | 21 | 11 | 10 | null | null |
ku-fpg/kansas-amber | tests/ExprTests/ExprBool.hs | bsd-3-clause | prop_eq :: ArduinoConnection -> RemoteRef Bool -> Bool -> Bool -> Property
prop_eq c r x y = monadicIO $ do
let local = x == y
remote <- run $ send c $ do
writeRemoteRef r $ (lit x) ==* (lit y)
v <- readRemoteRef r
return v
assert (local == litEvalB remote) | 293 | prop_eq :: ArduinoConnection -> RemoteRef Bool -> Bool -> Bool -> Property
prop_eq c r x y = monadicIO $ do
let local = x == y
remote <- run $ send c $ do
writeRemoteRef r $ (lit x) ==* (lit y)
v <- readRemoteRef r
return v
assert (local == litEvalB remote) | 293 | prop_eq c r x y = monadicIO $ do
let local = x == y
remote <- run $ send c $ do
writeRemoteRef r $ (lit x) ==* (lit y)
v <- readRemoteRef r
return v
assert (local == litEvalB remote) | 218 | false | true | 0 | 16 | 89 | 138 | 61 | 77 | null | null |
best-coloc-ever/twitch-cast | streamer/src/Twitch/API.hs | mit | channelAccessToken :: ClientID -> ChannelName -> IO (Maybe AccessToken)
channelAccessToken clientID channel = do
request <- addRequestHeader "Client-ID" (BS.pack clientID) <$>
parseRequest (channelAccessTokenUrl channel)
response <- httpJSONEither request
return $ rightToMaybe $ getResponseBody res... | 325 | channelAccessToken :: ClientID -> ChannelName -> IO (Maybe AccessToken)
channelAccessToken clientID channel = do
request <- addRequestHeader "Client-ID" (BS.pack clientID) <$>
parseRequest (channelAccessTokenUrl channel)
response <- httpJSONEither request
return $ rightToMaybe $ getResponseBody res... | 325 | channelAccessToken clientID channel = do
request <- addRequestHeader "Client-ID" (BS.pack clientID) <$>
parseRequest (channelAccessTokenUrl channel)
response <- httpJSONEither request
return $ rightToMaybe $ getResponseBody response | 253 | false | true | 0 | 13 | 54 | 95 | 42 | 53 | null | null |
ancientlanguage/haskell-analysis | grammar/src/Grammar/Common/Decompose.hs | mit | decomposeChar '\x00E0' = "\x0061\x0300" | 39 | decomposeChar '\x00E0' = "\x0061\x0300" | 39 | decomposeChar '\x00E0' = "\x0061\x0300" | 39 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.