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
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TupleSections #-} module Language.JsonGrammar.Serializer (serializeValue) where import Language.JsonGrammar.Grammar import Language.JsonGrammar.Util import Control.Applicative ((<$>), (<|>)) import Control.Monad ((>=>)) import...
MedeaMelana/JsonGrammar2
src/Language/JsonGrammar/Serializer.hs
bsd-3-clause
2,152
0
15
530
809
418
391
53
11
{-#LANGUAGE GADTs #-} module Calc where data Expr a where I :: Int -> Expr Int B :: Bool -> Expr Bool Add :: Expr Int -> Expr Int -> Expr Int Mul :: Expr Int -> Expr Int -> Expr Int Eq :: (Eq a) => Expr a -> Expr a -> Expr Bool eval :: Expr a -> a eval (I n) = n eval (B b) = b eval (Add e1 e2) = eval ...
aztecrex/haskell-experiments-gadt
src/Calc.hs
bsd-3-clause
537
0
9
166
336
171
165
18
1
{-| Module : Idris.Reflection Description : Code related to Idris's reflection system. This module contains quoters and unquoters along with some supporting datatypes. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE CPP, PatternGuards #-} {-# OPTIONS_GHC -fwarn-incomplete-patte...
ben-schulz/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
55,395
0
18
17,242
20,700
10,068
10,632
1,053
11
module TypedPerl.PerlAST ( PerlASTMapper (..) , foldAST , nopMapper ) where import TypedPerl.Types import qualified Data.Map as M import Prelude hiding (seq); data PerlASTMapper a b c = PerlASTMapper { declare :: PerlVars -> a -> a , int :: Integer -> a , str :: String -> a , var :: PerlVars -> a , i...
hiratara/TypedPerl
src/TypedPerl/PerlAST.hs
bsd-3-clause
2,354
0
11
615
996
536
460
64
1
{-# LANGUAGE CPP , GADTs , DataKinds , PolyKinds , ExistentialQuantification , StandaloneDeriving , TypeFamilies , TypeOperators , OverloadedStrings , DeriveDataTypeable , ScopedTypeVariables , RankN...
zachsully/hakaru
haskell/Language/Hakaru/Parser/AST.hs
bsd-3-clause
21,439
3
17
9,221
8,272
4,227
4,045
466
4
-- 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. ------------------...
rfranek/duckling
Duckling/Ranking/Classifiers/GA.hs
bsd-3-clause
8,101
0
15
3,588
1,717
1,069
648
141
1
module Text.Luthor.Classifier ( Classifier(..) , classifier , classify , classes , classSet , classMap -- * Classifier internals , Run , runChar , runClass , packRun ) where import qualified Data.Set as Set import Data.Set (Set) import qualified Data.IntSet as IntSet im...
ekmett/luthor
Text/Luthor/Classifier.hs
bsd-3-clause
5,570
5
13
1,549
1,368
746
622
-1
-1
{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, GeneralizedNewtypeDeriving #-} -- | Functions for starting QML engines, displaying content in a window. module Graphics.QML.Engine ( -- * Engines EngineConfig( EngineConfig, initialDocument, contextObject, importPaths, pluginPaths...
marcinmrotek/hsqml-fork
src/Graphics/QML/Engine.hs
bsd-3-clause
11,230
0
19
2,385
2,126
1,124
1,002
204
4
module Skell.Core where import Control.Lens import Control.Monad.State import qualified Data.Sequence as S import Pipes import Skell.Buffer import Skell.Types coreModel :: PSkell coreModel = do iSk <- await st <- lift $ get yield $ OSkell (case S.viewl (...
EleDiaz/Skell
src/Skell/Core.hs
bsd-3-clause
1,585
0
14
616
221
125
96
20
2
-- 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. import Prelude im...
rfranek/duckling
exe/RegenMain.hs
bsd-3-clause
393
0
6
67
31
20
11
4
1
{-# LANGUAGE CPP #-} module Main where import Distribution.Client.DistDirLayout import Distribution.Client.ProjectConfig import Distribution.Client.Config (defaultCabalDir) import Distribution.Client.ProjectPlanning import Distribution.Client.ProjectBuilding import qualified Distribution.Client.InstallPlan as InstallP...
Heather/cabal
cabal-install/tests/IntegrationTests2.hs
bsd-3-clause
10,650
0
15
2,666
2,137
1,081
1,056
224
5
{-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UnicodeSyntax #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-missing-import-lists #-} {-| Module : Reflex.Dom.HTML5...
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Component/Tree/LevelNCombNS.hs
bsd-3-clause
18,523
0
27
5,607
3,785
1,971
1,814
281
4
module Types where import Jetpack data HLSProxy = HLSProxy { url :: String , ready :: Bool } deriving (Show) data TwitchStream = TwitchStream { tsId :: Int , channel :: String , quality :: String , proxy :: Maybe HLSProxy } deriving (Show) u = undefined instance ToJSON HLSProxy where toJSON HLSP...
rvion/ride
twitch-cast/src/Types.hs
bsd-3-clause
1,850
0
13
395
473
260
213
-1
-1
{-# LANGUAGE OverloadedStrings #-} module State.User where import Control.Monad (void, forM) import Control.Applicative import Snap.Snaplet.PostgresqlSimple import Data.ByteString (ByteString) import Data.Text (Text) import Data.Maybe import Application import State.Site import Helpers.State data SiteUser = SiteUse...
dbp/positionsites
src/State/User.hs
bsd-3-clause
2,428
0
12
509
634
329
305
42
1
module Main where import Lib main :: IO () main = start
dinosaur-lin/haskell-game2048
app/Main.hs
bsd-3-clause
58
0
6
14
22
13
9
4
1
{-# LANGUAGE OverloadedStrings #-} import System.Environment import Data.Attoparsec.ByteString.Char8 (parseOnly) import qualified Data.ByteString as B import qualified Data.Vector as V import VM.Core import VM.Parser main = do [filename] <- getArgs file <- B.readFile filename case parseOnly parseFile fil...
gabrielPeart/VM.hs
src/Main.hs
mit
586
0
15
140
170
89
81
16
2
-- -- -- ----------------- -- Exercise 8.18. ----------------- -- -- -- module E'8'18 where -- Note: Chapter 7> cabal install import E'7'12 ( ins ) import E'8'11 ( isInteger ) import GHC.Base ( map ) import Data.List ( intercalate ) sortIntegers :: IO () sortIntegers = do putStr "\nType in integers to s...
pascal-knodel/haskell-craft
_/links/E'8'18.hs
mit
1,464
0
17
416
248
138
110
21
3
{-# LANGUAGE TemplateHaskell, UnicodeSyntax #-} {-# OPTIONS_GHC -Wno-unused-imports -Wno-type-defaults #-} module FlexTest where import Control.Lens import Control.Lens.TH import Data.List import Linear hiding (basis, trace) import Prelude.U...
deepfire/mood
tests/FlexTest.hs
agpl-3.0
63,263
0
44
21,399
24,150
11,720
12,430
-1
-1
module GreetIfCool1 where greetIfCool :: String -> IO() greetIfCool coolness = putStrLn coolness mytup = (1 :: Integer, "blah") awesome = ["Papuchon", "curry", ":)"] alsoAwesome = ["Quake", "The Simons"] allAwesome = [awesome, alsoAwesome] isPalindrome :: (Eq a) => [a] -> Bool isPalindrome x = x == reverse x ...
punitrathore/haskell-first-principles
src/greetIfCool1.hs
bsd-3-clause
533
0
8
128
272
155
117
20
2
{-# LANGUAGE RecordWildCards #-} module Network.MQTT.ClientSpec (spec) where import Control.Concurrent ( threadDelay ) import Control.Concurrent.MVar ( newEmptyMVar, putMVar, takeMVar, isEmptyMVar ) import qualified Data.ByteString as BS import Data.Maybe ( isJust, fromJust ) import quali...
rasendubi/mqtt-broker
test/Network/MQTT/ClientSpec.hs
bsd-3-clause
20,754
0
19
5,597
3,560
1,726
1,834
281
1
import Testsuite import Data.Array.Parallel.Unlifted $(testcases [ "" <@ [t| ( (), Char, Bool, Int ) |] , "acc" <@ [t| ( (), Int ) |] , "num" <@ [t| ( Int ) |] , "ord" <@ [t| ( (), Char, Bool, Int ) |] , "enum" <@ [t| ( ...
mainland/dph
dph-test/old/Unlifted_Subarrays.hs
bsd-3-clause
1,331
0
9
453
82
56
26
-1
-1
module Sound.Tidal.Cycle where import Control.Monad import Control.Monad.State import Control.Monad.Reader import Control.Concurrent.MVar import Data.Array.IArray import Graphics.UI.SDL import Graphics.UI.SDL.Image import qualified Graphics.UI.SDL.Framerate as FR import qualified Graphics.UI.SDL.Primitives as SDLP im...
d0kt0r0/Tidal
vis/Sound/Tidal/Cycle.hs
gpl-3.0
10,084
0
20
3,068
3,822
2,046
1,776
203
3
{-# LANGUAGE GADTs #-} module Data.TConsList where import Data.Interface.TSequence data TConsList c x y where CNil :: TConsList c x x Cons :: c x y -> TConsList c y z -> TConsList c x z instance TSequence TConsList where tempty = CNil tsingleton c = Cons c CNil (<|) = Cons tviewl CNil = TEmptyL tviewl...
JohnLato/transducers
src/Data/TConsList.hs
bsd-3-clause
341
0
8
82
125
68
57
12
0
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[Foreign]{Foreign calls} -} {-# LANGUAGE DeriveDataTypeable #-} module ForeignCall ( ForeignCall(..), isSafeForeignCall, Safety(..), playSafe, playInterruptible, CExportSpec(..), CLabelString, isCLabelString, pprCLabelStrin...
vikraman/ghc
compiler/prelude/ForeignCall.hs
bsd-3-clause
11,947
0
15
4,174
2,132
1,069
1,063
206
1
{-# LANGUAGE QuasiQuotes, OverloadedStrings, ExtendedDefaultRules, CPP #-} -- Keep all the language pragmas here so it can be compiled separately. module Main where import Prelude import qualified Data.Text as T import GHC hiding (Qualified) import GHC.Paths import Data.IORef im...
artuuge/IHaskell
Hspec.hs
mit
22,744
0
22
7,066
5,323
2,744
2,579
436
7
import Data.List import Data.Word import Data.Int fib1 n = snd . foldl fib' (1, 0) . map toEnum $ unfoldl divs n where unfoldl f x = case f x of Nothing -> [] Just (u, v) -> unfoldl f v ++ [u] divs 0 = Nothing divs k = Just (uncurry (flip (,)) (k `divMo...
hvr/jhc
regress/tests/7_large/fastest_fib.hs
mit
821
6
10
290
442
227
215
25
3
{-# LANGUAGE RankNTypes #-} {-# OPTIONS_GHC -fdefer-type-errors #-} module Main where type A a = forall b. a doA :: A a -> [a] doA = undefined f :: A a -> a f = doA main = do { print "Hello 1" ; f `seq` print "Hello 2" -- The casts are pushed inside the lambda -- for f, so thi...
green-haskell/ghc
testsuite/tests/typecheck/should_run/T7861.hs
bsd-3-clause
454
0
10
160
106
61
45
11
1
module ListSort () where {-@ LIQUID "--no-termination" @-} import Language.Haskell.Liquid.Prelude {-@ type OList a = [a]<{\x v -> v >= x}> @-} {-@ app :: forall <p :: a -> Prop, q :: a -> Prop, r :: a -> Prop>. {x::a<p> |- a<q> <: {v:a| x <= v}} {a<p> <: a<r>} {a<q> <: a<r>} Ord ...
mightymoose/liquidhaskell
tests/neg/ConstraintsAppend.hs
bsd-3-clause
1,188
0
12
332
438
235
203
17
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} module Main where import Data.FileEmbed import Unlisted main :: IO () main = do putStrLn ("main " ++ show foo ++ " " ++ show embedded) if embedded == "FAIL\n" then error "embedded contains FAIL" else return () embedded = $(e...
akhileshs/stack
test/integration/tests/32-unlisted-module/files/src/Main.hs
bsd-3-clause
342
0
12
78
91
47
44
12
2
-- !!! buggy deriving with function type, reported by Sigbjorn Finne module ShouldFail where data Foo = Foo (Int -> Int) deriving Eq
urbanslug/ghc
testsuite/tests/deriving/should_fail/drvfail007.hs
bsd-3-clause
134
0
8
24
24
15
9
2
0
module Employee where import Data.Tree -- Employee names are represented by Strings. type Name = String -- The amount of fun an employee would have at the party, represented -- by an Integer type Fun = Integer -- An Employee consists of a name and a fun score. data Employee = Emp { empName :: Name, empFu...
vaibhav276/haskell_cs194_assignments
io/Employee.hs
mit
1,296
0
13
400
426
227
199
30
1
-- | -- An API for the implementation of interpreters. -- Should only be used by the libraries, which implement the interpreters. module XMLQuery.AST where import XMLQuery.Prelude hiding (Text) import qualified XMLQuery.Prelude as Prelude data Text a = Text (Prelude.Text -> Either Prelude.Text a) deriving instanc...
sannsyn/xml-query
library/XMLQuery/AST.hs
mit
769
0
10
153
218
122
96
-1
-1
-- file ch02/Take.hs -- `->` is right-associative! take :: Int -> ([a] -> [a])
supermitch/learn-haskell
real-world-haskell/ch02/Take.hs
mit
79
0
8
14
25
15
10
1
0
module FileFormat.INES (readINESFile) where import Data.Array.Unboxed import Data.Bits import Data.Char import Data.ByteString (ByteString) import qualified Data.ByteString as BS import Data.Word import Prelude hiding (Maybe(..)) import Motherboard.NES import Data.Strict.Maybe data INESHeader = INESHeaderVers...
IreneKnapp/legal-emulator
BackEnd/FileFormat/INES.hs
mit
7,809
0
18
3,241
1,470
797
673
161
11
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Poker.Classify where import Control.Applicative import Control.Monad import Control.Monad.Identity import Control.Monad.Reader import Data.Function (on) import qual...
AndrewRademacher/poker
src/Poker/Classify.hs
mit
5,434
0
16
1,873
1,871
1,002
869
99
5
{- Arch.hs: Architecture-specific information needed for stub generation. Part of Flounder: a message passing IDL for Barrelfish 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 fo...
utsav2601/cmpe295A
tools/flounder/Arch.hs
mit
1,997
0
9
530
360
230
130
47
2
{-# LANGUAGE ScopedTypeVariables #-} module Scratch where -- base import Control.Concurrent (forkIO, killThread, threadDelay) import Control.Monad (void, when) import Data.Int (Int64) -- import GHC.Generics () -- import Data.Proxy (Proxy(Proxy)) -- assert import Control.Exception.Assert (assert) -- async -- import ...
tdox/aircraft-service
src/Scratch.hs
mit
3,989
0
14
1,140
726
391
335
64
2
module Fass.Parser.Value where import Fass.Parser.Color import Fass.Parser.Helper import Control.Applicative hiding ((<|>)) import Text.Parsec import Text.Parsec.String data Units = Pixel | Em | Ex | Vh data ValueTerm = Color RGBA | Size Float String d...
darthdeus/fass
src/Fass/Parser/Value.hs
mit
784
0
10
202
204
112
92
22
1
-- | -- Module: Math.NumberTheory.CurvesTests -- Copyright: (c) 2017 Andrew Lelechenko -- Licence: MIT -- Maintainer: Andrew Lelechenko <andrew.lelechenko@gmail.com> -- Stability: Provisional -- -- Tests for Math.NumberTheory.Curves -- {-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase ...
cfredric/arithmoi
test-suite/Math/NumberTheory/CurvesTests.hs
mit
3,944
0
23
886
1,379
690
689
66
2
module Main where import Prelude import qualified Hasql.Connection import qualified Hasql.Statement import qualified Hasql.Encoders import qualified Hasql.Decoders import qualified Hasql.Session import qualified Main.Statements as Statements main = acquire >>= use where acquire = (,) <$> acquire <*> ac...
nikita-volkov/hasql
threads-test/Main.hs
mit
1,383
0
15
416
339
169
170
38
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Applicative import Control.Lens import Control.Monad import qualified Data.ByteString.Char8 as C import Data.IORef import Data.Monoid ((<>)) import System.Exit import Sys...
jhedev/hs-mesos
test/TestFramework.hs
mit
2,781
0
20
721
769
396
373
63
2
{-# LANGUAGE TemplateHaskell #-} import qualified Graphics.Svg as SVG import Options.Applicative import Paths_juicy_gcode (version) import Data.Version (showVersion) import Development.GitRev (gitHash) import Data.Text (Text, pack, unpack, replace) import qualified Data.Configurator as C import Data.Monoid import ...
domoszlai/juicy-gcode
src/Main.hs
mit
3,142
17
13
912
868
435
433
77
2
{-# OPTIONS_GHC -Wall #-} module LogAnalysis where import Log parseMessage :: String -> LogMessage parseMessage = parseMessage' . words parseMessage' :: [String] -> LogMessage parseMessage' pieces | (=='I') label = LogMessage Info timestampOrError (unwords rest) | (=='W') label = LogMessage Warning timesta...
GrooveStomp/yorgey-haskell-course
week-02/exercise-05.hs
mit
1,948
0
10
370
760
387
373
44
1
module TwinkleStar where import Haskore import AutoComp -- note updaters for mappings fd d n = n d v vol n = n v v = [Volume(80)] lmap f l = line (map f l) v1a = lmap (fd qn) [c 4, c 4, g 4, g 4, a 4, a 4] v1b = lmap vol [g 4 hn] v2a = lmap (fd qn) [f 4, f 4, e 4, e 4, d 4,d 4] v2b = lmap v...
Zolomon/edan40-functional-music
twinkle.hs
mit
1,417
0
14
299
857
481
376
22
1
----------------------------------------------------------------------------- -- -- Module : SamplingOptions -- Copyright : -- License : GPL v3 -- -- Maintainer : Tobias Fuchs -- Stability : unstable -- Portability : Win32, POSIX -- -- | -- ------------------------------------------------------------...
fuchsto/drool
src/Drool/UI/SignalBufferOptions.hs
mit
3,412
0
16
461
712
350
362
50
1
{-# OPTIONS -w -O0 #-} {- | Module : RDF/ATC_RDF.der.hs Description : generated Typeable, ShATermConvertible instances Copyright : (c) DFKI Bremen 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable(overlapping Ty...
nevrenato/Hets_Fork
RDF/ATC_RDF.der.hs
gpl-2.0
6,922
0
5
835
221
173
48
23
0
import Data.Bits import Data.List import Data.Char nimSum :: [Integer] -> Integer nimSum = foldl' xor 0 hasMove :: [Integer] -> Bool hasMove = not . all (== 0) isValidMove :: [Integer] -> (Integer, Integer) -> Bool isValidMove xs (i, a) = i >= 0 && i < genericLength xs && a > 0 && a <= genericIndex xs i move :: [In...
3of8/haskell_playground
nim/Nim.hs
gpl-2.0
2,154
1
16
540
948
481
467
54
2
{-# LANGUAGE DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances #-} module Algebraic.Relation where import Algebraic.Relation.Restriction import PL.Struktur ( Predicate (..) ) import Algebraic2.Class import Algebraic2.Instance as AI import Condition import qualified Autolib.Relation as R import qualified A...
Erdwolf/autotool-bonn
src/Algebraic/Relation.hs
gpl-2.0
4,193
82
17
1,154
1,150
653
497
100
1
{-# LANGUAGE DeriveDataTypeable #-} ------------------------------------------------------------------------------- -- Module : Util.CmdOpts -- Desc : Utilities for the command line options -- Copyright : (c) 2016 Marcelo Sousa ------------------------------------------------------------------------------- ...
marcelosousa/poet
src/Util/CmdOpts.hs
gpl-2.0
4,532
0
10
1,141
764
442
322
100
1
<?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 1.0//EN" "http://java.sun.com/products/javahelp/helpset_1_0.dtd"> <helpset version="1.0"> <!-- title --> <title>jtreg - Command Line Help</title> <!-- maps --> <maps> ...
otmarjr/jtreg-fork
src/share/doc/javatest/regtest/usage/usage.hs
gpl-2.0
556
42
28
96
208
107
101
-1
-1
-- -- This file aims to provide (the essential subset of) the same functionality -- that vim plugins ctrlp and command-t provide. -- -- Setup: -- -- Add something like this to your config: -- -- (ctrlCh 'p' ?>>! fuzzyFile) -- module FuzzyFile ( fuzzyFile ) where import Control.Monad import Control...
ethercrow/yi-config
modules/FuzzyFile.hs
gpl-2.0
3,452
0
16
1,096
831
464
367
81
3
module Hkl.Types ( Beamline(..) , Mode(..) , Engine(..) , Factory(..) , Geometry(..) , Lattice(..) , Sample(..) , Source(..) , Trajectory -- factory ...
picca/hkl
contrib/haskell/src/Hkl/Types.hs
gpl-3.0
3,210
0
9
1,086
723
429
294
96
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedLists #-} module Math ( VecN ,Vec2(..) ,vLengthSq ,vLength ,normalize ,uncheckedNormalize ,vMap, vZip, vFold ,dot , (*|), (|*) , (|+|), (|-|), (-|) , toTuple , rotateToUnit , degToRad, radToDeg , angleBetween )...
Marthog/ld35
src/Math.hs
gpl-3.0
2,064
1
10
545
903
498
405
79
2
module Language where import Control.Applicative import Control.Monad (liftM, ap) import Data.Char (isAlpha, isDigit, isLetter, isSpace) data Expr a = EVar Name | ENum Int | EConstr Int Int | EAp (Expr a) (Expr a) | ELet IsRec [(a,Expr a)] (Expr a) | ECase (Expr a) ...
bixuanzju/SCore
src/Language.hs
gpl-3.0
11,113
0
16
2,933
4,834
2,521
2,313
380
3
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Util.Snap where import Control.Error import Data.Monoid import qualified Data.ByteString.Char8 as BS import qualified Data.Text as T import qualified Data.Text.Encoding as T import Snap.Core requireParam :: MonadSnap m => BS.ByteString -> m...
imalsogreg/reffit
src/Util/Snap.hs
gpl-3.0
1,980
0
16
579
494
251
243
49
2
module Middleware.Gloss.Environment where import Graphics.Gloss.Interface.IO.Game runEnvironment:: Int -> game -> (game -> IO Picture) -> (Event -> game -> IO game) -> (Float -> game -> IO game) -> IO () runEnvironment = playIO (InWindow "GameNumber on gloss" (800, 550) (10, 10)) black
EPashkin/gamenumber-gloss
src/Middleware/Gloss/Environment.hs
gpl-3.0
293
0
13
49
115
63
52
5
1
{-| Module : Main Description : The entry point of the voogie executable. Copyright : (c) Evgenii Kotelnikov, 2019 License : GPL-3 Maintainer : evgeny.kotelnikov@gmail.com Stability : provisional -} module Main ( main ) where import Data.Text (Text) import qualified Data.Text.IO as TIO import O...
aztek/voogie
src/Voogie/Executable/Main.hs
gpl-3.0
2,174
0
12
379
591
310
281
51
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-| Module : Main Description : The Main module of the tool The Main module of the fuzzy matching tool. -} module Main where import Fuzzball.Algorithm import UI.NCurses import System.Posix.IO import Control.Applicative (Applicative, (<$>)) import Control.Monad import...
froozen/fuzzball
src/Main.hs
gpl-3.0
6,288
0
21
1,769
1,844
919
925
138
7
{-# LANGUAGE GADTs , MultiParamTypeClasses , TemplateHaskell , ViewPatterns #-} module Satter.Types ( -- * Geometry simulationScale , Geometrics (..) , position , direction , velocity , geometricsDefault , playersAt , random...
shnarazk/satter
Satter/Types.hs
gpl-3.0
16,112
4
16
4,573
4,945
2,715
2,230
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/Entitlements/List.hs
mpl-2.0
5,182
0
20
1,289
785
456
329
118
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-blogger/gen/Network/Google/Resource/Blogger/PageViews/Get.hs
mpl-2.0
4,645
0
18
1,152
795
461
334
114
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/Users/Photos/Update.hs
mpl-2.0
3,205
0
16
771
395
237
158
64
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-webmaster-tools/gen/Network/Google/Resource/Webmasters/URLCrawlErrorscounts/Query.hs
mpl-2.0
4,967
0
17
1,160
552
327
225
90
1
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, ConstraintKinds, TypeSynonymInstances, LiberalTypeSynonyms #-}module Has ( Has(..) , MonadHas , peek , peeks , focusIO ) where import Control.Monad.IO.Class (MonadIO(..)) import Control.Monad.Reader (MonadReader, ReaderT(..), reader) class Has a c w...
databrary/databrary
src/Has.hs
agpl-3.0
933
0
9
196
341
189
152
27
1
{-# LANGUAGE DeriveGeneric #-} module Papstehrenwort.Types where import Protolude import Data.Time.Calendar (Day) import qualified Network.URL as U import Data.Aeson (ToJSON(..), FromJSON(..)) -- | We wrap the @U.URL@ type because it works with Text -- and does not provide aeson instances newtype URL = URL U.URL d...
openlab-aux/papstehrenwort
src/Papstehrenwort/Types.hs
agpl-3.0
929
0
9
189
272
157
115
26
1
module Test(test1, test2, test3, repeatedTest) where import System.Random import Test.HUnit import Data.List data ErrorInfo = ErrorInfo [String] String -- Operand strings and error string addOperand :: (Show a) => a -> ErrorInfo -> ErrorInfo addOperand a (ErrorInfo ops err) = ErrorInfo ((show a):ops) err instance S...
yjwen/hada
test/Test.hs
lgpl-3.0
2,590
0
18
908
1,113
557
556
43
2
{-# LANGUAGE TupleSections #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TemplateHaskell #-} -- |Contains the 'Successor' type which is used to -- construct crawl trees, together with a set of useful -- helper functions for creating 'Successor'...
jtapolczai/Hephaestos
Crawling/Hephaestos/Fetch/Successor.hs
apache-2.0
11,838
0
12
3,034
3,400
1,805
1,595
210
1
-- * Lack of extensibility in the data type view module ExtI where import qualified Intro1 as Old -- Attempt to add a new expression form: multiplication -- We would like to reuse the old code, in Intro1.hs (show the code) -- We don't want to extend the data type declaration in Intro1.hs -- as that would require adj...
mjhopkins/ttfi
src/haskell/ExtI.hs
apache-2.0
863
0
10
184
83
51
32
7
1
module Day16pt2 where import Data.List.Split type Line = (String, [(String, Int)]) main :: IO () main = do f <- readFile "input.txt" let lns = map parse $ map (splitOn " ") (lines f) fxs = [(adjust "children" (==3)), (adjust "cats" (>7)), (adjust "samoyeds" (==2)), ...
ksallberg/adventofcode
2015/src/Day16pt2.hs
bsd-2-clause
1,045
0
13
357
457
255
202
29
2
{-# LANGUAGE CPP #-} module Manager (tests) where import Control.Concurrent (forkIO) import Control.Concurrent.MVar (newEmptyMVar, putMVar, takeMVar) import Control.Exception (finally) import Control.Monad (replicateM_) import Foreign.C.Error (throwErrnoIfMinus1) import Foreign.Marshal (alloca) import Network.Socket h...
tibbe/event
tests/Manager.hs
bsd-2-clause
3,639
0
24
826
1,071
550
521
77
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TemplateHaskell #-} {- - Copyright (c) 2015, Peter Lebbing <peter@digitalbrains.com> - 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. Redistrib...
DigitalBrains1/clash-lt24
Simul/LT24/UARTInterface.hs
bsd-2-clause
5,412
0
13
1,662
1,719
1,089
630
77
1
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-} import Control.DeepSeq import Control.Monad import Text.JSON import Data.Time.Clock import System.Environment (getArgs) import System.IO instance NFData JSValue where rnf JSNull = () rnf (JSBool b) = rnf b rnf (JSRati...
moonKimura/aeson-0.6.2.1
benchmarks/JsonParse.hs
bsd-3-clause
1,002
0
22
281
412
201
211
31
2
{-# LANGUAGE BangPatterns #-} module Y2017.Day22 (answer1, answer2) where import Control.Monad import Data.Foldable import qualified Data.HashMap.Strict as Map answer1, answer2 :: IO () answer1 = do grid <- parseInput let initialState = ((0,-1), (0,0), grid, 0) let n = 10000 let (_, _, _, c) = foldl'...
geekingfrog/advent-of-code
src/Y2017/Day22.hs
bsd-3-clause
2,644
0
16
786
1,063
584
479
72
5
{-# LANGUAGE CPP, DeriveDataTypeable, UnboxedTuples #-} {-# OPTIONS_HADDOCK not-home #-} -- | -- Module : Data.Text.Internal -- Copyright : (c) 2008, 2009 Tom Harper, -- (c) 2009, 2010 Bryan O'Sullivan, -- (c) 2009 Duncan Coutts -- -- License : BSD-style -- Maintainer : bos@serp...
robinp/nemnem
tsrc/DataTextInternal.hs
bsd-3-clause
5,791
2
16
1,465
1,116
624
492
81
1
-- (C) vasylp https://github.com/vasylp/hgettext/blob/master/src/hgettext.hs import qualified Language.Haskell.Exts.Annotated as H import System.Environment import System.Console.GetOpt import Data.Time import System.Locale (defaultTimeLocale) import Data.Generics.Uniplate.Data import Distribution.Simple.PreProce...
portnov/localize
hgettext.hs
bsd-3-clause
4,088
0
16
1,124
1,190
643
547
85
2
module Data.Map.TernaryMap ( TernaryMap, insert, singleton, member, size, fromList, lookup, (!), findWithDefault, insertWith, insertWithKey, ...
axman6/TernaryTrees
Data/Map/TernaryMap.hs
bsd-3-clause
7,650
0
16
2,695
2,957
1,466
1,491
169
3
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2015 Dimitri Sabadie -- License : BSD3 -- -- Maintainer : Dimitri Sabadie <dimitri.sabadie@gmail.com> -- Stability : experimental -- Portability : portable -- -- Meshes are ...
phaazon/quaazar
src/Quaazar/Geometry/Mesh.hs
bsd-3-clause
1,411
0
11
248
252
150
102
-1
-1
module Pear.Operator (pearAlgebra) where import Pear.Types import Pear.Operator.Lexer (PAlgebra(..)) import Pear.Operator.Concrete -- import Pear.Operator.Algebra -- import Pear.Operator.Stack -- import Pear.Operator.Lexer -- import Pear.Operator.Tree import Text.Parsec.String (Parser) algebra :: PAlgebra Ast algeb...
Charlesetc/haskell-parsing
src/Pear/Operator.hs
bsd-3-clause
438
0
6
50
91
55
36
9
1
-- 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.Numeral.NB.Corpus ( corpus ) where import Prelude import D...
facebookincubator/duckling
Duckling/Numeral/NB/Corpus.hs
bsd-3-clause
10,452
0
11
5,062
2,158
1,186
972
306
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude , ExistentialQuantification , MagicHash , DeriveDataTypeable #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Exception -- Copyright ...
jstolarek/ghc
libraries/base/GHC/Exception.hs
bsd-3-clause
6,477
0
9
1,094
525
292
233
57
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MonoLocalBinds #-} module Config where import Prelude hiding (fail, lookup) import qualified Data.Configurator as C import qualified Data.Configurator.Types as CT import ...
shmookey/pure
app/Config.hs
bsd-3-clause
3,986
0
16
1,046
1,016
559
457
104
1
-- | construct a feed from a mailman (pipermail) archive, -- e.g., https://mail.haskell.org/pipermail/libraries/ -- see https://github.com/chrisdone/haskellnews/issues/12 -- and https://github.com/haskell-infra/hl/issues/63#issuecomment-74420850 {-# language OverloadedStrings #-} module HN.Model.Mailman where import...
jwaldmann/haskellnews
src/HN/Model/Mailman.hs
bsd-3-clause
5,413
113
21
1,354
1,424
757
667
105
4
module Mandelbrot.Algorithms.EscapeTime.Internal where import Data.Complex radius :: RealFloat a => a radius = 3 lessThanRadius :: (RealFloat a) => Complex a -> Bool lessThanRadius z = pythagoreanLT (realPart z) (imagPart z) radius where pythagoreanLT a b c = a ** 2 + b ** 2 < c ** 2 zSeries :: RealFloat a => Com...
matt-keibler/mandelbrot
src/Mandelbrot/Algorithms/EscapeTime/Internal.hs
bsd-3-clause
420
0
11
86
184
96
88
10
1
module Util where import System.Environment (getArgs) import System.Directory (doesFileExist, getCurrentDirectory) import System.IO import System.FilePath ((</>)) parseArgs :: [String] -> (String, [String]) parseArgs args = case iter args "" [""] of ("", _) -> error "filename is missing" ...
ehamberg/tapl-haskell-untyped
src/Util.hs
bsd-3-clause
1,807
0
11
591
467
241
226
35
4
{-# LANGUAGE TemplateHaskell #-} module TypeLevel.Number.Nat.TH where import Language.Haskell.TH import TypeLevel.Number.Nat.Types splitToBits :: Integer -> [Int] splitToBits 0 = [] splitToBits x | odd x = 1 : splitToBits rest | otherwise = 0 : splitToBits rest where rest = x `div` 2...
Shimuuar/type-level-numbers
TypeLevel/Number/Nat/TH.hs
bsd-3-clause
748
0
12
191
236
121
115
17
3
{-# LANGUAGE BinaryLiterals #-} module OpCodes where import BinUtils import Types import Header import qualified Data.Vector as V import Data.Word import Data.Either import Control.Monad import Debug.Trace import qualified Data.ByteString as B import qualified Data.Binary.Strict.Get as BS import qualified Data.Binary...
theor/zorkell
src/OpCodes.hs
bsd-3-clause
10,286
0
47
2,902
3,352
1,826
1,526
226
8
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE Trustworthy #-} module Data.Hexagon.Neighbors (HasNeighbors (..), neighbor, isNeighbor) where import Control.Lens.Operators import Data.Hexagon.Types import ...
alios/hexagon
src/Data/Hexagon/Neighbors.hs
bsd-3-clause
5,092
0
12
1,527
2,007
1,116
891
108
2
{-# LINE 1 "Foreign.Safe.hs" #-} {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.Safe -- Copyright : (c) The FFI task force 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- ...
phischu/fragnix
builtins/base/Foreign.Safe.hs
bsd-3-clause
1,151
0
5
227
116
81
35
19
0
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS_GHC -fno-warn-deprecations #-} module Network.Wai.Handler.Warp.Run where import Control.Arrow (first) import Control.Concurrent (threadDelay) import qualified Control.Concurrent as C...
AndrewRademacher/wai
warp/Network/Wai/Handler/Warp/Run.hs
mit
19,484
8
29
5,909
3,613
1,873
1,740
304
18
{-# LANGUAGE OverloadedStrings #-} module CountdownGame.Players ( isRegistered , registeredPlayer , registerPlayer )where import Control.Monad.IO.Class(liftIO) import Data.Char (toLower) import Data.List(isPrefixOf) import Data.Map.Strict (Map) import qualified Data.Map.Strict as M import...
CarstenKoenig/Countdown
src/web/CountdownGame/Players.hs
mit
1,627
0
15
269
493
264
229
40
2
module BankAccount ( BankAccount , openAccount , closeAccount , getBalance , incrementBalance ) where import Control.Concurrent.STM ( TVar , readTVar , newTVar , writeTVar , modifyTVar , atomically ) newtype BankAccount = Account (TVar (Maybe Integer)) openAccount :: IO BankAccount openAcc...
Bugfry/exercises
exercism/haskell/bank-account/src/BankAccount.hs
mit
745
0
10
141
238
125
113
24
1
-- -- -- ---------------- -- Exercise 7.5. ---------------- -- -- -- module E'7''5 where import Prelude hiding ( product ) product :: [Integer] -> Integer product [] = 1 product ( integer : remainingIntegers ) = integer * (product remainingIntegers)
pascal-knodel/haskell-craft
_/links/E'7''5.hs
mit
264
0
7
54
69
43
26
6
1
module Servant.Server.Auth.Token.Acid( AcidBackendT , runAcidBackendT , deriveAcidHasStorage ) where import Control.Monad.Base import Control.Monad.Except import Control.Monad.Reader import Control.Monad.Trans.Control import Data.Acid import Data.Acid.Core import Language.Haskell.TH import Servant.Server imp...
VyacheslavHashov/servant-auth-token
servant-auth-token-acid/src/Servant/Server/Auth/Token/Acid.hs
bsd-3-clause
7,216
0
12
1,257
495
280
215
-1
-1
-- -- Copyright © 2013-2015 Anchor Systems, Pty Ltd and Others -- -- The code in this file, and the program it is a part of, is -- made available to you by its authors as open source software: -- you can redistribute it and/or modify it under the terms of -- the 3-clause BSD licence. -- {-# LANGUAGE DataKinds ...
anchor/oauth2-server
lib/Network/OAuth2/Server/API.hs
bsd-3-clause
19,446
0
30
5,679
3,817
1,913
1,904
307
9
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/ByteString/Short/Internal.hs" #-} {-# LANGUAGE DeriveDataTypeable, CPP, BangPatterns, RankNTypes, ForeignFunctionInterface, MagicHash, UnboxedTuples, UnliftedFFITypes #-} {-# OPTIONS_GHC -fno-war...
phischu/fragnix
tests/packages/scotty/Data.ByteString.Short.Internal.hs
bsd-3-clause
16,065
0
14
3,979
4,216
2,192
2,024
290
3
{-# LANGUAGE RecordWildCards, DeriveDataTypeable #-} -- | Nix configuration module Stack.Config.Nix (nixOptsFromMonoid ,StackNixException(..) ) where import Control.Applicative import Control.Monad (join, when) import qualified Data.Text as T import Data.Maybe import Data.Typeable import Distribu...
harendra-kumar/stack
src/Stack/Config/Nix.hs
bsd-3-clause
2,482
0
21
580
609
318
291
52
6
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Cmm optimisation -- -- (c) The University of Glasgow 2006 -- ----------------------------------------------------------------------------- module CmmOpt ( constantFoldNode, constantFoldExpr, ...
acowley/ghc
compiler/cmm/CmmOpt.hs
bsd-3-clause
16,944
0
20
4,641
4,944
2,455
2,489
230
97
module ShowPublicOrganization where import qualified Github.Organizations as Github main = do possibleOrganization <- Github.publicOrganization "thoughtbot" case possibleOrganization of (Left error) -> putStrLn $ "Error: " ++ (show error) (Right organization) -> putStrLn $ formatOrganizati...
mavenraven/github
samples/Organizations/ShowPublicOrganization.hs
bsd-3-clause
565
0
12
101
165
86
79
12
2
{-# LANGUAGE CPP, BangPatterns, ScopedTypeVariables #-} -- | -- Module : Data.Attoparsec.Internal -- Copyright : Bryan O'Sullivan 2007-2014 -- License : BSD3 -- -- Maintainer : bos@serpentine.com -- Stability : experimental -- Portability : unknown -- -- Simple, efficient parser combinators, loosely...
DavidAlphaFox/ghc
utils/haddock/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal.hs
bsd-3-clause
5,639
0
16
1,659
1,402
718
684
77
2
{-# LANGUAGE FlexibleInstances, GADTs #-} module T5858 where class InferOverloaded a where infer :: a -> String -- instance (t1 ~ String, t2 ~ String) => InferOverloaded (t1,t2) where instance (t1 ~ String) => InferOverloaded (t1,t1) where infer = show . fst foo = infer ([],[])
urbanslug/ghc
testsuite/tests/typecheck/should_fail/T5858.hs
bsd-3-clause
288
0
7
55
76
43
33
7
1