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 OverloadedStrings #-} module InnerEar.Widgets.SpecEval where import Reflex import Reflex.Dom import Data.Map import Control.Monad import qualified Data.Text as T import Data.Monoid((<>)) import Data.Maybe (fromJust) import InnerEar.Types.Frequency import InnerEar.Widgets.Utility impo...
d0kt0r0/InnerEar
src/InnerEar/Widgets/SpecEval.hs
gpl-3.0
2,680
0
16
455
648
337
311
37
1
{-# LANGUAGE OverloadedStrings #-} -- | Shows and processes the upload form. module Handler.Upload (Options (..), getUploadR, postUploadR, uploadForm, score) where import Import import Control.Monad.Writer hiding (lift) import Data.Map (elems) import qualified Data.Text as T import Database.Persist.Sql (rawSql) ...
RaphaelJ/getwebb.org
Handler/Upload.hs
gpl-3.0
6,794
18
16
1,966
1,323
722
601
-1
-1
-- 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 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful...
Fuuzetsu/cwk2-cm20219-2013
Main.hs
gpl-3.0
19,244
6
35
5,713
6,237
3,306
2,931
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dataflow/gen/Network/Google/Resource/Dataflow/Projects/Locations/FlexTemplates/Launch.hs
mpl-2.0
6,667
0
20
1,501
874
510
364
138
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-storage-transfer/gen/Network/Google/Resource/StorageTransfer/GoogleServiceAccounts/Get.hs
mpl-2.0
5,905
0
16
1,262
711
420
291
106
1
module OptimizeThis where digitSum :: Integer -> Integer -- this is not fast enough! -- digitSum n = if n<10 then n else n `rem` 10 + digitSum (n `div` 10) -- this is not either digitSum = sum . (read <$>) . (return <$>) . show
ice1000/OI-codes
codewars/301-400/micro-optimization-digit-sum.hs
agpl-3.0
230
0
8
49
41
26
15
3
1
module Physics.Object where import qualified Data.Vec as V import Data.Vec import Physics.Mesh import Physics.Mesh.FaceVertex import Data.Vec.Quaternion type Quat = Quaternion Double -- | Objects within a space are identified by integers. type ObjectId = Int data Body = Body { bMass :: !Double, bPosition :...
gmaslov/rigbo3
src/Physics/Object.hs
lgpl-3.0
3,523
0
12
762
983
532
451
82
2
{- Um número inteiro não negativo diz-se perfeito se é igual à soma dos seus divisores próprios. Por exemplo, 6=2+3+1. Faça um programa que recebe um inteiro e decide se este é ou não perfeito. -} divisoresDeNumero :: Int -> [Int] divisoresDeNumero num = [ x | x <- [1 .. metadeNumero], ((mod num x) == 0...
erijonhson/ufcg-plp-e-aplicacoes
praticando_programacao_funcional_parte_1/numero-perfeito.hs
apache-2.0
560
0
11
121
152
80
72
9
2
{- ############################################################################# Sample code from: Simon Thompson - Haskell: the Craft of Functional Programming, 2011 ++++ Addison-Wesley ++++ http://www.haskellcraft.com/craft3e/Home.html #############################################################...
CarloMicieli/fun-with-haskell
src/craft3e/Chapter07.hs
apache-2.0
10,172
13
13
3,493
4,211
2,291
1,920
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Site.Vault where import Prelude hiding (id) import Blaze.ByteString.Builder (toByteString) import Control.Monad.Trans import Data.ByteString (ByteString) import Data.ByteString.Char8 (unpack) import Data.List (sort)...
dikmax/haskell-blog
src/Site/Vault.hs
bsd-2-clause
6,838
0
18
1,901
1,883
988
895
174
4
-- ghost-control is the server-side tool to add new repositories and users. {-# OPTIONS_GHC -fno-cse #-} {-# Language CPP #-} {-# Language DeriveDataTypeable #-} {-# Language RecordWildCards #-} module Main where import Paths_ghost (version) import Data.Version (showVersion) import System.Console.CmdArgs.Implicit im...
noteed/ghost
bin/ghost-control.hs
bsd-3-clause
4,731
0
15
970
1,021
512
509
118
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Api.Theorems ( API , handlers ) where import Api.Base import Api.Helpers imp...
jamesdabbs/pi-base-2
src/Api/Theorems.hs
bsd-3-clause
1,627
0
20
454
399
208
191
-1
-1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {- | Module : Data.Graph.Simple.Vertex Description : Newtype wrapper for graph vertices Copyright : Stefan Höck Maintainer : Stefan Höck Stability : experimental This module provides an abstract newtype wrapper for graph vertices. This gives certain guar...
stefan-hoeck/labeled-graph
Data/Graph/Simple/Vertex.hs
bsd-3-clause
2,754
0
8
603
471
266
205
-1
-1
module Main where import System.Environment(getArgs) import LevOps main = do [s,m,n] <- fmap (map read) getArgs mapM_ (print . maxDegree s) [m..n]
cullina/Extractor
src/DegreeMain.hs
bsd-3-clause
153
0
10
28
72
39
33
6
1
module Toy.Execution.Data ( In , Out , InOut , Meta (..) , withEmptyInput ) where import Data.Text (Text) import Data.Text.Buildable (Buildable (..)) import Formatting ((%)) import qualified Formatting as F import Toy.Base ...
Martoon-00/toy-compiler
src/Toy/Execution/Data.hs
bsd-3-clause
669
0
12
222
204
125
79
-1
-1
{-# LANGUAGE ImplicitParams, TupleSections #-} module Frontend.StatementInline(statSimplify, statAddNullTypes, procStatToCFA) where import Control.Monad import Control.Monad.State import Data.List import Data.Maybe import qualified Data.Traversable as Tr import Util hid...
termite2/tsl
Frontend/StatementInline.hs
bsd-3-clause
22,876
0
32
8,817
6,828
3,314
3,514
339
7
{-# LANGUAGE Trustworthy, ExplicitForAll, ScopedTypeVariables #-} {- VERY TRUST WORTHY :) -} module Numerical.HBLAS.UtilsFFI( withAllocaPrim , unsafeWithPrim , withRStorable_ , withRWStorable , withRStorable , unsafeWithPurePrim , unsafeWithPrimLen , unsafeWithPurePrimLen , storablePtrZero ) where ...
wellposed/hblas
src/Numerical/HBLAS/UtilsFFI.hs
bsd-3-clause
3,511
0
15
864
1,127
579
548
82
2
-- | A CSS 2.1 Parser. -- -- See <http://www.w3.org/TR/CSS21/syndata.html> for a description of -- CSS 2.1 syntax, grammer and data types. This parser follows the -- more restrictive grammer found in -- <http://www.w3.org/TR/CSS21/grammar.html>. Many of the names below -- come directly from this document. Most parser...
brentonashworth/css-parser
src/Text/CSS/CSSParser.hs
bsd-3-clause
5,870
0
16
1,485
892
491
401
72
2
-- hisg - IRC stats generator. -- -- Copyright (c) 2009, 2010 Antoine Kalmbach <antoine dot kalmbach at jyu dot fi> -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of ...
ane/hisg
src/Hisg.hs
bsd-3-clause
2,840
0
10
634
556
294
262
57
3
{- | Module : Protocol.ROC.OpCodeTable Description : OpCodeTable Lookup for Roc Copyright : Plow Technologies LLC License : MIT License Maintainer : Scott Murphy OpCode Table Lookup is different than TLP lookup | -} module Protocol.ROC.OpCodeTable () where
plow-technologies/roc-translator
src/Protocol/ROC/OpCodeTable.hs
bsd-3-clause
275
0
3
55
11
8
3
1
0
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Monad import Couchbase.Raw import qualified Data.ByteString as B import Foreign.Ptr import Test.Hspec assertLcbSuccess :: Monad m => String -> LcbError -> m () assertLcbSuccess msg err = when (err /= LcbSuccess) $ error msg defaultParams :: Con...
asvyazin/libcouchbase.hs
test/tests.hs
bsd-3-clause
15,533
0
29
4,034
4,057
1,931
2,126
319
1
module Main where import Code20 main :: IO () main = putStrLn $ display (countdown5 831 [1,3,7,10,25,50])
sampou-org/pfad
Code/countdown5.hs
bsd-3-clause
108
0
9
19
55
32
23
4
1
module Goblin.Workshop.Types where import Control.Concurrent import Control.Concurrent.STM import Control.Monad import Data.Either import Goblin.Workshop.Graph import System.Log.Logger import Text.Printf --------- -- Models --------- type Progress...
y-usuzumi/goblin-workshop
src/Goblin/Workshop/Types.hs
bsd-3-clause
2,899
0
13
1,209
639
363
276
73
1
-- -- Copyright © 2014-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. -- module Main where import Syste...
anchor/synchronise
test/tests.hs
bsd-3-clause
362
0
6
72
32
22
10
4
1
{-# LANGUAGE CPP #-} module ZM.Type.Prims() where import qualified ZM.Type.Words as Z import Data.Model import qualified Data.Word as H import qualified Data.Int as H import Numeric.Natural as H import qualified Prelude as H #include "MachDe...
tittoassini/typed
src/ZM/Type/Prims.hs
bsd-3-clause
1,457
0
9
274
442
236
206
-1
-1
{-| Module : Idris.Package.Parser Description : `iPKG` file parser and package description information. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE CPP, ConstraintKinds, FlexibleInstances, TypeSynonymInstances #-} module Idris.Package.Parser where import Idris.CmdOptions im...
uuhan/Idris-dev
src/Idris/Package/Parser.hs
bsd-3-clause
7,655
0
29
2,757
2,171
1,043
1,128
172
3
{-# LANGUAGE CPP #-} module Main (main) where import Development.Shake as Shake import System.Directory import System.Environment import Development.Shake.FilePath import Data.Char import Data.List #if MIN_VERSION_base(4,8,0) import Prelude hiding ((*>)) #endif -- local repos to use; later look at the srcs to figure...
ku-fpg/sunroof-examples
Shake.hs
bsd-3-clause
4,035
0
21
1,759
1,083
545
538
85
6
module Printable where
Megaleo/Electras
src/Printable.hs
bsd-3-clause
23
0
2
3
4
3
1
1
0
-- inspired by http://dlaing.org/cofun/posts/free_and_cofree.html module PolyGraph.Common.DslSupport.Product ( Product(..) , (:*:) , (*:*) , (:>:) () ) where import Control.Applicative data Product f g a = Pair (f a) (g a) deriving (Functor, Show) type f :*: g = Product f g --instance (Functor f, Functor g...
rpeszek/GraphPlay
src/PolyGraph/Common/DslSupport/Product.hs
bsd-3-clause
867
0
11
198
346
192
154
-1
-1
{- Copyright (c) 2008 David Roundy All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following...
droundy/franchise
Distribution/Franchise/Darcs.hs
bsd-3-clause
3,873
0
23
1,087
620
323
297
48
1
module Main where import Test.Tasty import qualified Data.Aeson.Casing.Test as Casing main :: IO () main = defaultMain $ testGroup "Tests" [ Casing.tests ]
AndrewRademacher/aeson-casing
test/Main.hs
mit
185
0
8
52
48
29
19
6
1
{-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDer...
david-christiansen/final-pretty-printer
Text/PrettyPrint/Final/Rendering/HTML.hs
mit
1,967
0
11
352
364
198
166
38
4
myCheck :: Int -> Bool myCheck n = ord n == 6 -- ord & chr bij elkaar in groepje, Bastiaan?
roberth/uu-helium
test/thompson/Thompson30.hs
gpl-3.0
95
0
6
24
26
13
13
2
1
{-# LANGUAGE Arrows, InstanceSigs #-} module Bot.Seen where import Control.Auto import Data.Map as M import Data.Time.Clock import Prelude hiding ((.), id) -- we use (.) and id from `Control.Category` import Control.Monad.IO.Class import Bot.Types seenBot :: MonadIO m => RoomBot m seenBot = proc (InMessage nick m...
urbanslug/nairobi-bot
src/Bot/Seen.hs
gpl-3.0
1,394
1
19
397
503
261
242
32
3
{-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Main -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- module Main (main)...
olorin/amazonka
amazonka-ecs/test/Main.hs
mpl-2.0
522
0
8
103
76
47
29
9
1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="sk-SK"> <title>Export Report | ZAP Extension</title> <maps> <homeID>top</homeID> <mapr...
veggiespam/zap-extensions
addOns/exportreport/src/main/javahelp/org/zaproxy/zap/extension/exportreport/resources/help_sk_SK/helpset_sk_SK.hs
apache-2.0
975
80
66
160
415
210
205
-1
-1
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, ScopedTypeVariables #-} -- | -- Module : Data.Vector.Primitive.Mutable -- Copyright : (c) Roman Leshchinskiy 2008-2010 -- License : BSD-style -- -- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au> -- Stability : experimental -- Portability : non-...
rleshchinskiy/vector
Data/Vector/Primitive/Mutable.hs
bsd-3-clause
9,846
0
12
2,293
2,448
1,338
1,110
171
1
{-# LANGUAGE CPP #-} -- | Note [Base Dir] -- ~~~~~~~~~~~~~~~~~ -- -- GHC's base directory or top directory containers miscellaneous settings and -- the package database. The main compiler of course needs this directory to -- read those settings and read and write packages. ghc-pkg uses it to find the -- global packag...
sdiehl/ghc
libraries/ghc-boot/GHC/BaseDir.hs
bsd-3-clause
2,836
0
11
491
278
158
120
16
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Hpc -- Copyright : Thomas Tuegel 2011 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This module provides functions for locating various HPC-related paths and -- a f...
IreneKnapp/Faction
libfaction/Distribution/Simple/Hpc.hs
bsd-3-clause
7,289
0
15
1,909
1,108
598
510
102
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} module Reflex.Dom.Widget.Resize where import Reflex.Class import Reflex.Time import Reflex.Dom.Builder.Class import...
reflex-frp/reflex-dom
reflex-dom-core/src/Reflex/Dom/Widget/Resize.hs
bsd-3-clause
5,041
0
21
959
1,415
733
682
83
2
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -- -- Copyright (c) 2009-2011, ERICSSON AB -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- mod...
emwap/feldspar-language
src/Feldspar/Core/Frontend/Future.hs
bsd-3-clause
2,562
0
11
479
351
203
148
25
1
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/Attoparsec/ByteString.hs" #-} {-# LANGUAGE CPP #-} {-# LANGUAGE Trustworthy #-} -- | -- Module : Data.Attoparsec.ByteString -- Copyright : Bryan O'Sullivan 2007-2015 -- License : BSD3 -- -- Maint...
phischu/fragnix
tests/packages/scotty/Data.Attoparsec.ByteString.hs
bsd-3-clause
7,604
0
11
1,757
742
475
267
83
2
factorial :: (Integral a) => a -> a factorial 0 = 1 factorial n = n * factorial (n - 1)
maggy96/haskell
smaller snippets/myfac.hs
mit
88
0
8
21
49
25
24
3
1
module Specify.Check where import Specify.Definition import Specify.Constraint import Specify.Eval import Autolib.Reporter import Autolib.ToDoc full :: System -> Program -> Int -> Reporter [ ( Maybe Bool, Doc ) ] full ( System cs ) p num = do results <- mapM ( \ c -> single c p num ) cs ...
florianpilz/autotool
src/Specify/Check.hs
gpl-2.0
1,517
3
27
567
544
265
279
44
2
module Text.XML.HaXml.TypeMapping ( -- * A class to get an explicit type representation for any value HTypeable(..) -- sole method, toHType -- * Explicit representation of Haskell datatype information , HType(..) -- instance of Eq, Show , Constr(..) -- instance of Eq, Show -- * Helper functions to ext...
Ian-Stewart-Binks/courseography
dependencies/HaXml-1.25.3/src/Text/XML/HaXml/TypeMapping.hs
gpl-3.0
14,222
0
18
4,599
5,122
2,723
2,399
233
10
module TokenDef(tokenDef) where -- This is a sample TokenDef module. Usually one exists in the -- same directory as the file that imports ParserAll import StdTokenDef import CommentDef stratusStyle = haskellStyle { commentEnd = cEnd , commentStart = cStart , commentLine = cLine , nestedComments = nest...
cartazio/omega
src/TokenDefExample.hs
bsd-3-clause
448
0
7
86
89
59
30
11
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} -- | Reading from external processes. module System.P...
Fuuzetsu/stack
src/System/Process/Read.hs
bsd-3-clause
18,638
0
30
5,523
4,036
2,150
1,886
351
8
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards #-} module Distribution.Client.GlobalFlags ( GlobalFlags(..) , defaultGlobalFlags , RepoContext(..) , withRepoC...
mydaum/cabal
cabal-install/Distribution/Client/GlobalFlags.hs
bsd-3-clause
11,087
0
17
3,225
2,024
1,119
905
202
4
<?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="sk-SK"> <title>All In One Notes Add-On</title> <maps> <homeID>top</homeID> <mapref loca...
kingthorin/zap-extensions
addOns/allinonenotes/src/main/javahelp/org/zaproxy/zap/extension/allinonenotes/resources/help_sk_SK/helpset_sk_SK.hs
apache-2.0
968
77
67
159
417
211
206
-1
-1
module D1 where {-demote 'sq' to 'sumSquares'. This refactoring affects module 'D1' and 'C1' -} sumSquares (x:xs) = sq + sumSquares xs where sq = x ^pow sumSquares [] = 0 pow = 2 main = sumSquares [1..4]
mpickering/HaRe
old/testing/demote/D1_TokOut.hs
bsd-3-clause
220
0
7
54
66
36
30
6
1
{-# OPTIONS -fglasgow-exts #-} {-# LANGUAGE MultiParamTypeClasses, OverlappingInstances, UndecidableInstances, FunctionalDependencies, NoMonomorphismRestriction #-} module DirUtils where import Prelude hiding (catch,ioError) import MUtils import Data.List(isSuffixOf,nub) import AbstractIO import PathUtils(pathSep) opt...
kmate/HaRe
old/tools/base/lib/DirUtils.hs
bsd-3-clause
1,891
4
14
386
307
164
143
24
2
module TreeIn2 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/TreeIn2_TokOut.hs
bsd-3-clause
341
0
10
74
181
95
86
10
1
-- Example.hs -- Examples from HUnit user's guide -- $Id: Example.hs,v 1.2 2002/02/19 17:05:21 heringto Exp $ module Main where import HUnit foo :: Int -> (Int, Int) foo x = (1, x) partA :: Int -> IO (Int, Int) partA v = return (v+2, v+3) partB :: Int -> IO Bool partB v = return (v > 5) test1 = TestCase (as...
alekar/hugs
packages/Cabal/tests/HUnit-1.0/src/Example.hs
bsd-3-clause
962
0
13
324
340
173
167
20
1
{-# LANGUAGE ScopedTypeVariables, DataKinds, PolyKinds, TypeOperators, TypeFamilies, GADTs #-} ----------------------------------------------------------------------------- -- | -- Module : Language.Glambda.Shift -- Copyright : (C) 2015 Richard Eisenberg -- License : BSD-style (see LICENSE) ...
ajnsit/glambda
src/Language/Glambda/Shift.hs
bsd-3-clause
3,052
4
13
908
1,136
587
549
46
11
import Data.Monoid import Control.Applicative import Data.Text (Text) import Data.String import Text.Blaze.Html.Renderer.Pretty (renderHtml) import Text.Blaze.XHtml5 import Text.Blaze.XHtml5.Attributes hiding (form, name) import SimpleForm.Combined hiding (text, name) import SimpleForm.Digestive.Combined import Simpl...
singpolyma/simple-form-haskell
examples/combined.hs
isc
852
10
14
137
311
172
139
23
1
import Test.Hspec import Complex import Limit import AsciiRenderer import Data.Array main :: IO () main = hspec $ do describe "Complex" $ do describe "real" $ do it "return real part of a complex number" $ do real (Complex 12 23) `shouldBe` 12 describe "imag" $ do it "return image part ...
kirhgoff/haskell-sandbox
complex_numbers/specs.hs
mit
2,639
0
28
731
1,073
534
539
55
1
main :: IO () main = putStr "Input a: " >> getLine >>= (\a's -> putStr "Input b: " >> getLine >>= (\b's -> let num :: Double num = read a's + read b's in putStrLn $ "the sum is: " ++ show num))
sclereid/collections
haskell-learning/a+b.hs
mit
239
0
16
90
91
45
46
11
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Snap.Core import Snap.Http.Server import Network.HTTP.Conduit import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as L import Control.Monad.IO.Class (liftIO) main :: IO () main = quickHttpS...
silky/cupduck
src/Main.hs
mit
862
0
12
189
193
97
96
26
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes #-} -- | Form wrapper module QuickForm.Form where import Da...
tomsmalley/quickform
src/QuickForm/Form.hs
mit
7,330
0
11
1,361
2,906
1,481
1,425
-1
-1
{-# LANGUAGE DeriveGeneric , DeriveDataTypeable #-} module Veva.Types.User ( User(..) , module Veva.Types.User.Id , module Veva.Types.User.Email ) where import Data.JSON.Schema import Data.Typeable (Typeable) import GHC.Generics (Generic) import Data.Aeson (FromJSON(..), ...
L8D/veva
lib/Veva/Types/User.hs
mit
692
0
8
176
183
114
69
23
0
import System.IO import System.Exit import XMonad hiding ( (|||) ) -- don't use the normal ||| operator import XMonad.Hooks.DynamicLog import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers import XMonad.Hooks.SetWMName import XMonad.Hooks.ToggleHook import XMonad.Layout.Name...
swillner/dotfiles
dotfiles/xmonad/xmonad.hs
mit
10,267
0
20
3,245
2,740
1,547
1,193
177
8
module Main where import Control.Monad (mapM_) import Data.List (sortBy, nub) import qualified Data.Bimap as BM import Data.Maybe (mapMaybe) import Data.Ord (comparing) import Data.Tuple (swap) import System.Environment (getArgs) import Picosat import Encoder import PBEncoder import Encodings import Parser import Ty...
rodamber/vmc-hs
sat/Main.hs
mit
2,109
0
16
540
728
370
358
67
5
-- v2 (cleanup) of DL reasoner {-# LANGUAGE DeriveGeneric, DefaultSignatures #-} import Prelude import Test.Hspec import qualified Data.Map as Map import Data.List (nub, find) import Data.Maybe (fromMaybe, isJust) import Data.Serialize import GHC.Exts hiding (Any) import GHC.Generics (Generic) -- a constant represent...
jbalint/banshee-sympatico
meera/dl2.hs
mit
11,072
0
24
3,768
3,175
1,607
1,568
187
13
module Types where import qualified Data.Vector as V import qualified Data.Vector.Storable as S import Linear type Event a = V3 a type Events a = S.Vector (Event a) type Patch a = Events a type Phi a = Events a type PushV a = Events a type As a = S.Vector a type Patches a = V.Vector (Patch a) type...
fhaust/aer-utils
src/Types.hs
mit
386
0
7
99
148
89
59
13
0
-- The sequence of triangle numbers is generated by adding the natural -- numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 -- + 7 = 28. The first ten terms would be: -- 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... -- Let us list the factors of the first seven triangle numbers: -- 1: 1 -- 3: 1...
whittle/euler
src/Euler/Problem012.hs
mit
1,125
0
9
314
225
130
95
15
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGForeignObjectElement (js_getX, getX, js_getY, getY, js_getWidth, getWidth, js_getHeight, getHeight, SVGForeignObjectElement, castToSVGForeignObjectElement, gTypeSVGForeignObjectElement) ...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGForeignObjectElement.hs
mit
2,780
24
10
375
638
377
261
43
1
module Spaceship where import Utils -- Hard Reset Spaceship informations resetSpaceship :: (Bool, Position, Int, Int) resetSpaceship = (False, (-44, 100), 1, 150)
joeyinbox/space-invaders-haskell
src/Spaceship.hs
gpl-2.0
165
0
7
25
50
33
17
4
1
{-| Module : Multilinear.Generic.MultiCore Description : Generic implementation of tensor as nested arrays, evaluated in sequential manner Copyright : (c) Artur M. Brodzki, 2018 License : BSD3 Maintainer : artur@brodzki.org Stability : experimental Portability : Windows/POSIX -} module Multilinear.Gener...
ArturB/Multilinear
src/Multilinear/Generic/MultiCore.hs
gpl-3.0
28,404
0
23
7,905
7,572
4,002
3,570
-1
-1
module Eval (eval) where import Ast(Def(..),Expr(..)) import Value(Value,union,intersect,diff,fromList,toList,combinations) eval :: [Value] -> Expr -> Value eval bindings expr = e expr where e (ExprBag _ elts) = fromList (map (fmap (eval bindings)) elts) e (ExprBound _ _ index) = bindings !! index e...
qpliu/esolang
gbagbo/hs/Eval.hs
gpl-3.0
954
0
14
215
464
239
225
19
7
{-# LANGUAGE OverloadedStrings #-} module Main where import System.LogFS (runLogFS, Packet(..)) import System.Fuse (defaultExceptionHandler) import System.Environment (getArgs) import Control.Concurrent (forkIO) import Control.Concurrent.Chan (Chan, newChan, readChan, writeChan, dupChan) import Control.Monad (forever...
adarqui/LogFS
examples/simple.hs
gpl-3.0
1,839
0
17
318
696
359
337
48
2
{-# LANGUAGE UnicodeSyntax #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} module Authinfo ( readAuthInfo , readAuthInfoFile , getPassword ) where import Control.Applicative ((<|>)) import Control.Monad (join) import Data.List (find) i...
deepfire/youtrack
src/Authinfo.hs
gpl-3.0
2,302
0
16
623
742
392
350
50
2
import Prelude hiding (even, odd, div, compare, Num, Int, Integer, Float, Double, Rational, Word) data Peano = Zero | Succ Peano deriving (Eq, Show) add, sub, mul, div :: Peano -> Peano -> Peano -- Addition add Zero x = x add x Zero = x add x (Succ Zero) = Succ x add (Succ Zero) x = Succ x add x (Succ y) = Succ (add...
YPBlib/NaiveFunGame_hs
cw/pe.hs
gpl-3.0
1,092
0
12
310
551
286
265
32
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Workspaces/Zones/Delete.hs
mpl-2.0
5,367
0
16
1,142
706
413
293
108
1
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-} module Core.ModelSpec where import qualified Data.ByteString.Char8 as BS import qualified Data.Map.Strict as M import qualified GHC.Generics as GN import qualified Misc.Json as Json import Core.Database ((=:)) import Core.Model import SpecHelper data Post = Post { p...
inq/manicure
spec/Core/ModelSpec.hs
agpl-3.0
1,919
0
15
528
530
297
233
48
1
-- -- Copyright 2017-2018 Azad Bolour -- Licensed under GNU Affero General Public License v3.0 - -- https://github.com/azadbolour/boardgame/blob/master/LICENSE.md -- {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE DisambiguateRecordFields #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE FlexibleContexts #-} -- TODO. ...
azadbolour/boardgame
haskell-server/src/BoardGame/Server/Domain/GameCache.hs
agpl-3.0
4,656
7
16
811
1,278
661
617
90
2
{-# LANGUAGE OverloadedStrings #-} import Database.Persist.Postgresql import THIS.Database.Entities main :: IO () main = do withPostgresqlConn "dbname=this" $ runSqlConn $ do runMigration migrateAll
portnov/integration-server
this-install-db.hs
lgpl-3.0
207
0
10
31
49
25
24
7
1
module Git.Command.Rerere (run) where run :: [String] -> IO () run args = return ()
wereHamster/yag
Git/Command/Rerere.hs
unlicense
84
0
7
15
42
23
19
3
1
module KthDifferences.A328190Spec (main, spec) where import Test.Hspec import KthDifferences.A328190 (a328190) main :: IO () main = hspec spec spec :: Spec spec = describe "A328190" $ it "correctly computes the first 20 elements" $ take 20 (map a328190 [1..]) `shouldBe` expectedValue where expectedValue =...
peterokagey/haskellOEIS
test/KthDifferences/A328190Spec.hs
apache-2.0
397
0
10
78
160
95
65
10
1
-- http://www.codewars.com/kata/55d2aee99f30dbbf8b000001 module Codewars.Kata.ScoringTests where scoreTest :: (Integral a) => [a] -> a -> a -> a -> a scoreTest li a b c = sum $ map f li where f 0 = a f 1 = b f 2 = -c
Bodigrim/katas
src/haskell/7-Scoring-Tests.hs
bsd-2-clause
231
0
9
57
92
49
43
6
3
{-# LANGUAGE DeriveDataTypeable, BangPatterns #-} module Data.Mathematica where import Data.Typeable import Data.Data {- data Atom = MSymbol String | MNumber Double | MString String deriving (Show, Eq, Typeable, Data) -} data MExpression = MSymbol !String | MInt...
wavewave/mathematica-data
lib/Data/Mathematica.hs
bsd-2-clause
569
0
9
216
85
49
36
19
0
{-# language CPP #-} -- No documentation found for Chapter "FrontFace" module Vulkan.Core10.Enums.FrontFace (FrontFace( FRONT_FACE_COUNTER_CLOCKWISE , FRONT_FACE_CLOCKWISE , .. ...
expipiplus1/vulkan
src/Vulkan/Core10/Enums/FrontFace.hs
bsd-3-clause
2,187
1
10
376
306
188
118
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Data.Pass.Robust -- Copyright : (C) 2012-2013 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Portability : non-...
ekmett/multipass
Data/Pass/Robust.hs
bsd-3-clause
3,341
0
12
789
1,382
741
641
79
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} module Main where import Control.Natural import Data.Aeson import qualified Data.Text.IO as TIO import qualified Data.Text.Lazy as LT import Dat...
ku-fpg/remote-json
tests/spec/Spec.hs
bsd-3-clause
3,008
0
20
1,011
1,033
516
517
67
5
{-# LANGUAGE BangPatterns #-} -- BANNERSTART -- - Copyright 2006-2008, Galois, Inc. -- - This software is distributed under a standard, three-clause BSD license. -- - Please see the file LICENSE, distributed with this software, for specific -- - terms and conditions. -- Author: Adam Wick <awick@galois.com> -- BANNEREND...
Tener/HaNS
src/Hans/Utils/Checksum.hs
bsd-3-clause
2,425
0
13
513
639
345
294
41
1
{-#LANGUAGE OverloadedStrings#-} {- Min Zhang 3-26-2015 Translate DNA/RNA to protein aa sequence. v.0.1.1 (Oct 14, 2015): switch from Data.Text to Data.Text.Lazy -} module Main where import qualified Data.Text.Lazy.IO as TextIO import qualified Data.Text.Lazy as T import Control.Applicative import System....
Min-/fourseq
src/utils/Translate.hs
bsd-3-clause
1,852
0
11
421
786
386
400
46
11
module ScannerSpec (spec) where import Data.Maybe (fromJust) import Test.Hspec import Scanner import Types scanAndExtractFirst :: String -> Token scanAndExtractFirst = head . fromJust . scan spec :: Spec spec = describe "The Scanner" $ do it "scans the empty Stri...
ob-cs-hm-edu/compiler-md2html
test/ScannerSpec.hs
bsd-3-clause
1,572
0
10
544
354
170
184
38
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP , NoImplicitPrelude , MagicHash , UnboxedTuples #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.TopHandler -- Copyright : (c) The University of G...
tolysz/prepare-ghcjs
spec-lts8/base/GHC/TopHandler.hs
bsd-3-clause
8,746
0
22
2,029
1,022
548
474
118
6
-- | Mostly GLFW stuff. -- See http://www.glfw.org/docs/3.0/moving.html#moving_window_handle -- module App.App ( App(..) , runApp ) where import App.Types import App.Clock import App.Input import App.UserApp import Control.Monad.State import Control.Concurrent import Control.Lens import ...
schell/blocks
src/App/App.hs
bsd-3-clause
4,807
0
27
1,907
1,155
559
596
-1
-1
-- | -- Module : Data.Array.Accelerate.CUDA.Array.Sugar -- Copyright : [2008..2014] Manuel M T Chakravarty, Gabriele Keller -- [2009..2014] Trevor L. McDonell -- License : BSD3 -- -- Maintainer : Trevor L. McDonell <tmcdonell@cse.unsw.edu.au> -- Stability : experimental -- Portability : non-...
mikusp/accelerate-cuda
Data/Array/Accelerate/CUDA/Array/Sugar.hs
bsd-3-clause
1,239
0
10
240
255
150
105
18
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. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE GADT...
rfranek/duckling
Duckling/Temperature/PT/Rules.hs
bsd-3-clause
2,392
0
18
528
542
306
236
60
3
module Main where import System.Environment (getProgName, getArgs) import System.Console.GetOpt import System.Exit import Control.Monad (when) import Data.Maybe (listToMaybe) import Data.List (intercalate) import DroidSignatureFileFilter -- | Construct a usage message header. header :: String -> String header progNam...
marhop/droidsfmin
src/Main.hs
bsd-3-clause
3,948
0
14
1,020
1,020
550
470
88
2
module LSC2008.TestMate where import LazySmallCheck import Benchmarks.Mate import System.Environment instance Serial Kind where series = cons0 King \/ cons0 Queen \/ cons0 Rook \/ cons0 Bishop \/ cons0 Knight \/ cons0 Pawn instance Serial Colour where series = cons0 Black \/ cons0 W...
UoYCS-plasma/LazySmallCheck2012
suite/performance/LSC2008/TestMate.hs
bsd-3-clause
424
0
11
100
128
63
65
16
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Reporting -- Copyright : (c) David Waern 2008 -- License : BSD-like -- -- Maintainer : david.waern@gmail.com -- Stability : experimental -- Portability : portable -- -- Anonymous build ...
sopvop/cabal
cabal-install/Distribution/Client/BuildReports/Anonymous.hs
bsd-3-clause
11,508
0
17
3,305
2,701
1,474
1,227
222
15
{-| Module : Git.DiffTree Description : Types for the results of @git diff-tree@ Copyright : (c) Michael Klein, 2016 License : BSD3 Maintainer : lambdamichael(at)gmail.com -} module Data.Git.DiffTree where import Git.Types ( DiffMode , Path ...
michaeljklein/git-details
src/Data/Git/DiffTree.hs
bsd-3-clause
1,406
0
9
600
223
132
91
23
0
{-# LANGUAGE OverloadedStrings #-} import Control.Monad.IO.Class (liftIO) import Servant (Proxy(..), (:<|>)(..)) import Servant.Crud (API, DeleteFile, GetFile, PutFile) import Servant.Server (Server, serve) import Turtle (argInt, options) import qualified Data.Text.IO as Text import qualified Network.Wai....
Gabriel439/servant-crud
exec/Server.hs
bsd-3-clause
1,066
0
11
190
278
159
119
23
1
module Action.Issue ( parseIssueFromDoc , createNewIssue , NewIssue(..) )where import Action.Internal.Issue (createNewIssue, parseIssueFromDoc) import Github.Issues (NewIssue (..))
smurphy8/issue-add
src/Action/Issue.hs
bsd-3-clause
271
0
6
107
49
32
17
5
0
{-# LANGUAGE DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances, TypeSynonymInstances #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Layout.Decoration -- Copyright : (c) 2010 Audun Skaugen -- License : BSD-style (see xmonad/LICENSE) -- -...
reenberg/XMonadContrib
XMonad/Layout/Fullscreen.hs
bsd-3-clause
8,814
0
17
1,771
2,008
1,040
968
137
1
{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-} module B.Shake.Rerun( defaultRuleRerun, alwaysRerun ) where import B.Shake.Core import B.Shake.Classes newtype AlwaysRerunQ = AlwaysRerunQ () deriving (Typeable,Eq,Hashable,Binary,NFData) instance...
strager/b-shake
B/Shake/Rerun.hs
bsd-3-clause
1,189
0
10
181
255
138
117
18
1
import Network.OpenID import MonadLib import Network.Socket import System.Environment import OpenSSL main = withSocketsDo $ withOpenSSL $ do [ident,check] <- getArgs case normalizeIdentifier (Identifier ident) of Nothing -> putStrLn "Unable to normalize identifier" Just i -> do let resolve = makeR...
elliottt/hsopenid
examples/test.hs
bsd-3-clause
981
0
26
316
297
137
160
26
4
{-# LANGUAGE OverloadedStrings #-} module HStyle.Rules.LineLength.Tests ( tests ) where import Test.Framework (Test, testGroup) import Test.Framework.Providers.HUnit (testCase) import Test.HUnit (Assertion) import qualified Data.Text as T import HStyle.Rule import HStyle.Rules.LineLength import HStyle.Tests.U...
jaspervdj/hstyle
tests/HStyle/Rules/LineLength/Tests.hs
bsd-3-clause
775
0
7
108
167
97
70
20
1