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 System.Warp.Match where import System.Warp.Types import System.Process import Data.List(intersperse, isInfixOf, find, null) import qualified Data.Map as M runMatch :: String -> Facts -> Matcher -> Bool runMatch _ _ MatchAll = True runMatch _ _ MatchNone = True runMatch host...
pyr/warp-agent
System/Warp/Match.hs
isc
792
0
9
148
292
153
139
20
3
module Data.Graphics.SVG where -- a solution to the SVG-problem posted at http://lpaste.net/4776707050010836992 import Control.Logic.Frege (adjoin) -- http://lpaste.net/111101 import Data.Graphics.BoundingBox -- http://lpaste.net/2865245555871711232 import Data.XHTML -- http://lpaste.net/11338...
geophf/1HaskellADay
exercises/HAD/Data/Graphics/SVG.hs
mit
3,675
0
15
951
1,207
646
561
60
1
-- Problems/Problem001Spec.hs module Problems.Problem001Spec (main, spec) where import Test.Hspec import Problems.Problem001 main :: IO() main = hspec spec spec :: Spec spec = describe "Problem 1" $ it "Should evaluate to 233168" $ p1 `shouldBe` 233168
Sgoettschkes/learning
haskell/ProjectEuler/tests/Problems/Problem001Spec.hs
mit
269
0
8
52
73
41
32
9
1
{-# htermination shows :: Show a => [a] -> String -> String #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_shows_4.hs
mit
64
0
2
13
3
2
1
1
0
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Applicative import Snap import Snap.Core import Snap.Util.FileServe import Snap.Http.Server import Snap.Snaplet.STL.View main :: IO () main = serveSnaplet defaultConfig stlAppInit
yogeshsajanikar/stl
snaplet-stl/stl-view/Main.hs
mit
311
0
6
91
57
35
22
10
1
import ClassyPrelude hiding (first) import Prelude (read) import System.IO.Unsafe import Data.Char import N import Helpers data T = T Text [T] file :: Text file = unsafePerformIO $ readFile "/home/yom/db.txt" doIt t = do rt ← use root note ← newNote [] "blah" addSub note rt addInputLines ["other text"] ...
aelve/Jane
Import.hs
mit
555
0
11
146
221
114
107
-1
-1
{- | module : Database.MySQLX.Model description : crud interface copyright : (c) naoto ogawa, 2017 license : MIT maintainer : stability : experimental portability : Interface for X Protocol Protocol Buffer. -} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE...
naoto-ogawa/h-xproto-mysql
src/DataBase/MySQLX/Model.hs
mit
77,817
0
19
23,307
16,152
8,954
7,198
1,076
15
{-# LANGUAGE OverloadedStrings #-} module Edabo.MPD where import Data.Either (partitionEithers) import Data.Maybe (mapMaybe) import Data.String (fromString) import Data.UUID (UUID) import qualifie...
mineo/edabo
src/Edabo/MPD.hs
mit
4,942
0
16
2,120
958
507
451
75
4
{-# LANGUAGE RecordWildCards #-} {-| Module : HSat.Make.Instances.Common.Literal Description : Generic functions to create Literal's Copyright : (c) Andrew Burnett 2014-2015 Maintainer : andyburnett88@gmail.com Stability : experimental Portability : Unknown Exports a main data type 'LiteralSet' that...
aburnett88/HSat
src/HSat/Make/Instances/Common/Literal.hs
mit
5,753
0
16
1,333
897
481
416
87
2
module NetHack.Monad.NHAction (runNHAction, answer, NHAction(), update, getTerminalM, get, putInventoryM, putInventoryNeedsUpdateM, getElementM, putElementM, getMessagesM, control, nextRunningIDM, getLevelM, bailout, getCoordsM, forbidMovementFromM, putLevelM, putCurrentLevelM, maybeMarkAsOpenDoorM, ...
Noeda/Megaman
src/NetHack/Monad/NHAction.hs
mit
4,960
0
13
1,090
1,666
839
827
145
1
module Pregame.GhcPrim ( module X ) where import GHC.Types as X ( Bool(False, True) , Char , Int , Word , Float , Double , Ordering(LT, GT, EQ) , IO )
jxv/pregame
src/Pregame/GhcPrim.hs
mit
174
0
6
54
59
42
17
11
0
-- HMM from Anglican (https://bitbucket.org/probprog/anglican-white-paper) {-# LANGUAGE FlexibleContexts, TypeFamilies #-} module HMM ( values, hmm, syntheticData ) where --Hidden Markov Models import Control.Monad (replicateM) import Data.Vector (fromList) import Control.Monad.Bayes.Class -- | Observe...
adscib/monad-bayes
models/HMM.hs
mit
1,336
0
13
268
515
280
235
35
3
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-filter.html module Stratosphere.ResourceProperties.IoTAnalyticsDatasetFilter where impo...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/IoTAnalyticsDatasetFilter.hs
mit
1,533
0
12
156
167
98
69
23
1
module Control.Schule.DB where import Control.SQL import Control.Types import Control.Schule.Typ import qualified Control.Student.Type as CST import qualified Control.Student.DB import Autolib.Multilingual ( Language (..)) import Prelude hiding ( all ) -- | get alle Schulen aus DB -- TODO: implementiere filter get ...
marcellussiegburg/autotool
db/src/Control/Schule/DB.hs
gpl-2.0
2,425
15
16
744
701
364
337
63
2
module UserError(assert) where { assert :: String -> Bool -> a -> a; assert s x y = if x then y else error $ "UserError.assert failed: " ++ s; -- assert _ _ y = y; }
kenta2/yescrypt
UserError.hs
gpl-3.0
166
0
7
38
59
35
24
3
2
module Shiny.Hardware.Dummy (mkDummyHardware) where import Shiny.Shiny import Shiny.Hardware import Data.IORef import Data.Time (getCurrentTime) mkDummyHardware :: Int -> IO (Hardware) mkDummyHardware size = do ref <- newIORef (emptyDisplay size) return $ Hardware { readDisplay = read ref, updateDisplay =...
dhrosa/shiny
Shiny/Hardware/Dummy.hs
gpl-3.0
593
0
12
144
181
92
89
18
1
-- Copyright (c) 2011 - All rights reserved - Keera Studios module Physics.Shapes where import Data -- * Shapes type AABB = (Pos2D, Size2D) -- We consider these half the size type Circle = (Pos2D, Double)
keera-studios/pang-a-lambda
src/Physics/Shapes.hs
gpl-3.0
209
0
5
40
36
25
11
4
0
-- | Helper functions to generate values of primitives. -- These are copied from Test.QuickCheck.Arbitrary and adjusted to use MonadGen module Sara.TestUtils.ArbitraryUtils where import Sara.TestUtils.GenT import Data.Ratio ( (%) ) -- | Generates a boolean. arbitraryBool :: MonadGen g => g Bool arbitraryBool = choose...
Lykos/Sara
tests/Sara/TestUtils/ArbitraryUtils.hs
gpl-3.0
1,472
1
16
279
393
212
181
23
1
module Main ( run, main ) where import Scanner import Parser import AST import Semantics -- |Runs a piece of code run :: String -> AST run code = let (ast, _) = parse . scan $ code in reduce ast main = do code <- getLine if code /= "exit" then do print $ run code main else putStrL...
marco-zanella/minilambda
src/Interpreter.hs
gpl-3.0
329
0
11
100
114
60
54
18
2
module FizzBuzz where fizzbuzz :: Int -> String fizzbuzz n | n `mod` 3 == 0 && n `mod`5 == 0 = "fizzbuzz!" | n `mod` 3 == 0 = "fizz!" | n `mod` 5 == 0 = "buzz!" | otherwise = number n ++ "!" lessThan20 :: Int -> String lessThan20 n | n >0 && n < 20 = answers !! (n-1) whe...
EduPH/Problemas
FizzBuzz/src/FizzBuzz.hs
gpl-3.0
1,027
0
12
423
363
186
177
24
1
{-# LANGUAGE FlexibleContexts #-} module Config ( parseConfig ) where import Data.ConfigFile ( readfile , get , emptyCP , CPError(..) , CPErrorData(..) ) import Control.Monad.IO...
MortimerMcMire315/sparkive
src/Config.hs
gpl-3.0
2,604
0
13
792
547
285
262
49
5
{-# LANGUAGE TupleSections #-} {-# LANGUAGE ScopedTypeVariables #-} module Worlds.SpaceFillingTunnel ( spaceFillingTunnel ) where import Data.Foldable import qualified Data.Set as Set import Control.Monad.Random import Linear hiding (translation) import Constraints.Scalar import Constraints.Vector import Worlds....
MatthiasHu/4d-labyrinth
src/Worlds/SpaceFillingTunnel.hs
gpl-3.0
870
0
11
145
264
150
114
24
1
{-# LANGUAGE Arrows #-} module Main where import System.IO import Data.Maybe import Control.Monad.Random import Control.Monad.Reader import Control.Monad.State import Data.MonadicStreamFunction import SIR type Time = Double type DTime = Double type EnvironmentFold e = [e] -> e -> e type AgentMSF g s m e = MSF (Rea...
thalerjonathan/phd
coding/papers/FrABS/Haskell/prototyping/SIRDunaiAgentIOState/src/Main.hs
gpl-3.0
6,898
5
22
2,385
2,124
1,073
1,051
155
3
module DL3034 (tests) where import Helpers import Test.Hspec tests :: SpecWith () tests = do let ?rulesConfig = mempty describe "DL3034 - Non-interactive switch missing from zypper command: `zypper install -y`" $ do it "not ok without non-interactive switch" $ do ruleCatches "DL3034" "RUN zypper instal...
lukasmartinelli/hadolint
test/DL3034.hs
gpl-3.0
855
0
13
158
119
53
66
-1
-1
-- | Qualification Round 2015 Problem D. Ominous Omino -- https://code.google.com/codejam/contest/6224486/dashboard#s=p3 module OminousOmino where -- constant imports import Text.ParserCombinators.Parsec import Text.Parsec import System.IO (openFile, hClose, hGetContents, hPutStrLn, IOMode(ReadMode), stderr) import De...
dirkz/google-code-jam-haskell
practice/src/OminousOmino.hs
mpl-2.0
2,932
0
23
770
1,014
540
474
79
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-servicenetworking/gen/Network/Google/Resource/ServiceNetworking/Services/Connections/List.hs
mpl-2.0
5,994
0
17
1,306
795
468
327
115
1
module DifferentialGeometry where import Vectors data DifferentialGeometry = DifferentialGeometry { dgPoint :: Vec3, dgNormal :: Vec3, dgDPDU :: Vec3, dgDPDV :: Vec3 } deriving Show
pstiasny/mgr
DifferentialGeometry.hs
lgpl-3.0
200
0
8
43
43
28
15
8
0
module Main where import Haste.DOM (withElems, getValue, setProp) import Haste.Events (onEvent, MouseEvent(Click)) import PLexceptGOTOdotNET (run) main = withElems ["prog", "result", "run-button"] driver driver [progElem, resultElem, runButtonElem] = onEvent runButtonElem Click $ \_ -> do Just prog <- g...
catseye/PL-GOTO.NET
src/HasteMain.hs
unlicense
389
0
10
69
123
68
55
9
1
module Lol.Champs where import Prelude import System.Random import Lol.Helpers data Champ = Ahri | Akali | Alistar | Amumu | Anivia | Annie | Ashe | Blitzcrank | Brand | Caitlyn | Cassiopeia | Ch...
MostAwesomeDude/lollerskates
Lol/Champs.hs
bsd-2-clause
2,071
0
6
1,208
340
220
120
99
0
{-# LANGUAGE BangPatterns #-} import qualified Data.ByteString.Char8 as C import qualified Data.Foldable as F import qualified Data.IntMap.Strict as IntMap import qualified Data.Sequence as Seq import Data.Sequence(Seq) import Data.IntMap.Strict(IntMap) import Data.Maybe pushBack x q = q Seq.|> x popFront q = (x, q') ...
wangbj/haskell
arraysub.hs
bsd-2-clause
1,693
0
11
405
784
404
380
43
2
{-# LANGUAGE RankNTypes, BangPatterns, FlexibleContexts, Strict #-} {- | Module : Dominators Copyright : (c) Matt Morrow 2009 License : BSD3 Maintainer : <morrow@moonpatio.com> Stability : experimental Portability : portable Taken from the dom-lt package. The Lengauer-...
sdiehl/ghc
compiler/utils/Dominators.hs
bsd-3-clause
16,145
0
22
5,622
5,986
3,072
2,914
435
4
module Problem45 where import Data.List isqrt :: Integer -> Maybe Integer isqrt n = binarySearch 1 n where binarySearch low high = let mid = (low + high) `div` 2 midSq = mid * mid in if high < low then Nothing else if midSq == n then Just mid else if midSq > n then binarySearch...
noraesae/euler
src/Problem45.hs
bsd-3-clause
953
0
14
279
439
230
209
32
4
{-| Module : Idris.REPL.Parser Description : Parser for the REPL commands. License : BSD3 Maintainer : The Idris Community. -} module Idris.REPL.Parser ( parseCmd , help , allHelp , setOptions ) where import Idris.AbsSyntax import Idris.Colours import Idris.Core.TT import Idris.Help import Idris....
uuhan/Idris-dev
src/Idris/REPL/Parser.hs
bsd-3-clause
21,486
0
21
5,611
6,792
3,514
3,278
442
3
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Volume.ES....
facebookincubator/duckling
Duckling/Volume/ES/Rules.hs
bsd-3-clause
1,925
0
19
491
483
291
192
49
2
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.EXT.CMYKA -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- -- The...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/EXT/CMYKA.hs
bsd-3-clause
678
0
4
87
46
37
9
6
0
{-# LANGUAGE TupleSections #-} -- | Server operations common to many modules. module Game.LambdaHack.Server.CommonServer ( execFailure, resetFidPerception, resetLitInDungeon, getPerFid , revealItems, moveStores, deduceQuits, deduceKilled, electLeader , addActor, addActorIid, projectFail , pickWeaponServer, sumO...
beni55/LambdaHack
Game/LambdaHack/Server/CommonServer.hs
bsd-3-clause
22,445
0
33
5,988
6,225
3,191
3,034
-1
-1
{-| Module : Main (file aern2-real-benchOp) Description : execute a simple CR expression Copyright : (c) Michal Konecny License : BSD3 Maintainer : mikkonecny@gmail.com Stability : experimental Portability : portable -} module Main where import MixedTypesNumPrelude -- ...
michalkonecny/aern2
aern2-net/bench/aern2-real-simpleOp.hs
bsd-3-clause
2,204
0
16
676
260
153
107
30
2
{-# LANGUAGE OverloadedStrings, TemplateHaskell, DeriveDataTypeable #-} module Rede.HarFiles.ServedEntry( sreStatus ,sreHeaders ,sreContents ,sreHost ,resolveFromHar ,createResolveCenter ,servedResources ,allSeenHosts -- ,createResolveCenterFromFilePath ,resourceHandleToByteStr...
loadimpact/http2-test
hs-src/Rede/HarFiles/ServedEntry.hs
bsd-3-clause
9,875
0
12
2,514
1,533
871
662
-1
-1
module Main where import Lib main :: IO () main = parseArgs
blischalk/servermon
app/Main.hs
bsd-3-clause
62
0
6
14
22
13
9
4
1
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} -- | Haskell code generator module Data.Protobuf.CodeGen ( convert ) where -- import Control.Arrow import Data.List import Data.Protobuf.AST import Data.Protobuf.DataTree import Data.Generics.Uniplate.Data import Language.Haskell.Exts.Syntax...
Shimuuar/protobuf
protobuf-grammar/Data/Protobuf/CodeGen.hs
bsd-3-clause
16,933
0
29
6,144
5,200
2,650
2,550
337
21
{-# LANGUAGE OverloadedStrings #-} module Jira2Sheet.GoogleDrive where import Control.Applicative (empty) import Control.Lens ((&), (.~), (?~), (^.)) import Data.Aeson (FromJSON (..), Value (..), (.:)) import Data.Aeson.Types (typeMismatch) import qua...
berdario/jira2sheet
src/Jira2Sheet/GoogleDrive.hs
bsd-3-clause
1,806
0
17
482
394
232
162
31
1
import Lichen.Count.Config import Lichen.Count.Main main :: IO () main = realMain defaultConfig
Submitty/AnalysisTools
app/count/Main.hs
bsd-3-clause
97
0
6
13
31
17
14
4
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE ScopedTypeVariables #-} module Mafia.Cabal.Dependencies ( findDependenciesForCurrentDirectory , findDependenciesForPackage , fil...
ambiata/mafia
src/Mafia/Cabal/Dependencies.hs
bsd-3-clause
10,338
0
21
2,427
2,995
1,515
1,480
249
4
module Data.Aeson.Serialize.Internal ( ) where
plow-technologies/aeson-serialize
src/Data/Aeson/Serialize/Internal.hs
bsd-3-clause
55
0
3
13
11
8
3
2
0
-- | The top level module. module Graphene ( module Graphene.Types ) where import Graphene.Types
piyush-kurur/graphene
Graphene.hs
bsd-3-clause
112
0
5
30
18
12
6
3
0
module Main where import Prelude import Data.Monoid import Data.String import Text.Read import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.Builder as TLB import qualified Data.Text.Lazy.IO as TLIO import qualified Data.List as L import qualified Data.Map as M import qualified Data.Scientific as Sc ...
eyeinsky/ho
Main.hs
bsd-3-clause
5,903
0
20
1,420
2,282
1,179
1,103
-1
-1
module Arhelk.Armenian.Lemma.Data.Common where import TextShow import Data.Text as T -- | Describes possible part of speach in Russian data SpeachPart = Substantive -- ^ Существительное | Adjective -- ^ Прилагательное | Numeral -- ^ Числительное | Pronoun -- ^ Местоимение | Verb -- ^ Глагол | Adverb ...
Teaspot-Studio/arhelk-armenian
src/Arhelk/Armenian/Lemma/Data/Common.hs
bsd-3-clause
3,391
0
11
604
1,048
585
463
81
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module Unison.Kind where import GHC.Generics import Data.Aeson.TH data Kind = Star | Constraint | Arrow Kind Kind deriving (Eq,Ord,Read,Show,Generic) deriveJSON defaultOptions ''Kind
CGenie/platform
shared/src/Unison/Kind.hs
mit
251
0
6
34
69
39
30
7
0
-- -- -- ----------------- -- Exercise 10.1. ----------------- -- -- -- module E'10''1 where -- List comprehension: -- ------------------- doubleAll :: [Integer] -> [Integer] doubleAll integerList = [ integer * 2 | integer <- integerList ] -- doubleAll [ 2 , 1 , 7 ] -- ~> [ integer * 2 | integer <- [ 2 , 1...
pascal-knodel/haskell-craft
_/links/E'10''1.hs
mit
1,902
0
7
630
197
130
67
13
1
-- -- -- ------------------ -- Exercise 10.37. ------------------ -- -- -- module E'10'37 where import E'10'36 ( Move ( Rock , Paper , Scissors ) , outcome , Tournament , tournamentOutcome ) showTournament :: Tournament -> String showTournament tournament@( firstPlayerMoves , secondPlayerMoves ) = ...
pascal-knodel/haskell-craft
_/links/E'10'37.hs
mit
1,827
0
15
769
387
220
167
30
3
{-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} {-# OPTIONS -fno-warn-type-defaults -fno-warn-deprecations #-} -- | Try Haskell! {- 127.0.0.1:4001 /sta...
wimvanderbauwhede/tryhaskell
src/TryHaskell.hs
bsd-3-clause
12,948
0
22
4,274
3,356
1,733
1,623
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Main where import Control.Lens (makeLenses, (^.), (&), (%~)) import Control.Monad (void) import Data.Default import qualified Graphics.Vty as V import qualified Brick.Types as T import Brick.Types (rowL, columnL) import qualified Brick.Main as...
FranklinChen/brick
programs/LayerDemo.hs
bsd-3-clause
2,147
0
10
440
824
448
376
-1
-1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Distribution.Types.PackageName ( PackageName, unPackageName, mkPackageName ) where import Prelude () import Distribution.Compat.Prelude import Distribution.Utils.ShortText import qualified Text.Pr...
mydaum/cabal
Cabal/Distribution/Types/PackageName.hs
bsd-3-clause
1,403
0
8
209
233
140
93
25
1
{-# LANGUAGE CPP, ImplicitParams #-} {- (c) The University of Glasgow 2006-2012 (c) The GRASP Project, Glasgow University, 1992-1998 -} -- | This module defines classes and functions for pretty-printing. It also -- exports a number of helpful debugging and other utilities such as 'trace' and 'panic'. -- -- The interfa...
vikraman/ghc
compiler/utils/Outputable.hs
bsd-3-clause
41,320
0
17
10,641
9,756
5,231
4,525
685
4
{-# LANGUAGE BangPatterns #-} module Network.Wai.Middleware.Push.Referer.LimitMultiMap where import Data.Map (Map) import qualified Data.Map.Strict as M import Data.Set (Set) import qualified Data.Set as S data LimitMultiMap k v = LimitMultiMap { limitKey :: !Int , limitVal :: !Int , multiMap :: !(Map ...
creichert/wai
wai-http2-extra/Network/Wai/Middleware/Push/Referer/LimitMultiMap.hs
mit
1,210
0
13
321
543
272
271
38
2
import System.Environment import System.IO import Text.ParserCombinators.Parsec import Control.Monad import Data.ByteString.Lazy.Char8 as BS hiding (length,take,drop,filter,head) import Control.Applicative hiding ((<|>), many) {-- cjoin1(Open usp Tukubai) designed by Nobuaki Tounaka written by Ryuichi Ueda The MIT L...
ShellShoccar-jpn/Open-usp-Tukubai
COMMANDS.HS/cjoin1.hs
mit
4,895
0
11
1,294
1,501
775
726
71
6
module PFEdeps( PFE5MT,runPFE5,clean5,getSt5ext,updSt5ext,setSt5ext, --Dep,Deps,deps0, tdepModules,tdepModules',depModules,depModules', tdefinedNames,isDefaultDecl,isInstDecl,splitDecls , Deps2(..) ) where import Prelude hiding (readFile,readIO) import Data....
SAdams601/HaRe
old/tools/pfe/PFEdeps.hs
bsd-3-clause
8,045
32
20
1,756
2,475
1,333
1,142
163
5
{-# Language KindSignatures #-} {-# Language PolyKinds #-} module T15881 where import Data.Kind data A n (a :: n n) :: Type
sdiehl/ghc
testsuite/tests/polykinds/T15881.hs
bsd-3-clause
132
0
6
30
28
19
9
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} module T9778 where data T = A | B data G a where C :: G A
ghc-android/ghc
testsuite/tests/rename/should_compile/T9778.hs
bsd-3-clause
112
0
6
29
29
19
10
6
0
module Carbs.Pasta where data Vongole = Vongole Int data Linguine = Linguine { eggs :: Bool , cooking_time :: Int }
elisehuard/hs-pasta
src/Carbs/Pasta.hs
mit
143
0
8
48
36
22
14
4
0
import Data.List import Data.Numbers.Primes result :: Int result = sum $ takeWhile (<2000000) primes main = putStrLn $ show(result)
nbartlomiej/haskeuler
010/problem-010.hs
mit
134
0
7
21
50
28
22
5
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticmapreduce-instancefleetconfig-volumespecification.html module Stratosphere.ResourceProperties.EMRInsta...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/EMRInstanceFleetConfigVolumeSpecification.hs
mit
3,237
0
13
269
357
203
154
34
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeFamilyDependencies #-} -------------------------------------------------------------------------------- -- | -- Module : Control.Workflow.Coordinator -- Copyright ...
kaizhang/SciFlow
SciFlow/src/Control/Workflow/Coordinator.hs
mit
2,894
12
18
615
416
262
154
43
0
-- trig utilities -- convert a value in degrees to radians radians :: Floating a => a -> a radians x = pi * x / 180.0 -- convert a value in radians to degrees degrees :: Floating a => a -> a degrees x = 180.0 * x / pi -- return the sine of a value given in degrees sinDeg :: Floating a => a -> a sinDeg x = sin (rad...
jdeisenberg/rwh_commentary
chapter02_files/trigUtils.hs
mit
868
0
7
202
272
137
135
16
1
import Data.List import Control.Monad solveRPN :: (Num a, Read a) => String -> a solveRPN = head . foldl foldingFunction [] . words where foldingFunction (x:y:ys) "*" = (x * y):ys foldingFunction (x:y:ys) "+" = (x + y):ys foldingFunction (x:y:ys) "-" = (y - x):ys fol...
mortum5/programming
haskell/usefull/parser/rpn.hs
mit
906
0
10
229
421
218
203
19
4
-- Double Char -- http://www.codewars.com/kata/56b1f01c247c01db92000076/ module Codewars.Strings where doubleChar :: String -> String doubleChar = concatMap (\c -> [c,c])
gafiatulin/codewars
src/7 kyu/Strings 2.hs
mit
173
0
8
21
39
24
15
3
1
-- RLE -- https://www.codewars.com/kata/578bf2d8daa01a4ee8000046 module Kata.RLE (encode,decode) where import Data.Char (isNumber) import Data.List (group, unfoldr) import Data.Maybe (listToMaybe) import Data.Tuple (swap) encode :: String -> String encode = concatMap (\g -> (show . length $ g) ++ take 1 g) . group ...
gafiatulin/codewars
src/6 kyu/RLE2.hs
mit
529
0
19
95
219
121
98
10
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds, MultiParamTypeClasses, UndecidableInstances #-} {-# LANGUAGE JavaScriptFFI #-} ----------------------------------------------...
mb21/qua-kit
libs/hs/ghcjs-hs-interop/src/JsHs/Array.hs
mit
19,063
93
16
5,122
5,753
2,906
2,847
401
1
{-# LANGUAGE OverloadedStrings #-} module Gratte.TextExtractor ( extractText ) where import Control.Monad import Control.Monad.Gratte import Control.Monad.Trans import qualified Data.Text as T import qualified Data.Text.IO as TIO import System.Exit import Sys...
ostapneko/gratte-papier
src/Gratte/TextExtractor.hs
mit
3,759
0
18
1,020
1,006
501
505
93
5
{-# LANGUAGE RecordWildCards #-} module SyntheticWeb.Plan.Writer (writePlan) where import Text.Printf (PrintfArg (), printf) import SyntheticWeb.Plan.Types import SyntheticWeb.Statistical (Statistical (..)) writePlan :: Plan -> String writePlan (Plan plan) = go plan where go = unlines . concatMap writePattern wr...
kosmoskatten/synthetic-web
src/SyntheticWeb/Plan/Writer.hs
mit
2,406
0
9
543
734
375
359
54
2
-- Help the fruit guy -- https://www.codewars.com/kata/557af4c6169ac832300000ba module Codewars.Kata.Fruits where import Data.Maybe(fromMaybe) import Data.Char(toLower) import Data.List (stripPrefix) removeRotten :: [String] -> [String] removeRotten = map ((\ f -> fromMaybe f . stripPrefix "rotten" $ f) . map toLowe...
gafiatulin/codewars
src/Beta/Fruits.hs
mit
323
0
12
41
94
54
40
6
1
module Sudoku where import Data.List.Split import Data.Tuple import Data.List import Control.Applicative import Control.Arrow import Control.Lens type Pos = (Int, Int) type Point a = (Pos, a) type SPoint = (Pos, Int) type Points a = [Point a] -- Numbers to be implemented into board. -- Board should be a matr...
siers/sudoku-solver
Sudoku.hs
mit
2,853
0
11
701
1,226
664
562
-1
-1
module Name (BuiltinName (..), LocalName (..), Name (..), qualifiedName, unqualifiedName, NameWith (..), Path (..), ResolvedName, Error (..), resolveNames, ValidationError (..), validateNames) where import MyPrelude import qualified Data.Map as Map import qualified Data.Text as Text import qualified Pretty as P imp...
glaebhoerl/stageless
src/Name.hs
mit
17,249
0
27
4,652
4,841
2,370
2,471
-1
-1
import Data.List import Control.Monad replace :: Int -> a -> [a] -> [a] replace index element list = (take index list) ++ [element] ++ (drop (index+1) list) type Matrix a = [[a]] replace' :: Int -> Int -> a -> Matrix a -> Matrix a replace' x y element matrix = replace x (replace y element (matrix !! x)) matrix diag...
nbartlomiej/takefive
takefive.hs
mit
3,544
0
17
1,003
1,676
874
802
71
3
module RandomSupply where import Supply import System.Random hiding(next) randomsIO :: Random a => IO [a] randomsIO = getStdRandom $ \g -> let (a, b) = split g in (randoms a, b)
dservgun/haskell_test_code
src/RandomSupply.hs
gpl-2.0
210
0
11
63
80
44
36
8
1
module TestSuite where import Driver import Control.Monad.Identity import Data.Traversable import Text.Show.Functions () main :: IO () main = Driver.main tests type Prop_Functor f a = f a -> Bool prop_functor :: (Eq (f a), Functor f) => f a -> Bool prop_functor ws = fmap id ws == ws prop_traversable :: (Eq (t b),...
codemac/yi-editor
tests/TestSuite.hs
gpl-2.0
699
0
10
143
232
127
105
15
1
{-| Implementation of the iallocator interface. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at...
narurien/ganeti-ceph
src/Ganeti/HTools/Backend/IAlloc.hs
gpl-2.0
18,477
0
23
5,289
4,745
2,362
2,383
354
9
{- notation: t in CL(S), Nf(t) - normal form of t DAG(t) - DAG of t with complete exact hash consing (equivalently, reduced in the BDD sense: each node has an address, for each addresses p, q: @(p,q) occurs at most once) conjectures: -} import S.DAG import S.Type import S.Size import S.Table (normalizing) ...
jwaldmann/s
compressor.hs
gpl-3.0
1,453
0
20
570
416
212
204
33
1
module Main where import System.Environment import System.Exit import Control.Monad import System.Console.Haskeline import qualified Data.Map as M import Data.List((\\)) import Environment import Interpreter main :: IO () main = do args <- getArgs Parameters int pro <- parseParameters args val <- case p...
kavigupta/N-programming-language
src/Main.hs
gpl-3.0
2,407
0
15
617
914
457
457
66
3
-- | Test correspondientes a las reglas de re-escritura. module TestSuite.Tests.Matching where import qualified Data.Map as M import qualified Data.Sequence as S import TestSuite.Tests.Samples import Equ.Matching import Equ.Parser import Equ.PreExpr import Equ.Theories.FOL(folForall,folExist) import Test.HUnit (Asse...
miguelpagano/equ
TestSuite/Tests/Matching.hs
gpl-3.0
6,980
0
14
2,526
1,306
713
593
120
1
{-| Module : Helper.Tuple Description : Helper functions for working with lists. Copyright : 2014, Jonas Cleve License : GPL-3 -} module Helper.Tuple ( -- * Triple functions first, second, third ) where -- | Return the first element from a three-tuple. first :: (a, b, c) -> a first (x, _, _) = x...
Potregon/while
src/Helper/Tuple.hs
gpl-3.0
514
0
6
125
127
79
48
8
1
-- grid is a game written in Haskell -- Copyright (C) 2018 karamellpelle@hotmail.com -- -- This file is part of grid. -- -- grid 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 Lice...
karamellpelle/grid
designer/source/Game/LevelPuzzleMode/LevelPuzzleWorld/Content/Fancy.hs
gpl-3.0
6,085
0
19
1,875
1,752
912
840
117
5
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-drive/gen/Network/Google/Resource/Drive/Files/Update.hs
mpl-2.0
9,333
0
40
2,617
1,417
792
625
204
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/GuardianInvitations/List.hs
mpl-2.0
10,652
0
23
2,412
1,246
730
516
176
1
{-# LANGUAGE OverloadedStrings #-} module Controller.Funding ( queryFunderHandler , postVolumeFunding , deleteVolumeFunder ) where import Control.Monad (liftM2) import qualified Data.Text as T import Has (focusIO) import qualified JSON import Model.Id import Model.Permission import Model.Volume import Model.F...
databrary/databrary
src/Controller/Funding.hs
agpl-3.0
2,222
0
21
347
629
330
299
52
2
{-# LANGUAGE FunctionalDependencies, TemplateHaskell #-} module Model.SQL.Select ( SelectOutput(..) , Selector(..) , selector , selectColumn , selectColumns , addSelects , fromMap , fromAlias , crossJoin , joinOn , joinUsing , maybeJoinOn , maybeJoinUsing , selectJoin , selectMap , makeQ...
databrary/databrary
src/Model/SQL/Select.hs
agpl-3.0
6,890
0
17
1,404
2,758
1,442
1,316
161
10
{-# LANGUAGE OverloadedStrings #-} import Language.PureScript.Bridge import Control.Lens import Data.Proxy import GHC.Generics import Servant.PureScript import Gonimo.CodeGen.TypeBridges import Gonimo.Server.DbEntities import Gonimo.Serve...
charringer/gonimo-back
app/PSGenerator.hs
agpl-3.0
1,634
0
9
400
384
209
175
-1
-1
module Language.Prolog.Syntax where data Expr = Var String -- variable | Str String [Expr] -- structure | Op String [Expr] -- operator | Cons Expr Expr -- list | Num (Either Integer Double) -- number deriving Show type Sentence = (Maybe Expr, Ma...
acharal/parsec-prolog
src/Language/Prolog/Syntax.hs
lgpl-3.0
443
0
9
175
109
67
42
11
0
{-| Module : Haskoin Description : Bitcoin (BTC/BCH) Libraries for Haskell Copyright : No rights reserved License : MIT Maintainer : jprupp@protonmail.ch Stability : experimental Portability : POSIX This module exports almost all of Haskoin Core, excluding only a few highly specialized address and block-...
haskoin/haskoin
src/Haskoin.hs
unlicense
1,055
0
4
372
106
77
29
19
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} {-| This module implements the core algebra of Karps with respect to structured transforms. It takes functional structured transforms and flattens them into simpler, flat projections. This is probably one of the most complex parts of the optimizer. -} ...
tjhunter/karps
haskell/src/Spark/Core/Internal/StructuredFlattening.hs
apache-2.0
32,147
13
25
6,650
6,904
3,630
3,274
-1
-1
-- | -- Module : ApiClient -- Copyright : (c) 2017 Alain O'Dea -- License : Apache Public License, v. 2.0. -- Maintainer : Alain O'Dea <alain.odea@gmail.com> -- Stability : experimental -- Portability : non-portable (GHC extensions) -- -- Tenable SecurityCenter REST API - API Client for examples -- -- Con...
AlainODea-haskell/tenable-securitycenter
app/ApiClient.hs
apache-2.0
4,074
0
11
1,132
1,001
536
465
115
1
--------------------------------------------------------------------------- -- | -- Module : Control.Concurrent.STM.THash.Internal -- Copyright : (C) 2006 Edward Kmett -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : experi...
ekmett/stm-hash
src/Control/Concurrent/STM/THash/Internal.hs
bsd-2-clause
8,209
10
17
2,552
2,779
1,463
1,316
196
2
{-| Implementation of the generic daemon functionality. -} {-# LANGUAGE CPP #-} {- Copyright (C) 2011, 2012 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source c...
ganeti/ganeti
src/Ganeti/Daemon.hs
bsd-2-clause
19,064
0
15
4,380
3,906
2,039
1,867
374
4
{- Graphs are considered equal (using relaxed (~#==) notation if they have the same vertices and the same vertex adjacency (each 2 verices have exactly the same number of edges connecting them) TODO this needs testing -} module PolyGraph.ReadOnly.Graph.GraphEquality ( (~#==) , edgeCountGIsomorphism ) where ...
rpeszek/GraphPlay
src/PolyGraph/ReadOnly/Graph/GraphEquality.hs
bsd-3-clause
1,363
0
9
347
266
155
111
-1
-1
-- | This module contains the definitions for creating properties to pass to javascript elements and -- foreign javascript classes. In addition, it contains definitions for the -- <https://facebook.github.io/react/docs/events.html React Event System>. {-# LANGUAGE ViewPatterns, UndecidableInstances #-} module React.Fl...
liqula/react-flux
src/React/Flux/PropertiesAndEvents.hs
bsd-3-clause
23,860
37
15
4,405
4,491
2,533
1,958
-1
-1
type Addr = Integer type Time = Integer type Env = Map Name Addr type Store = Map Addr Val data Val = LitV Lit | Clo [Name] Call Env type StateSpace = Maybe (Call, Env, Store, Time)
davdar/quals
writeup-old/sections/03AAMByExample/02AbstractStateSpace/00Cut.hs
bsd-3-clause
182
0
7
38
77
45
32
6
0
{-# LANGUAGE DeriveDataTypeable #-} module Main where import Data.Data import Data.Typeable import qualified DockerHub.Build as B import qualified DockerHub.Config as C import qualified DockerHub.Data as D import qualified DockerHub.Pull as P import System.Console.CmdArgs import System.Environment (getArgs, withArgs)...
krystalcode/docker-hub
app/Main.hs
bsd-3-clause
3,895
0
17
915
796
414
382
64
3
{-# LANGUAGE CPP, NamedFieldPuns, NondecreasingIndentation #-} {-# OPTIONS_GHC -fno-cse #-} -- -fno-cse is needed for GLOBAL_VAR's to behave properly ----------------------------------------------------------------------------- -- -- GHC Driver -- -- (c) The University of Glasgow 2005 -- ------------------------------...
snoyberg/ghc
compiler/main/DriverPipeline.hs
bsd-3-clause
102,179
0
31
34,248
16,242
8,230
8,012
1,372
43
module Day4 where import Data.Char (chr, ord) import Data.List (find, group, intercalate, sort, sortBy) import Data.Ord import Text.Megaparsec hiding (Pos) import Text.Megaparsec.Lexer hiding (space) import Text.Megaparsec.St...
liff/adventofcode-2016
app/Day4.hs
bsd-3-clause
1,589
0
14
466
672
347
325
45
1
import System.Environment (getArgs) guess :: Int -> Int -> [String] -> String guess lo (-1) (x:xs) = guess lo (read x) xs guess lo hi (x:xs) | x == "Lower" = guess lo (d - 1) xs | x == "Higher" = guess (d + 1) hi xs | otherwise = show d ...
nikai3d/ce-challenges
moderate/guess_the_number.hs
bsd-3-clause
541
0
14
220
263
131
132
13
1