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 Util.Handler ( urlDecode', title, titleConcat, addDomainToTitle, maybeApiUser, pageNo ) where import Import import Prelude (read) import Text.Blaze (toMarkup, Markup) urlDecode' :: Text -> Text urlDecode' x = decodeUtf8 $ urlDecode True $ encodeUtf8 x title :: Text -> Markup title text...
vinnymac/glot-www
Util/Handler.hs
mit
838
0
9
163
280
144
136
26
1
import Test.HUnit import Ex02 testString = TestList [ "Empty string" ~: [] ~=? (splitWith (/='b') "") , "No splitt" ~: ["aaa"] ~=? (splitWith (/='b') "aaa") , "Only delimiter" ~: [] ~=? (splitWith (/='b') "bbb") , "On start" ~: ["aaa"] ~=? (splitWith (/...
imrehg/rwhaskell
ch04/Ex02test.hs
mit
978
0
12
340
394
230
164
13
1
----------------------------------------------------------------------------- -- | -- Module : Numeric.Particle -- Copyright : (c) 2016 FP Complete Corporation -- License : MIT (see LICENSE) -- Maintainer : dominic@steinitz.org -- -- =The Theory -- -- The particle filter, `runPF`, in this library is app...
idontgetoutmuch/Kalman
src/Numeric/Particle.hs
mit
15,498
0
14
4,169
1,449
887
562
82
2
-- Draw fractal by escape time method module Escape where import Graphics.GD import Data.Complex import Draw type C = Complex Double -- maxTime -> -- maxRadius -> -- iteration function -> -- initial value -> -- time to escape escape :: Int -> Double -> (C -> C) -> C -> Int escape maxTime ...
delta4d/Fractal.hs
Escape.hs
mit
2,934
0
16
1,068
1,046
561
485
60
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveFunctor #-} {-# LA...
YLiLarry/db-model
src/DB/Model/Internal/Value.hs
mit
1,835
0
9
359
412
256
156
47
1
module Easy where import Control.Monad import Data.List import Data.Maybe import Text.Trifecta import Text.Trifecta.Delta data EasyParsed = EasyArray [Double] | EasyString String deriving (Show) test1 = "123" test2 = "44.234" test3 = "0x123N" test4 = "3.23e5" test5...
z0isch/reddit-dailyprogrammer
Challenge262/src/Easy.hs
mit
1,112
0
12
233
362
193
169
27
2
module Untyped.Core where import ClassyPrelude import Bound import Control.Monad.Writer hiding (fix) import Data.Deriving (deriveEq1, deriveOrd1, deriveRead1, deriveShow1) import Data.Maybe (fromJust) import qualified Data.Set as Set import Dashboard (pattern FastAtom) import Nock import SimpleNoun type Nat = Int ...
urbit/urbit
pkg/hs/proto/lib/Untyped/Core.hs
mit
6,350
0
21
2,117
3,191
1,562
1,629
-1
-1
module Parser (parse) where import qualified Data.Map as Map import Data.Maybe import Lex import Rules data ParseTree = Leaf String | Cmplx :^ [ParseTree] deriving (Eq, Ord) instance Show ParseTree where show (Leaf a) = show a show (c :^ trees) = show c ++ "^" ++ show trees type Cell = M...
agrasley/HaskellCCG
Parser.hs
mit
2,437
0
15
768
966
519
447
53
6
import System.IO import System.Directory (doesFileExist) import System.Console.ANSI import Control.Monad import Control.Monad.Trans import qualified Data.Map.Strict as M import Data.List (intercalate) import Language.HLisp.Expr import Language.HLisp.Parse import Language.HLisp.Eval import Language.HLisp.Prim import ...
rolph-recto/HLisp
src/HLisp.hs
mit
4,172
0
30
1,416
1,190
566
624
111
17
module Sequences.Special ( gs1, gs2, z, f ) where import Sequences.General gs1 :: Sequence Double gs1 = recSequence 1 (\n0 -> 1 / (1 + n0)) gs2 :: Sequence Double gs2 = recSequence (1 / (sqrt 2)) (\n0 -> 1 / (sqrt (2 + n0))) z :: Sequence Double z = expSequence (\n -> 1 / (fromInteger . fac $ n)) f...
DevWurm/numeric-sequences-haskell
src/Sequences/Special.hs
mit
1,127
0
14
400
349
186
163
24
1
-- GENERATED by C->Haskell Compiler, version 0.16.4 Crystal Seed, 24 Jan 2009 (Haskell) -- Edit the ORIGNAL .chs file instead! {-# LINE 1 "Input.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE TypeSynonymInstances #-} {-# context lib="hyd" #-} module Hyd.Input where import Foreign import Foreign.C....
Smilex/hyd_engine
bindings/haskell/Hyd/Input.hs
mit
1,647
11
17
265
424
233
191
-1
-1
module Main (main) where import GradientAscentDemo import UtilDemo main :: IO () main = runUtilDemos >> runGradientAscentDemos
rcook/mlutil
ch05-logistic-regression/src/Main.hs
mit
149
0
6
39
34
20
14
5
1
import Control.Applicative ((<$>)) import Control.Monad (unless) import Data.List (transpose) import qualified Data.Text as T import Debug.Trace (traceShowM) import System.Environment (getArgs) -- Picross solver implemented in Haskell -- Sell examples directory for examples of input type Hints = [Int] data Field = Un...
Eckankar/picross-solver
picross.hs
mit
4,731
0
15
1,623
1,511
781
730
85
2
{-# LANGUAGE OverloadedStrings #-} module App ( app ) where import Control.Monad.Except (runExceptT) import Control.Monad.Reader (asks, liftIO, ReaderT) import Data.ByteString.Char8 (pack) import Data.Time.Clock (getCurrentTime) import Database.Persist.Postgresql ((=.), entityKey, entityVal, get, getBy, insertBy,...
houli/distributed-file-system
directory-service/src/App.hs
mit
4,046
0
21
790
1,100
565
535
79
4
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalytics-application-inputschema.html module Stratosphere.ResourceProperties.KinesisAnalyticsApplicat...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/KinesisAnalyticsApplicationInputSchema.hs
mit
3,515
0
13
266
354
207
147
36
1
-- File: ch3/exB5.hs -- A function that determined if a given list is a palindrome. isPalindrome :: Eq a => [a] -> Bool isPalindrome [] = True isPalindrome [x] = True isPalindrome xs = (head xs == last xs) && (isPalindrome . init . tail $ xs)
friedbrice/RealWorldHaskell
ch3/exB5.hs
gpl-2.0
246
0
9
50
83
43
40
4
1
module T where import Tests.KesterelBasis -- Berry p130, parallel schizophrenia. sustainE' s = loopE (emitE s >>> (nothingE |||| pauseE)) e sustain = unitA >>> (signalE $ \s -> (sustain s) |||| pauseE) c = runE (e sustainE) c' = runE (e sustainE') prop_correct = property (\xs -> simulate c xs == simulat...
peteg/ADHOC
Tests/08_Kesterel/110_sustain_parallel_nothing_schizo.hs
gpl-2.0
472
0
11
89
174
90
84
13
1
module Parser (Parser, parseString, parseFile) where import Text.Parsec type Parser a = Parsec String () a parseString :: Parser a -> String -> a parseString p str = case parse p "" str of Left e -> error $ show e Right r -> r parseFile :: Parser a -> String -> IO a parseFile p f...
cryptica/slapnet
src/Parser.hs
gpl-3.0
486
0
11
164
182
88
94
15
2
-- | Feature extraction for results data. These features and their associated match outcomes can be used to -- train classifiers that attempt to predict results. module Anorak.FeatureExtractor (generateFeatures, MatchFeatures(..), Outcome, ...
dwdyer/anorak
src/haskell/Anorak/FeatureExtractor.hs
gpl-3.0
6,136
0
14
1,628
1,481
748
733
60
2
module Core.ClassFoo ( Foo(..) ) where class Foo a where foo :: a -> Char instance Foo Bool where foo True = 't' foo False = 'f'
adarqui/ToyBox
haskell/Core/src/Core/ClassFoo.hs
gpl-3.0
135
0
7
33
57
31
26
7
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} import Yesod data Links = Links mkYesod "Links" [parseRoutes| / HomeR GET /page1 Page1R GET /page2 Page2R GET |] instance Yesod Links getHomeR = defaultLayout [w...
prannayk/conj
Learning/Yesod/Links.hs
gpl-3.0
520
0
5
99
80
49
31
12
1
{-# LANGUAGE UndecidableInstances #-} module Syntax.Pretty where import Common import Pretty import Syntax.Types data SyntaxKind = SKText | SKOper | SKSep | SKLBracket | SKRBracket | SKColon deriving (Eq, Ord, Show) instance TokenKind SyntaxKind where space _ SKSep = False space SKLBracket _ = False space _...
ktvoelker/FLang
src/Syntax/Pretty.hs
gpl-3.0
5,587
0
14
1,559
2,449
1,147
1,302
-1
-1
{-| Description: Helpers for interacting with the graph database. Incomplete. This module is responsible for inserting values associated with the graphs into the database. These functions are just helpers for the main function in "Svg.Parser", though it is possible to put all of the data retrieval code in here as well...
Courseography/courseography
app/Svg/Database.hs
gpl-3.0
1,671
0
10
342
304
165
139
25
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/Create.hs
mpl-2.0
8,284
0
19
1,733
971
578
393
133
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DetachNetworkInterface.hs
mpl-2.0
3,962
0
9
837
469
284
185
57
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-searchconsole/gen/Network/Google/Resource/Webmasters/Sitemaps/Get.hs
mpl-2.0
4,913
0
19
1,206
786
458
328
114
1
module Parsing.ParseInline (inline) where import Data.Maybe import Network.URI (isURI) import Text.Parsec import qualified Data.Map.Strict as M import AST import Parsing.State import Parsing.Text import Parsing.TextUtils import Parsing.Utils import Parsing.ParseHtml nestedBold :: Parser Inline nestedBold = suppressE...
alexbecker/blogdown
src/Parsing/ParseInline.hs
agpl-3.0
3,281
0
17
765
958
479
479
-1
-1
module TopicExplorer.Creator.Corpus ( Keywords(Keywords), Corpus.getKeywords, Identifier(Identifier), Corpus.getIdentifier, SearchId, Corpus(..), toJSONObject, ) where import qualified TopicExplorer.Configuration.Corpus as Corpus import TopicExplorer.Configuration.Corpus (Keywords(Keywords),...
hinneburg/TopicExplorer
creator-server/creator/src-lib/TopicExplorer/Creator/Corpus.hs
agpl-3.0
1,349
0
12
261
414
245
169
43
1
{-# LANGUAGE TemplateHaskell, QuasiQuotes, RecordWildCards, OverloadedStrings, ScopedTypeVariables, DataKinds #-} module Model.AssetSegment ( module Model.AssetSegment.Types , lookupAssetSegment , lookupSlotAssetSegment , lookupAssetSlotSegment , lookupOrigSlotAssetSegment , lookupSlotSegmentThumb , audit...
databrary/databrary
src/Model/AssetSegment.hs
agpl-3.0
7,893
0
22
2,111
1,482
818
664
138
2
----------------------------------------------------------------------------- -- | -- Module : Translation -- Copyright : (c) Masahiro Sakai 2007-2009 -- License : BSD3-style (see LICENSE) -- -- Maintainer: masahiro.sakai@gmail.com -- Stability : experimental -- Portability : non-portable {-# LAN...
msakai/ptq
src/Translation.hs
lgpl-2.1
6,629
0
16
1,622
2,714
1,378
1,336
120
10
-- {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {- Copyright 2019 The CodeWorld Authors. 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 ...
alphalambda/codeworld
funblocks-client/src/Main.hs
apache-2.0
6,098
24
16
1,415
1,365
681
684
133
3
--primes = 2 : 3 : 5 : primes' -- where -- isPrime (p:ps) n = p*p > n || n `rem` p /= 0 && isPrime ps n -- primes' = 7 : filter (isPrime primes') (scanl (+) 11 $ cycle [2,4,2,4,6,2,6,4]) primes :: Integral a => [a] primes = map fromIntegral $ [2, 3] ++ primes' where primes' = [5] ++ f 1 7 primes' ...
a143753/AOJ
0009.hs
apache-2.0
655
0
15
217
286
152
134
12
1
{-# LANGUAGE DeriveDataTypeable #-} module Dimple2.Base ( Options(..) , Context(..) , Dimple2Error (..) , defaultOptions )where import Data.Typeable (Typeable) import Data.Data (Data) import Dimple2.MulticastGroup data Environment = Prod | Dev deriving (Show,Eq,Data,Typeable) data Options ...
jwilberding/dimple2-haskell
src/Dimple2/Base.hs
apache-2.0
1,458
0
9
624
287
177
110
36
1
module StoneTransfer.A292726 (a292726, a292726_list) where import Data.List (delete, nub, sort, null) import Data.Set (Set) import qualified Data.Set as Set import Data.IntMap.Strict (IntMap, toList, adjust, fromList) -- The best structure for this would probably be a Scala-like Map[Int, Int], -- which behaves like a h...
peterokagey/haskellOEIS
src/StoneTransfer/A292726.hs
apache-2.0
1,671
0
13
281
479
267
212
21
2
module STLCSyntax where type Name = String data Expr = Var Name | Lit Ground | App Expr Expr | Lam Name Type Expr deriving (Eq, Show) data Ground = LInt Int | LBool Bool deriving (Eq, Show) data Type = TInt | TBool | TArr Type Type deriving (Eq, Read, Show)
toonn/wyah
src/STLCSyntax.hs
bsd-2-clause
286
0
6
80
108
62
46
17
0
{-# LANGUAGE BangPatterns, OverloadedStrings, TypeOperators, TypeFamilies, FlexibleContexts, RecordWildCards #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Xournal.Simple -- Copyright : (c) 2011, 2012 Ian-Woo Kim -- -- License : BSD3 -...
wavewave/xournal-types
src/Data/Xournal/Simple.hs
bsd-2-clause
5,437
0
15
1,840
1,358
779
579
129
1
{- (c) The University of Glasgow 2006-2012 (c) The GRASP Project, Glasgow University, 1992-2002 -} {-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-} module TcSigs( TcSigInfo(..), TcIdSigInfo(..), TcIdSigInst, TcPatSynInfo(..), TcSigFun, isPartialSig, hasCompleteSig, tcIdSigName, ...
sdiehl/ghc
compiler/typecheck/TcSigs.hs
bsd-3-clause
32,518
0
21
9,855
5,026
2,594
2,432
361
24
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #...
MichielDerhaeg/stack
src/Stack/Types/Resolver.hs
bsd-3-clause
9,591
0
18
2,161
2,005
1,056
949
220
5
{-# LANGUAGE FlexibleContexts, TypeOperators, OverloadedStrings, GADTs, ScopedTypeVariables, RankNTypes, KindSignatures, MultiParamTypeClasses, FlexibleInstances, GeneralizedNewtypeDeriving #-} -- Experiment with the JsonRpc API import Prelude hiding ((.), id) import Control.Category import Data.Aeson import Contro...
ku-fpg/wakarusa
wakarusa-examples/json-rpc/JsonRpcServer.hs
bsd-3-clause
625
0
12
73
113
67
46
15
1
module Aws.Core.Protocol ( Protocol (..), defaultPort, Method (..), httpMethod, sig3XJsonMime, sig3JsonMime, sig4JsonMime, awsMimeBS ) where import qualified Data.ByteString.Char8 as B import qualified Network.HTTP.Types as HTTP newtype AwsMime = AwsMime B.ByteString -- | The default port to be us...
RayRacine/aws
Aws/Core/Protocol.hs
bsd-3-clause
1,768
0
7
388
276
166
110
39
1
{-# LANGUAGE PatternGuards #-} module Idris.Elab.Type (buildType, elabType, elabType', elabPostulate, elabExtern) where import Idris.AbsSyntax import Idris.ASTUtils import Idris.DSL import Idris.Error import Idris.Delaborate import Idris.Imports import Idris.Elab.Term import Idris.Coverage imp...
BartAdv/Idris-dev
src/Idris/Elab/Type.hs
bsd-3-clause
10,448
0
19
3,426
3,207
1,604
1,603
197
10
{-# LANGUAGE RecordWildCards , DeriveDataTypeable #-} {-| Primitives for the memcached protocol. -} module Network.Starling.Core ( Request , requestOp , Key , Value , set , add , replace , get , increment , decrement , append , prepend , delete , quit ...
silkapp/starling
Network/Starling/Core.hs
bsd-3-clause
12,769
0
14
3,665
3,268
1,729
1,539
-1
-1
{-# LANGUAGE CPP #-} module Bead.Persistence.Relations ( userAssignmentKeys , userAssignmentKeyList , submissionDesc , submissionListDesc , submissionDetailsDesc , groupDescription , isAdminedSubmission , canUserCommentOn , submissionTables , courseSubmissionTableInfo , userSubmissionDesc , us...
andorp/bead
src/Bead/Persistence/Relations.hs
bsd-3-clause
27,512
0
21
6,265
7,333
3,604
3,729
533
4
-- ghc -O2 -fspec-constr-recursive=10 -fmax-worker-args=16 -- Convert the input file to camel case and write to stdout import Data.Maybe (fromJust, isJust) import System.Environment (getArgs) import System.IO (Handle, IOMode(..), openFile, stdout) import qualified Streamly.Prelude as S import qualified Streamly.Inte...
harendra-kumar/asyncly
examples/CamelCase.hs
bsd-3-clause
915
0
12
240
303
165
138
24
4
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module System.Metrics.Prometheus.RegistryT where import Control.Applicative ((<$>)) import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Trans.Class (MonadTrans) import...
LukeHoersten/prometheus
src/System/Metrics/Prometheus/RegistryT.hs
bsd-3-clause
2,292
0
10
694
584
325
259
36
1
module Data.Typewriter.Data.Binary ( module Data.Typewriter.Data.Binary.Bit , module Data.Typewriter.Data.Binary.BitList ) where import Data.Typewriter.Data.Binary.Bit import Data.Typewriter.Data.Binary.BitList
isomorphism/typewriter
Data/Typewriter/Data/Binary.hs
bsd-3-clause
282
0
5
85
44
33
11
4
0
{-| Module: Data.Astro.Types Description: Common Types Copyright: Alexander Ignatyev, 2016 Common Types are usfull across all subsystems like Time and Coordinate. = Examples == /Decimal hours and Decimal degrees/ @ import Data.Astro.Types -- 10h 15m 19.7s dh :: DecimalHours dh = fromHMS 10 15 19.7 -- DH 10.2554722...
Alexander-Ignatyev/astro
src/Data/Astro/Types.hs
bsd-3-clause
5,167
0
12
1,146
1,784
932
852
117
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.License -- Copyright : Isaac Jones 2003-2005 -- Duncan Coutts 2008 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- The License datatype. For more information...
dcreager/cabal
Distribution/License.hs
bsd-3-clause
5,627
0
16
1,294
704
404
300
49
1
{-# LANGUAGE OverloadedStrings #-} import Test.Tasty import Test.Tasty.HUnit import IrcParser import Data.Attoparsec.Text testParse = parseOnly parseIrc main = defaultMain tests tests = testGroup "Tests" [parserTests] parserTests :: TestTree parserTests = testGroup "Parser tests" [ testCase "Command only" ...
UnrealQuester/irc-bot
tests/test.hs
bsd-3-clause
888
0
11
191
241
125
116
20
1
-- | Utilities for serving PDF from Yesod. -- Uses and depends on command line utility wkhtmltopdf to render PDF from HTML. module Yesod.Content.PDF ( -- * Conversion uri2PDF , html2PDF -- * Data type , PDF(..) , typePDF -- * Options , def , WkhtmltopdfOptions , wkCollate , wkCopies , wk...
alexkyllo/yesod-content-pdf
src/Yesod/Content/PDF.hs
bsd-3-clause
6,881
0
17
1,835
1,544
865
679
155
1
{-# LANGUAGE TemplateHaskellQuotes #-} {- Data/Singletons/TH/Promote/Defun.hs (c) Richard Eisenberg, Jan Stolarek 2014 rae@cs.brynmawr.edu This file creates defunctionalization symbols for types during promotion. -} module Data.Singletons.TH.Promote.Defun where import Language.Haskell.TH.Desugar import Language.Ha...
goldfirere/singletons
singletons-th/src/Data/Singletons/TH/Promote/Defun.hs
bsd-3-clause
35,976
0
24
9,464
3,337
1,758
1,579
-1
-1
module Network.Anarchy.Server (ServerState(..), runServer, block) where import Control.Concurrent import Control.Concurrent.Async import Control.Monad.IO.Class (liftIO) import Control.Monad.Maybe import Control.Monad.State import qualified Data.ByteString.Lazy.Char8 as LB import qualified Data.ByteString.Char8 as B im...
davidhinkes/anarchy
src/Network/Anarchy/Server.hs
bsd-3-clause
5,439
0
25
1,359
2,069
1,015
1,054
149
3
import Test.QuickCheck myLast :: [a] -> a myLast (x:[]) = x myLast (x:xs) = myLast xs prop_oneElem :: [Int] -> Int -> Bool prop_oneElem _ x = myLast (x:[]) == x prop_manyElems :: [Int] -> Int -> Bool prop_manyElems xs y = myLast (xs ++ [y]) == y main = do quickCheck prop_oneElem quickCheck prop_manyElems
SandeepTuniki/99-Haskell-Problems
src/problem1.hs
bsd-3-clause
319
0
9
68
155
80
75
11
1
{-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} #endif -- | -- Module : Data.ByteString.Base64.URL.Lazy -- Copyright : (c) 2012 Ian Lynagh -- -- License : BSD-style -- Maintainer : Emily Pillmore <emilypi@cohomolo.gy>, -- Herbert Valerio Riedel <hvr@gnu.org>, ...
bos/base64-bytestring
Data/ByteString/Base64/URL/Lazy.hs
bsd-3-clause
3,520
0
11
735
531
301
230
39
2
{-# LANGUAGE PackageImports #-} module Data.Type.Equality (module M) where import "base" Data.Type.Equality as M
silkapp/base-noprelude
src/Data/Type/Equality.hs
bsd-3-clause
118
0
4
18
23
17
6
3
0
{-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module QC.RGB (tests) where import Control.Monad (liftM3) import Data.Convertible import Data.Prizm.Color import Data.Prizm.Color.CIE as CIE import Test.Fra...
ixmatus/prizm
tests/QC/RGB.hs
bsd-3-clause
956
0
10
282
241
138
103
23
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns, CPP #-} {-# LANGUAGE NamedFieldPuns #-} module Network.Wai.Handler.Warp.HTTP2.Sender (frameSender) where #if __GLASGOW_HASKELL__ < 709 import Control.Applicative #endif import Control.Concurrent.MVar (putMVar) import Control.Concurrent.STM import qualified...
urbanslug/wai
warp/Network/Wai/Handler/Warp/HTTP2/Sender.hs
mit
17,978
0
19
4,878
4,113
2,047
2,066
291
17
import Data.Maybe (fromJust) import Data.List.Split (chunksOf) import Data.Char (ord, chr) import Data.Bits hiding (rotate) md :: a -> ([Char] -> [b]) -> ([Char] -> [Char]) -> (a -> b -> a) -> (a -> [Char]) -> ([Char] -> [Char]) md iv blockf padf f finalf = (\msg -> finalf $ foldl f iv (blockf $ padf msg)) compose ::...
CFFD/CRHF
crhf.hs
gpl-2.0
5,790
9
16
1,535
3,321
1,776
1,545
119
2
{-# language TemplateHaskell, DeriveDataTypeable, GeneralizedNewtypeDeriving #-} module Program.Cexp.Annotated where import Program.Cexp.Type hiding ( Symbol, Literal ) import qualified Program.Cexp.Type as T import Data.Map ( Map ) import qualified Data.Map as M import Autolib.FiniteMap import Control.Monad ( forM...
florianpilz/autotool
src/Program/Cexp/Annotated.hs
gpl-2.0
8,867
1
28
3,485
2,634
1,285
1,349
171
22
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GHCForeignImportPrim #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE UnliftedFFITypes #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE NegativeLiterals #-} ...
TomMD/ghc
libraries/integer-gmp/src/GHC/Integer/Type.hs
bsd-3-clause
73,220
14
19
17,697
21,072
10,595
10,477
-1
-1
{-# OPTIONS -fno-spec-constr-count #-} module Main where import QSortSeq import QSortPar import QSortVect import Control.Exception (evaluate ) import System.Console.GetOpt import Data.Array.Parallel.Unlifted import Data.Array.Parallel.Unlifted.Parallel import Data.Array.Parallel.Prelude (toUArrPA, fromUArrPA') ...
mainland/dph
icebox/examples/qsort/QSort.hs
bsd-3-clause
1,366
0
15
375
408
219
189
37
3
module Language.Haskell.Liquid.Interactive.Handler ( -- * Initial state for server initial -- * Command handler , handler ) where import Control.Concurrent.MVar import Language.Haskell.Liquid.Interactive.Types import Language.Haskell.Liquid.Liquid -----------------------------------------------------...
abakst/liquidhaskell
src/Language/Haskell/Liquid/Interactive/Handler.hs
bsd-3-clause
934
0
12
141
209
114
95
17
1
-------------------------------------------------------------------------- -- Copyright (c) 2007-2010, ETH Zurich. -- All rights reserved. -- -- This file is distributed under the terms in the attached LICENSE file. -- If you do not find this file, copies can be found by writing to: -- ETH Zurich D-INFK, Haldeneggsteig...
CoryXie/BarrelfishOS
hake/X86_64.hs
mit
5,617
4
17
2,212
788
448
340
100
1
module PCP.Solve where import Autolib.Schichten import Autolib.Util.Hide import Autolib.Util.Splits import Autolib.Hash import Autolib.Set import Autolib.ToDoc import Control.Monad import Data.Maybe import PCP.DFS import PCP.Type import PCP.Examples type Conf c = ( Maybe [c], Hide [Int] ) fsolve :: String -> I...
florianpilz/autotool
src/PCP/Solve.hs
gpl-2.0
1,352
10
13
428
584
316
268
47
1
module Uni.SS04.Serie4 where -- $Id$ import PCProblem.Quiz import PCProblem.Type import PCProblem.Param import SAT.Quiz import SAT.Types import SAT.Param ( p ) import Inter.Types generate :: [ IO Variant ] generate = [ return $ Variant $ make "PCP" "QUIZ" $ PCProblem.Quiz.quiz $ PCProblem.Param.P...
florianpilz/autotool
src/Uni/SS04/Serie4.hs
gpl-2.0
1,086
0
9
473
257
155
102
28
1
{-# LANGUAGE TupleSections, PatternGuards, CPP, OverloadedStrings #-} module Haste.CodeGen (generate) where -- Misc. stuff import Control.Applicative import Control.Monad import Data.Int import Data.Bits import Data.Word import Data.Char import Data.List (partition, foldl') import Data.Maybe (isJust) import qualified D...
beni55/haste-compiler
src/Haste/CodeGen.hs
bsd-3-clause
19,889
0
22
5,335
5,901
2,965
2,936
401
12
module C where import API import qualified A resource = let Test s = A.resource in Test { field = s }
abuiles/turbinado-blog
tmp/dependencies/hs-plugins-1.3.1/testsuite/load/thiemann2/C.hs
bsd-3-clause
104
0
9
24
41
23
18
4
1
f = \case 4 -> const 'x' 5 -> \case 'a' -> 'b' 'c' -> 'd' main = do print $ f 5 'a' print $ f 4 'y'
hvr/jhc
regress/tests/2_language/lambda-case.hs
mit
134
0
10
63
66
31
35
-1
-1
{-# LANGUAGE TemplateHaskell #-} module Fibonacci (plugin) where import Neovim import Fibonacci.Plugin (fibonacci) plugin :: Neovim (StartupConfig NeovimConfig) () NeovimPlugin plugin = wrapPlugin Plugin { exports = [ $(function' 'fibonacci) Sync ] , statefulExports = [] }
saep/nvim-hs-config-example
lib/Fibonacci.hs
mit
296
0
12
59
81
46
35
8
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="tr-TR"> <title>TreeTools</title> <maps> <homeID>treetools</homeID> <mapref location="ma...
kingthorin/zap-extensions
addOns/treetools/src/main/javahelp/help_tr_TR/helpset_tr_TR.hs
apache-2.0
960
77
66
155
404
205
199
-1
-1
-- A minimal server import Network.XmlRpc.Server add :: Int -> Int -> IO Int add x y = return (x + y) main = cgiXmlRpcServer [("examples.add", fun add)]
laurencer/confluence-sync
vendor/haxr/examples/simple_server.hs
bsd-3-clause
155
0
8
30
64
34
30
4
1
module Demote.C1 (module Demote.D1, module Demote.C1) where import Demote.D1 hiding (main, sq) sumSquares1 (x:xs) = sq x + sumSquares1 xs where sq x = x ^pow sumSquares1 [] = 0
SAdams601/HaRe
test/testdata/Demote/C1.hs
bsd-3-clause
188
0
7
41
83
46
37
5
1
module Distribution.Client.Dependency.Modular.IndexConversion ( convPIs -- * TODO: The following don't actually seem to be used anywhere? , convIPI , convSPI , convPI ) where import Data.List as L import Data.Map as M import Data.Maybe import Prelude hiding (pi) import qualified Distribution.Client.Pa...
gridaphobe/cabal
cabal-install/Distribution/Client/Dependency/Modular/IndexConversion.hs
bsd-3-clause
10,268
0
20
2,478
2,701
1,415
1,286
134
9
{-# LANGUAGE TypeFamilies #-} module T8034 where class C a where type F a foo :: F a -> F a
siddhanathan/ghc
testsuite/tests/typecheck/should_fail/T8034.hs
bsd-3-clause
97
0
8
26
33
18
15
5
0
{-# LANGUAGE GADTs, ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} module Control.Monad.Takahashi ( module Control.Monad.Takahashi.API , module Control.Monad.Takahashi.Slide , module Control.Monad.Takahashi.Monad , module Control.Monad.Takahashi.HtmlBuilder , module Control.Monad.Takahashi.Util )...
tokiwoousaka/takahashi
src/Control/Monad/Takahashi.hs
mit
564
0
5
57
97
70
27
15
0
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- | This executable generated .golden tests for importify. module Main where import Universum import Path (Abs, Dir, File, Path, fileExtension, fromAbsFile, (-<.>)) import ...
serokell/importify
test/GGenerator.hs
mit
1,949
0
12
472
483
243
240
43
4
{-| Module : Hi3Status.Blocks.Network License : MIT Maintainer : Josh Kirklin (jjvk2@cam.ac.uk) Stability : experimental -} module Hi3Status.Blocks.Network ( NetworkBlock (..) ) where import Hi3Status.Block import Hi3Status.Block.Util import qualified Data.Text as T import Data.Prefix.Units import C...
ScrambledEggsOnToast/hi3status
lib-src/Hi3Status/Blocks/Network.hs
mit
2,035
0
17
564
482
262
220
31
1
module FunctorLaws where -- The functor laws: -- 1) fmap id = id -- 2) fmap g . fmap h = fmap (g . h) -- A "computation counter" that adds up number of times `fmap` was -- applied. data Counter a = Counter Int a deriving (Show, Eq) instance Functor Counter where fmap f (Counter c x) = Counter (c + 1) (f x) -- ...
mjhoy/dotfiles
notes/2018_002_haskell_functor_derive_and_laws/FunctorLaws.hs
mit
946
0
8
215
136
84
52
9
0
{-# LANGUAGE CPP #-} module Data.Geometry.Geos.Raw.Topology ( envelope , intersection , convexHull , difference , symmetricDifference , boundary , union , unaryUnion , pointOnSurface , centroid , node , delaunayTriangulation , voronoiDiagram , polygonize , minimumRotatedRectangle , min...
ewestern/geos
src/Data/Geometry/Geos/Raw/Topology.hs
mit
6,364
0
17
1,269
1,414
713
701
95
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} module Cdo.Query where import Control.Lens import Control.Monad (join) import Control.Applicative -- import Control.Monad.Trans.Class (lift) import Data.ByteString (ByteString) -- import qualified Data.ByteString as BS i...
boothead/cdo
src/Cdo/Query.hs
mit
2,418
0
14
414
765
400
365
46
1
module Y2016.M06.D28.Exercise where import System.Environment {-- So, I was struggling both Sunday and Monday as to what would be this week's theme for the Haskell exercises, and there it was staring at me in the face the whole time. Work. So you would not believe the 'not invented here'-mentality that pervades B...
geophf/1HaskellADay
exercises/HAD/Y2016/M06/D28/Exercise.hs
mit
1,985
0
4
352
21
15
6
3
1
module Ch10 where import Data.List import Data.Char -- import qualified Data.Map as Map import Control.Monad solveRPN :: String -> Double solveRPN = head . foldl foldingFunction [] . words where foldingFunction (x:y:ys) "*" = (y*x):ys foldingFunction (x:y:ys) "+" = (y+x):ys foldingFunction (x:y:ys) "-" ...
sol2man2/Learn-You-A-Haskell-For-Great-Good
src/Ch10.hs
mit
587
0
10
114
276
146
130
15
8
import Raster sqsz = 16 main = writeFile "test02.xbm" $ exportXBM "test02" Nothing $ fnewRaster (\(y, x) -> toEnum $ (y `div` sqsz + x `div` sqsz) `mod` 2) (8 * sqsz, 8 * sqsz)
jwodder/hsgraphics
tests/xbmTest02.hs
mit
182
2
13
40
94
52
42
5
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Web.Intercom.Types ( appId, apiKey, Client, ping, defaultClient, withIntercom, userList, nextPage, name, email, customAttributes, users, next, User, blankUser, createOrUpdateUser...
bobjflong/intercom-haskell
src/Web/Intercom/Types.hs
mit
4,062
0
13
1,061
992
534
458
98
1
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2015 Smelkov Ilya -- License : MIT (see the file LICENSE) -- Maintainer : Smelkov Ilya <triplepointfive@gmail.com> -- Stability : experimental -- Portability : non-porta...
triplepointfive/sanre
src/Sanre/Draw.hs
mit
1,993
0
13
452
518
290
228
43
1
{-# LANGUAGE TemplateHaskell #-} module Galua.Debugger.EmbedDirectory where import Language.Haskell.TH import Language.Haskell.TH.Syntax import System.Directory import System.FilePath import Data.List import qualified Data.ByteString.Char8 as B8 embedDirectory :: (FilePath -> Bool) {- ^ predicate for inclusion appl...
GaloisInc/galua
galua-dbg/src/Galua/Debugger/EmbedDirectory.hs
mit
1,370
0
15
344
393
199
194
37
2
{-# LANGUAGE TupleSections #-} module Y2021.M03.D18.Solution where -- Remember that exercise where we built a map of keys and indices? import Y2021.M03.D11.Solution {-- Now, what we want to do is to have a ... okay, don't panic! ... 'mutable' map of keys and indicies. --} import Data.List (maximum) import Data.Ma...
geophf/1HaskellADay
exercises/HAD/Y2021/M03/D18/Solution.hs
mit
1,879
0
10
351
242
140
102
18
1
module Language.Combinators ( sCombinator , kCombinator , iCombinator , yCombinator ) where -- SKI Combinator Logic sCombinator :: (a -> b -> c) -> (a -> b) -> a -> c sCombinator f g x = f x (g x) kCombinator :: a -> b -> b kCombinator x y = y k1 :: a -> b -> b k1 x y = y iCombinator :: a -> a iCombinato...
owainlewis/lambda-calculus
src/Language/Combinators.hs
mit
549
0
9
153
279
150
129
19
1
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE InstanceSigs #-} module Cell ( bval0, nval0, sval0, rval0, err0, cfor, cfadd, Cell(..), CellFn(..), emptySheet, printCalcedSheet, nval, bval, sval, rval, eadd, emul, ...
b1g3ar5/Spreadsheet
Cell.hs
mit
8,320
0
16
2,150
3,547
1,825
1,722
130
2
-- | -- Module : $Header$ -- Description : Definition of an abstract expression language as the first IR for the Ohua compiler. -- Copyright : (c) Sebastian Ertel, Justus Adam 2017. All Rights Reserved. -- License : EPL-1.0 -- Maintainer : dev@justus.science, sebastian.ertel@gmail.com -- Stability : exper...
ohua-dev/ohua-core
core/src/Ohua/DFLang/Lang.hs
epl-1.0
2,417
2
11
483
460
263
197
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} -- | -- Module: $HEADER$ -- Description: Low level FFI. -- Copyright: -- License: GPL-2 -- -- Maintainer: Jan Sipr <jan.sipr@ixperta.com> -- Stability: experimental -- Portability: GHC specific lan...
IxpertaSolutions/hsua
src/Phone/Account.hs
gpl-2.0
4,336
0
13
928
995
553
442
107
3
{- | Module : Text.Highlighting.Kate.Styles Copyright : Copyright (C) 2011 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu> Stability : alpha Portability : portable Styles for rendering annotated source lines. -} module Text.Highlig...
sapek/highlighting-kate
Text/Highlighting/Kate/Styles.hs
gpl-2.0
6,792
0
11
1,388
1,842
1,127
715
122
1
{- | Module : FMP.Frames Copyright : (c) 2003-2010 Peter Simons (c) 2002-2003 Ferenc Wágner (c) 2002-2003 Meik Hellmund (c) 1998-2002 Ralf Hinze (c) 1998-2002 Joachim Korittky (c) 1998-2002 Marco Kuhlmann License...
peti/funcmp
FMP/Frames.hs
gpl-3.0
9,185
2
39
4,905
2,791
1,386
1,405
120
4
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-kinesis/gen/Network/AWS/Kinesis/CreateStream.hs
mpl-2.0
5,805
0
10
1,167
476
302
174
55
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- | -- Module : Network.Google.AppsLicensing -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozill...
brendanhay/gogol
gogol-apps-licensing/gen/Network/Google/AppsLicensing.hs
mpl-2.0
3,430
0
10
579
300
225
75
56
0
module HomeSpec ( spec ) where import TestImport import TestTools spec :: Spec spec = withApp $ describe "test homepage for unauthenticated user" $ do it "loads the index and checks it looks right" $ do get HomeR statusIs 200 htmlAllContain "h1" "Betty is a dia...
sajith/betty-web
test/HomeSpec.hs
agpl-3.0
1,642
0
16
596
216
97
119
25
1
{-# LANGUAGE TypeFamilies, DeriveDataTypeable #-} -- | SSH commands protocol. Uses ssh, scp commands -- to send commands and files. module THIS.Protocols.SSHCommands (SSHCommands (..) ) where import Control.Monad import Control.Monad.Trans import Control.Concurrent.STM import System.Process import System.Exit impo...
portnov/integration-server
THIS/Protocols/SSHCommands.hs
lgpl-3.0
2,639
4
15
629
875
427
448
67
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-| Module providing Bitcoin script evaluation. See <https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp> EvalScript and <https://en.bitcoin.it/wiki/Script> -} module Network.Haskoin.Script.Evaluator ( -- * Script evaluation verifySpen...
xenog/haskoin
src/Network/Haskoin/Script/Evaluator.hs
unlicense
29,207
0
17
8,286
7,862
4,049
3,813
577
20
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances #-} class TooMany a where tooMany :: a -> Bool instance TooMany Int where tooMany n = n > 42 newtype Goats = Goats Int deriving (Eq, Show, TooMany) instance TooMany (Int, String) where tooMany (i, s) = i > 42 instance TooMany (I...
aniketd/learn.haskell
haskellbook/adt.hs
unlicense
512
0
7
118
212
118
94
14
0
import Control.Monad import Control.Monad.Primitive import Control.Monad.Loops import Control.Monad.Trans import Data.ByteString (ByteString) import Database.Redis import System.Random.MWC import qualified Data.ByteString as ByteString import qualified Data.ByteString.Char8 as Char8 numberOfURL = 2 * 1000 *...
aloiscochard/redigo
redigo-testkit/Main.hs
apache-2.0
1,414
0
17
357
481
244
237
38
1