code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
module RunLength (decode, encode) where import Data.Char (isDigit) decode :: String -> String decode [] = [] decode xs = (replicate n c) ++ decode xs' where n | isDigit . head $ xs = read . takeWhile isDigit $ xs | otherwise = 1 c = head . dropWhile ...
vaibhav276/exercism_haskell
run-length-encoding/src/RunLength.hs
mit
704
0
11
282
285
143
142
18
2
{-# LANGUAGE OverloadedStrings #-} module Collab.App ( app ) where import Control.Applicative ((<$>)) import Control.Exception (finally) import Control.Monad (forever, when) import Control.Monad.IO.Class (liftIO) import Data.Aeson (decode) import Data.Text (Text) import Network.HTTP.Types.URI (decodePathSegments)...
dennis84/collab-haskell
src/Collab/App.hs
mit
1,847
0
16
386
543
284
259
41
6
-- file: ch08/ElfMagic.hs import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Lazy.Char8 as LC --我们将检测一个文件是否是 ELF object 文件:这种文件类型几乎被所有现代类 Unix 系统作为可执行文件。 --这个简单的问题可以通过查看文件头部的四个字节解决,看他们是否匹配某个特定的字节序列。表示某种文件类型的字节序列通常被称为 魔法数 。 hasElfMagic :: L.ByteString -> Bool hasElfMagic content = L.take 4 co...
Numberartificial/workflow
haskell-first-principles/src/RW/CH8/ElfMageic.hs
mit
1,316
3
14
219
385
196
189
27
3
commonWords :: Int -> [Char] -> [Char] type Text = [Char] type Word = [Char] -- words :: [Char] -> [[Char]] words :: Text -> [Word] map :: (a -> b) -> [a] -> [b] sortWords :: [Word] -> [Word] countRuns :: [Word] -> [(Int, Word)] sortRuns :: [(Int, Word)] -> [(Int, Word)] take :: Int -> [a] -> [a] showRun :: (I...
v0lkan/learning-haskell
common-words.hs
mit
1,545
7
7
406
351
199
152
-1
-1
{-# LANGUAGE TemplateHaskell #-} import Reflex import Reflex.Dom import Data.FileEmbed import qualified Data.Map as Map main = mainWidgetWithCss $(embedFile "style.css") $ do elAttr "div" ("id" =: "page-wrap") $ do el "header" $ do el "h1" $ text "External CSS Demo" el "ul" $ do el "li" $ text ...
Ninju/reflex-dom-demos
external-css/source.hs
mit
613
1
18
160
184
79
105
18
1
module Specs.P4Spec(main, spec) where import P4 import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "p4" $ do it "" $ p4 [] `shouldBe` 0 it "" $ p4 [1,2,3,4,5] `shouldBe` 5 it "" $ p4 "Hello" `shouldBe` 5 describe "p...
nosoosso/nnh
test/Specs/P4Spec.hs
mit
624
0
13
246
302
155
147
28
1
module Test.Handlers.PayReq where import qualified PayProto as P import PayProto.API import Test.Constants import Test.Util import qualified Network.Haskoin.Constants as HCC import Data.ProtoLens import Servant import Data.Time.Clock.POSIX import Data.Time.Clock import Servant.Common.Ba...
runeksvendsen/bitcoin-payment-protocol
test/Test/Handlers/PayReq.hs
cc0-1.0
1,025
0
11
235
263
142
121
26
1
{-# OPTIONS -fglasgow-exts #-} {-# LANGUAGE TemplateHaskell #-} module Baum.RedBlack.Type where import Autolib.ToDoc import Autolib.Reader import Data.Typeable data RedBlackColor = Red | Black deriving ( Eq, Typeable ) data RedBlackTree a = Empty | RedBlackTree RedBlackColor ( RedBlackTree a ) a ( RedBlac...
florianpilz/autotool
src/Baum/RedBlack/Type.hs
gpl-2.0
866
0
11
155
276
146
130
20
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveDataTypeable #-} module PL.Interpretation where import PL.Struktur import PL.Signatur import Autolib.Set import Autolib.Size import Autolib.FiniteMap import Autolib.TES.Identifier import Autolib.Reader import Autolib.ToDoc import Autolib.Reporter import qualified A...
marcellussiegburg/autotool
collection/src/PL/Interpretation.hs
gpl-2.0
1,377
35
9
307
396
220
176
38
1
module Types ( LispExp(..) , showType ) where data LispExp = LInt Integer | LBool Bool | LString String | LList [LispExp] | LSymbol String | LFunction String | LBind String | LNil deriving (Eq) instance...
felixsch/simplelisp
src/Types.hs
gpl-2.0
832
0
10
295
295
156
139
28
1
{-# LANGUAGE TupleSections #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE LambdaCase #-} -- {-# LANGUAGE Strict #-} {-| Module : Hypercube.Chunk Description : 3D Vectors Copyright : (c) Jaro Reinders, 2017 License : GPL-3 Maintainer : noughtmare@openmailbox.org Th...
noughtmare/hypercube
src/Hypercube/Chunk.hs
gpl-3.0
3,395
0
17
798
1,170
621
549
86
6
module Problem039 (answer) where import Data.List (maximumBy) import Data.Function (on) answer :: Int answer = fst $ maximumBy (compare `on` snd) solutionSpace where solutionSpace = zip [3..1000] $ fmap (length . rightTriangles) [3..1000] rightTriangles :: Int -> [(Int, Int, Int)] rightTriangles perimeter = [(...
geekingfrog/project-euler
Problem039.hs
gpl-3.0
541
0
14
109
253
137
116
15
1
module Vdv.Text(extractDelimited,readUnsafeInt) where import ClassyPrelude import Data.Text(breakOn) import Data.Text.Read(decimal) readUnsafeInt :: Text -> Int readUnsafeInt x = either (error $ "invalid decimal \"" <> unpack x <> "\"") fst (decimal x) data BreakMode = BreakWithDelimiter | BreakWithou...
pmiddend/vdvanalyze
src/Vdv/Text.hs
gpl-3.0
911
0
15
198
339
181
158
24
4
module Jumpie.UnitType where import Jumpie.Types type UnitType = Real
pmiddend/jumpie
lib/Jumpie/UnitType.hs
gpl-3.0
82
0
4
21
17
11
6
3
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/WorkflowTemplates/SetIAMPolicy.hs
mpl-2.0
6,479
0
16
1,345
783
459
324
124
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dlp/gen/Network/Google/Resource/DLP/Projects/Locations/StoredInfoTypes/Delete.hs
mpl-2.0
5,614
0
15
1,149
703
414
289
108
1
{-# LANGUAGE OverloadedStrings #-} import Control.Monad.IO.Class (liftIO) import Control.Monad.Reader (ask) import Database.PostgreSQL.Migrations import Database.PostgreSQL.Simple up :: Connection -> IO () up = migrate $ do conn <- ask liftIO $ execute_ conn "create extension if not exists pgcrypto" add_column "...
alevy/mappend
db/migrations/20151124163354_blog_password.hs
agpl-3.0
622
0
9
103
159
81
78
18
1
{-# LANGUAGE ViewPatterns #-} import Test.QuickCheck import Test.QuickCheck.Function -- 16.9 functorIdentity :: (Functor f, Eq (f a)) => f a -> Bool functorIdentity f = fmap id f == f functorCompose :: (Eq (f c), Functor f) => (a -> b) -> (b -> c) -...
dmvianna/haskellbook
src/Ch16-FunctorQuickCheck.hs
unlicense
4,814
0
10
1,294
2,055
1,035
1,020
140
1
module Provided.ExprT where data ExprT = Lit Integer | Add ExprT ExprT | Mul ExprT ExprT deriving (Show, Eq)
nilthehuman/cis194
Provided/ExprT.hs
unlicense
134
0
6
44
40
23
17
5
0
import Data.Char f :: Show a => (a, b) -> IO (a, b) f t@(a, _) = do print a return t isSubsequenceOf :: (Eq a) => [a] -> [a] -> Bool isSubsequenceOf sub par = case sub of [] -> True x:xs -> x `elem` par && isSubsequenceOf xs par -- isLetter :: Char -> Bool -- isLetter = flip elem (['a'..'z'] ++ [...
dmvianna/haskellbook
src/Ch11Ex-asPatterns.hs
unlicense
2,103
0
13
692
807
423
384
53
3
module Main where import System.Environment (getArgs) import Blockchain.Node.RestApi.Server (bootstrap) import Blockchain.Node.Config (BlockchainConfig(..), defaultConfig) config :: BlockchainConfig config = defaultConfig main :: IO () main = getArgs >>= parse parse :: [String] -> IO () parse [] = bootstrap con...
carbolymer/blockchain
blockchain-node/app/Main.hs
apache-2.0
382
0
8
58
135
77
58
11
1
-- Copyright 2019-2021 Google LLC -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed t...
google/hs-ten
ten/src/Data/Ten/Sigma.hs
apache-2.0
9,453
0
18
2,002
1,947
1,115
832
-1
-1
module AlgabraicDataTypes where -- Data type with multiple constructor options. Enum type data Thing = Shoe | Ship | SealingWax | Cabbage | King deriving Show shoe :: Thing shoe = Shoe listO'Things :: [Thing] listO'Things = [Shoe, SealingWax, King, Cabbage, King] -- wri...
markmandel/cis194
src/week3/lecture/AlgabraicDataTypes.hs
apache-2.0
2,208
0
9
546
701
374
327
66
2
{-| Copyright 2015 Michael Krolikowski Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
mkroli/couchdump
src/CouchDump/Convert.hs
apache-2.0
1,654
0
9
297
293
160
133
21
2
-- Copyright 2015 Google Inc. All Rights Reserved. -- -- Licensed under the Apache License, Version 2.0 (the "License")-- -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicabl...
polux/subsume
Parser.hs
apache-2.0
2,937
0
16
563
854
459
395
63
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ExistentialQuantification #-} module Yesod.Form.Types ( -- * Helpers Enctype (..) , FormResult (..) , FormMessage (..) , Env , FileEnv , Ints (..) -- * Form , MForm , AForm (..) -- * Build for...
chreekat/yesod
yesod-form/Yesod/Form/Types.hs
bsd-2-clause
4,933
0
15
1,423
1,472
824
648
117
0
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} module WebNewsAPI where import Network.Curl import Data.String.Utils (join) --MissingH import Network.HTTP import Data.Aeson (decode, encode) import Data.Aeson.TH (deriveJSON) import qualified Data.ByteString.Lazy.Char8 as BL (pack, unpack) imp...
clockfort/mobile-webnews
WebNewsAPI.hs
bsd-3-clause
2,042
11
15
352
605
304
301
45
1
{-# LANGUAGE DeriveGeneric #-} module Language.Parser.Errors where import Control.Monad ( mapM ) import Control.Monad.State ( State(..) , gets , put ...
rumblesan/proviz
src/Language/Parser/Errors.hs
bsd-3-clause
1,973
0
12
770
397
216
181
40
1
module GHC.Hs.Type (module HsTypes) where import HsTypes
google/ghc-source-gen
compat/GHC/Hs/Type.hs
bsd-3-clause
56
0
4
6
16
11
5
2
0
{-# LANGUAGE OverloadedStrings #-} module Scheme where import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BC -- needed by pattern match import Prelude hiding (lookup) data Object = SDouble Double | SInteger Integer | SString ByteString | SBool Bool ...
masaedw/3imp
src/Scheme.hs
bsd-3-clause
3,987
0
15
1,217
1,315
686
629
100
12
{- Welcome to your custom Prelude Export here everything that should always be in your library scope For more info on what is exported by Protolude check: https://github.com/sdiehl/protolude/blob/master/Symbols.md -} module PgRecorder.Prelude ( module Exports , id ) where import Protolude as Exports import...
diogob/pg-recorder
src/PgRecorder/Prelude.hs
bsd-3-clause
340
0
5
58
31
21
10
5
0
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Data.Concurrent.Queue.Roq.QueueWatch ( -- * API queue_watch -- * Types , Metric (..) -- * Debug -- , ping -- * Remote Table -- , Data.Concurrent.Queue.Roq.QueueWatchServer.__rem...
alanz/hroq
src/Data/Concurrent/Queue/Roq/QueueWatch.hs
bsd-3-clause
11,915
0
14
2,601
1,178
649
529
92
4
module Main where import qualified AI.Tests as LogicHelpers import qualified AI.VersionSpaceTests as VersionSpaces import Test.Framework ( defaultMain ) main :: IO () main = defaultMain [ LogicHelpers.tests , VersionSpaces.tests ]
creswick/HaVSA
tests/Main.hs
bsd-3-clause
272
0
7
71
58
36
22
7
1
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PolyKinds #-} module Fragment.IsoRec.Rules.Type ( Is...
dalaing/type-systems
src/Fragment/IsoRec/Rules/Type.hs
bsd-3-clause
1,111
0
10
242
242
131
111
29
1
module Y15.D01 where char2move :: Char -> Int char2move = \case '(' -> 1 ')' -> -1 x -> error $ "Unexpected character: " ++ [x] solve1 :: String -> Int solve1 = sum . map char2move solve2 :: String -> Int solve2 = fst . head . dropWhile (\(_, x) -> x >= 0) . zip [0..] . scanl (+...
oshyshko/adventofcode
src/Y15/D01.hs
bsd-3-clause
344
0
12
110
145
78
67
-1
-1
module RHM.EnumeratorT ( enumerate , enumHandle , enumTextFile ) where import RHM.Input import RHM.Intern.Trans import Control.Monad.IO.Class import System.IO type EnumeratorT e m a = IterateeT e m a -> IterateeT e m a enumerate :: Monad m => [e] -> EnumeratorT e m a enumerate (x:xs) m = Iterat...
afwlehmann/rhm-io-iter
src/RHM/EnumeratorT.hs
bsd-3-clause
934
0
18
255
339
169
170
28
3
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE OverloadedStrings #-} module Duckling.AmountOfMoney.MN.Corpus ( corpus ) where import Data.Str...
facebookincubator/duckling
Duckling/AmountOfMoney/MN/Corpus.hs
bsd-3-clause
2,513
0
10
1,044
427
250
177
69
1
-------------------------------------------------------------------------------- -- | Internally used compiler module {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} module Hakyll.Core.Compile...
freizl/freizl.github.com-old
src/Hakyll/Core/Compiler/Internal.hs
bsd-3-clause
9,115
0
22
2,020
1,715
915
800
155
3
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} ------------------------------------------------------------------- -- | -- Module : Irreverent.Bitbucket.Http.Repositories.Pipelines.GetConfig -- Copy...
irreverent-pixel-feats/bitbucket
bitbucket-http-client/src/Irreverent/Bitbucket/Http/Repositories/Pipelines/GetConfig.hs
bsd-3-clause
2,496
0
20
353
612
365
247
45
2
module Import.Semantic where import Import -- | Use SemanticUI to render a form. renderSemantic :: Monad m => FormRender m a renderSemantic aform fragment = do (res, views') <- aFormToForm aform let views = views' [] let widget = [whamlet| $newline never \#{fragment} $forall view <- views <d...
sulami/hGM
Import/Semantic.hs
bsd-3-clause
632
0
11
169
92
48
44
-1
-1
{-# OPTIONS_GHC -Wall #-} module Messages.Formatter.HumanReadable (format) where import Messages.Formatter.Format import Messages.Types import CommandLine.Helpers (showErrors) format :: InfoFormatterF a -> IO a format infoFormatter = case infoFormatter of OnInfo info next -> renderInfo info ...
nukisman/elm-format-short
src/Messages/Formatter/HumanReadable.hs
bsd-3-clause
753
0
9
188
187
96
91
22
2
module Language.Modelica.Test.Lexer (test) where import Language.Modelica.Syntax.ToString (toString) import qualified Language.Modelica.Parser.Lexer as Lexer import Language.Modelica.Test.Utility (testparser) import Text.ParserCombinators.Parsec (eof) import Text.Printf (printf) import Control.Applicative ((<*)...
xie-dongping/modelicaparser
test/Language/Modelica/Test/Lexer.hs
bsd-3-clause
1,558
0
18
319
527
295
232
50
1
module Data.Arib.CRC (CRC32(..)) where import Data.Arib.CRC.Internal (CRC32(..))
philopon/arib
src/Data/Arib/CRC.hs
bsd-3-clause
82
0
6
8
32
22
10
2
0
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE GADT...
rfranek/duckling
Duckling/Time/RO/Rules.hs
bsd-3-clause
35,577
0
21
9,250
10,309
5,627
4,682
1,148
2
module Data.XCB.Utils where -- random utility functions import Data.Char import Control.Applicative ensureUpper :: String -> String ensureUpper [] = [] ensureUpper (x:xs) = (toUpper x) : xs -- |Like mapMaybe, but for any Alternative. -- Never returns 'empty', instead returns 'pure []' mapAlt :: Alternative f => (a ...
aslatter/xcb-types
Data/XCB/Utils.hs
bsd-3-clause
458
0
10
109
176
92
84
11
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 -} {-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types] ...
bitemyapp/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
72,144
0
15
20,636
13,642
7,110
6,532
871
9
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Scripts.ReviewCommon where import ClassyPrelude import Appian import Appian.Types import Appian.Instances import Appian.Lens impor...
limaner2002/EPC-tools
USACScripts/src/Scripts/ReviewCommon.hs
bsd-3-clause
12,604
0
19
2,101
2,757
1,416
1,341
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} module Stack.FileWatch ( fileWatch , fileWatchPoll , printExceptionStderr ) where import Blaze.ByteString.Builder (toLazyByteString, copyByteString) import Blaze.ByteString.Builder.Char.Utf8 (fromShow) import Control.Concurrent.Async (ra...
meiersi-11ce/stack
src/Stack/FileWatch.hs
bsd-3-clause
6,011
0
25
2,171
1,441
714
727
128
10
{-| Module : Numeric.AERN.NumericOrder.Extrema Description : types that have least and greatest elements Copyright : (c) Michal Konecny License : BSD3 Maintainer : mikkonecny@gmail.com Stability : experimental Portability : portable Types that have least and ...
michalkonecny/aern
aern-order/src/Numeric/AERN/NumericOrder/Extrema.hs
bsd-3-clause
729
0
7
197
70
39
31
-1
-1
{-# LANGUAGE LambdaCase, OverloadedStrings #-} module Genotype.Comparison ( ReferenceComparison (..) , PhaseKnowledge (..) , compareToRef , printCompResult , headsTails , firstCertain ) where import Control.Monad (sequence) import Data.Text (Text) import Genotype.Types data ReferenceComparison = Bot...
Jonplussed/genotype-parser
src/Genotype/Comparison.hs
bsd-3-clause
1,856
0
13
429
663
352
311
68
9
module Test.Pos.Util.Golden where import Universum import Data.Aeson (FromJSON, ToJSON, eitherDecode, encode) import Data.Aeson.Encode.Pretty (Config (..), Indent (..), NumberFormat (..), encodePretty', keyOrder) import qualified Data.ByteString as BS import qualifie...
input-output-hk/pos-haskell-prototype
util/test/Test/Pos/Util/Golden.hs
mit
7,067
0
20
2,015
1,900
970
930
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} ---------------------------------------------------...
Gabriel439/succinct
src/Succinct/Dictionary/Rank9.hs
bsd-2-clause
5,443
0
16
1,308
1,560
838
722
107
1
-- | Organ definitions. module Content.ItemKindOrgan ( organs ) where import qualified Data.EnumMap.Strict as EM import Game.LambdaHack.Common.Ability import Game.LambdaHack.Common.Color import Game.LambdaHack.Common.Dice import Game.LambdaHack.Common.Flavour import Game.LambdaHack.Common.Misc import Game.LambdaHack....
Concomitant/LambdaHack
GameDefinition/Content/ItemKindOrgan.hs
bsd-3-clause
11,806
0
15
3,359
4,121
2,529
1,592
356
1
{-# LANGUAGE TemplateHaskell #-} module Database.DSH.VSL.Opt.Properties.Empty where import Control.Monad import qualified Data.Sequence as S import Database.DSH.Common.VectorLang import Database.DSH.VSL.Lang import Database.DSH.VSL.Opt.Properties.Comm...
ulricha/dsh
src/Database/DSH/VSL/Opt/Properties/Empty.hs
bsd-3-clause
3,749
0
14
1,117
1,497
740
757
79
23
-- Copyright (c) 2015 Eric McCorkle. All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditi...
emc2/saltlang
test/library/Tests/Language/Salt.hs
bsd-3-clause
1,793
0
7
295
91
71
20
6
1
module Main where import Lib main :: IO () main = exec
hherman1/CatanServ
app/Main.hs
bsd-3-clause
57
0
6
14
22
13
9
4
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeSynonymInstances #-} module IHaskell.Display.Widgets.String.Latex ( -- * The Latex Widget LatexWidget, -- * Constructor mkLatexWidget) where -- To keep `cabal repl` happy when r...
FranklinChen/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/String/Latex.hs
mit
1,580
0
13
360
283
158
125
33
1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="bs-BA"> <title>Server-Sent Events | ZAP Extension</title> <maps> <homeID>top</homeID> ...
0xkasun/security-tools
src/org/zaproxy/zap/extension/sse/resources/help_bs_BA/helpset_bs_BA.hs
apache-2.0
980
80
67
160
425
214
211
-1
-1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveDataTypeable #-} -- | Versions for packages. module Stack.Types.Version (Version ,Cabal...
tedkornish/stack
src/Stack/Types/Version.hs
bsd-3-clause
6,754
0
15
1,630
1,804
954
850
167
5
{-# LANGUAGE OverloadedStrings, RecordWildCards, ViewPatterns #-} module GameEngine.Graphics.BSP ( addBSP , addGPUBSP , uploadBSP , GPUBSP(..) , BSPInstance(..) ) where import Control.Monad import Data.Maybe import Data.HashSet (HashSet) import Data.Map (Map) import Data.Set (Set) import Data.Vector (Vecto...
csabahruska/quake3
game-engine/GameEngine/Graphics/BSP.hs
bsd-3-clause
7,526
0
18
1,742
2,229
1,203
1,026
120
8
{-# LANGUAGE BangPatterns, CPP, GeneralizedNewtypeDeriving #-} -- | -- Module : Data.Text.Foreign -- Copyright : (c) 2009, 2010 Bryan O'Sullivan -- -- License : BSD-style -- Maintainer : bos@serpentine.com -- Stability : experimental -- Portability : GHC -- -- Support for using 'Text' data with native cod...
beni55/text
Data/Text/Foreign.hs
bsd-2-clause
6,114
0
15
1,412
1,245
674
571
78
1
module ClassIn2 where --Any class/instance name declared in this module can be renamed --Rename instance name 'myreverse' to 'reversable' class Reversable a where reversable :: a -> a reversable _ = undefined instance Reversable [a] where reversable = reverse data Foo = Boo | Moo instance Eq Foo where ...
mpickering/HaRe
old/testing/renaming/ClassIn2_TokOut.hs
bsd-3-clause
410
0
7
98
116
62
54
12
1
module HAD.Y2114.M03.D27.Exercise where -- | compact Compact a list of values with the following rules: -- - Nothing are removed -- - If two remaining onsecutive values are equal, -- they are replaced by one value equal to the successor of those values -- - the previous rule is not recursive -- - Other values are ...
1HaskellADay/1HAD
exercises/HAD/Y2014/M03/D27/Exercise.hs
mit
831
0
8
171
72
53
19
3
1
{- Generate unicode tables used in shims, src/string.js using the same encoding as the metadata and static data and a simple RLE scheme that compresses sequences with the same value and also alternating sequences -} module Main where import Data.List.Split import Data.Bits import Data.Char import Data.List (g...
seereason/ghcjs
utils/genUnicode.hs
mit
3,555
0
16
896
1,228
655
573
59
1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module T10598_fail6 where newtype F x = F ([x], Maybe x) deriving Functor
olsner/ghc
testsuite/tests/deriving/should_fail/T10598_fail6.hs
bsd-3-clause
151
0
7
22
30
20
10
4
0
{-# LANGUAGE PatternGuards #-} module Idris.Transforms(transformPats, transformPatsWith, applyTransRulesWith, applyTransRules) where import Idris.AbsSyntax import Idris.Core.CaseTree import Idris.Core.TT import Debug.Trace transformPats :: ISt...
mrmonday/Idris-dev
src/Idris/Transforms.hs
bsd-3-clause
4,279
0
17
1,536
1,315
672
643
77
5
-- int32 to IPv4 -- http://www.codewars.com/kata/52e88b39ffb6ac53a400022e/ -- Note: Wrong type in tests, should be Word32 instead of Int32. module IPv4 where import Data.Word (Word32) import Data.Bits ((.&.), shiftR) import Data.List (unfoldr, intercalate) type IPString = String int32ToIP :: Word32 -> IPString int...
gafiatulin/codewars
src/5 kyu/IPv4.hs
mit
482
0
11
96
150
83
67
9
2
-- -- Config.hs -- Copyright (C) 2015 soud <soud@protonmail.com> -- -- Distributed under terms of the MIT license. -- module Config ( server , sPort , nickname , channel ) where server = "irc.freenode.org" sPort = 6667 nickname = "evalbot" channel = "#nekoproject"
soudy/evalbot
src/Config.hs
mit
300
0
4
78
44
30
14
10
1
module ImageMapTests ( withWrongDimensions , withRightDimensions , reportingSize , findingElements , elementToRGB , elementToRGBA ) where import Test.HUnit import BigE.ImageMap (ImageElement (..), VectorSpec (..), PixelRGB8 (..), elementAt, ...
psandahl/big-engine
test/ImageMapTests.hs
mit
2,524
0
14
714
1,016
508
508
63
2
-- | Module for operating on vectors and matrices. It includes some functions -- for using bra-ket notation. module DiracLists where import Data.Complex import Data.List (transpose) -- This can be used to hide the standard operators. -- import Prelude hiding ((+)) -- import qualified Prelude -- | Function 'ket' prov...
jmiszczak/hoqus
alternative/DiracLists.hs
mit
2,444
0
10
486
683
381
302
27
1
module Data.Hiper.Types ( Value(..) , Configurable (toValue, fromValue) ) where import Data.Hiper.Types.Internal
ivanjovanovic/hiper
src/Data/Hiper/Types.hs
mit
145
0
5
44
32
23
9
6
0
module Chapter_7_my_note where import Prelude hiding (Word, getLine) import Data.Char import Test.QuickCheck head' :: [a] -> a head' (x : _) = x tail' :: [a] -> [a] tail' (_ : xs) = xs null' :: [a] -> Bool null' [] = True null' (_ : _) = False digits :: String -> Stri...
tonyfloatersu/solution-haskell-craft-of-FP
Chapter_7_my_note.hs
mit
11,015
0
15
3,836
4,944
2,578
2,366
-1
-1
{-# LANGUAGE OverloadedStrings #-} import Dispatch () import Foundation import Web.Notebook.App import Web.YahooPortfolioManager.App import Yesod import Network.HTTP.Client.TLS (tlsManagerSettings) import Network.HTTP.Conduit (newManager) import Database.Persist.Sqlite (runMigration, createSqlitePool, runSqlPersis...
lhoghu/intranet
app/Main.hs
mit
750
0
9
118
154
86
68
17
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} module Main where import Web.Twitter.Conduit.Parameters import Web.Twitter.Conduit hiding (inReplyToStatusId) import Web.Twitter.Types.Lens import Control.Lens import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.Resource i...
shouya/parenbot
Main.hs
mit
3,316
0
13
802
992
512
480
85
4
{-# LANGUAGE Rank2Types #-} module Extra.Field.Optics ( setMay, viewMay, overMay, (^.?), (%~?), (.~?), by, useMay, ) where import Control.Applicative (Const (Const), getConst) import qualified Data.Map as M import Extra.Field.Optics.Internal import Control.Monad.State (MonadState, gets) --------------...
tempname11/field-optics
src/Extra/Field/Optics.hs
mit
1,350
0
13
314
540
293
247
33
2
module Main where import Parser import Processor import Printer import Data.ByteString hiding (unzip, map, concatMap, length, putStr, hPutStr, putStrLn, head) import System.Environment (getArgs) import System.IO (utf8, IOMode(..), Handle, openFile, hSetEncoding, hPutStr, withFile) getUtf8Handle :: FilePath -> IOMod...
lukaramu/ircparse
src/Main.hs
mit
1,367
0
13
299
450
229
221
36
2
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- | -- Module : Algebra.Graph.Export -- Copyright : (c) Andrey Mokhov 2016-2022 -- License : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability : experimental -- -- __A...
snowleopard/alga
src/Algebra/Graph/Export.hs
mit
6,815
0
11
1,489
1,004
567
437
49
1
import Control.Applicative import Test.QuickCheck import Squarify import Debug.Trace instance Arbitrary Rectangle where arbitrary = do x <- abs <$> arbitrary y <- abs <$> arbitrary w <- (\v -> 1 + abs v) <$> arbitrary h <- (\v -> 1 + abs v) <$> arbitrary return $ Rectangle x y w h rectArea (Rec...
specify/TreeMap
CheckSquarify.hs
gpl-2.0
1,874
0
15
468
881
471
410
53
1
{- Copyright (C) 2005 John Goerzen <jgoerzen@complete.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is di...
jgoerzen/media-index
Types.hs
gpl-2.0
930
0
8
222
38
25
13
5
0
answer :: Int answer = squareOfSum - sumOfSquare where squareOfSum = (sum [1..100]) ^ 2 sumOfSquare = sum . map (^2) $ [1..100]
rodgzilla/project-euler
problem_006/problem.hs
gpl-3.0
138
1
10
33
65
34
31
4
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Snap.Core (Snap, Method(GET), route, method, writeBS) import Snap.Http.Server (httpServe, defaultConfig, setPort) import Control.Monad.IO.Class (liftIO) import Data.ByteString.Char8 (pack) import Data.Char (toUpper) import Test.QuickCheck.Gen (generate) impor...
941design/bs-gen
src/Main.hs
gpl-3.0
890
0
9
148
251
141
110
21
1
module HEP.Automation.MadGraph.Dataset.Set20110717set2TEV where import HEP.Storage.WebDAV.Type import HEP.Automation.MadGraph.Model import HEP.Automation.MadGraph.Machine import HEP.Automation.MadGraph.UserCut import HEP.Automation.MadGraph.SetupType import HEP.Automation.MadGraph.Model.SChanC8V import HEP.Automati...
wavewave/madgraph-auto-dataset
src/HEP/Automation/MadGraph/Dataset/Set20110717set2TEV.hs
gpl-3.0
1,822
0
10
634
423
268
155
49
1
module Main where main :: IO() main = do let list = [x | x <- [1..2017], x `rem` 400 == 0 || (x `rem` 4 == 0 && x `rem` 100 /= 0)] print (list)
llscm0202/BIGDATA2017
ATIVIDADE1/exerciciosBasicos/ex8.hs
gpl-3.0
151
0
18
43
98
54
44
5
1
import Control.Applicative import Control.Concurrent import Control.Monad import Control.Monad.IfElse import Data.IORef import Debug.Trace import FRP.Yampa as Yampa import Text.Printf import Game import Display import Input import Graphics.UI.Extra.SDL -- TODO: Use MaybeT or ErrorT to report errors main :: IO () main...
keera-studios/pang-a-lambda
Experiments/collisions/Main.hs
gpl-3.0
1,431
0
15
428
357
191
166
34
4
{-# LANGUAGE OverloadedStrings #-} module CC.ShellCheck.ShellScript ( -- * Validation isShellScript , hasShellExtension , hasValidInterpretter -- * Retrieval , findShellScripts ) where import Control.Monad.Extra import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as C...
filib/codeclimate-shellcheck
src/CC/ShellCheck/ShellScript.hs
gpl-3.0
2,972
0
12
536
603
340
263
53
3
module Util(recurseMonad,maybeDefault,trim) where import Data.Text(strip,pack,unpack) --TODO is there a generic method to do this? reminds me of fold... is it related? recurseMonad :: (Monad b) => [a] -> (a -> b x) -> b () recurseMonad [] _ = return () recurseMonad (a : as) f = (f a) >> (recurseMonad as f) maybeDef...
redfish64/MpvLangLearn
Util.hs
gpl-3.0
468
0
10
91
201
107
94
10
1
module Util where import qualified Data.ByteString as BS chunk n = map (take n) . takeWhile (not.null) . iterate (drop n) zipEither :: (b -> c -> d) -> [Either a b] -> [c] -> [Either a d] zipEither f (Left x : xs) ys = Left x : zipEither f xs ys zipEither f (Right x : xs) (y:ys) = Right (f x y) : zipEither f xs ys...
maugier/cctk
src/CCTK/Util.hs
gpl-3.0
435
0
10
99
245
126
119
9
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-surveys/gen/Network/Google/Resource/Surveys/Surveys/Insert.hs
mpl-2.0
2,594
0
12
573
307
189
118
47
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-cognito-identity/gen/Network/AWS/CognitoIdentity/UpdateIdentityPool.hs
mpl-2.0
9,211
0
21
2,033
1,176
696
480
144
1
-- Chapter Exercises -- 1. data Constant a b = Constant b instance Foldable (Constant a) where foldr f i (Constant a) = f a i -- 2. data Two a b = Two a b instance Foldable (Two a) where foldr f i (Two _ b) = f b i -- 3. data Three a b c = Three a b c instance Foldable (Three a b) where foldr f i (Three _ _...
dmp1ce/Haskell-Programming-Exercises
Chapter 20/Chapter Exercises.hs
unlicense
1,033
0
9
251
399
210
189
17
2
{-# LANGUAGE BangPatterns, UnicodeSyntax #-} import Math.NumberTheory.Primes.Sieve import Math.NumberTheory.Primes.Testing import Data.Set (Set) import qualified Data.Set as Set p2 x = x*x p3 x = x*x*x p4 x = x*x*x*x main = do let limit = 50000000 -- Reduce infinite set of primes to initial subset let !re...
ulikoehler/ProjectEuler
Euler87.hs
apache-2.0
878
0
12
197
299
149
150
18
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} -- | module VK.App.AppSpec (main, spec) where import Control.Concurrent (threadDelay) import Control.Monad.IO.Class (liftIO) import Data.List ...
eryx67/vk-api-example
test/VK/App/AppSpec.hs
bsd-3-clause
2,348
0
15
560
655
330
325
56
1
{-# LANGUAGE ScopedTypeVariables, TypeSynonymInstances, FlexibleInstances #-} module Math.FormalFFT where import Control.Applicative ((<$>)) import Control.Arrow ((***)) import Control.Monad (join) import Data.Monoid ((<>)) import Data.SBV import Data.Tuple (swap) import Prelude hiding (length) import Test.QuickCheck...
davnils/formal-fft
src/Math/FormalFFT.hs
bsd-3-clause
3,496
0
15
828
1,731
922
809
85
2
module Utils.Exception where data Exception = IllformedLetPattern | VarNotInCtx | Nonlinearity | NonlocallyClosed | NonEmptyCtx | TypeErrorLetNotTop | TypeErrorLetNotTensor | IllformedPromote | TypeE...
heades/Agda-LLS
Source/ALL/Utils/Exception.hs
bsd-3-clause
503
0
5
214
52
34
18
15
0
{-# LANGUAGE CPP #-} import Control.Shell import Data.Bits import System.Info (os) import System.Environment (getArgs) import System.Exit inBuildDir :: [String] -> Shell a -> Shell a inBuildDir args act = do srcdir <- pwd isdir <- isDirectory "_build" when (isdir && not ("no-rebuild" `elem` args)) $ rmdir "_buil...
nyson/haste-compiler
build-release.hs
bsd-3-clause
5,957
1
19
1,607
1,516
754
762
127
3
{-| Module : Data.Number.MPFR.Mutable.Misc Description : Miscellaneous functions Copyright : (c) Aleš Bizjak License : BSD3 Maintainer : ales.bizjak0@gmail.com Stability : experimental Portability : non-portable For documentation on particular functions see <http://w...
ekmett/hmpfr
src/Data/Number/MPFR/Mutable/Misc.hs
bsd-3-clause
1,324
0
9
286
282
144
138
15
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ViewPatterns #-} -- | Build-specific types. module Stack.Types.B...
agrafix/stack
src/Stack/Types/Build.hs
bsd-3-clause
25,817
0
19
8,071
4,927
2,714
2,213
596
8
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.Version14 -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : por...
haskell-opengl/OpenGLRaw
src/Graphics/GL/Version14.hs
bsd-3-clause
28,339
0
5
4,291
4,961
3,074
1,887
1,168
0
module L5ToBinary.Compile where import qualified L5.AbsL as L5 import qualified L1Tox64.Compile as L1c import qualified L2ToL1.Compile as L2c import qualified L3ToL2.Compile as L3c import qualified L4ToL3.Compile as L4c import qualified L5ToL4.Compile as L5c translate :: L5.Program -> Either String String translate ...
mhuesch/scheme_compiler
src/L5ToBinary/Compile.hs
bsd-3-clause
412
0
10
56
104
65
39
9
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecursiveDo #-} import Control.Concurrent import Control.Concurrent.MVar import Control.Exception import Control.Monad import Control.Monad.IO.Class import Graphics.QML.Engine import Reflex import Reflex.QML.Internal import qualified Data.Text as T import qualified Refle...
bennofs/reflex-qml
examples/Games.hs
bsd-3-clause
1,167
0
14
204
360
185
175
35
1