code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
module GHCJS.TypeScript.Convert.Types where import Language.TypeScript import Data.Monoid data Config = Config { outputDir :: FilePath } data Decl = InterfaceDecl Interface deriving (Show) data OutputModule = OutputModule { omImports :: [String] , omDecls :: [String] } deriving (Show) instance Monoid...
mgsloan/ghcjs-typescript
ghcjs-typescript-convert/GHCJS/TypeScript/Convert/Types.hs
mit
530
0
9
116
150
85
65
18
0
module Interpreter (Val(..), Expr(..), interpret) where import Debug.Trace data Val = IntVal Integer | StringVal String | BooleanVal Bool -- since we are implementing a Functional language, functions are -- first class citizens. | FunVal [String] Expr Env deriving (Sh...
2015-Fall-UPT-PLDA/homework
02/your_full_name_here.hs
mit
8,926
0
18
2,338
1,999
1,052
947
145
3
-------------------------------------------------------------------- -- | -- Module : My.Data.Maybe -- Copyright : 2009 (c) Dmitry Antonyuk -- License : MIT -- -- Maintainer: Dmitry Antonyuk <lomeo.nuke@gmail.com> -- Stability : experimental -- Portability: portable -- -- 'Maybe' related utilities. -- -------...
lomeo/my
src/My/Data/Maybe.hs
mit
810
0
10
138
200
114
86
11
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Main where import Test.Tasty import Test.Tasty.QuickCheck as QC import Test.QuickCheck.Monadic (assert, monadicIO, run) import Control.Applicative import qualified Data.ByteString as BR import qualified Data.ByteString.Builder as BB import qua...
noexc/mapview
tests/test.hs
mit
1,907
0
12
300
557
303
254
46
1
module Main where import Control.Arrow (first) import Control.Monad (liftM) import qualified Crypto.Cipher as Cipher import qualified Crypto.Cipher.AES as AES import qualified Crypto.Cipher.Types as CipherTypes import qualified Cryptopals.Set1 as Set1 impor...
charlescharles/cryptopals
src/Main.hs
mit
982
0
6
316
202
138
64
22
1
module ReaderT where newtype ReaderT r m a = ReaderT { runReaderT :: r -> m a } instance Functor m => Functor (ReaderT r m) where fmap f (ReaderT rma) = ReaderT $ fmap f . rma instance Applicative m => Applicative (ReaderT r m) where pure a = ReaderT $ \_ -> pure a -- fab :: r -> m (a -> b) -- a :: r -> m a ...
JoshuaGross/haskell-learning-log
Code/Haskellbook/ComposeTypes/src/ReaderT.hs
mit
563
0
14
145
243
127
116
10
0
module Colors.SolarizedDark where colorScheme = "solarized-dark" colorBack = "#002b36" colorFore = "#839496" -- Black color00 = "#073642" color08 = "#002b36" -- Red color01 = "#dc322f" color09 = "#cb4b16" -- Green color02 = "#859900" color10 = "#586e75" -- Yellow color03 = "#b58900" color11 = "#657b83" -- Blue color...
phdenzel/dotfiles
.config/xmonad/lib/Colors/SolarizedDark.hs
mit
558
0
4
87
119
75
44
22
1
module SpaceAge (Planet(..), ageOn) where data Planet ageOn :: Planet -> Float -> Float ageOn planet seconds = undefined
parkertm/exercism
haskell/space-age/src/SpaceAge.hs
mit
123
0
6
21
42
25
17
-1
-1
module Main where import Lexical import Scanner import Data.List import Data.Maybe import Data.Char(readLitChar) import Text.ParserCombinators.ReadP(eof, many, ReadP, readS_to_P, readP_to_S) import System.Directory strParser :: ReadP String strParser = do str <- many (readS_to_P readLitChar) eof return ...
yangsiwei880813/CS644
src/SMain.hs
gpl-2.0
3,157
0
15
573
838
430
408
54
1
module Data.Char.WCWidth.Extended ( module Data.Char.WCWidth , wcstrwidth ) where import Data.Char.WCWidth wcstrwidth :: String -> Int wcstrwidth = sum . map wcwidth
jaspervdj/patat
lib/Data/Char/WCWidth/Extended.hs
gpl-2.0
180
0
6
36
47
29
18
6
1
{-# LANGUAGE CPP, ScopedTypeVariables, OverloadedStrings #-} ----------------------------------------------------------------------------- -- -- Module : IDE.Utils.GUIUtils -- Copyright : (c) Juergen Nicklisch-Franken, Hamish Mackenzie -- License : GNU-GPL -- -- Maintainer : <maintainer at leksah.org> -...
jaccokrijnen/leksah
src/IDE/Utils/GUIUtils.hs
gpl-2.0
16,546
0
27
4,731
3,770
1,842
1,928
351
4
module Commands (parseCommand, handleCommand ) where import Control.Monad.IO.Class (liftIO) import Control.Exception (catch, IOException) import System.IO import Data.Maybe import Data.List import Data.Char import Types import Parser import Eval import Monad imp...
g-deluca/yts-dl
app/Commands.hs
gpl-3.0
6,051
0
23
2,850
1,393
697
696
100
16
module Language.SMTLib2.Composite.Data (makeComposite) where import Language.SMTLib2 import Language.SMTLib2.Composite.Class import qualified Language.Haskell.TH as TH import Data.GADT.Compare import Data.GADT.Show import Control.Monad makeComposite :: String -- ^ Name of the composite type -> String -...
hguenther/smtlib2
extras/composite/Language/SMTLib2/Composite/Data.hs
gpl-3.0
8,770
0
28
3,015
3,685
1,899
1,786
-1
-1
module Sites.TryingHuman ( tryingHuman ) where import Network.HTTP.Types.URI (decodePathSegments) import Data.Maybe (catMaybes) import qualified Data.List as DL import qualified Data.Text as T import qualified Data.ByteString.UTF8 as US import qualified Data.ByteString.Lazy as BL import Control.Monad impor...
pharaun/hComicFetcher
src/Sites/TryingHuman.hs
gpl-3.0
3,610
0
24
982
1,314
700
614
68
1
{- The Delve Programming Language Copyright 2009 John Morrice Distributed under the terms of the GNU General Public License v3, or ( at your option ) any later version. This file is part of Delve. Delve is free software: you can redistribute it and/or modify it under the terms of the GNU Gene...
elginer/Delve
src/phase_test.hs
gpl-3.0
1,775
0
13
440
313
142
171
26
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Agent/Sessions/Contexts/Patch.hs
mpl-2.0
6,425
0
17
1,425
863
504
359
130
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-jobs/gen/Network/Google/Resource/Jobs/Projects/Jobs/BatchDelete.hs
mpl-2.0
5,418
0
17
1,270
784
458
326
116
1
module Chain where import UU.Parsing import Data.Char main = do let tokens = "s*s*C" resultado <- parseIO pSE tokens putStrLn . show $ resultado instance Symbol Char -- Sintaxis concreta data Class = Class deriving Show {- pRE :: Parser Char RE pRE = pChainl pOp pCla...
andreagenso/java2scala
src/J2s/Chain.hs
apache-2.0
855
0
9
294
157
84
73
18
1
{-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RoleAnnotations #-} {-# LANGUAGE ScopedTypeVariables #-} -- | -- Module : Data.Map.Justified -- Copyright : (c) Matt Noonan 2017 -- License : BSD-style -- Maintainer : matt.noonan@gmail.com -- Portability : porta...
matt-noonan/justified-containers
src/Data/Map/Justified.hs
bsd-2-clause
35,649
0
16
8,386
5,914
3,268
2,646
292
3
{-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ...
anthezium/rcu
src/Control/Concurrent/RCU/STM/Internal.hs
bsd-2-clause
5,541
0
15
1,051
1,412
761
651
106
1
module Handler.PostNew where import Import import Yesod.Form.Bootstrap3 import Yesod.Text.Markdown blogPostNewForm :: AForm Handler BlogPost blogPostNewForm = BlogPost <$> areq textField (bfs ("Title" :: Text)) Nothing <*> lift (liftIO getCurrentTime) <*> lift (liftIO getCurre...
roggenkamps/steveroggenkamp.com
Handler/PostNew.hs
bsd-3-clause
1,115
0
14
263
277
138
139
-1
-1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverlappingInstances #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} ...
notae/haskell-exercise
pack/Pack7.hs
bsd-3-clause
1,188
0
9
288
341
196
145
30
1
module Util.Command where import System.Exit import Data.Tuple import Data.Map (Map, (!)) import qualified Data.Map as M import Data.Char import Genome.Dna.Kmer import Genome.Dna.Dna data Command = Command {utility :: String, arguments :: Map String String } instance S...
visood/bioalgo
src/lib/Util/Command.hs
bsd-3-clause
3,189
0
15
741
1,112
559
553
77
3
{-# Language ScopedTypeVariables #-} module Pipes.Formats where import Control.Monad as M import Data.Array.Accelerate as A import Data.Array.Accelerate.IO as A import qualified Data.Vector.Storable as S import qualified Data.Vector.Storable.Mutable as SM import Pipes import Prelude as P vectorToArray :: (Int,Int...
cpdurham/accelerate-camera-sandbox
src/Pipes/Formats.hs
bsd-3-clause
1,722
0
21
493
616
327
289
49
1
{-# LANGUAGE QuasiQuotes #-} module System.Console.CmdArgs.Test.SplitJoin(test) where import System.Console.CmdArgs.Explicit import System.Console.CmdArgs.Test.Util import Control.Monad test = do forM_ tests $ \(src,parsed) -> do let a = splitArgs src b1 = joinArgs parsed b2 = j...
ndmitchell/cmdargs
System/Console/CmdArgs/Test/SplitJoin.hs
bsd-3-clause
8,627
0
15
1,452
1,731
999
732
115
3
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------------------ -- | This module is where all the routes and handlers are defined for your -- site. The 'app' function is the initializer that combines everything -- together and is exported ...
sethfowler/bzbeaver
src/Site.hs
bsd-3-clause
19,014
0
19
5,288
5,832
3,002
2,830
327
33
module Del.Parser where import Control.Applicative import Control.Exception import qualified Data.Set as S import qualified Data.MultiSet as MS import Data.Typeable import Text.Trifecta import Del.Syntax eomParser :: Parser EOM eomParser = many equationParser equationParser :: Parser Equation equationParser = do ...
ishiy1993/mk-sode1
src/Del/Parser.hs
bsd-3-clause
2,197
0
11
510
743
369
374
66
2
module Trans where import Control.Monad.Trans.Reader import Control.Monad.Trans.State import Data.Functor.Identity import Control.Monad.Trans import Control.Monad.Trans.Maybe import Control.Monad rDec :: Num a => Reader a a rDec = fmap (flip (-) 1) ask rShow :: Show a => ReaderT a Identity String rShow = show <$...
nicklawls/haskellbook
src/Trans.hs
bsd-3-clause
998
0
12
213
393
198
195
38
2
module Logic.ProofNet where
digitalheir/net-prove
src/Logic/ProofNet.hs
bsd-3-clause
27
0
3
2
6
4
2
1
0
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} module Language.Epilog.AST.Program ( Program (..) ) where -------------------------------------------------------------------------------- import Language.Epilog.AST.Procedure import Language.Epilog.Epilog (Strings, Types) i...
adgalad/Epilog
src/Haskell/Language/Epilog/AST/Program.hs
bsd-3-clause
1,113
0
12
274
216
130
86
22
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- Load information on package sources module Stack.Build.Source ( loadSourceMap , SourceMap , PackageSource (..) ) where import Network.HTTP.Clien...
mietek/stack
src/Stack/Build/Source.hs
bsd-3-clause
6,444
0
18
2,122
1,657
857
800
134
6
{-# LANGUAGE BangPatterns #-} module Atomo.Environment where import Control.Monad.Cont import Control.Monad.State import Data.IORef import Atomo.Method import Atomo.Pattern import Atomo.Pretty import Atomo.Types -- | Evaluate an expression, yielding a value. eval :: Expr -> VM Value eval (EDefine { emPattern = p, e...
vito/atomo
src/Atomo/Environment.hs
bsd-3-clause
16,982
0
20
5,074
6,835
3,405
3,430
390
28
module Test where test :: Int -> Int -> IO () test a b = putStrLn $ mconcat [ "Addition: " , show addition , ", Subtraction: " , show subtraction ] where addition = a + b subtraction = a - b main :: ...
hecrj/haskell-format
test/specs/where/output.hs
bsd-3-clause
436
0
8
233
123
63
60
20
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} -- | A pool of handles module Data.Concurrent.Queue.Roq.HandlePool ( -- * Starting the server hroq_handle_pool_server , hroq_handle_pool_server_closure , hroq_handle_pool_server_pid -- * API...
alanz/hroq
src/Data/Concurrent/Queue/Roq/HandlePool.hs
bsd-3-clause
8,601
0
19
1,615
1,584
832
752
141
2
-- -- An AST format for generated code in imperative languages -- module SyntaxImp -- Uncomment the below line to expose all top level symbols for -- repl testing {- () -- -} where data IId = IId [String] (Maybe Int) deriving( Show ) data IAnnTy = INoAnn ITy | IMut ITy -- things are immutable by def...
ethanpailes/bbc
src/SyntaxImp.hs
bsd-3-clause
707
0
8
208
172
102
70
19
0
{-# LANGUAGE DeriveGeneric #-} -- | This is a wrapper around IO that permits SMT queries module Language.Fixpoint.Solver.Monad ( -- * Type SolveM -- * Execution , runSolverM -- * Get Binds , getBinds -- * SMT Query , filterValid -- * Debug ...
gridaphobe/liquid-fixpoint
src/Language/Fixpoint/Solver/Monad.hs
bsd-3-clause
6,560
0
16
1,514
1,550
838
712
122
2
{-# LANGUAGE OverloadedStrings #-} module TW.Utils where import Data.Char import qualified Data.Text as T capitalizeText :: T.Text -> T.Text capitalizeText = T.pack . go . T.unpack where go (x:xs) = toUpper x : xs go [] = [] uncapitalizeText :: T.Text -> T.Text uncapitalizeText = T.pack . g...
typed-wire/typed-wire
src/TW/Utils.hs
mit
490
0
9
119
175
94
81
16
2
{-# LANGUAGE DeriveAnyClass, TemplateHaskell, PostfixOperators, LambdaCase, OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-type-defaults #-} {-# OPTIONS_GHC -O0 -fno-cse -fno-full-laziness #-} -- preserve "lexical" sharing for observed sharing module Commands.Plugins.Spiros.Act.Grammar wh...
sboosali/commands-spiros
config/Commands/Plugins/Spiros/Act/Grammar.hs
gpl-2.0
962
0
11
197
120
79
41
16
1
import System.IO import System.Environment import System.IO.Unsafe import Data.List import Data.List (intercalate) import Data.Char -- Returns a list with all of the lines from the XML file -- I'm just feeding it a file name for now read_file :: String -> [String] read_file fileName = do let file...
nadyac/todo-list
src/readMD.hs
gpl-3.0
5,911
0
22
3,284
890
461
429
84
6
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Main where import Data.Science.CF import Options.Generic data Opts = Suggest { dataFile :: String, user :: String} -- the recommendation | Blah { bob :: String } deriving (Generic, Show) instance ParseRecord Opts toSample...
akisystems/haskell-dsci
app/Main.hs
gpl-3.0
897
0
11
220
295
148
147
26
2
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ru-RU"> <title>ViewState</title> <maps> <homeID>viewstate</homeID> <mapref location="ma...
denniskniep/zap-extensions
addOns/viewstate/src/main/javahelp/help_ru_RU/helpset_ru_RU.hs
apache-2.0
960
77
66
155
404
205
199
-1
-1
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/Streaming/Zlib.hs" #-} {-# LANGUAGE DeriveDataTypeable #-} -- | This is a middle-level wrapper around the zlib C API. It allows you to -- work fully with bytestrings and not touch the FFI at all, but is still -- low-level enough to allow you to implement high-level abstractio...
phischu/fragnix
tests/packages/scotty/Data.Streaming.Zlib.hs
bsd-3-clause
12,910
0
20
2,839
2,084
1,107
977
184
3
----------------------------------------------------------------------------- -- | -- Module : Distribution.ParseUtils -- Copyright : (c) The University of Glasgow 2004 -- -- Maintainer : libraries@haskell.org -- Stability : alpha -- Portability : portable -- -- Utilities for parsing PackageDescription ...
IreneKnapp/Faction
libfaction/tests/UnitTest/Distribution/ParseUtils.hs
bsd-3-clause
7,904
4
15
2,318
943
532
411
138
2
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveDataTypeable #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Compiler -- Copyright : Isaac Jones 2003-2004 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability...
themoritz/cabal
Cabal/Distribution/Simple/Compiler.hs
bsd-3-clause
15,692
0
16
3,523
2,394
1,345
1,049
230
6
{-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | -- Module : Text.ParserCombinators.Parsec.Char -- Copyright : (c) Paolo Martini 2007 -- License : BSD-style (see the LICENSE file) -- -- Maintainer : derek.a.elkins@gmail.com -- Stability : provi...
aslatter/parsec
src/Text/ParserCombinators/Parsec/Char.hs
bsd-2-clause
870
0
5
215
102
72
30
23
0
<?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="bs-BA"> <title>Advanced SQLInjection Scanner</title> <maps> <homeID>sqliplugin</homeID> ...
thc202/zap-extensions
addOns/sqliplugin/src/main/javahelp/help_bs_BA/helpset_bs_BA.hs
apache-2.0
981
77
66
157
409
207
202
-1
-1
{- Refactoring: move the definiton 'fringe' to module C1. This example aims to test the moving of the definition and the modification of export/import -} module D1(fringe, sumSquares) where import C1 fringe :: Tree a -> [a] fringe p |isLeaf p = [(leaf1 p)] fringe p |isBranch p = fri...
kmate/HaRe
old/testing/fromConcreteToAbstract/D1_TokOut.hs
bsd-3-clause
481
0
9
153
148
74
74
11
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Monad.Fix -- Copyright : (c) Andy Gill 2001, -- (c) Oregon Graduate Institute of Science and Technology, 2002 -- License : ...
urbanslug/ghc
libraries/base/Control/Monad/Fix.hs
bsd-3-clause
3,227
0
12
829
701
390
311
49
0
{-# LANGUAGE MagicHash #-} module ShouldFail where import GHC.Base my_undefined :: a -- This one has kind *, not OpenKind my_undefined = undefined die :: Int -> ByteArray# die _ = my_undefined
urbanslug/ghc
testsuite/tests/typecheck/should_fail/tcfail090.hs
bsd-3-clause
198
0
5
37
38
23
15
7
1
module Main where newtype T = C { f :: String } {- hugs (Sept 2006) gives "bc" Program error: Prelude.undefined hugs trac #48 -} main = do print $ case C "abc" of C { f = v } -> v print $ case undefined of C {} -> True
olsner/ghc
testsuite/tests/codeGen/should_run/cgrun062.hs
bsd-3-clause
270
0
13
102
73
40
33
6
1
{-| Module: Itchy.Routes Description: Web app routes License: MIT -} {-# LANGUAGE BangPatterns, LambdaCase, MultiParamTypeClasses, OverloadedLists, OverloadedStrings, QuasiQuotes, RankNTypes, TemplateHaskell, TypeFamilies, ViewPatterns #-} module Itchy.Routes ( App(..) ) where import Control.Monad import Control.M...
quyse/itchy
Itchy/Routes.hs
mit
22,676
539
41
5,456
4,790
2,947
1,843
-1
-1
module Ch1010ex1 ( stops , vowels , nouns , verbs , allWords , allWordsPrefixP ) where import Combinatorial (comboOfN) import Data.Monoid stops :: [Char] stops = "pbtdkg" vowels :: [Char] vowels = "aeiou" nouns :: [String] nouns = ["bird", "dog", "cat", "car", "Elon Musk", "the ...
JoshuaGross/haskell-learning-log
Code/Haskellbook/ch10.10ex1.hs
mit
1,214
0
13
243
386
227
159
27
1
{-# LANGUAGE RecordWildCards, TypeFamilies #-} import Control.Monad import qualified Data.Map as M import Text.Printf type FieldName = String type Point = M.Map FieldName (Maybe Double) type Label = Double class DataPass a where type Init a create :: (Init a) -> a update :: a -> [(Point, Label)] -> a apply1...
michaelochurch/stats-haskell-talk-201509
Main.hs
mit
2,739
0
15
742
1,093
594
499
68
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Test.Unit.Connection where import qualified Test.Framework as Framework import Test.Framework import Test.HUnit import Test.Framework...
banacorn/socket.io-haskell
test/Test/Unit/Connection.hs
mit
3,318
0
17
760
643
331
312
67
2
module StupidBot.Bot (stupidBot) where import Vindinium.Types import Utils import StupidBot.Goal import qualified Data.Graph.AStar as AS import Data.Maybe (fromMaybe, fromJust) import Data.List (find) stupidBot :: Bot stupidBot = directionTo whereToGo directionTo :: GPS -> State -> Dir directionTo gps s = let fro...
flyrry/phonypony
src/StupidBot/Bot.hs
mit
1,712
0
16
459
633
317
316
47
3
{-# LANGUAGE MonadComprehensions #-} module Main where import Data.Foldable (traverse_) import Data.Maybe (fromMaybe, listToMaybe, maybe) import System.Environment (getArgs) fizzbuzz :: (Integral a, Show a) => a -> String fizzbuzz i = fromMaybe (show i) $ [ "fizz" | i `rem` 3 == 0 ] <> [ "buz...
genos/Programming
workbench/fizzbuzzMonadComprehensions.hs
mit
511
0
11
128
212
116
96
15
1
{-# LANGUAGE ImplicitParams #-} -- | Based on Cruise control system from -- http://www.cds.caltech.edu/~murray/amwiki/index.php/Cruise_control module CruiseControl where import Zelus data Gear = One | Two | Three | Four | Five deriving (Eq, Show) run :: Double -- ^ Initial speed, m/s -> S Double -- ^ Cruise ...
koengit/cyphy
src/CruiseControl.hs
mit
2,996
0
15
924
918
506
412
68
5
{-# LANGUAGE OverloadedStrings #-} module Network.API.Mandrill.SubaccountsSpec where import Test.Hspec import Test.Hspec.Expectations.Contrib import Network.API.Mandrill.Types import Network.API.Mandrill.Utils import qualified Data.Text as Text import qualified Network.API.Mand...
krgn/hamdrill
test/Network/API/Mandrill/SubaccountsSpec.hs
mit
2,692
0
14
637
682
333
349
77
1
{-# LANGUAGE ScopedTypeVariables #-} {-| Module : Labyrinth.Machine2d Description : labyrinth state machine Copyright : (c) deweyvm 2014 License : MIT Maintainer : deweyvm Stability : experimental Portability : unknown 2d state machine automata generating functions. -} module Labyrinth.Machine2d( (<...
deweyvm/labyrinth
src/Labyrinth/Machine2d.hs
mit
1,724
0
19
373
561
306
255
32
1
module Main where import System.Environment import Text.ParserCombinators.Parsec hiding (spaces) main :: IO() main = do args <- getArgs putStrLn (readExpr (args !! 0)) symbol :: Parser Char symbol = oneOf "!$%&|*+-/:<=?>@^_~#" readExpr :: String -> String readExpr input = case parse (spaces >> symbol) "lisp" in...
brianj-za/wyas
simpleparser1.hs
mit
440
0
11
81
156
80
76
15
2
{-| Module : Language.GoLite.Monad.Traverse Description : Traversing annotated syntax trees with class Copyright : (c) Jacob Errington and Frederic Lafrance, 2016 License : MIT Maintainer : goto@mail.jerrington.me Stability : experimental Defines a type family based approach for traversing general annota...
djeik/goto
libgoto/Language/Common/Monad/Traverse.hs
mit
1,882
0
9
479
237
146
91
35
0
{- H-99 Problems Copyright 2015 (c) Adrian Nwankwo (Arcaed0x) Problem : 14 Description : Duplicate the elements of a list. License : MIT (See LICENSE file) -} copyTwice :: [a] -> [a] copyTwice [] = [] copyTwice (x:xs) = x : x : copyTwice xs
Arcaed0x/H-99-Solutions
src/prob14.hs
mit
274
0
7
78
55
29
26
3
1
module Parser where import Lambda import Type import Control.Monad import Data.Char import Text.Parsec import Text.Parsec.Expr import Text.Parsec.Language import qualified Text.Parsec.Token as Token lexer = Token.makeTokenParser style where operators = ["+", "-", "*", "/", "==", ">=", "<=", "<", ">", "/=",...
LeonardoRigon/TypeInfer-LambdaExpressions-in-Haskell
Parser.hs
mit
4,099
0
16
1,700
1,312
647
665
106
1
module Nodes.Expression where import Data.Tree (Tree (Node)) import Nodes data Expr = Op { operator :: String, left :: Expr, right :: Expr } | StrLit { str :: String } | IntLit { int :: Int } | FloatLit { float :: Double } instance AstNode Expr where ast (Op operator left right) = Node operator [ast le...
milankinen/cbhs
src/nodes/Expression.hs
mit
507
0
9
146
212
116
96
13
0
{-# OPTIONS_GHC -fno-warn-orphans #-} import Application.Types import Handler.Admin import Handler.Block import Handler.Room import Handler.Snapshot import Handler.Socket import Handler.Instances import Import import Control.Conc...
kRITZCREEK/FROST-Backend
src/Main.hs
mit
1,248
0
14
299
252
132
120
-1
-1
module HaskovSpec where import Haskov (fromList,imap,hmatrix,walk,walkFrom,steady,steadyState,statesI) import System.Random import Test.Hspec import qualified Data.Set as Set import qualified Numeric.LinearAlgebra.Data as Dat import Data.List (intercalate) import Control.Monad (unless,when) testTransition...
mazuschlag/haskov
test/HaskovSpec.hs
mit
2,899
0
20
828
760
409
351
-1
-1
-- The solution of exercise 1.12 -- The following pattern of numbers is called Pascal's triangle. -- -- 1 -- 1 1 -- 1 2 1 -- 1 3 3 1 -- 1 4 6 4 1 -- -- The numbers at the edge of the triangle are...
perryleo/sicp
ch1/sicpc1e12.hs
mit
4,245
0
12
1,235
618
355
263
33
2
import Data.Numbers.Primes import Data.List primeFactors' = map (\all@(x:xs) -> (x, (length all))) . group . primeFactors sumOfFactors :: (Integral a, Eq a) => (a, a) -> a sumOfFactors (_, 0) = 1 sumOfFactors (x, y) = (x^y) + (sumOfFactors (x, (y - 1))) sumOfProperDivisors n = (product $ map sumOfFactors (primeFact...
t00n/ProjectEuler
23.hs
epl-1.0
460
0
12
81
231
127
104
10
1
{-# language FlexibleContexts #-} module NFA.Roll where -- $Id$ import Autolib.NFA import Autolib.NFA.Some import NFA.Property roll :: NFAC c Int => [ Property c ] -> IO ( NFA c Int ) roll props = do let [ alpha ] = do Alphabet alpha <- props ; return alpha let [ s ] = do Max_Size s <- props...
marcellussiegburg/autotool
collection/src/NFA/Roll.hs
gpl-2.0
356
0
13
98
135
66
69
11
1
module SimpleClass where data Color a = Red a | Blue a data MyList a = MyNil | MyCons a (MyList a) data MPList a b = MPNil | MPCons a b (MPList a b) myEqual :: Eq a => a -> a -> Bool myEqual x y = if x == y then True else False instance Eq a => Eq (Color a) instance Eq a => Eq (MyList a) class Joker...
nevrenato/Hets_Fork
Haskell/test/HOL/ex_class.hs
gpl-2.0
646
0
9
171
318
166
152
17
2
#!/usr/bin/runhugs -- created on 2009-01-21 --does simple HTML escaping on a main body text import System.Environment(getArgs) import Data.List(groupBy) flatmap f = concat . map f toHtml = flatmap code where code '&' = "&amp;" code '<' = "&lt;" code '>' = "&gt;" code c = [c] allnb = flatmap (\' ' -> "...
google-code/bkil-open
volatile/calc/htmesc.hs
gpl-2.0
818
0
13
261
320
166
154
24
4
{-# LANGUAGE TemplateHaskell #-} module Control.Isomorphism.Partial.Constructors ( nil , cons , listCases , left , right , nothing , just ) where import Prelude () import Data.Bool (Bool, otherwise) import Data.Either (Either (Left, Right)) import Data.Eq (Eq ((==))) import Data.Maybe (Maybe (Just, N...
ducis/scraper-dsl-open-snapshot
partial-isomorphisms-0.2/src/Control/Isomorphism/Partial/Constructors.hs
gpl-2.0
997
0
10
266
452
253
199
34
3
{- | Module : $Header$ Copyright : (c) Klaus Hartke, Uni Bremen 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : experimental Portability : portable -} module ModalCaslToCtl where import Control.Monad as Monad import Data.Maybe as Maybe import Mo...
nevrenato/Hets_Fork
Temporal/ModalCaslToCtl.hs
gpl-2.0
3,361
0
14
858
1,389
715
674
35
1
{- How to break a vigenere (repeating key xor) cipher -} module Vigenere where import Data.Bits(shift, xor, (.&.)) import Data.Char (ord, chr) import Data.List (sortBy, transpose) import Data.List.Split (chunksOf) import Base64 (base64Decode) import DecryptXor import XorEncrypt import Plaintext import Crypto maxKeyL...
CharlesRandles/cryptoChallenge
vigenere.hs
gpl-3.0
7,051
0
14
1,515
898
519
379
103
1
{-# LANGUAGE TupleSections #-} {-# LANGUAGE ScopedTypeVariables #-} {-| Module : Hypercube.Game Description : The main game loops and start function Copyright : (c) Jaro Reinders, 2017 License : GPL-3 Maintainer : noughtmare@openmailbox.org This module contains the @start@ function, the @mainLoop@ and the...
noughtmare/hypercube
src/Hypercube/Game.hs
gpl-3.0
8,212
0
40
2,231
2,786
1,408
1,378
-1
-1
{-# LANGUAGE MonadComprehensions #-} module Main (main) where import System.Environment import Fusion import Data.Foldable as T hiding (fold) main = do --runalltests 1 20 10000 1 20 10000 --runalltests (-1000000) 4001 1000000 (-1000000) 4001 1000000 --runalltests (-2100000000) 4000001 2100000000 (-2100000000) 4...
jyp/ControlledFusion
integer/MainFusion.hs
gpl-3.0
2,635
30
18
514
1,042
532
510
58
1
import Control.Monad.Error import Control.Monad.Trans(liftIO) import Data.IORef(IORef, newIORef, readIORef, writeIORef) import Data.List(sort) import Data.Maybe(fromJust) import Graphics.UI.Gtk import System.IO.Unsafe(unsafePerformIO) import System.Random import Paths_dsgen import Dsgen.Cards import Dsgen.GUIState imp...
pshendry/dsgen
src/Dsgen/MainGUI.hs
gpl-3.0
5,902
0
17
1,661
1,459
696
763
116
4
{-# LANGUAGE OverloadedStrings #-} import System.FSNotify import System.Directory import Control.Applicative((<$>)) import Control.Exception(throw) import Control.Monad(when,forM_,forever) import System.FilePath ((</>)) import Development.Shake.FilePath (splitPath , splitDirectories ...
JackTheEngineer/Drone
scripts/fileMirrorXMC1100.hs
gpl-3.0
3,818
0
17
947
1,072
531
541
88
4
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.LatencyTest...
rueshyna/gogol
gogol-latencytest/gen/Network/Google/LatencyTest/Types/Product.hs
mpl-2.0
8,631
0
14
2,276
1,980
1,128
852
219
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- | -- Module : Network.Google.AdExchangeSeller -- Copyright : (c) 2015-2016 Brendan Hay -- License : Moz...
brendanhay/gogol
gogol-adexchange-seller/gen/Network/Google/AdExchangeSeller.hs
mpl-2.0
7,140
0
17
1,438
798
586
212
173
0
{- ORMOLU_DISABLE -} -- Implicit CAD. Copyright (C) 2011, Christopher Olah (chris@colah.ca) -- Copyright (C) 2014 2015, Julia Longtin (julial@turinglace.com) -- Released under the GNU AGPLV3+, see LICENSE -- FIXME: required. why? {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeSyn...
colah/ImplicitCAD
Graphics/Implicit/ExtOpenScad/Util/OVal.hs
agpl-3.0
6,560
1
17
1,641
2,225
1,193
1,032
131
3
{-# OPTIONS_GHC -XFlexibleInstances -XTypeSynonymInstances -XStandaloneDeriving #-} {- Commands for HSH Copyright (C) 2004-2008 John Goerzen <jgoerzen@complete.org> Please see the COPYRIGHT file -} {- | Module : HSH.Command Copyright : Copyright (C) 2006-2009 John Goerzen License : GNU LGPL, version ...
jgoerzen/hsh
HSH/Command.hs
lgpl-2.1
24,639
4
16
6,698
4,836
2,539
2,297
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} module TestDay01 where import Control.Lens import Control.Lens.Action (act, (^!)) import qualified Prelude import Protolude hiding (to) import Test.HUnit ...
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/lens/2019-12-chris-penner-advent-of-optics/test/TestDay01.hs
unlicense
7,584
0
17
1,421
1,666
922
744
-1
-1
import Data.List import Data.Array -- The arctic slide game logic is based on the Macintosh Polar -- shareware game by Go Endo. The game is a simple 4x24 grid -- where a penguin can walk and push objects around. The goal -- is to place all the hearts on the board into houses. Objects -- slide frictionlessly until stop...
paulrpotts/arctic-slide-haskell
ArcticSlideCore.hs
unlicense
13,266
0
16
4,023
3,806
2,135
1,671
-1
-1
{-# LANGUAGE DeriveGeneric, StandaloneDeriving, DeriveDataTypeable, FlexibleInstances, Rank2Types, FlexibleContexts #-} module Language.Erlang.Modules where import Language.CoreErlang.Parser as P import Language.CoreErlang.Pretty as PP import Language.CoreErlang.Syntax as S import qualified Data.Map as M import qual...
gleber/erlhask
src/Language/Erlang/Modules.hs
apache-2.0
2,233
0
17
502
660
341
319
62
2
module Main (main) where import Language.Haskell.HLint (hlint) import System.Exit (exitFailure, exitSuccess) arguments :: [String] arguments = [ "puzzles/0-easy/onboarding/solution.hs" , "puzzles/0-easy/kirks-quest-the-descent/solution.hs" , "puzzles/0-easy/ragnarok-power-of-thor/solution.hs" , "puzzl...
lpenz/codingame-haskell-solutions
hlint.hs
apache-2.0
568
0
8
87
103
60
43
15
2
module Helpers.GridPolytopes (countPolygons, Polygon (..)) where import Helpers.ListHelpers (cartesianProduct) import Helpers.Subsets (choose) import Data.List (genericTake, nub) import Math.NumberTheory.Powers.Squares (exactSquareRoot) import Data.Set (Set) import qualified Data.Set as Set data Polygon = Triangle | S...
peterokagey/haskellOEIS
src/Helpers/GridPolytopes.hs
apache-2.0
3,988
0
14
711
1,475
809
666
68
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1.ProjectStatus where import GHC.Generics import Data.Text import qualified Data.Aeson -- | data ProjectStatus = ProjectStatus ...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1/ProjectStatus.hs
apache-2.0
521
0
9
77
83
50
33
14
0
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ru-RU"> <title>Bug Tracker</title> <maps> <homeID>top</homeID> <mapref location="map.jh...
secdec/zap-extensions
addOns/bugtracker/src/main/javahelp/org/zaproxy/zap/extension/bugtracker/resources/help_ru_RU/helpset_ru_RU.hs
apache-2.0
956
77
66
156
407
206
201
-1
-1
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Controller ( withFoundation ) where -- standard libraries import Control.Monad import Control.Concurrent.MVar import System.Directory import System.FilePath -- friends import Foundation import Settings import Yesod.Helpers.Static -...
sseefried/funky-foto
Controller.hs
bsd-2-clause
2,165
0
13
532
332
176
156
39
1
module Cologne.ParseNFF (parseNFF) where import Text.ParserCombinators.Parsec import qualified Text.ParserCombinators.Parsec.Token as PT import Text.ParserCombinators.Parsec.Language (emptyDef) import Data.Vect import Graphics.Formats.Assimp (Camera(Camera)) import Control.Arrow (left) import Control.Applicative hidi...
joelburget/Cologne
Cologne/ParseNFF.hs
bsd-3-clause
5,595
0
18
1,362
1,017
543
474
69
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.NV.TextureExpandNormal -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : porta...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/NV/TextureExpandNormal.hs
bsd-3-clause
688
0
4
78
37
31
6
3
0
-------------------------------------------------------------------------------- -- Chip16 Assembler written in Haskell -------------------------------------------------------------------------------- module HC.Ops where import Data.Bits import Data.Int import Data.List import Data.Maybe import Data.Word import Contr...
nandor/hcasm
HC/Ops.hs
bsd-3-clause
4,323
0
9
1,613
1,716
1,107
609
124
1
module Main where import qualified Language.Modelica.Test.Lexer as Lexer import qualified Language.Modelica.Test.Expression as Expr import qualified Language.Modelica.Test.Modification as Mod import qualified Language.Modelica.Test.Basic as Basic import qualified Language.Modelica.Test.ClassDefinition as ClassDef i...
xie-dongping/modelicaparser
test/Main.hs
bsd-3-clause
1,500
0
17
265
424
225
199
40
1
------------------------------------------------------------------------------- -- | -- Module : Control.Monad.Trans.Supply -- Copyright : (C) 2013 Merijn Verstraaten -- License : BSD-style (see the file LICENSE) -- Maintainer : Merijn Verstraaten <merijn@inconsistent.nl> -- Stability : experimental ...
merijn/transformers-supply
Control/Monad/Supply.hs
bsd-3-clause
1,868
0
5
383
147
108
39
29
0
module Text.Velocity ( defaultVelocityState , Vstate(..) , render , pretty_ast -- * Parsing , parseVelocityM , parseVelocity , parseVelocityFile ) where import Control.Applicative hiding ((<|>), many) import Control.Arrow import Control.Monad import Control.Monad.IO.Class import Data....
edom/velocity
Text/Velocity.hs
bsd-3-clause
7,030
0
30
2,676
1,614
821
793
128
7
{-# LANGUAGE ScopedTypeVariables, FlexibleContexts, TypeFamilies, TypeSynonymInstances, FlexibleInstances, GADTs, RankNTypes, UndecidableInstances #-} -- | The 'Enabled' module allows the construction of circuits that use -- additional control logic -- an enable signal -- that externalizes whether a -- data s...
andygill/kansas-lava
Language/KansasLava/Protocols/Enabled.hs
bsd-3-clause
2,134
0
10
420
524
279
245
29
1
module AssetsHelper where import Assets import Utils.Utils import TypeSystem.Parser.TypeSystemParser import TypeSystem import Data.List import qualified Data.Map as M import Control.Arrow ((&&&)) import SyntaxHighlighting.Coloring stfl = parseTypeSystem Assets._Test_STFL_language (Just "Assets/STFL.language") & ...
pietervdvn/ALGT
src/AssetsHelper.hs
bsd-3-clause
1,127
23
14
175
343
185
158
27
1
{-# LANGUAGE CPP , GADTs , Rank2Types , DataKinds , TypeFamilies , FlexibleContexts , UndecidableInstances , LambdaCase , MultiParamTypeClasses , OverloadedStrings #-} {-# OPTIONS_GHC -Wall -fwarn-tabs -fsimpl...
zaxtax/hakaru
haskell/Language/Hakaru/Runtime/LogFloatPrelude.hs
bsd-3-clause
13,161
8
15
3,695
4,702
2,531
2,171
-1
-1
module ADP.Tests.RGExample where import ADP.Multi.All type RG_Algebra alphabet answer = ( EPS -> answer, -- nil answer -> answer -> answer, -- left answer -> answer -> answer -> answer, -- pair answer -> answer -> answer -> a...
adp-multi/adp-multi-monadiccp
tests/ADP/Tests/RGExample.hs
bsd-3-clause
1,413
0
11
608
453
258
195
35
2