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 FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Futhark.IR.PropTests ( tests, ) where import qualified Futhark.IR.Prop.RearrangeTests import qualified Futhark.IR.Prop.ReshapeTests import Test.Tasty tests :: TestTree tests = testGroup "PropTests" [ Futhark.IR.Prop.Reshape...
HIPERFIT/futhark
unittests/Futhark/IR/PropTests.hs
isc
382
0
7
60
67
46
21
13
1
{-# LANGUAGE DeriveDataTypeable #-} module Data.Logic.Prop where import Numeric.Natural.QuickCheck () import Data.Typeable (Typeable) import Control.Applicative import Test.QuickCheck import Text.Read import Data.Data (Data) import Data.Name -- $setup -- >>> import Text.Show.Functions () -- >>> :set -XOverloadedStri...
kmyk/proof-haskell
Data/Logic/Prop.hs
mit
1,627
0
12
404
418
227
191
34
0
{-# LANGUAGE FlexibleContexts #-} module HolyProject.StringUtils.Test ( stringUtilsSuite ) where import Data.Char (isPrint,isSymbol) import Test.Tasty (testGroup, TestTree) import Test.Tasty.HUnit import Test.Tasty.SmallCheck...
yogsototh/holy-project
test/HolyProject/StringUtils/Test.hs
mit
1,719
0
12
513
479
258
221
36
1
----------------------------------------------------------------------- -- -- Haskell: The Craft of Functional Programming, 3e -- Simon Thompson -- (c) Addison-Wesley, 1996-2011. -- -- Chapter 12 -- ----------------------------------------------------------------------- -- For Rock-Paper-Scissors examples see RPS...
Numberartificial/workflow
snipets/src/Craft/Chapter12.hs
mit
3,982
0
10
916
1,148
632
516
69
1
module Ex6 where test = \x -> let f = \y -> y x in (f (\z -> z)) (f (\u -> \v -> u))
roberth/uu-helium
test/typeerrors/Edinburgh/Ex6.hs
gpl-3.0
99
0
13
39
69
38
31
3
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-sdb/gen/Network/AWS/SDB/BatchDeleteAttributes.hs
mpl-2.0
3,873
0
10
744
449
274
175
62
1
{- Module : Database.Util Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley License : BSD-style Maintainer : oleg@pobox.com, alistair@abayley.org Stability : experimental Portability : non-portable Utility functions. Mostly used in database back-ends, and tests. -} {-# LANGUAGE TypeS...
bagl/takusen-oracle
Database/Util.hs
bsd-3-clause
9,203
0
22
2,243
2,971
1,575
1,396
184
3
module MatrixTree ( addSubtreeNorms , ifZeroReplace , isZero , matrixListToTree , MatrixTree , mmReadTree , mmWriteTree , MTree(..) , nextPowOf2 , norm , Norm , setNorm , size , Size , treeToMatrixList , Value , valueNorm ) where -- a recursive matrix data type that efficiently encodes sparsity import MatrixList (Mat...
FreeON/spammpack
src-Haskell/MatrixTree.hs
bsd-3-clause
4,216
0
11
1,349
1,803
991
812
100
3
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} -- | Stream operations on 'ByteString'. module System.IO.Streams.ByteString ( -- * Counting bytes countInput , countOutput -- * Treating strings as streams , fromByteString , fromLazyByteString --...
snapframework/io-streams
src/System/IO/Streams/ByteString.hs
bsd-3-clause
26,417
0
22
6,399
3,964
2,128
1,836
297
4
{-# LANGUAGE CPP, BangPatterns #-} module Main where import Control.Monad import Data.Int import System.Environment (getArgs, withArgs) import Data.Time (getCurrentTime, diffUTCTime, NominalDiffTime) import System.IO (withFile, IOMode(..), hPutStrLn, Handle, stderr) import Control.Concurrent (forkIO) import Control....
tweag/network-transport-zeromq
benchmarks/subparts/h-zmq-tmchan.hs
bsd-3-clause
2,983
0
15
640
870
447
423
71
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 The @TyCon@ datatype -} {-# LANGUAGE CPP, DeriveDataTypeable #-} module TyCon( -- * Main TyCon data types TyCon, AlgTyConRhs(..), visibleDataCons, AlgTyConFlav(..), isNoParent, Fa...
AlexanderPankiv/ghc
compiler/types/TyCon.hs
bsd-3-clause
80,521
1
17
23,968
9,412
5,341
4,071
822
7
<?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="ru-RU"> <title>Viewstate (просмотр состояния)</title> <maps> <homeID>viewstate</homeID> ...
kingthorin/zap-extensions
addOns/viewstate/src/main/javahelp/help_ru_RU/helpset_ru_RU.hs
apache-2.0
1,030
82
52
157
482
250
232
-1
-1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TypeFamilies #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.InstalledPackageInfo -- Copyright : (c) The University of Glasgow 2004 -- -- Maintainer : libraries@has...
themoritz/cabal
Cabal/Distribution/InstalledPackageInfo.hs
bsd-3-clause
20,883
0
14
5,978
3,651
2,080
1,571
371
2
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} #if __GLASGOW_HASKELL__ >= 707 {-# LANGUAGE DeriveDataTypeable #-} #endif ----------------------------------------------------------------------------- ...
dalaing/free
src/Control/Comonad/Trans/Coiter.hs
bsd-3-clause
6,653
0
14
1,279
1,850
991
859
-1
-1
module LetIn3 where sumSquares x y = let pow = 2 in (let in ((sq pow) x) + ((sq pow) y)) sq 0 = 0 sq z = z ^ pow anotherFun 0 y = sq y where sq x = x ^ 2
kmate/HaRe
old/testing/liftToToplevel/LetIn3AST.hs
bsd-3-clause
163
0
14
53
109
55
54
6
1
{-# OPTIONS -fglasgow-exts #-} {-# OPTIONS -fforall #-} -- The interesting thign about this one is that -- there's an unbound type variable of kind *->* -- that the typechecker should default to some -- arbitrary type. -- -- GHC 5.02 could only really deal with such things -- of kind *, but 5.03 extended that to *->....
hvr/jhc
regress/tests/1_typecheck/2_pass/ghc/tc146.hs
mit
468
0
9
98
67
41
26
-1
-1
{-+ Knot-tying definitions for the type decorated base+property syntax to Stratego translation. -} module TiProp2Stratego2 where import TiPropDecorate(TiDecl(..),TiExp(..), TiAssertion(..),OTiAssertion(..),TiPredicate(..)) import PropSyntax(prop,mapHsIdent) import BaseStruct2Stratego2 import PropStruct2Stratego...
forste/haReFork
tools/hs2stratego/TiProp2Stratego2.hs
bsd-3-clause
1,470
4
11
263
398
215
183
32
3
{-# LANGUAGE TypeInType #-} module Bug11592 where data A (a :: a) = MkA String data B b (a :: a b) = MkB String data C b (a :: b a) = MkC String data D b c (a :: c a b) = MkD String
ezyang/ghc
testsuite/tests/rename/should_fail/T11592.hs
bsd-3-clause
186
0
6
51
84
52
32
-1
-1
-------------------------------------------------------------------------------- -- | The LLVM abstract syntax. -- module Llvm.AbsSyn where import Llvm.MetaData import Llvm.Types import Unique -- | Block labels type LlvmBlockId = Unique -- | A block of LLVM code. data LlvmBlock = LlvmBlock { -- | The code labe...
lukexi/ghc-7.8-arm64
compiler/llvmGen/Llvm/AbsSyn.hs
bsd-3-clause
8,442
0
9
2,368
532
345
187
62
0
{-# LANGUAGE RankNTypes, ScopedTypeVariables, PolyKinds #-} module T14066d where import Data.Proxy g :: (forall c b (a :: c). (Proxy a, Proxy c, b)) -> () g _ = () f :: forall b. b -> (Proxy Maybe, ()) f x = (fstOf3 y :: Proxy Maybe, g y) where y :: (Proxy a, Proxy c, b) -- this should NOT generalize over b ...
sdiehl/ghc
testsuite/tests/dependent/should_fail/T14066d.hs
bsd-3-clause
438
0
9
131
168
97
71
10
1
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {- Copyright (C) 2008 John MacFarlane <jgm@berkeley.edu> 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...
vsivsi/gitit
src/Network/Gitit/Server.hs
gpl-2.0
2,474
0
13
574
365
198
167
31
3
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP , NoImplicitPrelude , NondecreasingIndentation #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.IO.Encoding.Iconv -- Copyright : (c) The University of Glasgo...
tolysz/prepare-ghcjs
spec-lts8/base/GHC/IO/Encoding/Iconv.hs
bsd-3-clause
7,543
0
45
1,843
1,313
693
620
123
3
{-# LANGUAGE GADTs, CPP, Trustworthy, TemplateHaskell, TupleSections, ViewPatterns, DeriveDataTypeable, ScopedTypeVariables #-} module GameB where --import Utils --import Paths_bomberman import qualified CodeWorld as CW import Graphics.Gloss import Graphics.Gloss.Data.Picture import Graphics.Gloss.Interface.IO.Game ...
hpacheco/HAAP
examples/gameworker/GameB.hs
mit
23,275
2
34
5,617
8,977
4,640
4,337
441
10
module Hanoi where type Peg = String type Move = (Peg, Peg) type Disc = Integer type PegState = (Peg, [Disc]) type BoardState = [PegState] {- | Solve the Towers of Hanoi puzzle by returning a list of Moves that will transfer a tower of N discs from the first to the second peg. >>> hanoi 2 "a" "b" "c" [("a","c"),("a...
ajcoppa/cis194
01-intro/Hanoi.hs
mit
809
0
9
179
156
90
66
9
1
module Beer (song) where song :: String song = concatMap line (reverse [0..99]) -- | line returns the nth line of the song. Only non-negative 'n' would make a -- correct song line line :: Int -> String line 0 = "No more bottles of beer on the wall, no more bottles of beer.\n\ \Go to the store and buy some mo...
vaibhav276/exercism_haskell
beer-song/src/Beer.hs
mit
735
0
12
241
158
81
77
12
4
module Y2020.M07.D15.Exercise where {-- Okay, we've got historical context, we have a way to query that historical context, we have active members of our group, and we have already paired them, but it was a simple pairing algorithm, ignoring the context of who was paired with whom before. Today, we're going to create...
geophf/1HaskellADay
exercises/HAD/Y2020/M07/D15/Exercise.hs
mit
1,891
0
8
330
93
58
35
9
1
module U.Codebase.Sqlite.JournalMode where data JournalMode = DELETE | TRUNCATE | PERSIST | MEMORY | WAL | OFF deriving Show
unisonweb/platform
codebase2/codebase-sqlite/U/Codebase/Sqlite/JournalMode.hs
mit
128
0
5
22
33
22
11
3
0
module Store.SQL.Connection where {-- We're basically rewriting Store.SQL.Connection. Good module, if you only have one database to manage, but now I have multiple SQL databases, so I have to make all these functions confirgurable. --} import Database.PostgreSQL.Simple import System.Environment -- let's codify which...
geophf/1HaskellADay
exercises/HAD/Store/SQL/Connection.hs
mit
1,509
0
11
323
309
164
145
22
1
module Util.Prelude where -- | Ternary if-then operator (?) :: Bool -> a -> a -> a (?) True t _ = t (?) False _ f = f infix 3 ? -- | Alias for comparison functions type Comparison a = (a -> a -> Ordering) -- | Convert from implicitly ordered projection, to comparison function toComparison :: Ord b => (a -> b) -> C...
sgord512/Utilities
Util/Prelude.hs
mit
374
0
8
83
132
75
57
8
1
module Main where import Control.Concurrent import Control.Concurrent.STM import Control.Monad import System.IO import System.Process -- import Control.Monad.Trans.Resource -- import Data.Conduit.Process data GhciOutput = StdOutput String ...
haskellbr/meetups
code/ghci-api/src/Main.hs
mit
1,211
0
13
381
362
181
181
32
1
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module FP15.Disp where import Text.PrettyPrint import qualified Data.Map as M import Data.Void(Void) -- * The Disp Typeclass -- | The 'Disp' typeclass is for converting a value to string. The difference -- betwen 'Disp' and 'Show' is that 'Show'...
Ming-Tang/FP15
src/FP15/Disp.hs
mit
967
0
14
196
216
122
94
21
0
module Tape where import Data.Stream (Stream (..), (<:>)) import qualified Data.Stream as S import Parser data Tape a = Tape (Stream a) a (Stream a) instance Functor Tape where fmap f (Tape xs y zs) = Tape (fmap f xs) (f y) (fmap f zs) emptyTape :: Tape Int emptyTape = Tape zeros 0 zeros ...
Rydgel/Brainfokt
src/Tape.hs
mit
588
0
9
146
277
145
132
16
1
module Handler.AboutSpec (spec) where import TestImport spec :: Spec spec = withApp $ do describe "getAboutR" $ do error "Spec not implemented: getAboutR"
swamp-agr/carbuyer-advisor
test/Handler/AboutSpec.hs
mit
171
0
11
39
44
23
21
6
1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} #ifdef MYSQL module Persistence.MySQL (connection) where import Persistence.DBConfig import Control.Monad.IO.Class import Control.Monad.Trans...
spechub/Hets
Persistence/MySQL.hs
gpl-2.0
1,532
0
12
474
323
172
151
4
0
module Functions where -- cabal install Crypto import Data.Time import Data.List --import Crypto.HASH import Socket -- Get Date --getTime :: IO UTCTime --getTime = do -- let c = getCurrentTime -- llamar a Socket con c para enviar datos desde aquí -- return() -- Get MD5 --md5 returns a 4-tuple of 32bi...
overxfl0w/IRC-BOT
Functions.hs
gpl-2.0
892
7
9
195
79
54
25
7
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE Rank2Types #-} -- | exports from "Yi.Config.Simple" which are useful to \"core yi\" rather than just config files. module Yi.Config.Simple.Types where import Control.Monad.State hiding (modify, get) import Control.Monad.Base import Control.Applicative import C...
atsukotakahashi/wi
src/library/Yi/Config/Simple/Types.hs
gpl-2.0
1,325
0
7
194
135
82
53
15
1
{-# LANGUAGE DeriveDataTypeable #-} module Scyther.Sequent ( -- * Datatype Sequent(..) , SequentQualifier(..) , seProto -- ** Logically safe construction , wellTypedCases , reduceInjectivity , saturate , frule , fruleInst , chainRule , splitEq , exploitTyping , uniqueTIDQuantifiers ) whe...
meiersi/scyther-proof
src/Scyther/Sequent.hs
gpl-3.0
10,791
0
19
2,941
2,164
1,129
1,035
150
7
module Screepy.Dump (dumpPhotos) where import Control.Monad.Error import Control.Monad.Trans.Resource (runResourceT, ResourceT) import qualified Data.ByteString.Lazy as BL import Screepy.Photo (Photo(..)) import Data.Conduit import qualified Data.Conduit.Binary as CB import qualified Data.Co...
kototama/screepy
src/Screepy/Dump.hs
gpl-3.0
2,485
0
14
673
415
234
181
33
2
{-# LANGUAGE RankNTypes, DeriveDataTypeable, ViewPatterns, FlexibleContexts, GADTs #-} -- Static semantics, used by the typechecker to evaluate indexes module Language.SecreC.Prover.Semantics where import Language.SecreC.Syntax import Language.SecreC.Location import Language.SecreC.Position import Language.SecreC.Mon...
haslab/SecreC
src/Language/SecreC/Prover/Semantics.hs
gpl-3.0
7,738
0
18
1,828
3,516
1,752
1,764
155
6
-- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } func reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable = x
lspitzner/brittany
data/Test412.hs
agpl-3.0
271
0
5
18
12
6
6
2
1
module HelperSequences.A005117 (a005117, a005117_list) where import Data.List (genericIndex) a005117 :: Integral a => a -> a a005117 n = genericIndex a005117_list (n - 1) -- This isn't efficient, but it'll work for now. a005117_list :: Integral a => [a] a005117_list = filter squarefree [1..] where squarefree k = al...
peterokagey/haskellOEIS
src/HelperSequences/A005117.hs
apache-2.0
402
0
12
74
149
81
68
8
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1.ClusterRoleBindingList where import GHC.Generics import Data.Text import Openshift.Unversioned.ListMeta import Openshift.V1.Cluste...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1/ClusterRoleBindingList.hs
apache-2.0
1,268
0
9
174
125
77
48
19
0
{-# LANGUAGE OverloadedStrings #-} module Gitlog.Types ( GitEntry(..) , GitBody(..) , Config(..) , JiraIssue(..) , OutputFormat(..) , defaultConfig , hasJira ) where import Control.Applicative import Control.Monad ( mzero ) import Control.Parallel.Strategies import ...
kongo2002/gitlog
src/Gitlog/Types.hs
apache-2.0
6,386
0
15
1,762
1,847
1,016
831
164
1
module Foundation ( App (..) , Route (..) , AppMessage (..) , resourcesApp , Handler , Widget , Form , maybeAuth , requireAuth , module Settings , module Model , getExtra ) where import Prelude import Yesod hiding ((==.)) import Yesod.Static import Yesod.Auth import ...
MasseR/introitu
Foundation.hs
bsd-2-clause
8,981
0
18
1,879
1,848
980
868
-1
-1
-- | -- -- Copyright: -- This file is part of the package vimeta. It is subject to the -- license terms in the LICENSE file found in the top-level -- directory of this distribution and at: -- -- https://github.com/pjones/vimeta -- -- No part of this package, including this file, may be copied, -- modified...
pjones/vimeta
src/Vimeta/UI/CommandLine/TV.hs
bsd-2-clause
2,601
0
14
553
688
352
336
55
3
{-# LANGUAGE GADTs #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE RecordWildCards #-} ----------------------------------------------------------------------------- -- | -- Module : HEP.Physics.LoopCalculation.Box -- Copyright : (c) 2013 Ian-Woo Kim -- -- License : GPL-3 -- ...
wavewave/loopdiagram
src/HEP/Physics/LoopCalculation/Box.hs
bsd-3-clause
9,714
0
22
2,944
4,142
2,230
1,912
193
18
-- | Brand/Box-validation module Data.ByteString.IsoBaseFileFormat.MediaFile where import Data.ByteString.IsoBaseFileFormat.ReExports import Data.ByteString.IsoBaseFileFormat.Util.BoxContent -- TODO move this to general module merge with Box.hs -- | A class that describes (on the type level) how a box can be nested ...
sheyll/isobmff-builder
src/Data/ByteString/IsoBaseFileFormat/MediaFile.hs
bsd-3-clause
684
0
13
122
106
62
44
-1
-1
module Main where import System.IO import Control.Monad.Reader import DiceGame import ConsolePlay main :: IO () main = do putStr "How big a board do you want? " hFlush stdout sizeS <- getLine putStr "What should the maximum dice on a cell be? " hFlush stdout diceS <- getLine putStrLn "playing against th...
smithhmark/dice-game
app/Main.hs
bsd-3-clause
1,392
0
18
603
359
166
193
38
2
module ArbiRef where import qualified Data.IntMap as IM import Logic import GenState import BruijnEnvironment import FreeEnvironment import Name class ArbiRef n where updateState :: GenState n -> Bool -> String -> Free -> GenState n refFromState :: GenState n -> Generater (n, Free) instance ArbiRef Bound w...
kwibus/myLang
tests/ArbiRef.hs
bsd-3-clause
1,616
0
15
337
554
296
258
35
2
{-# LANGUAGE ScopedTypeVariables #-} import qualified Zora.List as ZList import qualified Zora.Math as ZMath import qualified Data.Ord as Ord import qualified Data.List as List import Data.Maybe import Control.Applicative num_solutions :: Integer -> Integer num_solutions = ZMath.num_divisors_of_n_squared_leq_n so...
bgwines/project-euler
src/solved/problem108.hs
bsd-3-clause
455
2
10
73
125
75
50
17
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Lib.Console where import Control.Applicative ((<|>)) import qualified Control.Concurrent.MVar as MVar import Control.Concurrent.STM (atomically) import Control...
passy/hls-proxy
src/Lib/Console.hs
bsd-3-clause
2,883
0
15
932
764
404
360
61
6
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ViewPatterns #-} module Numeric.Basics ( -- * Constants pattern M_E, pattern M_LOG2E, pattern M_LOG10E, pattern M_LN2, pattern M_LN10 , pattern M_SQRT2, pattern M_SQRT1_2 , pattern M_PI, patt...
achirkin/easytensor
easytensor/src/Numeric/Basics.hs
bsd-3-clause
7,689
0
15
1,640
1,586
859
727
138
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} module Webcrank.Internal.HandleRequest where import qualified Blaze.ByteString.Builder as BB import qualified Blaze.ByteString.Builder.Char.Utf8 as BB import Control.Applicative import Control.Lens import Control.Monad.Catch im...
webcrank/webcrank.hs
src/Webcrank/Internal/HandleRequest.hs
bsd-3-clause
5,173
0
17
895
1,193
633
560
98
5
{-# LANGUAGE OverloadedStrings #-} -- | Handles parsing of both infix and RPN 'Pred' expressions. module Prednote.Expressions ( ExprDesc(..) , Error , Token , operand , opAnd , opOr , opNot , openParen , closeParen , parseExpression ) where import Data.Either (partitionEithers) import qualified ...
massysett/prednote
lib/Prednote/Expressions.hs
bsd-3-clause
2,236
0
16
507
633
340
293
59
3
module Main where import Sirea.Prelude main = runSireaApp $ record |*| report record = btickOfFreq 3 >>> bsplitOn even >>> bleft (bconst () >>> btimeStamp "r") report = btimeStampMon "r" >>> bprint
dmbarbour/Sirea
tst/TimeStamp.hs
bsd-3-clause
205
0
10
39
71
36
35
5
1
{-# LANGUAGE TemplateHaskell, GeneralizedNewtypeDeriving, ViewPatterns, RecordWildCards #-} module AbstractInterpretation.LiveVariable.Result where import Lens.Micro.Platform import Data.Set (Set) import qualified Data.Set as Set import Data.Map (Map) import qualified Data.Map as Map import Data.Vector (Vector) impor...
andorp/grin
grin/src/AbstractInterpretation/LiveVariable/Result.hs
bsd-3-clause
4,209
0
12
803
1,266
683
583
87
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} ...
sdiehl/ghc
libraries/base/Data/Type/Equality.hs
bsd-3-clause
6,060
0
11
1,306
1,003
596
407
-1
-1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveDataTypeable #-} module Development.Shake.Install.Exceptions ( setDefaultUncaughtExceptionHandler ) where import Control.Exception (Exception(..), SomeException(..)) import Data.IORef (IORef, newIORef, writeIORef) import Data.Typeable (Typeable) import GHC.Conc (se...
alphaHeavy/shake-install
Development/Shake/Install/Exceptions.hs
bsd-3-clause
1,320
0
9
174
248
139
109
31
1
TaskGroupData { tgdPreds = LevelPreds { lpredPre = NameT { nameTName = "p_galois'find'P" , nameTParams = [ TyCon "map" [ TyCon "int" [] , TyCon "int" [] ] , TyCon "map" [ TyCon "addr" [] , TyCon "addr" [] ] , T...
GaloisInc/verification-game
web-prover/demo-levels/find/tasks.hs
bsd-3-clause
30,244
0
21
15,706
7,438
4,134
3,304
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} module Regress (regressions) where import qualified Test.Framework as F import Test.Framework.Providers.HUnit (testCase) import Test.HUnit ((@=?)) import GHC.Generics (Generic) import Data.List (nub) #ifdef HAVE_MMAP import qualified Regress.Mmap as Mmap #endif im...
pacak/cuddly-bassoon
hashable-1.2.6.0/tests/Regress.hs
bsd-3-clause
1,279
0
14
322
389
208
181
31
1
{-# LANGUAGE FlexibleContexts , FlexibleInstances , TypeSynonymInstances , MultiParamTypeClasses , GADTs , TupleSections , RankNTypes , ScopedTypeVariables #-} module Linear.Constraints.Cassowary.AugmentedSimplex where import Prelude hiding (foldr, minimum, zip, lookup, filter) import Linear.Cons...
athanclark/cassowary-haskell
src/Linear/Constraints/Cassowary/AugmentedSimplex.hs
bsd-3-clause
4,423
0
14
1,249
1,321
705
616
100
2
module System.Termutils.Url ( findUrls , matchUrls -- , showUrls , launchUrl ) where import Text.Regex import Graphics.UI.Gtk.Vte.Vte import System.Posix.Process import Control.Concurrent import Codec.Binary.UTF8.String (encodeString) {- data Attr = Attr { column :: Int , row :: Int , foreg...
dagle/hermite
src/System/Termutils/Url.hs
bsd-3-clause
1,727
0
15
420
417
226
191
29
2
module System.Build.Access.Encoding where class Encoding r where encoding :: Maybe String -> r -> r getEncoding :: r -> Maybe String
tonymorris/lastik
System/Build/Access/Encoding.hs
bsd-3-clause
159
0
8
47
45
24
21
9
0
-- | -- Module : Crypto.Random.Entropy.Backend -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : stable -- Portability : good -- {-# LANGUAGE CPP #-} {-# LANGUAGE ExistentialQuantification #-} module Crypto.Random.Entropy.Backend ( EntropyBackend , supportedBa...
tekul/cryptonite
Crypto/Random/Entropy/Backend.hs
bsd-3-clause
1,708
0
11
353
295
171
124
25
1
module T6056 where import T6056a foo1 :: Int -> (Maybe Int, [Int]) foo1 x = smallerAndRest x [x] foo2 :: Integer -> (Maybe Integer, [Integer]) foo2 x = smallerAndRest x [x]
spacekitteh/smcghc
testsuite/tests/simplCore/should_compile/T6056.hs
bsd-3-clause
175
0
7
33
81
45
36
6
1
module AmbitiousSignature where hServer :: String hServer = "Server"
phischu/fragnix
tests/quick/AmbiguousSignature/AmbitiousSignature.hs
bsd-3-clause
71
0
4
11
14
9
5
3
1
module Petri.Roll where import Petri.Type import Autolib.Util.Zufall import qualified Data.Map as M import qualified Data.Set as S import Control.Monad ( forM ) net :: ( Ord s , Ord t ) => [s] -> [t] -> Capacity s -> IO ( Net s t ) net ps ts cap = do s <- state ps cs <- conn ps ts return...
Erdwolf/autotool-bonn
src/Petri/Roll.hs
gpl-2.0
1,189
0
13
436
494
257
237
38
2
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Monad import Control.Monad.Trans import qualified Data.ByteString as ByteString import qualified Data.ByteString as BS import Data.Monoid ((<>)) import Foreign.Lua (Lu...
rodrigo-machado/verigraph
src/repl/Main.hs
gpl-3.0
4,208
0
23
1,188
1,189
576
613
117
7
-- A primes algorithm as posted to Haskell Cafe by "oleg" -- http://www.haskell.org/pipermail/haskell-cafe/2007-February/022437.html module OlegPrimes where -- repl_every_n n l replaces every (n+1)-th element in a list (_:l) -- with False repl_every_n :: Int -> [Bool] -> [Bool] repl_every_n n l = repl_every_n' n l w...
dkensinger/haskell
haskell-primes/OlegPrimes.hs
gpl-3.0
594
0
13
115
216
113
103
8
2
{-# OPTIONS_GHC -fno-warn-orphans #-} module Main where import Data.Foldable as F import Data.Map as M import Data.Maybe import Data.Vector.Map as V import Control.DeepSeq import Control.Monad.Random import Control.Monad import Criterion.Config import Criterion.Main instance NFData (V.Map k v) buildV :: Int -> V.Map...
ekmett/structures
benchmarks/lookups.hs
bsd-2-clause
1,642
0
12
404
657
328
329
41
1
module Cards where import Global import System.Random import Test.HUnit hiding (Path) {- REPRESENTATION CONVENTION: Represents the rank/value of the playing card. REPRESENTATION INVARIANT: True -} data Rank = One | Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack ...
DeeLaiD/project_megadeal
cards.hs
bsd-3-clause
4,633
0
12
1,202
1,182
620
562
91
14
{-# LANGUAGE ForeignFunctionInterface #-} module Main where import Control.Monad (when) import System.Exit (ExitCode(ExitFailure), exitWith) import System.Mem import qualified Spec import GDAL import GDAL.Internal.GDAL (openDatasetCount) import Test.Hspec (hspec) main :: IO () main = withGDAL $ do hspec Spec.spec...
meteogrid/bindings-gdal
tests/Main.hs
bsd-3-clause
548
0
13
91
166
89
77
20
1
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1996-1998 TcHsSyn: Specialisations of the @HsSyn@ syntax for the typechecker This module is an extension of @HsSyn@ syntax, for use in the type checker. -} {-# LANGUAGE CPP #-} module TcHsSyn ( mkHsConApp, mkHsDictLet, mkHsApp,...
ml9951/ghc
compiler/typecheck/TcHsSyn.hs
bsd-3-clause
64,653
2
19
19,179
18,719
9,364
9,355
-1
-1
module Lang.LamIf.Semantics where import FP import MAAM import Lang.LamIf.Syntax hiding (PreExp(..)) import Lang.LamIf.CPS import Lang.LamIf.StateSpace type Ψ = LocNum -- These are the raw constraints that must hold for: -- - time lτ and dτ -- - values val -- - the monad m type TimeC τ = ( Time Ψ τ , Bot τ , ...
FranklinChen/maam
src/Lang/LamIf/Semantics.hs
bsd-3-clause
10,617
184
29
2,569
4,958
2,517
2,441
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Macro.PkgAesonGeneric where import Macro.Types import Data.Aeson as Aeson import Data.ByteString.Lazy as BS import Data.Maybe serialise :: [GenericPackageDescription] -> BS.ByteString serialise pkgs = Aeson.encode pkgs deserialise :: BS.ByteString -> [GenericPackageDescri...
arianvp/binary-serialise-cbor
bench/Macro/PkgAesonGeneric.hs
bsd-3-clause
2,344
0
7
270
634
292
342
76
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module Ros.Sensor_msgs.Illuminance where import qualified Prelude as P import Prelude ((.), (+), (*)) import qualified Data.Typeable as T import Control.Applicative import Ros.Internal....
acowley/roshask
msgs/Sensor_msgs/Ros/Sensor_msgs/Illuminance.hs
bsd-3-clause
1,451
1
10
287
380
221
159
35
0
module Language.Haskell.Liquid.Constraint.ToFixpoint ( cgInfoFInfo ) where import qualified Language.Fixpoint.Types as F import Language.Haskell.Liquid.Constraint.Types import Language.Haskell.Liquid.Types hiding ( binds ) import Language.Fixpoint.Misc ( mapSnd ) import ...
mightymoose/liquidhaskell
src/Language/Haskell/Liquid/Constraint/ToFixpoint.hs
bsd-3-clause
1,572
0
10
482
441
246
195
36
1
{- | Module : $Id$ Description : testing mere CASL basic specs Copyright : (c) Christian Maeder, Uni Bremen 2002-2004 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : experimental Portability : portable test some parsers (and printers) -} module Main w...
keithodulaigh/Hets
CASL/capa.hs
gpl-2.0
1,565
0
12
305
445
248
197
29
1
module Main where import Build_doctests (deps) import Control.Applicative import Control.Monad import Data.List import System.Directory import System.FilePath import Test.DocTest import Prelude main :: IO () main = getSources >>= \sources -> doctest $ "-isrc" : "-idist/build/autogen" : "-optP-include" : "-o...
fumieval/machines
tests/doctests.hs
bsd-3-clause
870
0
13
150
280
150
130
26
1
module A6 where data T a = T1 a | T3 a | T2 a data S = C1 | C2 | C3 addedT3 = error "added T3 a to T" over :: S -> (T Int) -> Int over a (T3 b) = addedT3 over x (T1 y) = 42 over x (T2 y) = 42
kmate/HaRe
old/testing/addCon/A6AST.hs
bsd-3-clause
201
0
8
66
112
61
51
8
1
-- From nhc13/src/comiler13/Unlit.hs module Unlit(CommentClass(..),unlit,readHaskellFile,writeHaskellFile, optUnlit,isLiterateFile) where import Prelude hiding (readFile) import AbstractIO import MUtils(apFst,pairWith) -- Part of the following code is from "Report on the Programming Language Haskell", -- version 1.2, ...
kmate/HaRe
old/tools/base/lib/Unlit.hs
bsd-3-clause
6,011
5
14
1,516
2,231
1,149
1,082
108
13
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Unittests for ganeti-htools. -} {- Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions a...
grnet/snf-ganeti
test/hs/Test/Ganeti/JSON.hs
bsd-2-clause
5,088
0
14
960
1,014
523
491
82
2
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Init.Heuristics -- Copyright : (c) Benedikt Huber 2009 -- License : BSD-like -- -- Maintainer : cabal-devel@haskell.org -- Stability : provisional -- Portability : portable -- -- Heuris...
mydaum/cabal
cabal-install/Distribution/Client/Init/Heuristics.hs
bsd-3-clause
14,521
0
20
3,656
3,391
1,833
1,558
253
4
{-# LANGUAGE CPP, TypeFamilies, MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, FlexibleInstances, UndecidableInstances, OverlappingInstances, TypeSynonymInstances, GeneralizedNewtypeDeriving #-} ----------------------------------------------------------------------------- -- | -- Module ...
oldmanmike/ghc
testsuite/tests/typecheck/should_run/T4809_XMLGenerator.hs
bsd-3-clause
3,011
0
13
566
680
367
313
47
1
-- !!! rn001: super-simple set of bindings, -- !!! incl wildcard pattern-bindings and *duplicates* x = [] y = [] y = [] _ = [] _ = 1 z = [] _ = []
wxwxwwxxx/ghc
testsuite/tests/rename/should_fail/rnfail002.hs
bsd-3-clause
148
0
5
36
53
29
24
7
1
{-# LANGUAGE MagicHash, BangPatterns #-} import Foreign.C import Data.Word import Foreign.Ptr import GHC.Exts import Control.Exception hashStr :: Ptr Word8 -> Int -> Int hashStr (Ptr a#) (I# len#) = loop 0# 0# where loop h n | isTrue# (n GHC.Exts.==# len#) = I# h | otherwise = loop h2 (n GHC.Ex...
urbanslug/ghc
testsuite/tests/codeGen/should_run/cgrun066.hs
bsd-3-clause
611
0
15
157
228
117
111
15
1
module CrackEgg where -- unpack zipped egg files into directories -- compile: -- ghc --make CrackEgg -main-is CrackEgg.main -- run: -- find ~/eggs/ -maxdepth 1 -type f -name '*.egg' -exec ./CrackEgg {} + import System.Environment (getArgs) import System.Process import System.Directory import System.IO import Text.Pri...
RichardBarrell/snippets
CrackEgg.hs
isc
1,844
0
14
564
542
279
263
37
2
{- Problem 7 Flatten a nested list structure. -} module Problems.Seven where data NestedList a = Elem a | List [NestedList a] flatten (Elem x) = [x] flatten (List x) = concatMap flatten x problemSeven = do putStrLn "Problem 7" putStrLn "Flatten a nested list structure." putStrLn "> flatten (Elem...
maxdeviant/99-haskell
src/Problems/Seven.hs
mit
609
0
16
145
205
99
106
13
1
module Lib ( main ) where import qualified Study1 import qualified Catalan {- TODO: - find example for zygo? - references: + https://github.com/willtim/recursion-schemes + https://stackoverflow.com/q/36851766/315302 + https://blog.sumtypeofway.com/posts/introduction-to-recursion-schemes.html ...
Javran/misc
recursion-schemes-playground/src/Lib.hs
mit
472
0
7
91
74
37
37
13
1
{-# htermination union :: (Eq a, Eq k) => [(Either a k)] -> [(Either a k)] -> [(Either a k)] #-} import List
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/List_union_11.hs
mit
109
0
3
23
5
3
2
1
0
module Test.Framework where import Test.Hspec.Core.Spec import Test.Hspec.Runner import Test.Framework.Providers.API defaultMain :: [Test] -> IO () defaultMain = hspec . parallel . fromSpecList testGroup :: TestName -> [Test] -> Test testGroup = specGroup
sol/hspec-test-framework
src/Test/Framework.hs
mit
290
0
7
66
77
46
31
8
1
-- Welcome to the City -- https://www.codewars.com/kata/5302d846be2a9189af0001e4 module Welcome where sayhello :: [String] -> String -> String -> String sayhello ns c s = "Hello, " ++ unwords ns ++ "! Welcome to " ++ c ++ ", " ++ s ++ "!"
gafiatulin/codewars
src/8 kyu/Welcome.hs
mit
240
0
11
44
65
35
30
3
1
{-# LANGUAGE OverloadedStrings #-} module Ch26.HitCounter where import Control.Monad.Trans.Class import Control.Monad.Trans.Reader import Control.Monad.IO.Class import Data.IORef import qualified Data.Map as M import Data.Maybe (fromMaybe) import Data.Text.Lazy (Text) import qualified Data.Text.Lazy as TL import Web....
andrewMacmurray/haskell-book-solutions
src/ch26/HitCounter.hs
mit
1,302
0
13
334
464
246
218
43
2
module Solar.Cast.Client where
Cordite-Studios/solar-wind
Solar/Cast/Client.hs
mit
31
0
3
3
7
5
2
1
0
{-# LANGUAGE GADTs #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ImpredicativeTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE StandaloneDeriving #-} module ASP ( ) where import Text.PrettyPrint import Control.Applicative hiding (empty) import Data.Char data Fact = F...
mfpi/hsys
src/ASP.hs
mit
3,701
0
12
869
1,334
673
661
92
1
{-@ LIQUID "--no-termination" @-} import Euterpea {-@ measure len @-} len :: Music a -> Int len m = case m of Prim _ -> 1 m1 :+: m2 -> len m1 + len m2 m1 :=: m2 -> len m1 + len m2 Modify c m -> len m third :: Pitch -> Pitch third=trans 3 n = c 4 qn :+: d 3 qn {-@ exs :: [(Music Pitch,Music Pit...
santolucito/ives
tests/musicNoSize.hs
mit
443
0
9
141
169
85
84
14
4
{-# LANGUAGE FlexibleContexts #-} module Language.Haskell.Exts.PrettyAst ( PrettyAst(..) , renderWithMode , renderWithDefMode , renderWithTrace , PrettyMode(..) , defPrettyMode , PR.Style(..) , PR.style , PR.PPHsMode(..) , PR.defaultMode , DocM ) where import Language.Haskell.Exts.Annotated imp...
Pnom/haskell-ast-pretty
Language/Haskell/Exts/PrettyAst.hs
mit
89,513
103
22
21,568
28,683
13,825
14,858
1,879
3
{-# LANGUAGE OverloadedStrings #-} module Main where import qualified Chart.Bar as Bar import qualified Chart.BarW as BarW import qualified Chart.Combo as Combo import qualified Chart.Heatmap as Heatmap import qualified Chart.Line as Line import Chart.Render import qualified Chart.Scatter as Scatter import ...
tonyday567/hdcharts
test/example.hs
mit
4,142
0
22
1,029
1,310
696
614
-1
-1
module HsSearch.Paths_hssearch where import System.FilePath ((</>)) import HsSearch.Config (getDataPath) -- NOTE: this path is only used for testing/development, after cabal install -- the path will be overridden by the data-files setting in the cabal file getDataFileName :: FilePath -> IO FilePath getDataFileName f ...
clarkcb/xsearch
haskell/hssearch/src/HsSearch/Paths_hssearch.hs
mit
377
0
8
59
68
38
30
7
1
module Interface.Top ( topMenue ) where import Interface.General import Interface.ArGeo import Interface.Special import Control.Monad import System.IO topMenue :: IO () topMenue = do putStrLn "<1> Operationen mit arithmetischen und geometrischen Zahlenfolgen" putStrLn "<2> Operatione...
DevWurm/numeric-sequences-haskell
src/Interface/Top.hs
mit
872
0
9
326
190
89
101
26
1