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
import Utils import Data.Array import Debug.Trace nmax = 999999 arrMax = 6*(factorial 9) factorialArr = array (0,9) $ zip [0..9] $ map factorial [0..9] sumFactorialDigits n = sumFactDigArr ! n sumFactDigArr = listArray (0,arrMax) $ (map factorial [0..9]) ++ [ sumFactorialDigits' i | i <- [10..arrMax] ] where ...
arekfu/project_euler
p0074/p0074.hs
mit
1,049
0
14
251
474
249
225
19
1
data Doggies a = Husky a | Mastiff a deriving (Eq, Show) data DogueDeBordeaux doge = DogueDeBordeaux doge
candu/haskellbook
ch11/doggies.hs
mit
106
0
6
18
37
21
16
2
0
-- Copyright (c) 2011 Alexander Poluektov ([email protected]) -- -- Use, modification and distribution are subject to the MIT license -- (See accompanying file MIT-LICENSE) import Distribution.Simple main = defaultMain
predee/heroes2
Setup.hs
mit
232
0
4
30
15
10
5
2
1
module Main where import Graphics.Gloss import Graphics.Gloss.Interface.Pure.Game import Draw import Game import Debug.Trace import Data.Maybe main :: IO () main = do let game = newGame graphics <- loadGraphics let window = InWindow "Chess in Haskell" (windowWidth, windowHeight) (0, 0) play window black 10 g...
mtak/chess-hs
src/Main.hs
mit
684
0
11
130
245
127
118
22
2
import Data.List countBy f = length . filter f isVowel = flip elem ['a', 'e', 'i', 'o', 'u'] dontContainBadWords str = not $ any (\x -> isInfixOf x str) ["ab", "cd", "pq", "xy"] isNiceStringPt1 str = 3 <= countBy isVowel str && (any (\x->length x >= 2) $ group str) && dontContainBadWords str isNiceString...
bruno-cadorette/AdventOfCode
Day 5/Day5.hs
mit
776
0
13
173
332
166
166
19
2
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} -- Run as: pv cur/sentences.tsv | ./countPairs import Control.Exception (bracket) import Control.Monad (liftM2) --import qualified Data.Text as T import qualified Data.Text.Lazy as T --import qualified Data.Text.IO as T import qualified Data.Text.Lazy.I...
dancor/melang
src/Main/tat-count-pairs.hs
mit
2,731
0
19
603
790
438
352
52
1
-- | Integration of complex and real functions along straight lines module Data.Complex.Integrate ( integrate ) where -- We will work with complex numbers import Data.Complex -- | Integration of complex function using Simpson's rule integrate :: (Fractional v) => (v -> v) -- ^ Function to be integrated ...
hijarian/complex-integrate
Data/Complex/Integrate.hs
cc0-1.0
1,210
0
14
327
321
178
143
16
1
choose n k = product [k+1..n] `div` product [1..n-k] solution = choose 40 20 main = print solution
drcabana/euler-fp
source/hs/P15.hs
epl-1.0
101
0
8
20
59
30
29
3
1
{- | Module : Solver Description : Solver Copyright : (c) Frédéric BISSON, 2015 License : GPL-3 Maintainer : [email protected] Stability : experimental Portability : POSIX The Solver can take a 'Grid' and a 'Dictionary' and searches for all 'DictWord's that can be constructed in the 'Grid' that appears in ...
Zigazou/RuzzSolver
src/Solver/Score.hs
gpl-3.0
2,263
0
12
691
606
351
255
36
2
{-# LANGUAGE EmptyDataDecls, FlexibleContexts, FlexibleInstances, GADTs, GeneralizedNewtypeDeriving, MultiParamTypeClasses, OverloadedStrings, DeriveGeneric, QuasiQuotes, TemplateHaskell, Ty...
arkon/courseography
hs/Database/Tables.hs
gpl-3.0
5,664
0
11
1,696
768
436
332
82
1
{-# LANGUAGE NoImplicitPrelude, LambdaCase, GeneralizedNewtypeDeriving, TemplateHaskell, QuasiQuotes, OverloadedStrings, PolymorphicComponents #-} -- | Compile Lamdu vals to Javascript module Lamdu.Eval.JS.Compiler ( Actions(..) , ValId(..) , compile, Mode(..), loggingEnabled ) where import qualified ...
da-x/lamdu
Lamdu/Eval/JS/Compiler.hs
gpl-3.0
19,621
0
23
5,733
6,159
3,180
2,979
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ...
kelnage/tamarin-prover
src/Web/Types.hs
gpl-3.0
26,803
0
13
7,625
4,575
2,442
2,133
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} import Haste.HPlay.View import Haste.HPlay.Cell import Haste.Perch import Haste import Haste.LocalStorage import Control.Applicative import Prelude hiding (div,span,id,all) import Data.Typeable import Control.Monad(when) import Control.Monad.IO.Class import qualified Data.IntMap as ...
agocorona/hplay-todo
src/todo.hs
gpl-3.0
6,462
0
23
2,037
2,284
1,121
1,163
170
9
{- Copyright (C) 2015 Michael Dunsmuir 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 i...
mdunsmuir/routequery-service
src/Main.hs
gpl-3.0
1,771
0
12
308
274
143
131
24
2
{- ============================================================================ | Copyright 2011 Matthew D. Steele <[email protected]> | | | | This file is part of Fallback. | ...
mdsteele/fallback
src/Fallback/Preferences.hs
gpl-3.0
3,594
0
11
972
409
222
187
42
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-bigtableadmin/gen/Network/Google/Resource/BigtableAdmin/Projects/Instances/Tables/SetIAMPolicy.hs
mpl-2.0
6,253
0
16
1,336
793
465
328
125
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/AdvertiserGroups/Patch.hs
mpl-2.0
3,888
0
15
886
509
300
209
75
1
module Widgets.ProjectPledges where import Import import Model.User (fetchUserPledgesDB) import Model.Project import Model.Currency -- | A summary without ticket or discussion counts. summarizeProject' :: Entity Project -> [Entity Pledge] -> ProjectSummary summarizeProject' a b = summarizeProject a b [] [] -- |The...
akegalj/snowdrift
Widgets/ProjectPledges.hs
agpl-3.0
1,883
0
13
587
244
126
118
-1
-1
{-# LANGUAGE OverloadedStrings #-} {- | Module : $Header$ Description : JSON stuff for tests. Copyright : (c) plaimi 2014 License : AGPL-3 Maintainer : [email protected] -} module Tempuhs.Spoc.JSON where import Data.Aeson ( ToJSON, Value, (.=), encode, object, ) import qualified Data....
plaimi/tempuhs-server
test/Tempuhs/Spoc/JSON.hs
agpl-3.0
757
0
7
155
118
73
45
16
1
import Graphics.UI.Gtk import Graphics.UI.Gtk.ModelView as New import Data.Tree main = do initGUI win <- windowNew -- Create a tree model with some unsorted data. rawmodel <- New.treeStoreNew [Node ("zoo",8) [], Node ("foo",5) [], Node ("bar",20) [], Node ("baz",2) []] -- Create a sorting proxy mode...
thiagoarrais/gtk2hs
demo/treeList/TreeSort.hs
lgpl-2.1
3,316
0
20
664
841
395
446
62
2
{-# OPTIONS_GHC -Wall #-} -- !! WARNING: SPOILERS AHEAD !! -- -- CIS 194: Homework 2 -- Log file parsing module LogAnalysis where import Provided.Log import Control.Applicative ( liftA2 ) import Data.Ord ( comparing ) import Data.List ( unfoldr ) import Text.Read ( readMaybe ) ...
nilthehuman/cis194
Homework2.hs
unlicense
3,627
0
14
1,166
956
503
453
61
4
{-# LANGUAGE OverloadedStrings #-} -- Copyright 2014 (c) Diego Souza <[email protected]> -- -- 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....
locaweb/leela
src/warpdrive/src/Leela/Data/Time.hs
apache-2.0
3,738
0
14
993
1,104
600
504
92
1
ans [] = [] ans ((a:b:_):xs) = (gcd a b):(ans xs) main = do c <- getContents let i = map (map read) $ map words $ lines c :: [[Int]] o = ans i mapM_ print o
a143753/AOJ
1009.hs
apache-2.0
170
0
14
51
126
62
64
7
1
{-# LANGUAGE Rank2Types, ImpredicativeTypes, FlexibleInstances, UndecidableInstances #-} module Data.Torrent.MetaInfo (PieceID, MetaInfo (..), SHA1, MetaInfoConduits (..)) where import Prelude hiding (FilePath) import Data.Maybe (fromJust) import Data.Torrent.Types import Crypto.Hash.SHA1 import Data.Map (Map) impo...
alios/lcars2
Data/Torrent/MetaInfo.hs
bsd-3-clause
7,604
0
24
2,019
2,328
1,186
1,142
152
3
{-# LANGUAGE BinaryLiterals #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NegativeLiterals #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE ScopedTypeVariables #-} -- | Tests for the flat module module Main w...
tittoassini/flat
test/Spec.hs
bsd-3-clause
26,353
0
17
7,393
9,095
5,170
3,925
56
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DataKinds ...
et4te/zero
frontend/Main.hs
bsd-3-clause
3,970
0
12
1,044
766
455
311
85
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.VertexBlend -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <[email protected]> -- Stability : stable -- Portability : portable -- ...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/VertexBlend.hs
bsd-3-clause
1,832
0
4
238
199
140
59
55
0
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PolyKinds #-} {-# LANG...
byorgey/new-active
src/Control/IApplicative/Unified.hs
bsd-3-clause
2,961
0
10
898
473
279
194
34
0
{- (c) The University of Glasgow, 1992-2006 Here we collect a variety of helper functions that construct or analyse HsSyn. All these functions deal with generic HsSyn; functions which deal with the instantiated versions are located elsewhere: Parameterised by Module ---------------- ------------- R...
oldmanmike/ghc
compiler/hsSyn/HsUtils.hs
bsd-3-clause
46,930
0
27
12,268
12,134
6,255
5,879
-1
-1
{-# LANGUAGE RecordWildCards #-} module Network.DHT.Kademlia.Util ( dumpRT , secToMicro , storeChunks , tryReassemble , forkIO_ , prunePings ) where import Control.Concurrent import Control.Concurrent.STM import Control.Monad import Data.Binary import Data.Time.C...
phylake/kademlia
Network/DHT/Kademlia/Util.hs
bsd-3-clause
2,329
0
14
632
774
415
359
60
4
-- | Parsing and evaluation of strict Goto. module Language.LoopGotoWhile.Goto.Strict ( run , eval , parse , prettyPrint ) where import Control.Monad import Control.Monad.ST import qualified Data.Vector as V import Data.Vector ((!)) import Data.List (genericLength) import Text.ParserCombinators.P...
eugenkiss/loopgotowhile
src/Language/LoopGotoWhile/Goto/Strict.hs
bsd-3-clause
5,092
0
16
1,471
1,525
758
767
139
7
{-# LANGUAGE DeriveGeneric #-} module Csv ( readCSV , writeCSV , LogCsv(..) ) where import Control.Applicative import Control.Monad import qualified Data.ByteString.Char8 as BS import qualified Data.ByteString.Lazy.Char8 as BL import Data.Csv import Data.Vector ...
matonix/BTScraper
src/Csv.hs
bsd-3-clause
844
0
11
222
241
135
106
24
1
module Main where import Data.Monoid import System.Console.GetOpt import System.Environment (getArgs) import System.Exit import System.IO import Finance.Halifax.CSV import Finance.Halifax.Ledger import Finance.Halifax.QIF import Finance.Halifax.Options import Finance.Halifax.Rules import Finance.Halifax.RulesParser ...
batterseapower/halifax-import
Finance/Halifax/Main.hs
bsd-3-clause
2,003
0
15
571
403
208
195
38
4
module MatSpec where import Data.Ratio import Toys.Mat.Field import Toys.Mat.Vector import Toys.Mat.Mat import Test.Hspec import Test.Hspec.QuickCheck (prop) import Test.QuickCheck hiding ((.&.)) -- Supports only 4 dimension vector instance Arbitrary f => Arbitrary (Vector f) where arbitrary = do xs <- sequen...
dagezi/ToysMat
test/MatSpec.hs
bsd-3-clause
2,171
0
16
594
661
350
311
57
1
{-# LANGUAGE ScopedTypeVariables #-} -- | -- Module : Data.Git.Storage.CacheFile -- License : BSD-style -- Maintainer : Vincent Hanquez <[email protected]> -- Stability : experimental -- Portability : unix -- module Data.Git.Storage.CacheFile (CacheFile, newCacheVal, getCacheVal) where import Control.Concu...
NicolasDP/hit
Data/Git/Storage/CacheFile.hs
bsd-3-clause
1,640
0
17
372
440
243
197
28
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} module Analysis.FFT_Py (peakListPython) where import Types.Common import qualified Settings as S import Shelly (shelly, silently, run) import qualified Data.Text as T import qualified Data.Text.Encodi...
aedanlombardo/HaskellPS
DSP-PBE/src/Analysis/FFT_Py.hs
bsd-3-clause
1,431
0
16
275
392
223
169
32
1
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} {-# LANGUAGE TypeFamilies, EmptyDataDecls, GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE RecordWildCards, OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} module Network.DNS.Pocket.Type where import Data.De...
junjihashimoto/pocket-dns
Network/DNS/Pocket/Type.hs
bsd-3-clause
1,359
0
12
284
409
221
188
39
0
module Main ( main ) where import Control.Concurrent import Control.Concurrent.STM import Control.Monad (when) import Data.List (find) import Data.Maybe (isJust) import System.Environment (getArgs) import System.Console.GetOpt import System.Log.Logger import System.Log.Handler.Simple import System.Log.Handler...
artems/FlashBit
cli/Main.hs
bsd-3-clause
3,501
0
13
760
952
506
446
87
4
{-# LANGUAGE PolyKinds, KindSignatures, GADTs #-} module Geordi.Util.Exists where data Exists :: (x -> *) -> * where ExI :: a b -> Exists a
liamoc/geordi
Geordi/Util/Exists.hs
bsd-3-clause
143
0
7
28
41
24
17
4
0
module AWS.EC2.Types.Tag ( Tag(..) ) where import AWS.Lib.FromText data Tag = Tag { tagResourceId :: Text , tagResourceType :: Text , tagKey :: Text , tagValue :: Maybe Text } deriving (Show, Read, Eq)
IanConnolly/aws-sdk-fork
AWS/EC2/Types/Tag.hs
bsd-3-clause
234
0
9
66
74
46
28
9
0
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell [lq| data Wrapper a <p :: a -> Prop, r :: a -> a -> Prop > = Wrap (rgref_ref :: a<p>) |] data Wrapper a = Wrap (a) -- Two measures [lq| measure fwdextends :: Int -> Int -> Prop |] [lq| measure actionP :: Int -> Prop |] [lq| data Wrapper2 = Wrapper2 (unwrapp...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/Measures.hs
bsd-3-clause
534
0
9
115
66
43
23
8
0
-- Pos.Chain.Txp.Memstate module Pos.DB.Txp.MemState ( module Pos.DB.Txp.MemState.Class , module Pos.DB.Txp.MemState.Holder , module Pos.DB.Txp.MemState.Metrics , module Pos.DB.Txp.MemState.Types ) where import Pos.DB.Txp.MemState.Class import Pos.DB.Txp.MemState....
input-output-hk/pos-haskell-prototype
db/src/Pos/DB/Txp/MemState.hs
mit
415
0
5
102
79
60
19
9
0
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} -- | Review the imported data, and the analysis upon that data. module DataAnalysis.Application.Handler.Review where imp...
glebovitz/demo
src/DataAnalysis/Application/Handler/Review.hs
mit
2,432
0
19
629
599
314
285
55
2
module Utils.KeyVal(formatKeyValList) where import Data.List(intercalate) import qualified Data.Text as T import Text.Printf(printf) import BDCS.DB(KeyVal) import BDCS.KeyValue(formatKeyValue) formatKeyValList :: [KeyVal] -> String formatKeyValList [] = "" formatKeyValList lst = printf " [%s]" ...
atodorov/bdcs
src/tools/inspect/Utils/KeyVal.hs
lgpl-2.1
377
0
12
64
119
68
51
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="fil-PH"> <title>Mag-import nga mga URL | Extensyon ng ZAP</title> <maps> <homeID>top</homeID...
secdec/zap-extensions
addOns/importurls/src/main/javahelp/org/zaproxy/zap/extension/importurls/resources/help_fil_PH/helpset_fil_PH.hs
apache-2.0
998
78
67
164
429
216
213
-1
-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="de-DE"> <title>Code Dx | ZAP Extension</title> <maps> <homeID>top</homeID> <mapref loc...
veggiespam/zap-extensions
addOns/codedx/src/main/javahelp/org/zaproxy/zap/extension/codedx/resources/help_de_DE/helpset_de_DE.hs
apache-2.0
969
80
66
160
415
210
205
-1
-1
module Tandoori.Typing.Instantiate (instantiate, instantiatePolyTy, instantiateTyping) where import Tandoori.Typing import Tandoori.Typing.Monad import Tandoori.Typing.MonoEnv import qualified Data.Map as Map import Control.Monad.State type TvMap = Map.Map Tv Tv type Instantiate = StateT TvMap Typing lookup...
bitemyapp/tandoori
src/Tandoori/Typing/Instantiate.hs
bsd-3-clause
2,182
0
15
623
521
271
250
38
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module Ros.Geometry_msgs.TwistStamped where import qualified Prelude as P import Prelude ((.), (+), (*)) import qualified Data.Typeable as T import Control.Applicative import Ros.Intern...
acowley/roshask
msgs/Geometry_msgs/Ros/Geometry_msgs/TwistStamped.hs
bsd-3-clause
1,423
1
9
255
364
215
149
35
0
module Main where import Control.Monad.Reader import Control.Monad.Except import Control.Exception (try) import Data.List import Data.Time import System.Directory import System.FilePath import System.Environment import System.Console.GetOpt import System.Console.Haskeline import System.Console.Haskeline.History import...
abooij/cubicaltt
Main.hs
mit
7,830
1
35
2,479
2,505
1,280
1,225
165
11
-- | An architecture independent description of a register. -- This needs to stay architecture independent because it is used -- by NCGMonad and the register allocators, which are shared -- by all architectures. -- {-# OPTIONS -fno-warn-tabs #-} -- The above warning supression flag is a temporary kludge. -- While wor...
lukexi/ghc-7.8-arm64
compiler/nativeGen/Reg.hs
bsd-3-clause
6,224
155
12
1,194
1,320
718
602
141
5
{-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} #ifdef TRUSTWORTHY {-# LANGUAGE Trustworthy #-} #endif ------------------------------------------------------------------...
rpglover64/lens
src/Control/Lens/Cons.hs
bsd-3-clause
13,810
0
16
2,817
3,017
1,764
1,253
186
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} import Conduit import Data.List (stripPrefix) import ...
juhp/stack
test/integration/IntegrationSpec.hs
bsd-3-clause
8,590
3
29
2,779
2,207
1,095
1,112
216
5
{-# LANGUAGE MagicHash #-} module ShouldFail where import GHC.Base die :: Int -> ByteArray# die _ = undefined
hvr/jhc
regress/tests/1_typecheck/4_fail/ghc/tcfail090.hs
mit
113
0
5
21
27
16
11
5
1
{-# LANGUAGE UnboxedTuples #-} -- | State monad for the linear register allocator. -- Here we keep all the state that the register allocator keeps track -- of as it walks the instructions in a basic block. module RegAlloc.Linear.State ( RA_State(..), RegM, runR, spillR, ...
shlevy/ghc
compiler/nativeGen/RegAlloc/Linear/State.hs
bsd-3-clause
4,270
0
13
1,203
1,238
687
551
109
1
module Syntax where import Data.List ------------------------------------------------------------------ -- Abstract syntax ----------------------------------------------- ------------------------------------------------------------------ -- info for all primops; the totality of the info in primops.txt(.pp) data Info...
tjakway/ghcjvm
utils/genprimopcode/Syntax.hs
bsd-3-clause
6,550
0
16
2,160
1,405
788
617
128
3
import Test.Cabal.Prelude main = setupAndCabalTest $ do skipUnless =<< hasCabalForGhc -- On Travis OSX, Cabal shipped with GHC 7.8 does not work -- with error "setup: /usr/bin/ar: permission denied"; see -- also https://github.com/haskell/cabal/issues/3938 -- This is a hack to make the test not run ...
mydaum/cabal
cabal-testsuite/PackageTests/CustomPlain/setup.test.hs
bsd-3-clause
543
0
14
104
96
49
47
6
1
compareDouble :: Double -> Double -> Ordering compareDouble x y = case (isNaN x, isNaN y) of (True, True) -> EQ (True, False) -> LT (False, True) -> GT (False, False) -> -- Make -0 less than 0 case (x == 0, y == 0, isNegativeZero x, isNegativeZero y) of ...
ezyang/ghc
testsuite/tests/deSugar/should_run/T9238.hs
bsd-3-clause
538
0
11
212
228
126
102
14
6
{-# LANGUAGE CPP #-} -- | SimpleForm implementation that works along with digestive-functors -- -- The Combined module both renders to 'Html' and also parses input. module SimpleForm.Digestive.Combined ( SimpleForm, SimpleForm', postSimpleForm, getSimpleForm, simpleForm', -- * Create forms input, input_, toFor...
singpolyma/simple-form-haskell
SimpleForm/Digestive/Combined.hs
isc
4,242
124
15
867
1,105
628
477
84
1
module HW1.TowersOfHanoiSpec (main, spec) where import HW1.TowersOfHanoi import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = describe "hanoi" $ it "returns a list of moves required to stack pegs in order" $ hanoi 2 'a' 'b' 'c' `shouldBe` [('a','c'), ('a','b'), ('c','b')]
wstrinz/school-of-haskell
cis194/homework-1/test/HW1/TowersOfHanoiSpec.hs
mit
307
0
8
64
108
62
46
10
1
{-# LANGUAGE OverloadedStrings #-} module Y2018.M05.D18.Solution where import Data.Aeson import Data.ByteString.Lazy.Char8 (ByteString) import qualified Data.ByteString.Lazy.Char8 as BL import Data.Time.Clock import Database.PostgreSQL.Simple import Network.HTTP.Conduit -- below imports available via 1HaskellADay ...
geophf/1HaskellADay
exercises/HAD/Y2018/M05/D18/Solution.hs
mit
4,053
0
17
780
884
472
412
63
2
module Level.Grid.GrowingTree where import Coord.Types import Level.Grid.Types import System.Random import System.Random.PCG -- Using FRecBT as the frontier results in a recursive backtracker newtype FRecBT = FRecBT [Coord] -- Using FPrim as the frontier results in Prim's algorithm newtype FPrim = FPrim [Coord] dat...
wmarvel/haskellrogue
src/Level/Grid/GrowingTree.hs
mit
3,049
0
18
676
1,239
615
624
73
3
-- ------------------------------------------------------------------------------------- -- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved. -- For email, run on linux (perl v5.8.5): -- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0...
cbrghostrider/Hacking
HackerRank/FunctionalProgramming/MemoizationAndDP/sherlockMaze.hs
mit
2,679
0
23
730
898
506
392
41
3
module Apl1 where import Control.Applicative import Data.Monoid import Test.QuickCheck import Test.QuickCheck.Checkers import Test.QuickCheck.Classes -- unfortunate orphan instances. Try to avoid these -- in code you're going to keep or release. -- this isn't going to work properly instance Monoid a => Monoid (ZipLi...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter17/Apl1/src/Apl1.hs
mit
608
0
7
106
159
86
73
15
0
module Backends.D16Hoopl.Backend where
d16-processor/Haskell-C-
src/Backends/D16Hoopl/Backend.hs
mit
39
0
3
3
7
5
2
1
0
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGAnimatedNumber (js_setBaseVal, setBaseVal, js_getBaseVal, getBaseVal, js_getAnimVal, getAnimVal, SVGAnimatedNumber, castToSVGAnimatedNumber, gTypeSVGAnimatedNumber) where import Pr...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/SVGAnimatedNumber.hs
mit
2,195
20
9
264
524
314
210
32
1
{-# LANGUAGE OverloadedStrings #-} module Y2017.M02.D23.Solution where import Control.Arrow (second, app) import Control.Comonad import Data.List (intercalate) import Data.Maybe (catMaybes) import Network.HTTP -- below imports from 1HaskellADay git repository 'may' help reading FASTA files import Control.List -- fo...
geophf/1HaskellADay
exercises/HAD/Y2017/M02/D23/Solution.hs
mit
7,458
0
13
1,279
844
477
367
53
2
module Root.Test.Test2SpecWE where import Test.Hspec import Test.QuickCheck import Control.Exception (evaluate) main :: IO () main = hspec spec spec::Spec spec = do describe "Prelude.head" $ do it "returns the first element of a list" $ do head [23 ..] `shouldBe` (23 :: Int)
codeboardio/kali
test/src_examples/haskell/several_files/Root/Test/Test2SpecWE.hs
mit
284
0
15
51
97
53
44
11
1
{-# htermination fromInt :: Num a => Int -> a #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_fromInt_1.hs
mit
50
0
2
11
3
2
1
1
0
------------------------------------------------------------------------------------ -- | -- Module : Conversion -- Copyright : (C) 2015 Sajith Sasidharan -- License : MIT (see LICENSE) -- -- Maintainer : [email protected] -- Stability : experimental -- Portability : unknown -- ----------------------...
sajith/bmp2xpm
src/Conversion.hs
mit
6,131
0
17
1,405
1,060
580
480
70
2
module Atom.Marker where import GHCJS.Types data Marker_ type Marker = JSRef Marker_
CRogers/stack-ide-atom
haskell/src/Atom/Marker.hs
mit
88
0
5
15
23
14
9
-1
-1
module Main (main) where import Data.Monoid (mempty) import Debug.Trace import Test.Framework.Options (TestOptions, TestOptions'(..)) import Test.Framework.Providers.QuickCheck2 (testProperty) import Test.Framework.Runners.Options (RunnerOptions, RunnerOptions'(..)) import qualified Test.Framework as T import qualifie...
temoto/nginx-lint
test/Main.hs
mit
5,279
0
13
1,444
1,755
921
834
132
2
-- | Main entry point to the application. module Main where type Peg = String type Move = (Peg, Peg) hanoi :: Integer -> Peg -> Peg -> Peg -> [Move] hanoi 0 _ _ _ = [] hanoi 1 sourcePeg destPeg _ = [(sourcePeg, destPeg)] hanoi n sourcePeg destPeg tempPeg = hanoi (n - 1) sourcePeg tempPeg destPeg ++ [(so...
gscalzo/HaskellTheHardWay
cis194/week1/hanoi.hs
mit
1,600
0
11
546
565
303
262
28
1
-- | -- -- Checks that namespaces /can/ be nested module Main where import Control.Biegunka import System.Exit (ExitCode) main :: IO ExitCode main = biegunka id run $ do namespace "outer" $ namespace "inner" $ return () namespace "outer" $ namespace "inner" $ return ()
biegunka/biegunka
test/typecheck/should_compile/OK6.hs
mit
297
0
10
72
88
44
44
11
1
import Data.List import Math exp2 n | m == 1 && r == 0 = True | r /= 0 = False | otherwise = exp2 m where m = quot n 2 r = rem n 2 specPrimes lim = [x|i <- [1.. (ceiling $ logBase 2 lim)], let x = 2^i + 1, prime x] powerFor2 lim = [ m | m <- [1..lim], (rem m 2) == 0, ((rem (succ m) ...
zeniuseducation/poly-euler
haskell/prob301-400.hs
epl-1.0
1,249
8
19
402
811
423
388
26
1
-- Copyright (C) 2002-2004 David Roundy -- Copyright (C) 2005 Juliusz Chroboczek -- -- 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, or (at your option) -- any later version....
DavidAlphaFox/darcs
src/Darcs/Repository.hs
gpl-2.0
35,578
398
23
9,234
7,985
4,310
3,675
726
8
instance Functor Tree where fmap f (Leaf a) = Leaf (f a) fmap f (Node t t') = Node (fmap f t) (fmap f t')
hmemcpy/milewski-ctfp-pdf
src/content/1.8/code/haskell/snippet15.hs
gpl-3.0
113
0
8
32
73
35
38
3
0
-- ---- Copyright (c) 2015 Scott Wakeling - http://www.diskfish.org/ ---- GPL version 3 or later (see http://www.gnu.org/licenses/gpl.html) -- module Compile ( compileSrc, getSrcFilesRecursive ) where import Control.Monad (forM) import Data.List.Utils import System.Process import System.Directory ...
scottwakeling/hikiwiki
Compile.hs
gpl-3.0
3,975
35
22
1,256
948
489
459
76
5
import Sound.SC3 import qualified Data.ByteString.Lazy as B import Sound.OpenSoundControl (Datum(..), OSC(..), Time(..), encodeOSC, utcr) blobFromOSC :: OSC -> Datum blobFromOSC = Blob . B.unpack . encodeOSC d_load' :: String -> OSC -> OSC d_load' p c = Message "/d_load" [String p, blobFromOSC c] complMess _ = s_new...
kaoskorobase/mescaline
tests/scsynth/completion.hs
gpl-3.0
799
0
14
213
287
160
127
18
1
module Main where import System.Random import Test.Tasty import Test.Tasty.QuickCheck as QC import ABSFeedbackTests import ABSDataTests -- to generate html from coverage use hpc: -- hpc markup --hpcdir=/home/io.nathan/phd/coding/reports/verificationABS/Testing/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.0.1.0/hpc ...
thalerjonathan/phd
coding/papers/pfe/testing/src/Main.hs
gpl-3.0
494
0
11
68
80
45
35
11
1
{-# LANGUAGE Arrows #-} {-# LANGUAGE FlexibleContexts #-} module SugarScape.Agent ( agentSF , dieOfAge , agentMetabolism , agentDies , starvedToDeath ) where import Control.Monad.Random import Control.Monad.State.Strict import FRP.BearRiver import SugarScape.AgentMonad import Sug...
thalerjonathan/phd
public/towards/SugarScape/experimental/chapter2/src/SugarScape/Agent.hs
gpl-3.0
8,336
1
17
2,283
2,032
1,004
1,028
183
2
-- | -- Module : Commands.RpmBuild -- Copyright : (C) 2007-2008 Bryan O'Sullivan -- (C) 2012-2014 Jens Petersen -- -- Maintainer : Jens Petersen <[email protected]> -- Stability : alpha -- Portability : portable -- -- Explanation: Support for building RPM packages. Can also gen...
mathstuf/cabal-rpm
src/Commands/RpmBuild.hs
gpl-3.0
3,103
0
16
693
579
313
266
45
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/Enterprises/GenerateSignupURL.hs
mpl-2.0
3,638
0
13
734
311
193
118
50
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-cognito-identity/gen/Network/AWS/CognitoIdentity/DeleteIdentityPool.hs
mpl-2.0
3,206
0
9
658
346
211
135
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 DeriveGeneric #-} module BoardGame.Server.Domain.ServerConfig ( DeployEnv(..) , ServerConfig(..) , defaultServerConfig , readSe...
azadbolour/boardgame
haskell-server/src/BoardGame/Server/Domain/ServerConfig.hs
agpl-3.0
2,816
0
9
415
431
258
173
59
2
module SimpleJSON ( JValue(..) -- .. means export that type and all its constructors , getString , getInt , getDouble , getBool , getObject , getArray , isNull ) where -- from Haskell type to JSON type data JValue = JString String | JNumber Double | JBo...
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2009-Real_World_Haskell/SimpleJSON.hs
unlicense
922
0
8
346
264
142
122
30
1
module GridPolytopes.A338885 (a338885_row) where import Helpers.Primes (divisors) import Data.Set (Set) import qualified Data.Set as Set import Data.List (genericLength) -- https://codegolf.stackexchange.com/q/213754/53884 a338885_row :: Integer -> [Integer] a338885_row n = Set.toAscList $ Set.fromList factorProducts w...
peterokagey/haskellOEIS
src/Sandbox/Rectangles_in_rectangles.hs
apache-2.0
625
0
13
95
224
128
96
14
1
-- x first parameter and y second parameter doubleUs x y = x*2 + y*2
tonilopezmr/Learning-Haskell
Functions/doubleUs.hs
apache-2.0
68
0
7
14
24
12
12
1
1
-- | This module contains a number of benchmarks for the different streaming -- functions -- -- Tested in this benchmark: -- -- * Most streaming functions -- {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveGeneric, RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Benchmarks.Stream ( initEnv , b...
bos/text
benchmarks/haskell/Benchmarks/Stream.hs
bsd-2-clause
4,110
0
13
1,111
1,112
597
515
111
1
module Code.Generating.Utils.Exports ( mergeExportSpec, addExportSpec ) where ------------------------------------------------------------------------ import Data.List(union) import Language.Haskell.Exts.Syntax import Code.Generating.InternalUtils ----------------------------------------------------------------...
Laar/CodeGenerating
src/Code/Generating/Utils/Exports.hs
bsd-3-clause
2,180
0
11
535
589
309
280
29
19
-- | -- Module: $Header$ -- Description: Find and execute external subcommands. -- Copyright: (c) 2018-2020 Peter Trško -- License: BSD3 -- -- Maintainer: [email protected] -- Stability: experimental -- Portability: GHC specific language extensions. -- -- Find and execute external subcommands. module ...
trskop/command-wrapper
command-wrapper/src/CommandWrapper/Toolset/ExternalSubcommand.hs
bsd-3-clause
11,889
80
21
3,103
2,204
1,258
946
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Language.CFamily.Data -- Copyright : (c) 2008 Benedikt Huber -- License : BSD-style -- Maintainer : [email protected] -- Stability : experimental -- Portability : ghc -- -- Common data types for Langua...
micknelso/language-c
src/Language/CFamily/OldData.hs
bsd-3-clause
1,084
0
5
136
126
95
31
15
0
-- | -- Module: Data.Aeson -- Copyright: (c) 2011-2015 Bryan O'Sullivan -- (c) 2011 MailRank, Inc. -- License: Apache -- Maintainer: Bryan O'Sullivan <[email protected]> -- Stability: experimental -- Portability: portable -- -- Types and functions for working efficiently with JSON data. -- -...
nurpax/aeson
Data/Aeson.hs
bsd-3-clause
11,643
0
8
2,441
862
619
243
80
1
{-# LANGUAGE UndecidableInstances, FlexibleContexts, MultiWayIf #-} module SearchTree where import Control.Monad import Control.Monad.Trans.Class import Control.Applicative import Data.Maybe data Tree a = Node [Tree a] | Leaf a deriving (Show, Eq) instance Functor Tree where fmap = liftM instance Applicative Tree...
kwibus/myLang
tests/SearchTree.hs
bsd-3-clause
4,611
0
18
1,233
1,880
963
917
101
7
{-# LANGUAGE TemplateHaskell #-} -- | Static files. module HL.Static where import Control.Monad.IO.Class import Yesod.Static staticFiles "static/" -- | Get the directory for static files. In development returns the -- local copy, in production mode uses the Cabal data-files -- functionality. getStaticDir :: MonadI...
haskell-lang/haskell-lang
src/HL/Static.hs
bsd-3-clause
372
0
6
59
52
30
22
8
1
{-# LANGUAGE CPP #-} ------------------------------------------------------------------------ -- © 1998 Peter Thiemann -- some default settings -- module Defaults (afmPathDefault, ebnfInputDefault, rgbPathDefault) where afmPathDefault = [ #include "afmpath.h" , "/usr/local/tex/lib/TeXPS/afm...
FranklinChen/Ebnf2ps
src/Defaults.hs
bsd-3-clause
441
6
5
96
52
35
17
-1
-1
{- Problem 15 How many routes are there through a 20*20 grid? Result 137846528820 0.00 s Comment To traverse the 20*20 grid, one has to take 20 steps right and another 20 down. The problem thus reduces in "how many different way...
quchen/HaskellEuler
src/Problem15.hs
bsd-3-clause
508
0
7
174
31
20
11
3
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Prelude hiding ((+),(-),(*),(==)) import Verbal import System.Environment (getArgs) import Data.String (fromString) -- for ghci -- :set -XOverloadedStrings test1 = print $ findConditions $ "debt" + "star" == "death" test2 = print $ findConditions $ "send...
mitsuji/verbal-arithmetic
app/General.hs
bsd-3-clause
729
2
10
140
236
130
106
18
1
module Scheme.Eval.Primitives (ioPrimitives, basicPrimitives) where import Control.Monad import Data.Maybe import Data.Complex as C import Data.Ratio import Control.Monad.Error import Scheme.Types import System.IO import Scheme.Eval.DynamicTypes prim = undefined convert typ wrap = expect typ >=> return . wrap fo...
hucal/SCMinHS
Scheme/Eval/Primitives.hs
bsd-3-clause
6,606
0
21
2,070
2,261
1,217
1,044
-1
-1
{-# LANGUAGE BangPatterns, TypeFamilies #-} module Main where import Control.Category import Prelude hiding ((.), log) import Foreign.C import System.FilePath import qualified Vision.Image as F hiding (mean) import Pipes import qualified Pipes.Prelude as P import Control.Monad import Data.VectorSpace import Data.List ...
alexisVallet/hnn
examples/mnist/Main.hs
bsd-3-clause
4,252
0
26
1,063
1,596
838
758
100
1
module PFDS.Commons.Heap where class Heap h where empty :: Ord e => h e isEmpty :: Ord e => h e -> Bool insert :: Ord e => e -> h e -> h e merge :: Ord e => h e -> h e -> h e findMin :: Ord e => h e -> e deleteMin :: Ord e => h e -> h e -- impl leftist heap data LHeap e = E | T Int e (LHeap e) (LHeap e) d...
matonix/pfds
src/PFDS/Commons/Heap.hs
bsd-3-clause
934
0
10
298
539
265
274
30
2