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 Jhc.Type.Word(module Jhc.Type.Word, module Jhc.Prim.Bits) where import Jhc.Prim.Bits -- define the lifted form of the basic -- numeric types. data {-# CTYPE "unsigned" #-} Word = Word Bits32_ data {-# CTYPE "uint8_t" #-} Word8 = Word8 Bits8_ data {-# CTYPE "uint16_t" #-} Word16 = Word16 Bits16_ data {-# C...
m-alvarez/jhc
lib/jhc/Jhc/Type/Word.hs
mit
1,013
0
6
183
191
118
73
18
0
-- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apache License, Version 2.0 (the -- "License"); you ma...
jcgruenhage/dendrite
vendor/src/github.com/apache/thrift/lib/hs/test/Spec.hs
apache-2.0
1,298
0
8
216
98
61
37
11
1
{-# LANGUAGE DeriveDataTypeable #-} module Main where import qualified Data.Array.Accelerate as A import qualified Data.Array.Accelerate.CUDA as CUDA import Data.Data import Data.Int import Data.Typeable import System.Console.CmdArgs import Life data Profile = ...
AndrewRademacher/game-of-life-accelerate
src/Profile.hs
mit
1,297
0
12
417
346
185
161
29
1
min :: (Int,Int) -> Int min (x,y) | x <= y =x | otherwise =y max :: (Int,Int) -> Int max (x,y) | x <= y =y | otherwise =x
MaximilianMihoc/Algorithms
Haskell/MinAndMaxwithTouples.hs
mit
127
6
8
35
104
53
51
8
1
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-} module Web.Slack.Types.IM where import Data.Aeson import Data.Aeson.Types import Control.Applicative import Control.Lens.TH import Web.Slack.Types.Id import Web.Slack.Types.Time import {-# SOURCE #-} Web.Slack.Types.ChannelOpt (ChannelOpt) import Prelude data IM =...
madjar/slack-api
src/Web/Slack/Types/IM.hs
mit
862
0
19
263
224
130
94
26
0
{-# LANGUAGE OverloadedStrings #-} import Data.Bits import qualified Data.ByteString.Char8 as BS import Data.Maybe (catMaybes) import Data.Monoid ((<>)) import Numeric (showHex) import Pwn cfg = defaultConfig { arch = "i386", bits = ...
Tosainu/pwn.hs
example/codegate2017prequal-babypwn.hs
mit
1,682
0
15
694
476
233
243
50
1
module Ori.Misc ( module Ori.Misc ) where import Ori.Types initPoly :: Poly initPoly = mkPoly 4 [V2 0 0, V2 1 0, V2 1 1, V2 0 1] initFacets :: Facets initFacets = mkFacets 1 [mkFacet 4 [0, 1, 2, 3]] initial :: OState initial = (initPoly, (initFacets, initPoly)) init' :: Rat -> Rat -> OState init' xl yl = ...
pbl64k/icfpc2016
Ori/Misc.hs
mit
2,430
0
12
655
1,045
572
473
36
4
{-# LANGUAGE Arrows #-} module Types where import FRP.Yampa.Vector3 import Graphics.UI.GLUT hiding (Level,Vector3(..),normalize) import qualified Graphics.UI.GLUT as G(Vector3(..)) -- Basic Data Types type Pos = Double type Vel = Double type Pos3 = Vector3 Pos type Vel3 = Vector3 Vel -- Reference: Graphics.UI.GLUT....
SLMT/haskell-ping-pong
Types.hs
mit
943
0
8
252
162
107
55
14
0
{-# LANGUAGE RecordWildCards #-} import Data.Set (fromList) import Stackage.Build (build, defaultBuildSettings) import Stackage.BuildPlan (readBuildPlan, writeBuildPlan) import Stackage.CheckPlan (checkPlan) import Stackage.GhcPkg (getGhcVersion) import ...
Tarrasch/stackage
app/stackage.hs
mit
6,102
0
19
1,957
1,560
823
737
124
10
{-# LANGUAGE NoMonomorphismRestriction #-} module Plugins.Gallery.Gallery.Manual49 where import Diagrams.Prelude example = circle 1 ||| strutX 2 ||| square 2
andrey013/pluginstest
Plugins/Gallery/Gallery/Manual49.hs
mit
170
0
7
31
36
20
16
4
1
{-# htermination (toEnumTup0 :: MyInt -> Tup0) #-} import qualified Prelude data MyBool = MyTrue | MyFalse data List a = Cons a (List a) | Nil data Tup0 = Tup0 ; data MyInt = Pos Nat | Neg Nat ; data Nat = Succ Nat | Zero ; primEqNat :: Nat -> Nat -> MyBool; primEqNat Zero Zero = MyTrue; primEqNat Zero (...
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/toEnum_1.hs
mit
977
0
9
209
436
234
202
25
1
{-# LANGUAGE DeriveGeneric #-} module D20.Internal.Character.BasicClass where import GHC.Generics import D20.Internal.Character.Ability import D20.Internal.Character.ClassTable import D20.Internal.Character.Feat import D20.Internal.Character.Skill import D20.Internal.Character.Talent import D20.Dice -- import quali...
elkorn/d20
src/D20/Internal/Character/BasicClass.hs
mit
1,051
0
10
253
194
124
70
25
0
module Tree where import Data.Semigroup import Test.QuickCheck import Test.QuickCheck.Checkers (EqProp, eq, (=-=)) data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) deriving (Eq, Show) instance Functor Tree where fmap _ Empty = Empty fmap f (Leaf a) = Leaf (f a) fmap f (Node...
JoshuaGross/haskell-learning-log
Code/Haskellbook/Foldable/src/Tree.hs
mit
1,097
0
12
283
479
246
233
26
0
{-# LANGUAGE NamedFieldPuns #-} module Utils where import Control.Monad.State.Lazy import Crypto.Cipher.AES import Crypto.Cipher.Types import Crypto.Error import Data.Bits import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as LBS i...
ur-crypto/sec-lib
library/Utils.hs
mit
3,149
0
14
659
1,137
600
537
77
2
{-# LANGUAGE OverloadedStrings, MultiWayIf #-} {-# LANGUAGE RecordWildCards #-} -- | Data structures pertaining to Discord Channels module Network.Discord.Types.Channel where import Control.Monad (mzero) import Data.Text as Text (pack, Text) import Data.Aeson import Data.Aeson.Types (Parser) import Data.Time...
jano017/Discord.hs
src/Network/Discord/Types/Channel.hs
mit
13,073
0
42
5,756
2,507
1,378
1,129
279
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} module Language.Rowling.ValuesSpec (main, spec) where import SpecHelper import Language.Rowling.Definitions.Express...
thinkpad20/rowling
test/Language/Rowling/ValuesSpec.hs
mit
4,301
0
22
1,127
1,799
898
901
90
1
----------------------------------------------------------------------------- -- -- Module : PhyQ.Quantity -- Copyright : -- License : MIT -- -- Maintainer : - -- Stability : -- Portability : -- -- | -- module PhyQ.Quantity ( module Export , TypesEq(..), type (=~=), type (/~=), TypesOrd(..) ) whe...
fehu/PhysicalQuantities
src/PhyQ/Quantity.hs
mit
562
0
5
89
81
61
20
-1
-1
-- Copyright: (c) 2013 Gree, Inc. -- License: MIT-style import System.Prefork import System.Posix import System.Exit (exitSuccess) data ServerConfig = ServerConfig data Worker = Worker1 String | Worker2 String deriving (Show, Read, Eq) instance WorkerContext Worker main :: IO () main = defaultMain defaultSettings {...
gree/haskell-prefork
sample/various-workers.hs
mit
956
3
14
183
269
140
129
24
2
{-| Module : Web.App.State Copyright : (c) Nathaniel Symer, 2016 License : MIT Maintainer : nate@symer.io Stability : experimental Portability : POSIX Typeclass all types to be used as state for a WebApp must have an instance of. -} module Web.App.State ( WebAppState(..) ) where -- |Defines a commo...
fhsjaagshs/webapp
src/Web/App/State.hs
mit
619
0
9
160
85
47
38
10
0
data StatePoint
Zomega/thesis
Wurm/System/ControlledSystem.hs
mit
16
0
3
2
4
2
2
-1
-1
module GHCJS.DOM.SVGNumberList ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/SVGNumberList.hs
mit
43
0
3
7
10
7
3
1
0
{-# LANGUAGE CPP #-} module Tinc.GhcPkgSpec (spec) where import Control.Monad import System.Environment import Helper import Tinc.Facts import Tinc.GhcPkg import Tinc.Package globalPackages :: [String] globalPackages = [ "array" , "base" , "binary" ...
robbinch/tinc
test/Tinc/GhcPkgSpec.hs
mit
1,030
0
14
268
217
131
86
45
1
module Main where import NXT -- btBrick = NXTBrick Bluetooth "/dev/tty.NXT-DevB-1" -- -- main = do -- h <- nxtOpen btBrick -- -- reactimate (mkInit h) (mkSense h) (mkActuate h) nxtSF -- -- nxtClose h main = testloop
janv/haskell-nxt
src/test.hs
mit
226
0
4
48
20
16
4
3
1
module Driver where import Data.Monoid ((<>)) import Data.Foldable import Control.Monad import Data.Maybe import Data.Int import Data.Either hiding (fromRight) import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Char8 as BS import qualified Data.Vector as ...
postgres-haskell/postgres-wire
tests/Driver.hs
mit
9,248
0
18
2,132
2,385
1,182
1,203
203
2
{-# LANGUAGE FlexibleContexts #-} module Data.Functor.Foldable.Extended ( module Data.Functor.Foldable , cataM , paraM ) where import Prelude import Control.Monad import Data.Functor.Foldable import Data.Traversable as T -- from https://github.com/ekmett/recursion-schemes/issues/3 cataM :: (Recursive t, ...
imccoy/utopia
src/Data/Functor/Foldable/Extended.hs
mit
786
0
10
186
267
146
121
-1
-1
{-# LANGUAGE TemplateHaskell, CPP #-} module Yesod.Routes.TH.RenderRoute ( -- ** RenderRoute mkRenderRouteInstance , mkRenderRouteInstance' , mkRouteCons , mkRenderRouteClauses ) where import Yesod.Routes.TH.Types #if MIN_VERSION_template_haskell(2,11,0) import Language.Haskell.TH (conT) #end...
erikd/yesod
yesod-core/Yesod/Routes/TH/RenderRoute.hs
mit
6,126
0
21
1,772
1,972
1,012
960
117
9
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module LiuCourses (runApp, runMigrations) where import Web.Scotty.Trans (middleware, scottyOptsT, json, get, defaultHandler, notFou...
SebastianCallh/liu-courses
src/LiuCourses.hs
mit
1,264
0
12
330
306
156
150
32
1
{-# LANGUAGE GeneralizedNewtypeDeriving, TemplateHaskell, QuasiQuotes, ScopedTypeVariables, MultiParamTypeClasses, DeriveDataTypeable, TypeSynonymInstances,FlexibleInstances #-} {- ** ********************************************************************* * ...
elitak/forest
Language/Forest/BaseTypes.hs
epl-1.0
2,484
0
4
1,120
40
28
12
7
0
module Main where import Text.ParserCombinators.Parsec import Types import Reader import Eval import Data.Map import Functions import Control.Exception main :: IO () main = do res <- startEval (parseLisp code) initEnv putStrLn res code = "(def x 3) " ++ "(def l '(1 2 3)) " ++ "(def do (fn (arg ...
ckirkendall/hlisp
Main.hs
gpl-2.0
1,789
0
20
717
444
238
206
48
1
module LambdaRay.Helper where import Numeric.LinearAlgebra import Numeric.LinearAlgebra.Util(cross, norm) import qualified Control.Parallel.Strategies as P import qualified Codec.Picture as CI import LambdaRay.Types pmap f as = P.withStrategy (P.parListChunk 1024 P.rpar) $ map f as vec4 :: [Double] -> Vect vec4 = (4 ...
zombiecalypse/LambdaRay
src/LambdaRay/Helper.hs
gpl-2.0
1,145
0
10
225
519
282
237
33
2
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE DeriveGeneric #-} module Lib.Makefile.Types ( TargetType(..), targetAllInputs , FilePattern(..), onFilePatternPaths , InputPat(..), onInputPatPaths , Target, onTargetPaths , Pattern, onPatternPaths , VarName, VarValue, Vars , Makefile(..), onMakefilePaths ...
da-x/buildsome
src/Lib/Makefile/Types.hs
gpl-2.0
3,495
0
12
569
1,110
603
507
87
1
-- File: ch3/exB1.hs -- A function that computes the number of elements in a list. length' :: [a] -> Int length' (x:xs) = 1 + (length' xs) length' [] = 0
friedbrice/RealWorldHaskell
ch3/exB1.hs
gpl-2.0
159
0
7
36
50
27
23
3
1
module Network.Tremulous.NameInsensitive ( TI(..), mk, mkColor, mkAlphaNum ) where import Prelude hiding (length, map, filter) import Data.ByteString.Char8 import Data.Char import Data.Ord import Network.Tremulous.ByteStringUtils data TI = TI { original :: !ByteString , cleanedCase :: !ByteString ...
Cadynum/tremulous-query
Network/Tremulous/NameInsensitive.hs
gpl-3.0
1,169
0
12
299
446
233
213
38
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NamedFieldPuns #-} module Formatter where import Data.Char (intToDigit) import Data.Text (Text) import qualified Data.Text as T import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Data.Set (Set) import qualified Data.Set as Set import Numeric (sh...
easoncxz/hack-assembler
src/Formatter.hs
gpl-3.0
2,319
0
11
616
667
354
313
70
18
content <- readFile "/etc/lsb-release" let nChars = length content putStrLn $ "File content = \n" ++ content putStrLn $ "File size (number of chars) = " ++ show nChars putStrLn "--------------------------------" :{ getPassword :: String -> IO () -> IO () -> IO () getPassword password s...
caiorss/Functional-Programming
haskell/src/script_ghci.hs
unlicense
1,736
13
15
551
421
199
222
-1
-1
{-# LANGUAGE FlexibleInstances #-} import GHC.Arr import Data.Word -- Chapter exercises -- 1. Bool has kind *, hence no Functor instance -- 2. Kind * -> *, can have Functor -- 3. Same -- 4. newtype Mu f = InF { outF :: f (Mu f) } -- Mu :: (* -> *) -> * -- Yes? -- 5. data D = D (Array Word Word) Int Int -- D :: * --...
dmvianna/haskellbook
src/Ch16Ex-Functor.hs
unlicense
2,844
0
10
756
1,336
708
628
63
0
-- Copyright 2015 Google Inc. All Rights Reserved. -- -- Licensed under the Apache License, Version 2.0 (the "License")-- -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicabl...
polux/subsume
Algo.hs
apache-2.0
4,959
0
13
1,225
1,865
943
922
99
12
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- | -- Module : Web.Pagure.Projects -- Copyright : (C) 2015 Ricky Elrod -- License : BSD2 (see LICENSE file) -- Maintainer : Ricky Elrod <relrod@redhat.com> -- Stability : experimental -- Portability : ghc ...
fedora-infra/pagure-haskell
src/Web/Pagure/Projects.hs
bsd-2-clause
2,314
0
16
389
395
223
172
-1
-1
{-# LANGUAGE MagicHash #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.AttachInstances -- Copyright : (c) Simon Marlow 2006, -- David Waern 2006-2009, -- Isaac Dupree 2009 -- License : BSD-like -- -...
nominolo/haddock2
src/Haddock/Interface/AttachInstances.hs
bsd-2-clause
5,221
0
26
1,329
1,323
699
624
91
10
{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, RecordWildCards #-} module Network.DBpedia.Spotlight (Client(..), SpotlightResponse(..), SpotlightResource(..), ResourceType, SpotlightCandidatesResponse, SpotlightCandidates (..), CandidateEntity (..), candidates, defaultHost, defaultPort, d...
ThoughtLeadr/spotlight-client
Network/DBpedia/Spotlight.hs
bsd-3-clause
8,228
0
16
1,912
2,045
1,055
990
164
3
{-# LANGUAGE TypeSynonymInstances #-} module Data.TrieMap.OrdMap.Zippable () where import Data.TrieMap.OrdMap.Base instance Zippable (SNode k) where empty = tip clear (Empty _ path) = rebuild tip path clear (Full _ path l r) = rebuild (l `glue` r) path assign a (Empty k path) = rebuild (single k a) path ...
lowasser/TrieMap
Data/TrieMap/OrdMap/Zippable.hs
bsd-3-clause
735
0
8
162
358
180
178
17
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} module FinalTagless.Deep where import FinalTagless.GoalSyntax import qualified Syntax newtype Deep v = Deep { unDeep :: Syntax.G v } instance Goal v Deep where unif x y = Deep $ (Syntax.:=:) x y conj x y xs = Deep $ Syntax.Conjunction (unD...
kajigor/uKanren_transformations
src/FinalTagless/Deep.hs
bsd-3-clause
713
0
9
131
286
150
136
16
1
{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} #include "thyme.h" -- | Calendar months and day-of-months. module Data.Thyme.Calendar.MonthDay ( Month, DayOfMonth , MonthDay (..), _mdMonth, _mdDay , monthDay, monthDayValid, monthLength , module Data.Thyme.Calendar.M...
liyang/thyme
src/Data/Thyme/Calendar/MonthDay.hs
bsd-3-clause
1,847
0
10
333
235
146
89
31
1
{-# LANGUAGE OverloadedStrings #-} module Trombone.Middleware.Cors ( cors ) where import Data.ByteString import Data.List.Utils import Database.Persist.Types import Network.HTTP.Types.Header ( HeaderName ) import Network.HTTP.Types.Status import Network.Wai import Netwo...
johanneshilden/trombone
Trombone/Middleware/Cors.hs
bsd-3-clause
2,364
0
16
745
529
286
243
46
4
module Main where import Test.Tasty import Test.Tasty.QuickCheck as QC import Test.Tasty.HUnit import Data.List import Data.Ord main = defaultMain tests tests :: TestTree tests = testGroup "Tests" [properties, unitTests] properties :: TestTree properties = testGroup "Properties" [qcProps] qcProps = testGroup "(ch...
creswick/wikicfp-parser
tests/src/Main.hs
bsd-3-clause
977
0
15
214
326
186
140
-1
-1
module Main where import Control.Applicative import Criterion.Main import Data.Maybe (catMaybes) import System.Directory (getDirectoryContents) import System.FilePath import Language.Lua main :: IO () main = defaultMain [ env (loadFiles "lua-5...
osa1/language-lua
bench/Main.hs
bsd-3-clause
675
0
18
179
203
105
98
16
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Stack.PackageDump ( Line , eachSection , eachPair , DumpPa...
vigoo/stack
src/Stack/PackageDump.hs
bsd-3-clause
16,659
0
27
5,385
4,240
2,172
2,068
-1
-1
{-# LANGUAGE DeriveGeneric #-} -- | The type of item aspects and its operations. module Game.LambdaHack.Common.ItemAspect ( AspectRecord(..), KindMean(..) , emptyAspectRecord, addMeanAspect, castAspect, aspectsRandom , aspectRecordToList, rollAspectRecord, getSkill, checkFlag, meanAspect , onlyMinorEffects, ite...
LambdaHack/LambdaHack
engine-src/Game/LambdaHack/Common/ItemAspect.hs
bsd-3-clause
7,645
0
16
1,671
2,102
1,119
983
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} ------------------------------------------------------------------------------- -- | -- Module : Bart.Departure.Parser -- Copyright : (c) 2012 Paulo Tanimoto -- License : BSD3 -- -- Maintainer : Paulo Tanimoto <ptanimoto@gmail.com> -- ------...
tanimoto/bart
src/Bart/Departure/Parser.hs
bsd-3-clause
3,634
0
17
1,076
947
497
450
103
2
{-# LANGUAGE RecordWildCards #-} module Codex.Lib.Server.MVar ( Server, ID, Message (..), Event (..), Client (..), initServer, deliverWall, deliverBroadcast, deliverMessage, send'event'connection, send'event'disconnect, send'event'debug ) where import Codex.Lib.Map import Control.Monad import Control.Conc...
adarqui/Codex
src/Codex/Lib/Server/MVar.hs
bsd-3-clause
4,228
0
16
803
1,538
761
777
135
6
{-# LANGUAGE OverloadedStrings #-} module ETA.CodeGen.Rts where import Data.Text import Codec.JVM import ETA.Util import Data.Monoid((<>)) import qualified Data.Text as T -- NOTE: If the RTS is refactored, this file must also be updated accordingly -- merge "a" "b" == "a/b" merge :: Text -> Text -> Text merge x...
AlexeyRaga/eta
compiler/ETA/CodeGen/Rts.hs
bsd-3-clause
9,559
0
12
1,797
2,608
1,420
1,188
231
8
{-# LANGUAGE OverloadedStrings, TypeFamilies, FlexibleContexts, PackageImports #-} module Retrieve (retrievePln, retrieveEx, retrieveDM5, retrieveSS1) where import "monads-tf" Control.Monad.State import "monads-tf" Control.Monad.Error import qualified Data.ByteString as BS import qualified Network.Sasl as SASL impor...
YoshikuniJujo/xmpipe
examples/Retrieve.hs
bsd-3-clause
1,670
24
10
222
534
288
246
33
1
-- | Random-access, streaming sources, which are used to read PDF files -- incrementally. module Graphics.PDF.Source ( -- * Sources Source(..) -- * Construction , handleSource , byteStringSource -- * Parsing , parseStream ) where import Control.Applicative import ...
knrafto/pdfkit
Graphics/PDF/Source.hs
bsd-3-clause
1,429
0
12
373
326
180
146
29
1
module Closure where import Control.Applicative import Control.Monad.State import Data.Set (Set, difference, union) import qualified Data.Set as Set import Data.Map (Map) import qualified Data.Map as Map import Data.Maybe (fromJust) import Debug.Trace import Id import Type import Syntax hiding (name, args, body) impo...
koba-e964/hayashii-mcc
Closure.hs
bsd-3-clause
6,145
2
23
1,333
2,582
1,318
1,264
209
21
{- | Use GHC to load a ModIface from a .hi file -} module HPack.Iface.LoadIface ( IfaceM , ModName(..) , ModIface , runIfaceM , compileAndLoadIface , showModIface ) where import GHC ( getSessionDynFlags, setSessionDynFlags, workingDirectoryChanged , runGhc, Ghc, GhcMonad , defaultErrorHandler, SuccessFlag(...
markflorisson/hpack
src/HPack/Iface/LoadIface.hs
bsd-3-clause
2,724
0
11
496
632
358
274
59
2
module Types where -- | data World = World { worldCells :: [Cell] -- ^ клетки , worldPlayer :: State -- ^ чей ход , worldTotals :: CountBlackWhite -- ^ кол-во черныз, белых , prevWorld :: Maybe World -- ^ храним предыдущий шаг , mouse :: Point -- ^ считывание п...
cmc-haskell-2016/reversi
src/Types.hs
bsd-3-clause
3,406
0
12
704
780
462
318
59
1
{-# LANGUAGE RankNTypes, TypeOperators, DefaultSignatures #-} module MHask.Impl.Identity ( IdentityT , fmap , extract ) where import Prelude hiding (fmap, return) import MHask.Arrow import Control.Monad.Trans.Identity import Control.Monad.Trans.Class (lift) fmap :: (Monad m, Monad n) => (m ~> n) -> (Ident...
DanBurton/MHask
MHask/Impl/Identity.hs
bsd-3-clause
453
0
9
82
150
86
64
15
1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Test.Data.SymReg.AST( ) where import Data.SymReg.AST import Data.SymReg.Functions import Test.QuickCheck instance Arbitrary AST where arbitrary = frequency [ (2, literal) , (2, var) , (1, function) ] where literal = do v <- arbitrary...
Teaspot-Studio/genmus
test/Test/Data/SymReg/AST.hs
bsd-3-clause
1,225
0
15
288
368
189
179
29
2
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Main (main) where import Data.Text (Text) import qualified Data.Text.Normalize as T import Data.Text.Normalize (NormalizationMode) import Data.Unicode.Internal.Division (quotRem21, quotRem28) import QuickCheckUtils () ...
harendra-kumar/unicode-transforms
test/Properties.hs
bsd-3-clause
2,110
0
14
479
476
259
217
35
1
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Control.Functor.Concurrent where import Control.Applicative import Control.Monad import Control.Monad.Base import Control.Monad.Trans.Control import Control.Monad.Trans.Identity import Control.Mona...
jwiegley/functors
Control/Functor/FreeControl.hs
bsd-3-clause
1,985
0
9
458
267
167
100
20
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} module Control.Distributed.Process.ManagedProcess.Brisk ( handleCallSpec , replySpec , callSpec , defaultProcessSpec , serveSpec , module Control.Distributed.Process.ManagedProcess ) where import Brisk.Annota...
abakst/brisk-prelude
src/Control/Distributed/Process/ManagedProcess/Brisk.hs
bsd-3-clause
2,852
0
13
836
676
378
298
72
2
module UnitTests.SimulationConstantsSpec( spec ) where import Test.Hspec import SimulationConstants spec :: Spec spec = parallel $ describe "SimulationConstants" $ do it "dimensionCount is at least 1" $ dimensionCount >= 1 `shouldBe` True it "z...
satai/FrozenBeagle
Simulation/Lib/testsuite/UnitTests/SimulationConstantsSpec.hs
bsd-3-clause
1,063
0
11
323
204
101
103
24
1
module Alias where import Data.Word import qualified Data.IntMap as M type BitBoard = Word64 type ZobristKey = Word64 type From = BitBoard type To = BitBoard type PieceMap = BitBoard type EmptyMap = BitBoard type AttackMap = BitBoard type Oc...
syanidar/Sophy
src/Alias.hs
bsd-3-clause
979
0
5
421
188
126
62
30
0
{-# LINE 1 "GHC.Float.RealFracMethods.hs" #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, MagicHash, UnboxedTuples, NoImplicitPrelude #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Fl...
phischu/fragnix
builtins/base/GHC.Float.RealFracMethods.hs
bsd-3-clause
11,966
0
29
3,506
2,279
1,211
1,068
189
2
{-# OPTIONS_GHC -fno-warn-type-defaults #-} module Math.NumberTheory.ZetaBench ( benchSuite ) where import Gauge.Main import Math.NumberTheory.Zeta benchSuite :: Benchmark benchSuite = bgroup "Zeta" [ bench "riemann zeta" $ nf (sum . take 20 . zetas) (1e-15 :: Double) , bench "dirichlet beta" $ nf (sum . ...
Bodigrim/arithmoi
benchmark/Math/NumberTheory/ZetaBench.hs
mit
359
0
12
68
109
60
49
9
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module CO4.Unique ( MonadUnique(..), UniqueT, Unique, withUnique, withUniqueT , newName, newNamelike, originalName, liftListen, liftPass) where import Prelude hiding (fail) import Control.Monad.Identity (Identity,runIdentity) import Control...
apunktbau/co4
src/CO4/Unique.hs
gpl-3.0
4,176
0
13
1,017
1,310
711
599
87
1
{-#LANGUAGE DeriveDataTypeable#-} module Data.P440.Domain.FilenameAst where import Data.Typeable (Typeable) import Data.Text data Message = Message {messagePrefix :: Text ,messageResend :: Text ,messageBIC :: Text ,messageTaxcode :: Text ,messageFiledate ...
Macil-dev/440P-old
src/Data/P440/Domain/FilenameAst.hs
unlicense
1,911
0
9
703
447
270
177
54
0
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RecordWildCards #-} -- | The Config type. module Stack.Ty...
tedkornish/stack
src/Stack/Types/Config.hs
bsd-3-clause
40,760
0
17
10,128
7,887
4,205
3,682
855
6
{-# LANGUAGE OverloadedStrings #-} module ConfigSpec (configSpec) where import TestImport configSpec :: Spec configSpec = ydescribe "postAddConfigureR" $ do yit "Parses an config and insert it into the manager" $ do testNodeConfig <- liftIO $ readTestConf "testConfigs/testAddConfig.yml" postBody ...
bitemyapp/node-manager
test/ConfigSpec.hs
bsd-3-clause
1,365
0
16
349
269
115
154
29
1
-- | -- Copyright : (c) Sam Truzjan 2013 -- License : BSD3 -- Maintainer : pxqr.sta@gmail.com -- Stability : experimental -- Portability : portable -- module Network.BitTorrent.Exchange ( -- * Manager Options (..) , Manager , Handler , newManager , clo...
DavidAlphaFox/bittorrent
src/Network/BitTorrent/Exchange.hs
bsd-3-clause
736
0
5
255
90
65
25
20
0
module Runner ( run ) where import Control.DeepSeq (deepseq) import TAPL.Meow (Meow, meow) import Evaluator (evaluate) import Parser (parseTree) import PPrint (pprint) run :: String -> Meow () run str = do let term = parseTree str let val = term `deepseq` evaluate term meow $ pprint val
foreverbell/unlimited-plt-toys
tapl/untyped/Runner.hs
bsd-3-clause
299
0
11
59
118
64
54
12
1
{-# LANGUAGE CPP, ScopedTypeVariables #-} module TcErrors( reportUnsolved, reportAllUnsolved, warnAllUnsolved, warnDefaulting, solverDepthErrorTcS ) where #include "HsVersions.h" import TcRnTypes import TcRnMonad import TcMType import TcType import TypeRep import Type import Kind ( isKind ) i...
fmthoma/ghc
compiler/typecheck/TcErrors.hs
bsd-3-clause
72,845
1
21
22,355
15,070
7,671
7,399
-1
-1
{-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- -- The register allocator -- -- (c) The University of Glasgow 2004 -- ----------------------------------------------------------------------------- {- The algorithm is roughly: 1...
sgillespie/ghc
compiler/nativeGen/RegAlloc/Linear/Main.hs
bsd-3-clause
37,774
6
25
13,350
5,737
2,935
2,802
459
13
{-# LANGUAGE CPP, MagicHash #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.AttachInstances -- Copyright : (c) Simon Marlow 2006, -- David Waern 2006-2009, -- Isaac Dupree 2009 -- License : BSD-like...
Helkafen/haddock
haddock-api/src/Haddock/Interface/AttachInstances.hs
bsd-2-clause
9,858
106
23
2,499
2,693
1,438
1,255
170
7
-- | Some helpers for dealing with WAI 'Header's. module Network.Wai.Header ( contentLength ) where import qualified Data.ByteString.Char8 as S8 import Network.HTTP.Types as H -- | More useful for a response. A Wai Request already has a requestBodyLength contentLength :: [(HeaderName, S8.ByteString)] -> Mayb...
erikd/wai
wai-extra/Network/Wai/Header.hs
mit
530
0
9
107
128
72
56
11
2
{-# LANGUAGE PatternGuards, ExistentialQuantification, CPP #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.Core.Execute (execute) where import Idris.AbsSyntax import Idris.AbsSyntaxTree import IRTS.Lang(FDesc(..), FType(..)) import Idris.Primitives(Prim(..), primitives) import Idris.Core.TT import Id...
phaazon/Idris-dev
src/Idris/Core/Execute.hs
bsd-3-clause
29,471
0
6
10,849
259
166
93
28
1
module TreeIn4 where data Tree a = Leaf a | Branch (Tree a) (Tree a) fringe :: Tree a -> [a] fringe (Leaf x) = [x] fringe (Branch left right@(Leaf b_1)) = (fringe left) ++ (fringe right) fringe (Branch left right@(Branch b_1 b_2)) = (fringe left) ++ (fringe right) fringe (Branch left right) = (fringe lef...
kmate/HaRe
old/testing/subIntroPattern/TreeIn4_TokOut.hs
bsd-3-clause
341
0
10
74
181
95
86
10
1
{-# LANGUAGE KindSignatures, TypeFamilies, PolyKinds #-} module T7341 where data Proxy a = Proxy class C a where type F (a :: *) :: * op :: Proxy a -> Int instance C [] where op _ = 5
urbanslug/ghc
testsuite/tests/polykinds/T7341.hs
bsd-3-clause
194
0
8
49
65
37
28
8
0
facMod :: Integer -> Integer -> Integer facMod n m = loop n 1 where loop 0 acc = acc loop k f | k >= m = 0 | f == 0 = 0 | otherwise = loop (k - 1) ((f * k) `mod` m) main :: IO () main = print $ 1000000 `facMod` 1001001779
genos/online_problems
prog_praxis/modular_factorial.hs
mit
276
0
12
112
136
69
67
8
2
{-# LANGUAGE LambdaCase #-} module Main where import Language.Haskell.Interpreter import System.Environment import System.Exit import System.IO import Test.Target import Text.Printf main :: IO () main = do [src, binder] <- getArgs r <- runInterpreter $ do loadModules [src] mods <- getLoadedModules -- ...
gridaphobe/target
bin/Target.hs
mit
966
0
17
230
311
157
154
25
4
{-# LANGUAGE OverloadedStrings #-} module JoScript.Util.TextTest (tests) where import Prelude (flip, String, ($)) import Data.Word import Test.HUnit import Control.Applicative (pure, (<$>), (<*>)) import JoScript.Util.Text tests = [ TestLabel "JoScript.Util.Text.foldlM" tryFoldM , TestLabel "JoScript.Util.Text.r...
AKST/jo
source/test/JoScript/Util/TextTest.hs
mit
807
0
13
137
215
117
98
20
1
----------------------------------------------------------------------------- -- | -- Module : My.Control.Concurrent -- Copyright : (c) Dmitry Antonyuk 2009 -- License : MIT -- -- Maintainer : lomeo.nuke@gmail.com -- Stability : experimental -- Portability : portable -- -- Utilities for multithreadi...
lomeo/my
src/My/Control/Concurrent.hs
mit
819
0
8
140
102
63
39
8
1
module BlankSpec where import Test.Hspec import Main spec :: Spec spec = do describe "blank test" $ do it "test" $ 3 `shouldBe` (3 :: Int)
mathfur/grep-tree
test/Spec.hs
mit
147
0
12
34
54
30
24
7
1
import Data.Time.Calendar (fromGregorian) import Data.Time.Calendar.WeekDate (toWeekDate) months = [fromGregorian y m d|y<-[1901..2000],m<-[1..12],d<-[1]] sundays = filter sunday months where sunday d = trd (toWeekDate d) == 7 trd (_,_,x) = x answer = length sundays coins = [200,100,50,20,10,5,2,1] ns = [1,0,0,0...
yuto-matsum/contest-util-hs
src/Euler/019.hs
mit
412
1
10
70
257
147
110
-1
-1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.CSSStyleRule (js_setSelectorText, setSelectorText, js_getSelectorText, getSelectorText, js_getStyle, getStyle, CSSStyleRule, castToCSSStyleRule, gTypeCSSStyleRule) where import Prelud...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/CSSStyleRule.hs
mit
2,451
20
11
372
596
351
245
42
1
{-# LANGUAGE ExistentialQuantification, RankNTypes, ImpredicativeTypes #-} module ConstraintWitness.TcPlugin.Instances where import Prelude hiding (init) import Data.Monoid import Data.List (union) import Data.Traversable (traverse) import Control.Monad (sequence, void) import GhcPlugins () import T...
Solonarv/constraint-witness
plugin/ConstraintWitness/TcPlugin/Instances.hs
mit
1,807
0
11
439
436
237
199
29
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module Products.DomainTermsAPI ( DomainTermsAPI , CreateDomainTermsAPI , EditDomainTermsAPI , RemoveDomainTermAPI , APIDom...
gust/feature-creature
legacy/exe-feature-creature-api/Products/DomainTermsAPI.hs
mit
4,232
0
19
1,288
1,079
570
509
87
2
{- definitions: DayOfWeek is a datatype Mon, Tue are data instances -} -- intro: data DayOfWeek = Mon|Tue|Wed|Thu|Fri|Sat|Sun deriving (Show) data Date = Date DayOfWeek Int deriving (Show) instance Eq DayOfWeek where (==) Mon Mon = True (==) Tue Tue = True (==) Wed Wed = True (==) Thu Thu = True (==) Fri...
Numberartificial/workflow
haskell-first-principles/haskell-from-first-principles-master/06/06.05.00-writing-typeclass-instancess.hs
mit
1,917
0
8
538
835
462
373
49
0
module Handlers.InfoDiagramBtn where import Control.Lens import Data.Time import Graphics.UI.Gtk as Gtk import Graphics.Rendering.Chart.Easy hiding (label) import Graphics.Rendering.Chart.Gtk as Chart import Types i...
deynekalex/Money-Haskell-Project-
src/Handlers/InfoDiagramBtn.hs
gpl-2.0
5,941
3
31
1,516
1,480
700
780
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_HADDOCK show-extensions #-} -- | -- Module : Yi.Keymap.Vim.Ex.Commands.Reload -- License : GPL-2 -- Maintainer : yi-devel@googlegroups.com -- Stability : experimental -- Portability : portable module Yi.Keymap.Vim.Ex.Commands.Reload (parse) where import...
atsukotakahashi/wi
src/library/Yi/Keymap/Vim/Ex/Commands/Reload.hs
gpl-2.0
655
0
8
104
125
81
44
14
1
-- | A config file will be parsed by 'runConfigParser' into a list of -- @['Config']@. Use 'getTextRoot', 'getHyphens', etc. to get an -- aspect of the configuration from this list. module HTCF.ConfigParser ( Config (..) , runConfigParser , getTextRoot , getHyphens , getLineBreaks , getDroppedTrees , get...
lueck/htcf
src/HTCF/ConfigParser.hs
gpl-3.0
14,441
0
18
3,459
2,546
1,383
1,163
259
2
module Constraint.Strategy.Simple ( SimpleStrategy ) where import Constraint.Strategy import Data.Traversable (sequenceA) data SimpleStrategy = Simple instance ConstraintStrategy SimpleStrategy where feasibleArrangements = feasibleNormalArrangements feasibleNormalArrangements :: ConstraintMap a -> [Arrangemen...
recursion-ninja/SecretSanta
Constraint/Strategy/Simple.hs
gpl-3.0
529
0
9
100
125
67
58
13
2
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE FlexibleContexts #-} module Sara.Semantic.Checker ( checkWithoutMain , checkWithMain ) where import Text.Parsec.Pos import Control.Monad import Control.Monad.Identity import Control.Monad.Except import Control.Monad.State.Strict import Data.Monoid impo...
Lykos/Sara
src/lib/Sara/Semantic/Checker.hs
gpl-3.0
2,789
0
13
702
844
432
412
55
4
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses, RankNTypes#-} ----------------------------------------------------------------------------- -- | -- Module : Numerical.PETSc.Internal.PutGet.SVD -- Copyright : (c) Marco Zocca 2015 -- License : LGPL3 -- Maintainer : zocca . marco . gmail . com -- Stabili...
ocramz/petsc-hs
src/Numerical/PETSc/Internal/PutGet/SVD.hs
gpl-3.0
1,356
0
10
200
299
165
134
22
1
module Response ( -- | @/about@ module Response.About, -- | @/calendar@ module Response.Calendar, -- | @/draw@ module Response.Draw, -- | @/graph@ module Response.Graph, -- | @/grid@ module Response.Grid, -- | @/image@ m...
pkukulak/courseography
hs/Response.hs
gpl-3.0
887
0
5
272
138
92
46
24
0
import Parsers import Exprs as E import Data.Char import Control.Monad import Control.Applicative number :: Parser Integer number = do ds <- some digit return (read ds :: Integer) constInt :: Parser E.Expr constInt = do n <- token numb...
2016-Fall-UPT-PLDA/labs
week-04/week-04.hs
gpl-3.0
809
1
11
299
266
128
138
35
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/GetConsoleOutput.hs
mpl-2.0
5,243
0
11
1,114
654
396
258
71
1
module Handler.Supplier where import Import import Handler.Common import Data.Maybe getSupplierR :: Handler Html getSupplierR = do sups <- runDB $ selectList [] [Asc SupplierIdent] defaultLayout $ do setTitleI MsgSuppliers $(widgetFile "supplier") getNewSupplierR :: Handler Html getNewSupplierR = do (n...
nek0/yammat
Handler/Supplier.hs
agpl-3.0
3,688
0
21
863
1,099
526
573
99
3
module School (School, empty, grade, add, sorted) where import qualified Data.Map as M import qualified Data.Set as S import Control.Arrow (second) type Grade = Int type Student = String type School = M.Map Grade (S.Set Student) empty :: School empty = M.empty sorted :: School -> [(Grade, [Student])] sorted = map (s...
mscoutermarsh/exercism_coveralls
assignments/haskell/grade-school/example.hs
agpl-3.0
578
0
9
93
220
125
95
15
1
{-# LANGUAGE GADTs #-} -- Calculating exception machine: http://www.cs.nott.ac.uk/~pszgmh/bib.html#machine -- Syntax data Expr = Val Int | Add Expr Expr deriving (Show) -- Semantics: eval :: Expr -> Int eval (Val n) = n eval (Add x y) = eval x + eval y -- Expression e = Add (Val 3) (Val 5) --...
egaburov/funstuff
Haskell/exceptions/exceptions0.hs
apache-2.0
3,792
1
13
1,000
960
514
446
58
1