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
-- | Part of this code is from "Report on the Programming Language Haskell", -- version 1.2, appendix C. module Language.Preprocessor.Unlit (unlit) where import Char data Classified = Program String | Blank | Comment | Include Int String | Pre String classify :: [String] -> [Classified] classify []...
alekar/hugs
cpphs/Language/Preprocessor/Unlit.hs
bsd-3-clause
3,350
1
13
1,022
1,363
700
663
50
5
{-# LANGUAGE GADTs #-} -- ToDo: remove -fno-warn-incomplete-patterns {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} module CmmCvt ( cmmOfZgraph ) where import BlockId import Cmm import CmmUtils import qualified OldCmm as Old import OldPprCmm () import Compiler.Hoopl hiding ((<*>), mkLabel, mkBranch) import Data...
mcmaniac/ghc
compiler/cmm/CmmCvt.hs
bsd-3-clause
5,848
0
18
2,183
1,429
713
716
81
11
import Distribution.Simple import System.Process import System.Exit main = defaultMainWithHooks $ simpleUserHooks { postBuild = makeManPage } makeManPage _ _ _ _ = runCommand "make hops.1" >>= waitForProcess >>= exitWith
akc/gfscript
Setup.hs
bsd-3-clause
227
0
7
35
58
31
27
6
1
{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Lens.Setter -- Copyright : (C) 2012-15 Edward Kmett...
Icelandjack/lens
src/Control/Lens/Setter.hs
bsd-3-clause
42,062
0
17
9,602
5,394
3,347
2,047
-1
-1
{- Teak synthesiser for the Balsa language Copyright (C) 2007-2010 The University of Manchester This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or...
Mahdi89/eTeak
src/GuiSupport.hs
bsd-3-clause
32,746
0
27
10,396
8,480
4,218
4,262
640
7
module Spec where import Test.Hspec import Challenge main :: IO () main = hspec $ do describe "Challenge.findTheDifference" $ do it "returns Nothing when no difference" $ do findTheDifference "a" "a" `shouldBe` Nothing it "returns the differing char" $ do findTheDifference "abcd" "adecb" `shoul...
DakRomo/2017Challenges
challenge_5/haskell/halogenandtoast/src/Spec.hs
mit
475
0
15
102
119
57
62
12
1
-- This module implements FIR filters, and compositions of them. -- The generated code looks OK, but the use of `force` leads to different space/time -- characteristics. -- -- In order to fuse filters without forcing the entire intermediate vector, one should use streams -- with a cyclic buffer; see example in the Str...
emwap/feldspar-compiler
benchs/FIR_Fusion.hs
bsd-3-clause
1,761
0
10
345
422
218
204
22
1
-- | -- Module: Control.Wire.Switch -- Copyright: (c) 2013 Ertugrul Soeylemez -- License: BSD3 -- Maintainer: Ertugrul Soeylemez <es@ertes.de> module Control.Wire.Switch ( -- * Simple switching (-->), (>--), -- * Context switching modes, -- * Event-based switching -- **...
jship/metronome
local_deps/netwire/Control/Wire/Switch.hs
bsd-3-clause
8,442
0
19
2,657
2,590
1,354
1,236
152
4
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ms-MY"> <title>Import/Export</title> <maps> <homeID>exim</homeID> <mapref location="map...
kingthorin/zap-extensions
addOns/exim/src/main/javahelp/help_ms_MY/helpset_ms_MY.hs
apache-2.0
959
77
67
155
408
207
201
-1
-1
module RmOneParameter.A2 where import RmOneParameter.D2 sumSq xs ys= sum (map sq xs) + sumSquares xs main = sumSq [1..4]
RefactoringTools/HaRe
test/testdata/RmOneParameter/A2.expected.hs
bsd-3-clause
125
0
8
23
52
27
25
4
1
{-@ LIQUID "--no-termination" @-} module Blank (quickSort, foo, qsort) where -- This is a blank file. {- foo :: xs:[Int] -> {v:[Int] | (len v) = (len xs)} @-} foo :: [Int] -> [Int] foo [] = [] foo (x:xs) = (x+1) : foo [y | y <- xs] {- qsort :: (Ord a) => xs:[a] -> {v:[a] | (len v) <= (len xs)} @-} qsort [] ...
mightymoose/liquidhaskell
tests/pos/comprehensionTerm.hs
bsd-3-clause
792
0
10
240
283
152
131
12
1
module T15005 ( OrderCell, ElementCell, rawAlgorithm, rawAlgorithmWithSize ) where -- Control import Control.Applicative import Control.Monad import Control.Monad.ST -- Data import Data.Word import Data.Bits import Data.STRef type RawOrder s o = STRef s (o s) type RawElement s e = STRef s (e s...
sdiehl/ghc
testsuite/tests/simplCore/should_compile/T15005.hs
bsd-3-clause
7,442
0
23
3,091
1,573
806
767
125
3
import Database.Persist.Postgresql import Database.Persist.Store import Data.Yaml main :: IO () main = do Just yaml <- decodeFile "settings.yaml" conf <- parseMonad loadConfig yaml conf' <- applyEnv (conf :: PostgresConf) pool <- createPoolConfig conf' runPool conf' (return ()) pool
creichert/persistent-postgresql
test-settings.hs
mit
305
0
10
59
102
49
53
10
1
import Test.Tasty import LesserActionSpec import SemiLatticeActionSpec main :: IO () main = defaultMain $ testGroup "all" [ allLesserAction , allSemiLatticeAction ]
blargg/crdt
src-test/Main.hs
isc
209
0
7
65
42
23
19
7
1
module ClipSpaceZSimple where import qualified Matrix4f as M4x4; import qualified Vector4f as V4; clip_z_simple :: M4x4.T -> V4.T -> Float clip_z_simple m eye = let m22 = M4x4.row_column m (2, 2) m23 = M4x4.row_column m (2, 3) in ((V4.z eye) * m22) + m23
io7m/r2
com.io7m.r2.documentation/src/main/resources/com/io7m/r2/documentation/haskell/ClipSpaceZSimple.hs
isc
273
0
12
62
106
61
45
9
1
module Geometry.Vector2d where import Algebra.Vector as Vector import Prelude.Extensions as PreludeExt crossProduct :: Vector -> Vector -> Rational crossProduct = \a b -> let e = Vector.element in ((-) ((*) (e a 0) (e b 1)) ((*) (e a 1) (e b 0))) quadrant :: Vector -> Int quadrant = \vector -> let (x, y...
stevedonnelly/haskell
code/Geometry/Vector2d.hs
mit
1,958
0
16
451
1,034
573
461
47
1
-- Adopted from https://github.com/haskell/hackage-server/blob/master/Distribution/Server/Packages/ModuleForest.hs {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ViewPatterns #-} module Distribution.Package.ModuleForest ( moduleName , moduleForest , ModuleTree(..) , ModuleForest , NameComponent ...
fpco/stackage-server
src/Distribution/Package/ModuleForest.hs
mit
1,425
0
13
307
404
224
180
33
3
module DynamoDbEventStore (streamEventsProducer ,globalEventsProducer ,globalEventKeysProducer ,writeEvent ,readEvent ,buildTable ,doesTableExist ,runGlobalFeedWriter ,RuntimeEnvironment(..) ,GlobalFeedPosition(..) ,RecordedEvent(..) ,StreamId(..) ,EventStoreError(..) ,EventStoreActionError(...
adbrowne/dynamodb-eventstore
dynamodb-eventstore/src/DynamoDbEventStore.hs
mit
3,602
0
13
523
908
503
405
75
3
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.CSSKeyframeRule (setKeyText, getKeyText, getStyle, CSSKeyframeRule(..), gTypeCSSKeyframeRule) wher...
ghcjs/jsaddle-dom
src/JSDOM/Generated/CSSKeyframeRule.hs
mit
1,911
0
10
249
472
290
182
30
1
import Bio.Phylo main = do -- read in a Newick file tree <- parse_file "newick" "test.newick" -- print all of the terminal nodes putStrLn $ show $ terminals tree -- write the tree to a new output file write_file "newick" "output.newick" tree
bendmorris/biophylo
test.hs
mit
296
0
8
96
50
24
26
5
1
{-# LANGUAGE TemplateHaskell #-} -- | Types used during the rendering. module Graphics.Types where import Graphics.Rendering.OpenGL import Cghs.Types.Circle2 import Cghs.Types.Line2 import Cghs.Types.PlaneRegion2 import Cghs.Types.PointVector2 import Cghs.Types.Polygon2 import Cghs.Types.Segment2 import Cghs.Types.T...
nyorem/cghs
viewer/Graphics/Types.hs
mit
1,790
0
8
499
324
192
132
40
1
{-# Language FlexibleContexts #-} {-# Language UndecidableInstances #-} {-# Language GeneralizedNewtypeDeriving #-} -- base import Control.Applicative -- lens import Control.Lens -- linear import Linear -- falling import Falling -- QuickCheck import Test.QuickCheck -- hspec import Test.Hspec instance Arbitrary a => Ar...
startling/falling
test.hs
mit
1,633
0
17
381
552
279
273
37
1
module DiceTool.Random ( randomRCs ) where import System.Random (Random, RandomGen, randomR) randomRCs :: (Random a, RandomGen g) => (a, a) -> Int -> g -> ([a], g) randomRCs r n g | n <= 0 = ([], g) | otherwise = let (x, ng) = randomR r g (rest, fg) = randomRCs r (n-1) ng in (x:rest, fg)
garrettpauls/dicetool
src/DiceTool/Random.hs
mit
318
0
12
87
172
94
78
10
1
module BDD.Util where import BDD.Raw import Control.Exception (finally) -- | Brackets an action that requires a BDD manager with manager -- creation and destruction. withBddMgr :: Int -- ^ the number of variables -> (BddMgr -> IO a) -- ^ the action to run -> IO a withBddMgr nVars act ...
bradlarsen/bdd
hs-bdd/BDD/Util.hs
mit
814
0
11
209
237
116
121
22
1
module P19 where -- | Rotate a list N places to the left. -- >>> rotate ['a','b','c','d','e','f','g','h'] 3 -- "defghabc" -- >>> rotate ['a','b','c','d','e','f','g','h'] (-2) -- "ghabcdef" rotate :: [a] -> Int -> [a] rotate xs n | n == 0 = xs | n > 0 = drop n xs ++ take n xs | n < 0 = drop n' xs ++ take n' xs ...
briancavalier/h99
p19.hs
mit
347
0
8
85
116
59
57
7
1
module Hero where import Nicknames import Data.Char import System.Random import City import Probability import CharacterSheet import BasicNames import FantasyName import FantasyProfession import FantasyRace import Alignment import StringHelpers data Hero = Hero {...
jweissman/heroes
src/Hero.hs
mit
1,626
10
17
464
399
227
172
37
1
module BlocVoting.Bitcoin.Base58 where import qualified Data.ByteString.Base58 as B58 import qualified Network.Haskoin.Crypto as HCrypto (decodeBase58Check) encodeBase58 = B58.encodeBase58 B58.bitcoinAlphabet decodeBase58Check = HCrypto.decodeBase58Check
XertroV/blocvoting
src/BlocVoting/Bitcoin/Base58.hs
mit
259
0
6
25
49
32
17
5
1
-- | Author : John Allard -- | Date : Feb 19th 2016 -- | Class : CMPS 112 UCSC -- | I worked alone, no partners to list. -- | Homework #4 |-- {-# LANGUAGE FlexibleInstances, OverlappingInstances, UndecidableInstances #-} import Data.Char import Data.List import Data.Int import System.Random -- | 1. The following...
jhallard/WinterClasses16
CS112/hw/hw4/hw4.hs
mit
5,201
8
12
1,540
1,110
591
519
61
2
module XBattBar.Backend (getCharge, getPower, Power(..)) where data Power = AC | Battery deriving (Show) -- | retrieves battery charge getCharge :: IO Double getCharge = getChargeLinux -- | retrieves power status getPower :: IO Power getPower = getPowerLinux -- | get charge from ACPI on linux getCharge...
polachok/xbattbar
src/XBattBar/Backend.hs
mit
856
0
10
204
218
112
106
22
2
module Font (withFontTexture, drawText) where import Data.Word (Word8, Word32) import Data.Bits (shiftL, shiftR, (.&.)) import Data.Char (ord) import qualified Foreign.Marshal.Array (withArray) import qualified Data.Vector.Unboxed as VU import qualified Graphics.Rendering.OpenGL as GL import qualified Graphics.Render...
blitzcode/rust-exp
hs-src/Font.hs
mit
11,624
0
25
2,426
2,991
1,840
1,151
154
2
{-# LANGUAGE DoAndIfThenElse , FlexibleContexts , OverloadedStrings , RecordWildCards #-} module CreateSendAPI.V3.List.Webhooks where import Control.Applicative ((<$>), (<*>)) import Control.Monad.IO.Class (MonadIO) import Data.Aeson (FromJSON (parseJSON), Value (Object), ...
pavpen/createsend-haskell
src/CreateSendAPI/V3/List/Webhooks.hs
gpl-2.0
4,893
101
18
1,095
1,403
801
602
115
4
main = do return () return "Hahaha" line <- getLine return "Blah blah blah" return 4 putStrLn line
softwaremechanic/Miscellaneous
Haskell/6.hs
gpl-2.0
111
0
8
30
45
17
28
7
1
{-# LANGUAGE FlexibleContexts, GeneralizedNewtypeDeriving #-} -- Haskell Music Player, client for the MPD (Music Player Daemon) -- Copyright (C) 2011 Ivan Vitjuk <v@iv.id.au> -- 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...
ivitjuk/Haskell-Music-Player
src/HMP.hs
gpl-3.0
1,599
0
11
371
269
148
121
25
1
module Interface.Peer.Behavior where import Interface.Peer.Handler import HTorrentPrelude import Peer.State import qualified Graphics.UI.Threepenny as UI import Graphics.UI.Threepenny.Core import Network.Socket import Reactive.Threepenny data PeerStateB = PeerStateB { _interestedB :: Behavior Bool, _chokedB ...
ian-mi/hTorrent
Interface/Peer/Behavior.hs
gpl-3.0
2,110
0
12
438
554
296
258
-1
-1
{-# OPTIONS_GHC -XNoMonomorphismRestriction #-} module Strategies where import Pattern import Dirt import Data.Ratio import Control.Applicative echo n p = combine [p, n ~> p] double f p = combine [p, f p] -- every 4 (smash 4 [1, 2, 3]) $ sound "[odx sn/2 [~ odx] sn/3, [~ hh]*4]" smash n xs p = cat $ map (\n -> slo...
yaxu/smooth
Strategies.hs
gpl-3.0
834
0
13
186
350
183
167
17
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-storage/gen/Network/Google/Resource/Storage/ObjectAccessControls/Delete.hs
mpl-2.0
4,611
0
17
1,058
572
338
234
87
1
{-# LANGUAGE OverloadedStrings #-} module CountdownGame.Database ( createPool , initializeDatabase , addPlayer , updatePlayer , getPlayer , checkPlayer , getPlayers , getPlayersMap , insertChallange , setPlayerScore , getHighscores ...
CarstenKoenig/DOS2015
CountdownGame/src/web/CountdownGame/Database.hs
unlicense
4,113
0
18
896
1,449
738
711
104
3
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Bantam.Service.View.Fight ( fightView , matchesView , lemmaView , lemmaReadView , reviewView ) where import Bantam.Service.Data import Bantam.Service.Data.Fight import Bantam.Service.Path import ...
charleso/bantam
bantam-service/src/Bantam/Service/View/Fight.hs
unlicense
4,502
0
27
1,687
1,474
717
757
140
5
import Data.List f x@([d,v]:_) = sum $ g $ sortBy s x where s [a0,a1] [b0,b1] = let c0 = compare a0 b0 c1 = compare b1 a1 in if c0 /= EQ then c0 else c1 g [] = [] g ([d,v]:x) = let r = dropWhile (\ [d',v'] -> d == d' ) x in v:(g r) ans ([0,0]:...
a143753/AOJ
2823.hs
apache-2.0
542
1
14
228
347
176
171
22
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeFamilies #-} module TypeFam where import Data.Kind (Type) import GHC.TypeNats (Nat) -- - @Foo defines/binding FamFoo -- - @n defines/binding _ -- - @Nat ref _ -- - @Type ref _ type family Foo (n :: Nat) :: Type -- It'd be nice to have the f...
google/haskell-indexer
kythe-verification/testdata/basic/TypeFam.hs
apache-2.0
1,346
0
6
246
102
80
22
9
0
-- | -- Module : Main -- Copyright : (c) 2011 Kevin Cantu -- -- License : BSD3 -- Maintainer : Kevin Cantu <me@kevincantu.org> -- Stability : experimental -- -- A program to clear out old Twitter favorites module Main (main) where import Control.Monad (when) import Data.Time.Clock (addUTCTime, getCurre...
killerswan/twitter-unfav
Main.hs
bsd-2-clause
5,073
0
15
1,549
1,287
687
600
100
2
{-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DefaultSignatures #-} module Data.Authenticated (Prover, Verifier, AuthM, Auth, runProver, runVerifier, Digestible(..), Authentica...
derekelkins/ads
Data/Authenticated.hs
bsd-2-clause
3,269
0
15
753
1,174
616
558
-1
-1
import Yesod.Default.Config (fromArgs) import Yesod.Default.Main (defaultMain) import Application (withCms) main :: IO () main = defaultMain fromArgs withCms
snoyberg/yesodcms
main.hs
bsd-2-clause
170
0
6
30
51
29
22
5
1
module DayOfTheWeek where data DayOfTheWeek = Mon | Tue | Wed | Thu | Fri | Sat | Sun -- Let's omit the last case to break this instance Eq DayOfTheWeek where (==) Mon Mon = True (==) Tue Tue = True (==) Wed Wed = True (==) Thu Thu = True (==) Fri Fri = True (==) Sat Sat = True (==) S...
OCExercise/haskellbook-solutions
chapters/chapter06/scratch/dayoftheweek_broken.hs
bsd-2-clause
358
0
6
112
123
74
49
11
0
module Main where import Drasil.SWHS.Generate (generate) main :: IO () main = generate
JacquesCarette/literate-scientific-software
code/drasil-example/Drasil/SWHS/Main.hs
bsd-2-clause
89
0
6
15
30
18
12
4
1
module Main where import RunIdea import Options.Applicative import Data.Maybe import Data.Text data CommandLineArgs = CommandLineArgs { maybeJavaVersion :: Maybe JavaVersion , maybeIdeaVersion :: Maybe IdeaVersion , gwbArgs :: [Text] } main :: IO () main = do args <- execParser $ info commandLin...
DPakJ989/d-env
app/Main.hs
bsd-3-clause
1,541
0
10
328
460
242
218
37
3
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ScopedTypeVariables #-} module VDPT.Parser ( traceTreeParser , parseIntoEither , module VDPT.Types ) whe...
danidiaz/vdpt
library/VDPT/Parser.hs
bsd-3-clause
3,125
0
16
575
1,030
536
494
60
1
module Talks.Free.Demo where import Talks.Free runbletch :: Int runbletch = bletch 5
markhibberd/fp-syd-free
demo/Talks/Free/Demo.hs
bsd-3-clause
87
0
5
14
25
15
10
4
1
-- Exercises/Ch2/Pt1/Ex5.hs module Ex5 where -- Exercise 5 -- Add a `Character` constructor to `LispVal`, and create a parser for character -- literals as defined in R5RS. import Data.Char (digitToInt, isSpace) import Control.Monad import Numeric import System.Environment import Text.Parse...
EFulmer/haskell-scheme-wikibook
src/Exercises/Ch2/Pt1/Ex5.hs
bsd-3-clause
3,143
0
16
868
870
432
438
82
2
module Atomo.Parser.Expr where import Control.Monad.State import Data.Maybe (fromJust) import Text.Parsec import Atomo.Parser.Base import Atomo.Pattern import Atomo.Types hiding (keyword, option, particle, string) import qualified Atomo.Types as T -- | The default precedence for an operator (5). defaultPrec :: Inte...
vito/atomo
src/Atomo/Parser/Expr.hs
bsd-3-clause
11,410
0
24
3,104
3,239
1,647
1,592
-1
-1
module Web.ApiAi.Responses.Core where import ClassyPrelude import Data.Aeson data ResponseErrorType = ResponseSuccess | ResponseErrorType Text deriving Show instance FromJSON ResponseErrorType where parseJSON = withText "ResponseErrorType" $ return . errt where errt "success" = ResponseSuccess ...
CthulhuDen/api-ai
src/Web/ApiAi/Responses/Core.hs
bsd-3-clause
1,083
0
15
487
175
96
79
18
0
{-# LANGUAGE TypeApplications #-} module Database.PostgreSQL.PQTypes.SQL ( SQL , mkSQL , sqlParam , (<?>) , isSqlEmpty ) where import Control.Concurrent.MVar import Data.Monoid import Data.String import Foreign.Marshal.Alloc import TextShow import qualified Data.ByteString.Char8 as BS import qualified Da...
scrive/hpqtypes
src/Database/PostgreSQL/PQTypes/SQL.hs
bsd-3-clause
3,000
0
24
608
904
499
405
-1
-1
{-# LANGUAGE FlexibleContexts #-} module Error ( module Error , Identity (..) , lift ) where import Util import Control.Applicative import Control.Monad.Trans.Class import Data.Functor.Identity newtype ErrorT m a = ErrorT { runErrorT :: m (Either String a) } instance Functor m => Functor (ErrorT m) whe...
kylcarte/wangtiles
src/Error.hs
bsd-3-clause
2,554
0
12
593
1,170
587
583
59
2
{-# LANGUAGE DataKinds, KindSignatures, TypeFamilies #-} module Main (main) where import Test.QuickCheck import Data.Hot.Pidgin import Control.Monad (replicateM) import Data.List (sort) import Data.Proxy (Proxy (Proxy)) import GHC.Exts (IsList, Item) import GHC.TypeLits (KnownNat, Nat, natVal) main :: IO () main ...
tserduke/hot
test/PidginProp.hs
bsd-3-clause
867
0
14
169
351
186
165
22
1
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-} module Main where import Control.Applicative ((<$>),(<|>)) import Control.Monad (guard) import Control.Monad.Trans (MonadIO(liftIO)) import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as BSC import qualified Dat...
deadfoxygrandpa/Elm
server/Server.hs
bsd-3-clause
4,249
0
14
903
981
519
462
89
4
{-# LANGUAGE FlexibleContexts, FlexibleInstances, UndecidableInstances #-} -- Pure Haskell implementation of standard BFGS algorithm with cubic -- line search, with the BFGS step exposed to provide access to -- intermediate Hessian estimates. module Math.Probably.BFGS ( BFGSOpts (..) , LineSearchOpts (....
glutamate/probably
Math/Probably/BFGS.hs
bsd-3-clause
10,481
0
23
3,129
3,235
1,759
1,476
171
10
{-# LANGUAGE MultiParamTypeClasses, TypeOperators #-} module SeqZip where import Data.Monoid import Data.List.Split import qualified Data.Sequence as S import Control.Applicative import Control.Monad.State import Control.Comonad import Debug.Trace data b :>: a = b :>: a deriving (Show, Eq, Ord) ...
nsmryan/Misc
src/SeqZip.hs
bsd-3-clause
1,587
0
16
428
822
441
381
41
2
{-# LANGUAGE Rank2Types, BangPatterns, ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | -- Module : Numeric.AD.Halley -- Copyright : (c) Edward Kmett 2010 -- License : BSD3 -- Maintainer : ekmett@gmail.com -- Stability : experimental -- Portab...
yairchu/ad
src/Numeric/AD/Halley.hs
bsd-3-clause
3,334
0
14
611
565
328
237
27
2
{-# LANGUAGE RecordWildCards #-} module Sound.Sequencer.Vty where import Sound.Sequencer.Editor import Sound.Sequencer.Sequencer import Data.Char import Data.Maybe import Graphics.Vty import Control.Monad rootImage :: Editor -> Int -> Image rootImage Editor{..} h = renderPatternList Editor{..} ...
riottracker/sequencer
src/Sound/Sequencer/Vty.hs
bsd-3-clause
4,153
0
20
1,344
1,638
819
819
76
15
{-# LANGUAGE ConstraintKinds , EmptyDataDecls , FlexibleContexts , FlexibleInstances , FunctionalDependencies , GADTs , MultiParamTypeClasses , OverloadedStrings , UndecidableInstances , ScopedTypeVariables , I...
krisajenkins/esqueleto
src/Database/Esqueleto/Internal/Sql.hs
bsd-3-clause
60,682
0
18
15,836
19,533
10,810
8,723
-1
-1
{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-} {-# OPTIONS -fglasgow-exts -cpp #-} ----------------------------------------------------------------------------- -- | -- Module : Language.Haskell.Parser -- Copyright : (c) Simon Marlow, Sven Panne 1997-2000 -- License : BSD-style (see the file libraries...
emcardoso/CTi
src/Haskell/Parser/Parser.hs
bsd-3-clause
252,819
7,858
72
34,797
74,501
40,538
33,963
-1
-1
module Graphics.Pastel.XPM.Draw ( drawXPM ) where import Graphics.Pastel import Numeric import Data.Maybe import Data.List import Data.Array hexOut :: Int -> Int -> String hexOut l x = (replicate padLen '0') ++ hex where padLen = l - length hex hex = showHex x "" drawXPM :: (Int, Int) -> Drawing -> St...
willdonnelly/pastel
Graphics/Pastel/XPM/Draw.hs
bsd-3-clause
892
0
12
223
333
181
152
20
1
-- E2.hs {-# OPTIONS_GHC -Wall #-} module Euler.E002 ( e002 ) where e002 :: Integer e002 = sum $ filter even (fibsUnder 4000000 []) where fibsUnder :: Integer -> [Integer] -> [Integer] fibsUnder n [] = fibsUnder n [1] fibsUnder n [x] = fibsUnder n (2:[x]) fibsUnder n (x:xs) | x + (head xs) >...
ghorn/euler
Euler/E002.hs
bsd-3-clause
392
0
14
104
196
104
92
10
3
{-# LANGUAGE QuasiQuotes #-} -- | A somewhat fancier example demonstrating the use of Abstract Predicates and exist-types import LiquidHaskell ------------------------------------------------------------------------- -- | Data types --------------------------------------------------------- ----------------------...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/ex1.hs
bsd-3-clause
2,623
0
9
576
348
198
150
23
1
module Chess where import Data.List import Data.String.ToString import Data.Sequence hiding (replicate) data ChessmanType = Pawn | Bishop | Knight | Castle | Queen | King data Placeholder = Free | Line data C...
apischan/hs-chess
src/Chess.hs
bsd-3-clause
2,036
0
14
582
552
303
249
48
2
{-# LANGUAGE TemplateHaskell #-} -- | Code snippets used by the Python backends. module Futhark.CodeGen.RTS.Python ( memoryPy, openclPy, panicPy, scalarPy, serverPy, tuningPy, valuesPy, ) where import Data.FileEmbed import qualified Data.Text as T -- | @rts/python/memory.py@ memoryPy :: T...
diku-dk/futhark
src/Futhark/CodeGen/RTS/Python.hs
isc
981
0
7
139
187
110
77
25
1
{-# LANGUAGE DerivingVia #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} module Database.Persist.Compatible.TH ( makeCompatibleInstances , makeCompatibleKeyInstances ) where import Data.Aeson import Database.Persist.Class ...
yesodweb/persistent
persistent/Database/Persist/Compatible/TH.hs
mit
7,439
0
18
1,856
454
259
195
-1
-1
-- Copyright (C) 2017 Red Hat, Inc. -- -- This library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- -- This library i...
atodorov/bdcs
src/tests/BDCS/DepsolveSpec.hs
lgpl-2.1
9,452
42
41
3,584
2,212
1,159
1,053
140
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE CPP #-} module Web.Twitter.Conduit.Cursor ( CursorKey (..) , IdsCursorKey , UsersCursorKey , ListsCursorKey , WithCursor (..) ) where import Control.Applicativ...
johan--/twitter-conduit
Web/Twitter/Conduit/Cursor.hs
bsd-2-clause
2,094
0
13
433
298
180
118
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Language.Python.Common.PrettyToken -- Copyright : (c) 2009 Bernie Pope -- License : BSD-style -- Maintainer : bjpop@csse.unimelb.edu.au -- Stability : experimental -- Portability : ghc -- -- Pretty printing of...
jml/language-python
src/Language/Python/Common/PrettyToken.hs
bsd-3-clause
5,158
0
11
1,612
1,420
674
746
111
0
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Distribution.Server.Util.Histogram where import Data.Map (Map) import qualified Data.Map as Map import Data.List (delete, sortBy) import Data.Ord (comparing) import Control.DeepSeq -- | Histograms are intended to keep track of an integer attribute related -- to a co...
isomorphism/hackage2
Distribution/Server/Util/Histogram.hs
bsd-3-clause
2,077
0
13
425
816
422
394
44
4
{-# LANGUAGE TypeFamilies #-} {-# OPTIONS -Wall #-} data Duo a = Duo a a deriving(Eq,Ord,Read,Show) data Trio a = Trio a a a deriving(Eq,Ord,Read,Show) data Index2 = Index2 Int deriving(Eq,Ord,Read,Show) data Index3 = Index3 Int deriving(Eq,Ord,Read,Show) data Axis v = Axis Int deriving(Eq,Ord,Read,Show) class Ve...
nushio3/Paraiso
attic/Traversable/FootTestFamilyless.hs
bsd-3-clause
1,205
0
16
314
645
318
327
39
1
-- -- Data vault for metrics -- -- Copyright © 2013-2014 Anchor Systems, Pty Ltd and Others -- -- The code in this file, and the program it is a part of, is -- made available to you by its authors as open source software: -- you can redistribute it and/or modify it under the terms of -- the 3-clause BSD licence. -- {-...
anchor/vaultaire
src/Inspect.hs
bsd-3-clause
8,021
0
16
2,739
1,648
840
808
-1
-1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="hi-IN"> <title>Advanced SQLInjection Scanner</title> <maps> <homeID>sqliplugin</homeID> ...
kingthorin/zap-extensions
addOns/sqliplugin/src/main/javahelp/help_hi_IN/helpset_hi_IN.hs
apache-2.0
981
77
66
157
409
207
202
-1
-1
{-# LANGUAGE TransformListComp #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE Rank2Types #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Backends.Html.Decl -- Copyright : (c) Simon Marlow 2003-2006, -- David Waern 2006-2009, ...
niteria/haddock
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
bsd-2-clause
43,362
0
22
11,553
12,801
6,465
6,336
711
9
<?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="en-GB"> <title>Custom Payloads Add-on</title> <maps> <homeID>custompayloads</hom...
thc202/zap-extensions
addOns/custompayloads/src/main/javahelp/org/zaproxy/zap/extension/custompayloads/resources/help/helpset.hs
apache-2.0
991
81
68
170
423
216
207
-1
-1
{-# LANGUAGE ForeignFunctionInterface #-} module Static001 where foreign export ccall f :: Int -> Int f :: Int -> Int f n = n + 1
urbanslug/ghc
testsuite/tests/driver/Static001.hs
bsd-3-clause
130
0
6
26
40
23
17
5
1
module Main where import Data.List import Data.Map (Map) import qualified Data.Map as Map import qualified Data.Set as Set data Edge = Edge String String deriving (Eq, Ord) edge :: String -> String -> Edge edge a b | a < b = Edge a b | otherwise = Edge b a edgeToList :: Edge -> [String] edgeToList (Edge a...
glguy/advent2015
Day13.hs
isc
1,541
1
15
349
629
338
291
39
3
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-} module Y2017.M06.D15.Solution where import Data.Monoid ((<>)) {-- Today's Haskell problem comes by way of @aisamanra, Mr. Lists-are-Mu-functions- in-the-function-of-Mus. For, as we all know: 'Mus' is the plural of 'Mu.' Deep thoughts, from geophf, the Muse. ...
geophf/1HaskellADay
exercises/HAD/Y2017/M06/D15/Solution.hs
mit
3,060
15
9
688
705
369
336
35
1
{-#LANGUAGE OverloadedStrings#-} module Yesod.Raml.Routes ( parseRamlRoutes , parseRamlRoutesFile , routesFromRaml , toYesodRoutes ) where import Yesod.Raml.Routes.Internal
junjihashimoto/yesod-raml
yesod-raml/Yesod/Raml/Routes.hs
mit
177
0
4
20
29
20
9
7
0
import Data.List numbers :: [Integer] numbers = [1500, 1765, 2364, 3345, 3700, 5934, 8313] batches :: [Integer] -> [[Integer]] batches xs = filter (not . null) . map (\(x, y) -> filter (\a -> a >= x && a < y) xs) . emptyBuckets $ xs emptyBuckets :: [Integer] -> [(...
adsmit14/haskell
Sandbox/bucketRanges.hs
mit
484
0
16
180
209
120
89
13
1
module Verifier (Result(..), Type(..), verify) where import Control.Exception.Base (handleJust) import Control.Monad.IO.Class (MonadIO, liftIO) import qualified Data.ByteString as BS (readFile) import Data.Digest.CRC32 (crc32) import Data.Functor ((<$>)) import Data.Word (Word32) import System.IO.Error (isDoesNotExist...
asvanberg/hsfv
Verifier.hs
mit
834
0
12
151
275
158
117
24
3
module Hafer.Export.Common.Dot ( module Hafer.Export.Common.Dot ) where -- ########################################################################## -- # Constants -- ########################################################################## cGRAPH_START = "digraph G {" cGRAPH_END = "}" cGENERAL_CONFIG = "fontnam...
ooz/Hafer
src/Hafer/Export/Common/Dot.hs
mit
1,180
0
8
217
255
140
115
28
7
-- Problems/Problem040Spec.hs module Problems.Problem040Spec (main, spec) where import Test.Hspec import Problems.Problem040 main :: IO() main = hspec spec spec :: Spec spec = describe "Problem 40" $ it "Should evaluate to 210" $ p40 `shouldBe` 210
Sgoettschkes/learning
haskell/ProjectEuler/tests/Problems/Problem040Spec.hs
mit
264
0
8
51
73
41
32
9
1
-- Sum of Odd Cubed Numbers -- https://www.codewars.com/kata/580dda86c40fa6c45f00028a module OddCubed.JorgeVS.Kata where oddCubed :: [Int] -> Int oddCubed = sum . map (^3) . filter odd
gafiatulin/codewars
src/7 kyu/OddCubed.hs
mit
187
0
8
27
44
26
18
3
1
module Hickory.Graphics.Debug ( debugShape, debugShapeId, grabDebug, clearDebug, DebugShape(..), module Hickory.Color ) where import System.IO.Unsafe import Data.IORef import Hickory.Math.Vector import Hickory.Color import Linear (V3) data DebugShape = DebugVector (V3 Scalar) ...
asivitz/Hickory
Hickory/Graphics/Debug.hs
mit
1,296
0
12
392
478
262
216
41
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeSynonymInstances #-} module IHaskell.Display.Widgets.Output ( -- * The Output Widget OutputWidget, -- * Constructor mkOutputWidget, -- * Using the output widget appendOutput, cl...
sumitsahrawat/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Output.hs
mit
2,128
0
11
441
386
202
184
45
1
{-# LANGUAGE IncoherentInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Jira.API.Types.Project where import Jira.API.Types.Avatar import Jira.API.Types.Classes import Control.Applicative import Control.Lens (makeLenses) i...
dsmatter/jira-api
src/Jira/API/Types/Project.hs
mit
1,194
0
15
415
277
154
123
31
0
module MAL.Types ( module MAL.Types.Common , module MAL.Types.Anime , module MAL.Types.Manga ) where import MAL.Types.Common import MAL.Types.Anime import MAL.Types.Manga
nyorem/skemmtun
src/MAL/Types.hs
mit
189
0
5
37
47
32
15
7
0
module Main where import qualified Web.MarkovBot.Main as MarkovBot main :: IO () main = MarkovBot.main
mgaut72/MarkovChain
markov-bot/Main.hs
mit
104
0
6
16
30
19
11
4
1
import Test.QuickCheck ------------------------------------------------------------------------------- -- Ejercicio 2 - intercambia ------------------------------------------------------------------------------- intercambia :: (a,b) -> (b,a) intercambia (a,b) = (b,a) ----------------------------------------...
Nachox07/ED-Haskell-Java
Practicas/QuickCheck/QuickCheck.hs
mit
3,825
0
15
940
1,146
641
505
-1
-1
module Algebraic.Nested.Roll where import Algebraic.Nested.Type import Algebraic.Nested.Op import Autolib.Pick import Autolib.ToDoc import qualified Data.Set as S import System.Random import Control.Applicative ((<$>)) roll :: Ord a => [a] -> Int -> IO (Type a) roll base size = if size < 1 then do action <...
marcellussiegburg/autotool
collection/src/Algebraic/Nested/Roll.hs
gpl-2.0
567
0
12
148
234
122
112
19
2
{-# LANGUAGE DeriveDataTypeable, TemplateHaskell #-} module Baum.Such.Config where import Autolib.ToDoc import Autolib.Reader import Data.Typeable data Config a = -- use phantom type for baum Config { start_size :: Int , min_key :: a , max_key :: a , fixed_insert_ops :: Int , fixed_dele...
Erdwolf/autotool-bonn
src/Baum/Such/Config.hs
gpl-2.0
675
6
9
168
169
105
64
24
1
module InferenceSpec (spec) where import Test.Hspec import Language.Inference.Syntax import Language.Inference.Semantics import Data.Either spec :: Spec spec = do describe "infering types" $ do -- TODO: these tests are brittle due to the explicit numbering it "should infer the identi...
robertclancy/tapl
inference/tests/InferenceSpec.hs
gpl-2.0
2,301
0
28
703
780
375
405
36
1
-- Euler discovered the remarkable quadratic formula: -- -- n² + n + 41 -- -- It turns out that the formula will produce 40 primes for the consecutive values n = 0 to 39. However, when n = 40, 402 + 40 + 41 = 40(40 + 1) + 41 is divisible by 41, and certainly when n = 41, 41² + 41 + 41 is clearly divisible by 41. -- ...
ciderpunx/project_euler_in_haskell
euler027.hs
gpl-2.0
1,806
0
12
400
379
219
160
19
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Model.Event ( Event (..) ) where import Data.Aeson import GHC.Generics import Test.QuickCheck import Model.Number data Event = Event ...
massimo-zaniboni/netrobots
robot_examples/haskell-servant/rest_api/lib/Model/Event.hs
gpl-3.0
539
0
8
98
111
65
46
19
0
{-# LANGUAGE Arrows, OverloadedStrings, LambdaCase #-} module Utils.Yukari.Parser (parsePage, parseYenPage) where import Control.Applicative import Control.Lens hiding (deep) import qualified Data.Attoparsec.Text as A import Data.Char import Data.List import Data.May...
Fuuzetsu/yukari
src/Utils/Yukari/Parser.hs
gpl-3.0
11,360
3
19
3,589
3,880
1,976
1,904
-1
-1
module Sound.Tidal.Config where {- Config.hs - For default Tidal configuration values. Copyright (C) 2020, Alex McLean and contributors This library 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 Founda...
bgold-cosmos/Tidal
src/Sound/Tidal/Config.hs
gpl-3.0
1,682
0
8
655
142
93
49
20
1
{-# 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.ServiceNetw...
brendanhay/gogol
gogol-servicenetworking/gen/Network/Google/ServiceNetworking/Types/Product.hs
mpl-2.0
274,459
0
37
61,773
41,816
24,372
17,444
4,594
1
{-# LANGUAGE TupleSections #-} -- | create handlers for menu actions. module Jaek.UI.MenuActionHandlers ( createHandlers ,newHandler ,openHandler ,saveHandler ,importHandler ,renderHandler ,zoomInHandler ,zoomOutHandler ,copyHandler ,deleteHandler ,insertHandler ,muteHandler ,module Jaek.UI.FrpHandlers )...
JohnLato/jaek
src/Jaek/UI/MenuActionHandlers.hs
lgpl-3.0
4,997
0
25
977
1,377
679
698
119
4