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
{-# htermination isDenormalized :: Float -> Bool #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_isDenormalized_1.hs
mit
53
0
2
8
3
2
1
1
0
module Test.Entities.FooChild ( FooChild (..), isChildOf, table, fooChildIdField, fooChildFooIdField, generate, generateList, withTables, ) where import Control.Monad.IO.Class (MonadIO (liftIO)) import Data.Function (on) import Data.Int (Int32) import qualified Data.List as List import ...
flipstone/orville
orville-postgresql-libpq/test/Test/Entities/FooChild.hs
mit
2,143
0
13
338
586
323
263
60
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Database.Persist.Sql.Orphan.PersistQuery ( deleteWhereCount , updateWhereCount , decorateSQLWithLimitOffset ) where import Database....
psibi/persistent
persistent/Database/Persist/Sql/Orphan/PersistQuery.hs
mit
18,502
0
33
7,073
5,092
2,619
2,473
358
44
{-# LANGUAGE CPP #-} module Data.String.Interpolate.Compat ( readMaybe , module Language.Haskell.TH #if !MIN_VERSION_template_haskell(2,8,0) , reportError #endif ) where import Language.Haskell.TH import Text.Read #if !MIN_VERSION_base(4,6,0) import qualified Text.ParserCombinators.ReadP as P #e...
beni55/interpolate
src/Data/String/Interpolate/Compat.hs
mit
1,160
0
10
265
251
136
115
24
3
module Rebase.Control.Concurrent.STM.TArray ( module Control.Concurrent.STM.TArray ) where import Control.Concurrent.STM.TArray
nikita-volkov/rebase
library/Rebase/Control/Concurrent/STM/TArray.hs
mit
131
0
5
12
26
19
7
4
0
module Initialization where import Control.Applicative ((<$>)) import Control.Monad (replicateM) import Control.Monad.Random (getRandomR, Rand, StdGen) import Types import Vector radius, angularVelocity :: Scalar radius = 20 angularVelocity = 0.4 initialize :: Options -> Rand StdGen Model initialize options = do ...
tcsavage/gravitysim
src/Initialization.hs
mit
1,540
0
19
465
640
339
301
38
4
{-#LANGUAGE DeriveDataTypeable #-} {-#LANGUAGE BangPatterns#-} module Control.Concurrent.HEP.Supervisor ( SupervisorMessage(..) , SupervisorCommand -- , spawnSupervisor , procContinue , procFinish , procRestart , procReshutdown ) where import Control.Concurrent.HEP.Types import Con...
dambaev/hep
src/Control/Concurrent/HEP/Supervisor.hs
mit
1,202
0
9
211
256
135
121
27
1
{-# LANGUAGE ScopedTypeVariables, MagicHash, ExistentialQuantification #-} -- Copyright (c) Jean-Philippe Bernardy 2005-2007. module Yi.Dynamic ( Initializable(..), toDyn, fromDynamic, dynamicValueA, emptyDV, Typeable, Dynamic, DynamicValues ) where import Prelude () import Yi.Prelude import GHC.Exts impo...
codemac/yi-editor
src/Yi/Dynamic.hs
gpl-2.0
2,119
0
12
425
445
245
200
33
2
module Main where import System.Exit import QuickBench (defaultMain) main :: IO () main = defaultMain >>= maybe exitSuccess die
simonmichael/quickbench
app/Main.hs
gpl-3.0
130
0
6
21
41
23
18
5
1
{- RJSONConvert By Gregory W. Schwartz Collects functions pertaining to converting the JSON output of R to the workable tree. To create the input for this program from R: @ library(data.tree) library(jsonlite) hc = hclust(dist(USArrests), "ave") tree = as.Node(as.dendrogram(hc)) toJSON(as.list(tree, mode = "explicit"...
GregorySchwartz/find-clumpiness
src/RJSONConvert.hs
gpl-3.0
2,187
0
10
593
396
221
175
44
1
{-# LANGUAGE BangPatterns #-} module Main where import Control.Concurrent.TokenBucket import Control.Concurrent import Control.Exception import Control.Monad import Data.Time.Clock.POSIX (getPOSIXTime) import System.Exit import Data.Word getPosixTime :: IO Double getPosixTime = fmap realToFrac getPOSIXTime toInvRat...
hvr/token-bucket
test-tb.hs
gpl-3.0
1,526
0
16
400
499
239
260
44
1
{- | Module: SynthParams Description: Parameters to control synth In general, synth parameters specify patterns of sounds, and patterns of effects on those sounds. These are the synthesis parameters you can use with the default Dirt synth: -} module Sound.Tidal.MIDI.SynthParams ( sound, grp, accelerate, bandf,...
kindohm/tidal-midi
Sound/Tidal/MIDI/SynthParams.hs
gpl-3.0
664
0
4
159
125
84
41
38
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/RegionURLMaps/Get.hs
mpl-2.0
3,764
0
16
898
468
280
188
77
1
module Common.HTTPHelper where import Data.Text (Text) import Data.Text.Encoding (encodeUtf8, decodeUtf8) import Network.HTTP.Types.URI (urlEncode) textUrlEncode :: Bool -> Text -> Text textUrlEncode flag = decodeUtf8 . urlEncode flag . encodeUtf8
asvyazin/my-books.purs
server/my-books/Common/HTTPHelper.hs
mpl-2.0
254
0
7
35
74
43
31
7
1
module LongestCommonSubsequence where lcs :: String -> String -> String lcs "" _ = "" lcs _ "" = "" lcs [a] [b] = if a == b then [a] else "" lcs [a] y = if elem a y then [a] else "" lcs y [a] = if elem a y then [a] else "" lcs x y |x1 == y1 = x1 : lcs x2 y2 |otherwise = let xl = lcs x2 y ...
ice1000/OI-codes
codewars/101-200/longest-common-subsequence.hs
agpl-3.0
483
0
10
203
237
124
113
13
5
returnTest :: IO () returnTest = do one <- return 1 let two = 2 putStrLn $ show (one + two)
EricYT/Haskell
src/real_haskell/chapter-7/return2.hs
apache-2.0
105
0
10
34
52
24
28
5
1
{-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} -- Common utilities in writing program transformations. module Language.K3.Transform.Common where import Control.Monad.Identity import Control.Monad.State import Data.Tree import Language.K3.C...
yliu120/K3
src/Language/K3/Transform/Common.hs
apache-2.0
3,610
0
15
834
1,064
559
505
60
10
{-# LANGUAGE FlexibleContexts,FlexibleInstances,GADTs,DataKinds#-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ScopedTypeVariables #-} {- | This Module essentially stubs out the subset of Random Access Stack operations we need for efficient substitution environments -} module Resin.Environment.Class ( ) where
cartazio/resin
src/Resin/Environment/Class.hs
bsd-2-clause
320
0
3
41
14
11
3
4
0
module Data.Minecraft.Snapshot192 ( module Data.Minecraft.Snapshot192.Protocol , module Data.Minecraft.Snapshot192.Version ) where import Data.Minecraft.Snapshot192.Protocol import Data.Minecraft.Snapshot192.Version
oldmanmike/hs-minecraft-protocol
src/Data/Minecraft/Snapshot192.hs
bsd-3-clause
223
0
5
21
39
28
11
5
0
{-# LANGUAGE FlexibleContexts, UndecidableInstances #-} module Text.Roundtrip.Xml.Parser ( GenXmlParser, XmlParser, runXmlParser, runXmlParser', runXmlParser'' , WithPos, EventWithPos, eventWithPos, eventWithoutPos , SourceName, Line, Column, ParseError , EntityRenderer, defaultEntityRenderer , runXmlP...
skogsbaer/roundtrip-xml
src/Text/Roundtrip/Xml/Parser.hs
bsd-3-clause
10,363
0
25
2,678
3,401
1,737
1,664
187
19
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Tinfoil.Hash( hash , hashSHA256 ) where import Crypto.Hash.Algorithms (SHA256) import qualified Crypto.Hash as Cryptonite import qualified Data.ByteArray as BA import Data.ByteString (ByteString) import qualified Da...
ambiata/tinfoil
src/Tinfoil/Hash.hs
bsd-3-clause
612
0
10
130
147
86
61
18
1
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, FlexibleContexts, ViewPatterns #-} module Language.SPL.Data.Instruction where import Language.SPL.Printer (Pretty,pretty,text,char,vsep,indent,fill,(<>),(<+>)) import Prelude hiding (length) import Data.List ((\\)) import Data.Sequence (Seq,singleton,viewl,viewr,...
timjs/spl-compiler
src/Language/SPL/Data/Instruction.hs
bsd-3-clause
3,371
0
12
1,062
1,110
617
493
68
1
module PeerTrader.Types where import Data.Text (Text) type UserLogin = Text
WraithM/peertrader-backend
src/PeerTrader/Types.hs
bsd-3-clause
88
0
5
22
22
14
8
3
0
module Problem381 where import Prime import Modular main :: IO () -- (p-1)! + (p-2)! + (p-3)! + (p-4)! + (p-5)!; Use wilson's theorem -- (p-1)! = -1 mod p -- (p-2)! * (p-1) = -1 mod p => (p-2)! * -1 = -1 mod p => (p-2)! = 1 mod p -- (p-3)! * (p-2) = 1 mod p => (p-3)! = inv (-2) -- (p-4)! = inv (-2) * inv (-3) -- (p-...
adityagupta1089/Project-Euler-Haskell
src/problems/Problem381.hs
bsd-3-clause
684
0
13
195
176
103
73
11
1
{-# LANGUAGE BangPatterns #-} module Gamgine.Image.PNG.Internal.CRC (update_crc, crc) where import Data.Word import Data.Array.Unboxed import Data.Bits import qualified Gamgine.Image.PNG.Internal.LBS as LBS import Gamgine.Image.PNG.Internal.LBS (LBS) crc_table :: UArray Word32 Word32 crc_table = listArray (0,255) . ...
dan-t/Gamgine
Gamgine/Image/PNG/Internal/CRC.hs
bsd-3-clause
951
0
17
272
313
177
136
21
1
-- ----------------------------------------- -- Parse.hs -- ----------------------------------------- -- Try to parse strings like "46, 28, 0.29" or " 8, 9, 59.98" -- -- ---------------------------------------- module Parse (getCoord) where import Text.Parsec import Text.Parsec.String import Data.Geo.Swiss.Conversio...
hansroland/ShowOnSwissMap
src/Parse.hs
bsd-3-clause
903
0
9
195
251
128
123
27
2
module Main where newtype Age = Age Int type Age' = Int newtype Speed = Speed {getSpeed :: Double} newtype Forget a = Remember {value :: a} data Tree a = Empty | Tree a [Tree a] main :: IO () main = print "New-Type and haskell" a :: Int a = 5 b :: Age' b = Age 5 c :: Age' c = 5 d :: Speed d = Speed 5 e :: Forget ...
epsilonhalbe/01_types_and_typos
src/NewtypeExampleBad.hs
bsd-3-clause
343
0
8
88
146
86
60
18
1
{-# LANGUAGE DataKinds, PolyKinds, TypeFamilies, GADTs, TypeOperators, DefaultSignatures, ScopedTypeVariables, InstanceSigs, MultiParamTypeClasses, FunctionalDependencies, UndecidableInstances, TypeInType #-} module ByHand2 where import Prelude hiding ( Eq(..), Ord(..) ) import ...
int-index/singletons
tests/ByHand2.hs
bsd-3-clause
5,150
17
14
1,392
2,665
1,380
1,285
158
1
{-# LANGUAGE ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Spoon -- Copyright : © 2009 Matt Morrow & Dan Peebles, © 2013 Liyang HU -- License : see LICENSE -- -- Maintainer : spoon@liyang.hu -- Stability : experimental...
liyang/spoon
Control/Spoon.hs
bsd-3-clause
2,219
0
10
413
369
211
158
31
1
module Fibon.Run.SysTools ( size , cabal , diff ) where size :: String size = "size" cabal :: String cabal = "cabal" diff :: String diff = "diff"
dmpots/fibon
tools/fibon-run/Fibon/Run/SysTools.hs
bsd-3-clause
157
0
4
39
48
30
18
10
1
module Main where import qualified Test.ReadWrite as RW main :: IO () main = RW.main
8c6794b6/dph-sndfile
example/rw.hs
bsd-3-clause
86
0
6
16
29
18
11
4
1
module Sound where import qualified Graphics.UI.SDL.Mixer as Mix import Graphics.UI.SDL.Audio import Control.Monad import Data.IORef type SoundState = IORef [ Mix.Chunk ] initSound :: [FilePath] -> IO SoundState initSound soundFiles = do Mix.openAudio 44100 AudioS16Sys 2 4096 sounds <- mapM Mix.loadWAV sound...
timbod7/hbeat
Sound.hs
bsd-3-clause
604
0
12
118
215
111
104
18
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} -- | Display attributes -- -- Attributes have three components: a foreground color, a background -- color, and a style mask. The simplest attribute is the default -- attribute, or 'defAttr'. Attributes can be modified with -- 'withFore...
jtdaugherty/vty
src/Graphics/Vty/Attributes.hs
bsd-3-clause
6,859
0
11
1,557
840
530
310
101
3
import Universum import Test.Hspec (hspec) import Spec (spec) import qualified Test.Pos.Core.Bi import qualified Test.Pos.Core.Json import qualified Test.Pos.Core.SafeCopy import Test.Pos.Util.Tripping (runTests) main :: IO () main = do hspec spec runTests [ T...
input-output-hk/pos-haskell-prototype
core/test/test.hs
mit
426
0
9
121
109
69
40
14
1
{-# LANGUAGE Rank2Types, OverloadedStrings, CPP #-} module Utils where import Data.Generics hiding (typeOf) import GHC import GHC.SYB.Utils -- ghcmod/Language/Haskell/GhcMod/Info.hs listifySpans :: Typeable a => TypecheckedSource -> (Int, Int) -> [Located a] listifySpans tcs lc = listifyStaged TypeChecker p tcs wh...
bfpg/bfpg-2015-08
demo/Utils.hs
bsd-2-clause
565
0
12
92
192
106
86
10
1
------------------------------------------------------------------------ -- | -- Module : Main -- Copyright : (c) Amy de Buitléir 2012-2016 -- License : BSD-style -- Maintainer : amy@nualeargais.ie -- Stability : experimental -- Portability : portable -- -- Runs the QuickCheck tests. -- ------------...
mhwombat/numeral-wains
test/Main.hs
bsd-3-clause
766
0
6
117
109
76
33
11
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Stg to C--: heap management functions -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmHeap ( getVirtHp, setVirtHp...
TomMD/ghc
compiler/codeGen/StgCmmHeap.hs
bsd-3-clause
25,605
0
20
7,240
3,739
1,939
1,800
298
8
{- ToDo [Oct 2013] ~~~~~~~~~~~~~~~ 1. Nuke ForceSpecConstr for good (it is subsumed by GHC.Types.SPEC in ghc-prim) 2. Nuke NoSpecConstr (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[SpecConstr]{Specialise over constructors} -} {-# LANGUAGE CPP #-} module SpecConstr( specConstrProgram, ...
ezyang/ghc
compiler/specialise/SpecConstr.hs
bsd-3-clause
94,978
56
19
29,064
11,269
6,246
5,023
-1
-1
module Opaleye.Internal.Column where import qualified Opaleye.Internal.HaskellDB.PrimQuery as HPQ -- | The 'Num' and 'Fractional' instances for 'Column' 'a' are too -- general. For example, they allow you to add two 'Column' -- 'String's. This will be fixed in a subsequent release. newtype Column a = Column HPQ.Pri...
benkolera/haskell-opaleye
src/Opaleye/Internal/Column.hs
bsd-3-clause
2,183
0
11
399
733
381
352
42
1
module HJS.Parser(parseProgram,lexProgram,lexFile,runLexer) where import HJS.Parser.JavaScriptParser import HJS.Parser.JavaScript lexFile flags name = do input <- readFile name putStrLn $ show $ lexProgram input
disnet/jscheck
src/HJS/Parser.hs
bsd-3-clause
270
0
11
80
66
36
30
6
1
module Main where import qualified System.IO as IO import Data.Complex import Data.Char (chr,ord) data Scene = Scene { scaleX :: Double, scaleY :: Double, ulX :: Double, ulY :: Double } -- ideally get real console support at some point... lenX = 72 lenY = 20 clrScr = mapM_ (\_ -> putStrLn "") [1..lenY] -- add more...
waywardcode/small_programs
mandelbrot/mandel.hs
gpl-2.0
2,727
0
15
763
922
487
435
48
2
module GoToSymbolFunction_Pattern_CaretOnVariable where test :: Int test = let (seven, eight) = (7,8) in s<caret>even + 1
charleso/intellij-haskforce
tests/gold/codeInsight/GoToSymbolFunction_Pattern_CaretOnVariable.hs
apache-2.0
129
0
9
24
50
28
22
-1
-1
{-# LANGUAGE OverloadedStrings #-} module ResponseHeaderSpec (main, spec) where import Data.ByteString import qualified Network.HTTP.Types as H import Network.Wai.Handler.Warp.ResponseHeader import Network.Wai.Handler.Warp.Response import Network.Wai.Handler.Warp.Header import Test.Hspec main :: IO () main = hspec s...
sordina/wai
warp/test/ResponseHeaderSpec.hs
bsd-2-clause
1,799
0
17
440
403
220
183
41
1
module Rules.Test (testRules) where import System.Environment import Base import Expression import Oracles.Setting import Packages import Settings import Settings.Default import Settings.Builders.RunTest import Target import Utilities ghcConfigHsPath :: FilePath ghcConfigHsPath = "testsuite/mk/ghc-config.hs" ghcCon...
snowleopard/shaking-up-ghc
src/Rules/Test.hs
bsd-3-clause
4,355
0
16
1,126
911
441
470
87
2
{-# LANGUAGE CPP #-} -- ---------------------------------------------------------------------------- -- | Handle conversion of CmmData to LLVM code. -- module LlvmCodeGen.Data ( genLlvmData, genData ) where #include "HsVersions.h" import GhcPrelude import Llvm import LlvmCodeGen.Base import BlockId imp...
ezyang/ghc
compiler/llvmGen/LlvmCodeGen/Data.hs
bsd-3-clause
5,469
0
17
1,598
1,335
657
678
109
12
{-# LANGUAGE LambdaCase, DeriveFunctor #-} module LambdaPi.Bound where import Bound import Control.Applicative import Control.Monad import Control.Monad.Gen import Control.Monad.Reader import qualified Data.Map as M import Data.Maybe import ...
jozefg/cooked-pi
src/LambdaPi/Bound.hs
mit
3,074
0
17
944
1,476
734
742
92
6
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} ...
ltoth/mtg
Game/MtG/Types.hs
mit
31,000
0
16
9,945
6,856
3,999
2,857
-1
-1
{-# LANGUAGE FlexibleContexts #-} {- Copyright (C) 2012 Kacper Bak <http://gsd.uwaterloo.ca> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation t...
juodaspaulius/clafer-old-customBNFC
src/Language/Clafer/Intermediate/Resolver.hs
mit
4,072
0
14
681
992
518
474
56
3
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} module Hickory.Utils.Bvh where import Control.Monad (void) import Text.Megaparsec import Text.Megaparsec.Char import qualified Text.Megaparsec.Char.Lexer as L import Data.Maybe import Hickory.Utils.Parsing import Data.Text (Te...
asivitz/Hickory
Hickory/Utils/Bvh.hs
mit
3,160
0
17
950
1,010
513
497
97
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE Strict #-} ----------------------------------------------------------------------------- -- | -- Module : SmallGL.Shader -- Copyright : (c) Artem Chirkin -- License : MIT -- -- Maintainer : Artem Chirkin <chirkin@arch.ethz.ch> -- Stability : experimental...
achirkin/qua-view
src/SmallGL/Shader.hs
mit
6,945
30
16
1,535
1,564
782
782
106
2
module SymVector where import Data.IntMap.Strict as Map import Control.Monad import Data.Aeson --this is the qc file data Vec a = V (IntMap a) {-@ data Vec a <dom :: Int -> Prop, rng :: Int -> a -> Prop> = V {a :: i:Int<dom> -> a <rng i>} @-} instance (Show a) => Show (Vec a) where show (V m) = show m ins...
abakst/symmetry
checker/include/SymVectorQC.hs
mit
2,254
0
11
731
538
278
260
31
2
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} import Control.Applicative ((<|>)) import Control.Monad (when) import Control.Monad.State (get, put, gets) import Control.Monad.State (execStateT) import Contr...
mmn80/yi-static
src/Main.hs
mit
7,866
0
18
3,021
2,021
1,052
969
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE QuasiQuotes #-} module Main (main) where import Blaze.ByteString.Builder.Char.Utf8 (fromLazyText) import CMarkGFM ...
snoyberg/servius
app/servius.hs
mit
4,508
0
16
1,393
914
479
435
70
1
{-# LANGUAGE ScopedTypeVariables #-} {-@ LIQUID "--no-termination" @-} module Class () where import Language.Haskell.Liquid.Prelude import Prelude hiding (sum, length, (!!), Functor(..)) import qualified Prelude as P {-@ qualif Size(v:Int, xs:a): v = size xs @-} {-@ qualif Size(v:Int, xs:MList a): v = size xs @-} {...
santolucito/ives
tests/Class.hs
mit
1,953
0
11
548
576
309
267
38
1
module DiveIntoMonads where import Control.Monad.Writer import Control.Monad.State monadReturn = return "WHAT" :: Maybe String monadOnJust = Just 9 >>= \x -> return (x*10) monadOnNothing = Nothing >>= \x -> return $ x ++ " that all!" fooUgly, fooLessUgly, fooDoNotion :: Maybe String fooUgly = Just 3 >>= (\x ...
aquatir/remember_java_api
code-sample-haskell/hello_world/func_magic/monads.hs
mit
3,888
0
14
1,070
1,384
734
650
92
2
----------------------------------------------------------------------------- -- -- Module : ParetoSearch -- Copyright : -- License : AllRightsReserved -- -- Maintainer : -- Stability : -- Portability : -- -- | -- ----------------------------------------------------------------------------- {-# OPTIONS...
Lewerow/TestSelector
src/ParetoSearch.hs
mit
4,546
0
15
840
1,879
992
887
-1
-1
{-# LANGUAGE OverloadedStrings #-} import Crypto.Hash.MD5 import Data.List import Data.ByteString.Base16 import qualified Data.ByteString.Char8 as B key = "yzbqklnj" isValid :: Int -> Int -> Bool isValid n i = possibleResult == (B.take n $ getHashString i) where possibleResult = B.replicate n '0' showB :: S...
bruno-cadorette/AdventOfCode
Day 4/Day4.hs
mit
575
0
9
116
213
112
101
18
1
module Nondet where import Data.Complex import Test.QuickCheck type Nondet a = [a] sqrts :: Floating a => a -> Nondet a sqrts x = [y, negate y] where y = sqrt x -- Exercise Four: Apply the function on all input values and aggregate the results bind :: (a -> Nondet b) -> (Nondet a -> Nondet b) bind = undefine...
PavelClaudiuStefan/FMI
An_3_Semestru_1/ProgramareDeclarativa/Extra/Laborator/Laborator 9/Nondet.hs
cc0-1.0
1,738
0
11
382
502
271
231
28
1
module BoardSpec where import Test.Hspec import Reversi.Coord import Reversi.Board import Reversi.Piece main :: IO () main = hspec spec spec :: Spec spec = do context "node" $ do let empty = node Nothing piece p = node $ Just p node x = (Coord 0 0, x) it "should determ...
mharrys/reversi
test/BoardSpec.hs
gpl-2.0
1,486
0
16
488
481
232
249
38
1
module Main where import Paths_StatiGen import System.FilePath import System.Environment import System.Directory import System.Exit import System.IO import Control.Monad import StatiGen.Util import StatiGen.Build -- Startpunkt des Programms -- Anhand der angegebenen Parameter wird die entsprechende Funk...
pads-fhs/hawebgen
StatiGen.hs
gpl-2.0
2,985
0
16
636
641
316
325
44
6
module S.Head where import S.Type import S.Cache import S.Reduce (here) import qualified Data.Map.Strict as M import qualified Control.Monad.State.Strict as S -- | member of the set Q Q Q, -- consequently, t has infinite head reduction isq3 t = case t of App {fun=xy, arg=z} | isq z -> case xy of App {fu...
jwaldmann/s
S/Head.hs
gpl-3.0
2,012
0
19
751
756
378
378
50
4
module Main where import UI.HSCurses.Curses hiding (pi) import Data.Convertible.Base import Data.Convertible.Instances import Data.Word import Control.Concurrent main :: IO () main = do win <- initScr startColor wclear win cursSet CursorInvisible echo False let Just fgColor = color "cyan" initPair (Pair 1) fg...
pmikkelsen/Haskell-sinewave
Main.hs
gpl-3.0
1,442
0
14
289
637
311
326
39
8
module SpacialGameMsg.SGModelMsg where import System.Random import Control.Monad.STM import qualified Data.Map as Map import qualified PureAgentsConc as PA data SGState = Defector | Cooperator deriving (Eq, Show) data SGMsg = NeighbourPayoff (SGState, Double) | NeighbourState SGState deriving (Eq, Show) data SGAge...
thalerjonathan/phd
public/ArtIterating/code/haskell/PureAgentsConc/src/SpacialGameMsg/SGModelMsg.hs
gpl-3.0
6,809
0
15
2,279
2,136
1,173
963
143
2
module TPL.Test.Value where import Control.Applicative import Test.QuickCheck import TPL.Parse import TPL.Value instance Arbitrary TPLValue where arbitrary = oneof [ nullValue ] permutationsOf :: [a] -> Gen [a] permutationsOf = listOf1 . oneof . map return idS...
TikhonJelvis/TPL
test/TPL/Test/Value.hs
gpl-3.0
832
0
10
208
260
141
119
22
1
module GnomeLookOrg.Data ( Meta(..) , Content(..) , Data(..) , getData ) where import Data.ByteString.Char8 (pack) import Data.Maybe (catMaybes, listToMaybe) import qualified Data.Text as T import Network.Connection (TLSSettings(..)) import Network.HTTP.Conduit import ...
jplatte/gtk-theme-manager
src/GnomeLookOrg/Data.hs
gpl-3.0
3,164
0
16
997
785
419
366
66
1
-- |This contains some simple frame renderers module Effects where import Elovalo import Fractional -- |Produces frame with a static intensity singleIntensity :: RealFrac a => Elovalo -> a -> Frame singleIntensity e intensity = fractionalToFrame e $ replicate (totalVoxels e) intensity
elovalo/helovalo
src/Effects.hs
gpl-3.0
318
0
8
74
60
32
28
6
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
olorin/amazonka
amazonka-iam/gen/Network/AWS/IAM/GetAccountAuthorizationDetails.hs
mpl-2.0
9,507
0
20
1,958
1,269
750
519
138
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE LambdaCase #-} -- Module : Khan.Model.EC2.VPC -- Copyright : (c) 2018 Wire Swiss GmbH <backend@wire.com> ...
zinfra/khan
khan/src/Khan/Model/EC2/VPC.hs
mpl-2.0
1,437
0
13
374
261
144
117
28
2
import System.Directory import System.Environment checkArgs :: [String] -> IO Bool checkArgs args | length args /= 2 = return False | otherwise = do dE <- doesDirectoryExist ( head args ) fE <- doesFileExist ( last args ) return $ ...
JavierJF/TextInserter
src/Main.hs
agpl-3.0
426
0
11
169
140
64
76
12
1
{-# LANGUAGE TypeSynonymInstances #-} module Network.UDP ( DataPacket(..) , openBoundUDPPort , openListeningUDPPort , pingUDPPort , sendUDPPacketTo , recvUDPPacket , recvUDPPacketFrom ) where import qualified Data.ByteString as Strict (ByteString, concat, singleton) import qualified Data.ByteString.Lazy as Lazy (ByteS...
SoftwareHeritage/swh-web-ui
swh/web/tests/resources/contents/code/extensions/test.hs
agpl-3.0
1,136
0
12
175
304
170
134
31
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} module StaticConfig where import Control.Concurrent (threadDelay) import Control.Concurrent.MVar (MVar, modifyMVar, newMVar, ...
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/distributed/static-config/StaticConfig.hs
unlicense
3,866
0
22
1,156
1,068
563
505
93
2
import Safe (readMay) displayAge maybeAge = case maybeAge of Nothing -> putStrLn "You provided Invalid year" Just age -> putStrLn $ "In 2020, you will be : " ++ show age calcAge n = 2020 - n main = do putStrLn "Enter your birthyear: " yearString <- getLine -- instead of fmap, we can extract va...
dongarerahul/edx-haskell
main-5.hs
apache-2.0
672
0
13
162
120
57
63
-1
-1
import Data.List ans c@(c1:c2:c3:_) = let r = [1..10] \\ c a = filter (\x -> x+c1+c2 <= 20) r in if (length a) >= 4 then "YES" else "NO" main = do c <- getContents let i = map (map read) $ map words $ lines c :: [[Int]] o = map ans i mapM_ putStrLn o
a143753/AOJ
0060.hs
apache-2.0
287
0
14
94
171
87
84
12
2
{- Copyrights (c) 2016. Samsung Electronics Ltd. All right reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
ryzhyk/cocoon
cocoon/Parse.hs
apache-2.0
12,303
0
15
4,493
3,654
1,904
1,750
242
6
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} -------------------------------------------------------------------- -- | -- Copyright : (c) Edward Kmett...
PipocaQuemada/ermine
src/Ermine/Syntax/Instance.hs
bsd-2-clause
2,517
0
11
371
511
286
225
49
0
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE AllowAmbiguousTypes #-} module System.Fuse.Box.FSTypes ( FuseBox(..), MonadIO, MonadError, MonadFuse, MonadFSRead, MonadFSWrite, ...
RobertFischer/fusebox
shared/System/Fuse/Box/FSTypes.hs
bsd-3-clause
8,819
0
14
1,831
2,048
1,144
904
164
2
module D12Spec (main, spec) where import Test.Hspec import D12Lib import qualified Text.Parsec as P main :: IO () main = hspec spec spec :: Spec spec = parallel $ do describe "instructionsP" $ it "parses messages" $ do let tape = P.parse instructionsP "fixture" "cpy -1 a\ninc a\ncpy a b\n" ...
wfleming/advent-of-code-2016
2016/test/D12Spec.hs
bsd-3-clause
1,323
0
22
478
462
237
225
31
1
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} module Main where import Control.Concurrent import Control.Monad import Control.Monad.Identity import Control.Monad.IO.Class import Control.Monad.Ref import Control.Monad.Trans.Class import Control.Monad.Trans.Maybe import Data.Dependent.Sum (DSum (..)) import Da...
Rotaerk/windowTest
src/Main.hs
bsd-3-clause
4,619
0
24
1,075
1,124
573
551
112
7
-- | Compiling Ivory to ACL2. module Ivory.Compile.ACL2 ( compile , var , lit ) where import qualified Language.ACL2 as A import qualified Ivory.Language.Syntax.AST as I import qualified Ivory.Language.Syntax.Type as I import qualified Ivory.Language.Syntax.Names as I import qualified Ivory.Compile.ACL2.C...
tomahawkins/ivory-backend-acl2
src/Ivory/Compile/ACL2.hs
bsd-3-clause
5,213
0
16
1,511
2,245
1,111
1,134
121
19
{-# LANGUAGE Arrows #-} {-# LANGUAGE RecordWildCards #-} module Wires.Camera ( camera , CameraEvents(..) ) where import Control.Arrow import Control.Lens import Control.Wire import Control.Wires.Extra import Data.Monoid import Linear import qualified Linear as L import Prelude hiding ((.), id) import qualified ...
ocharles/hs-quake-3
Wires/Camera.hs
bsd-3-clause
2,691
2
18
754
802
418
384
67
1
{-# LANGUAGE NoImplicitPrelude #-} module Protocol.ROC.PointTypes.PointType21 where import Data.Binary.Get (getByteString, getWord8, getWord32le, Get) import Data.ByteString (ByteString) import Data.Word (Word8,Word32) import Prelude ...
plow-technologies/roc-translator
src/Protocol/ROC/PointTypes/PointType21.hs
bsd-3-clause
1,375
0
9
517
210
121
89
38
1
module CommonMarkTests (construct) where import qualified CMark import Prelude hiding (init) import Test.Tasty import Test.Tasty.HUnit import qualified Data.Text as Strict import qualified Data.Text.Lazy as Text import qualified Data.Text.Lazy.IO as TextIO import qualified ElmFormat.Render.Markdown import qualified Pa...
avh4/elm-format
tests/CommonMarkTests.hs
bsd-3-clause
4,615
0
16
1,748
1,085
622
463
114
8
{-# LANGUAGE TypeFamilies,RankNTypes,ImpredicativeTypes,FlexibleContexts,DeriveDataTypeable #-} {-| Provides a common interface for all backend types. -} module Language.GTL.Backend.All where import Language.GTL.Expression import Language.GTL.Backend import Language.GTL.Backend.Scade import Language.GTL.Backend.None ...
hguenther/gtl
lib/Language/GTL/Backend/All.hs
bsd-3-clause
2,514
0
18
589
625
330
295
45
2
module BlackjackServer where import BlackjackData import Network.NetSpec import Network.NetSpec.Json import Control.Monad -- cabal install random-shuffle import System.Random.Shuffle (shuffleM) shuffle :: [a] -> IO [a] shuffle = shuffleM -- TODO: not depend on random-shuffle newGame :: BlackjackState newGame = BJ ...
DanBurton/netspec
examples/BlackjackServer.hs
bsd-3-clause
1,970
0
19
555
877
459
418
49
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Glug.Types ( MovieDetails (..) , MovieSubtitles (..) , IMDbId , ApiKey , WordCount (..) , WordRank (..) , Subtitle (..) ) where import qualified Data.Text as T import qualified Data.Text.Lazy as TL import qualified Data.Time.Clock as C import...
robmcl4/Glug
src/Glug/Types.hs
bsd-3-clause
2,013
0
10
492
420
258
162
47
0
module Hint.GHC ( Message, module X ) where import GHC as X hiding (Phase, GhcT, runGhcT) import Control.Monad.Ghc as X (GhcT, runGhcT) import HscTypes as X (SourceError, srcErrorMessages, GhcApiError) import Outputable as X (PprStyle, SDoc, Outputable(ppr), showSDoc, showSDocForUser, sho...
meditans/hint
src/Hint/GHC.hs
bsd-3-clause
1,232
0
6
214
300
212
88
18
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} module Stack.FileWatch ( fileWatch , fileWatchPoll , printExceptionStderr ) where import Blaze.ByteString.Builder (toLazyByteString, copyByteString) import Blaze.ByteString.Builder.Char.Utf8 (fromShow) import Control.Concurrent.Async (ra...
rrnewton/stack
src/Stack/FileWatch.hs
bsd-3-clause
5,390
0
25
1,889
1,307
649
658
112
8
----------------------------------------------------------------------------- -- | -- Module : Control.Concurrent.STM.TMVar -- Copyright : (c) The University of Glasgow 2004 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : experimen...
FranklinChen/hugs98-plus-Sep2006
packages/stm/Control/Concurrent/STM/TMVar.hs
bsd-3-clause
2,299
25
14
533
870
418
452
73
2
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.GHC -- Copyright : Isaac Jones 2003-2007 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This is a fairly large module. It...
valderman/cabal
Cabal/Distribution/Simple/GHC.hs
bsd-3-clause
52,297
0
23
15,988
9,768
5,124
4,644
827
19
module Mire.Hint (ConfigVar, readConfigAsync, errorToString) where import Mire.Prelude import Mire.Plugin (Config (..)) import Language.Haskell.Interpreter import qualified Data.Text as T import Control.Concurrent.STM import Control.Concurrent import System.Directory type ConfigVar = TMVar (Either InterpreterErro...
ellej/mire
src/Mire/Hint.hs
bsd-3-clause
1,562
0
12
291
409
220
189
29
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Test -- Copyright : Thomas Tuegel 2010 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This is the entry point into testing a built package. It performs the -- \"@.\/...
alphaHeavy/cabal
Cabal/Distribution/Simple/Test.hs
bsd-3-clause
21,357
0
29
6,477
4,097
2,120
1,977
330
7
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[TcMovectle]{Typechecking a whole module} https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/TypeChecker -} {-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NondecreasingIndentation #-} {-# LAN...
ezyang/ghc
compiler/typecheck/TcRnDriver.hs
bsd-3-clause
113,232
20
29
37,138
18,431
9,698
8,733
-1
-1
{-# LANGUAGE RecordWildCards #-} module Data.ComponentSystem.Terrain ( updateTerrain, newTerrainState ) where import Prelude hiding (Left) import Data.ComponentSystem import Data.Wizard.Model import Data.FiniteDouble import qualified Data.Set as S type Left = Int type Top = Int type Width = Int type Heigh...
smobs/elblog
server/src/Data/ComponentSystem/Terrain.hs
bsd-3-clause
3,543
0
16
1,485
1,269
697
572
64
2
module Config.Command.Run ( Config(..) , mkCfg , opts ) where import State.Types ( State ) import Network.URI ( parseRelativeReference, URI ) import Config.GetOpt ( MkCfg, Opts, noArgs, Err, contentDirDesc ) import Config.Store ( storeOptDescr, ParseStore ) import System.Console.GetOpt import qualified...
j3h/doc-review
src/Config/Command/Run.hs
bsd-3-clause
4,072
0
12
1,201
940
533
407
98
2
-- import Control.Monad (forM) -- import Data.Either (isRight) -- import Data.TicTacToe -- import qualified Data.TicTacToe as T (Result (..)) -- import Test.Hspec -- import Test.QuickCheck -- instance Arbitrary GameState where -- arbitrary = do -- player <...
rodamber/haskell-tic-tac-toe
test/Spec.hs
bsd-3-clause
1,968
0
6
549
67
57
10
2
1
module Data.SymReg( module X ) where import Data.SymReg.AST as X import Data.SymReg.Parser as X import Data.SymReg.Evolvable as X
Teaspot-Studio/genmus
src/Data/SymReg.hs
bsd-3-clause
136
0
4
24
36
26
10
5
0
module Idris.Imports where import Idris.AbsSyntax import Idris.Error import Idris.Core.TT import Paths_idris import System.FilePath import System.Directory import Control.Monad.State.Strict data IFileType = IDR FilePath | LIDR FilePath | IBC FilePath IFileType deriving (Show, Eq) srcPath :: FilePath -> FilePat...
DanielWaterworth/Idris-dev
src/Idris/Imports.hs
bsd-3-clause
3,137
0
13
1,462
729
368
361
57
4
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module LDrive.Tests.SPI where import Ivory.Language...
sorki/odrive
src/LDrive/Tests/SPI.hs
bsd-3-clause
2,196
0
17
430
583
300
283
58
1
{- | Module : ./Common/ConvertMixfixToken.hs Description : generic conversion of mixfix tokens Copyright : Christian Maeder and Uni Bremen 2004 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : experimental Portability : portable generic conversion of mi...
spechub/Hets
Common/ConvertMixfixToken.hs
gpl-2.0
3,749
0
21
1,250
1,375
700
675
79
7
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/AssociateAddress.hs
mpl-2.0
8,033
0
13
1,568
1,046
632
414
118
1