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
-- odds :: Int -> [Int] -- returns the first n odds odds n = map f [0..n-1] where f x = x * 2 + 1 -- defined using lambda notation odds n = map (\ x -> x * 2 + 1) [0..n-1]
calebgregory/fp101x
wk2/odds.hs
mit
176
6
9
49
96
43
53
3
1
import Data.List import Network import System.IO import Control.Monad.Reader import System.Exit import Control.Exception import Text.Printf import Text.Regex.Posix server = "irc.esper.net" port = 6667 chan = "#gamocosm" nick = "hmmmbot" putStrLnStderr :: String -> IO () putStrLnStderr str = hPutStrLn stderr str main...
Raekye/irc-bot-history
ibh.hs
mit
1,774
7
15
358
804
368
436
59
2
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.NavigatorUserMediaErrorCallback (newNavigatorUserMediaErrorCallback, newNavigatorUserMediaErrorCallbackSy...
ghcjs/jsaddle-dom
src/JSDOM/Generated/NavigatorUserMediaErrorCallback.hs
mit
3,050
0
13
753
561
335
226
51
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.Storage (js_key, key, js_getItem, getItem, js_setItem, setItem, js_removeItem, removeItem, js_clear, clear, js_getLength, getLength, Storage, castToStorage, gTypeStorage) where import...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/Storage.hs
mit
3,381
46
11
530
915
515
400
56
1
module Main where import Data.List import Control.Monad import Control.Applicative import System.IO main = do ls <- lines <$> readFile "../JavaScript/JQuery/UI/Internal.hs" h <- openFile "../JavaScript/JQuery/UI/nonghcjs.txt" WriteMode forM_ ls $ \l -> do let sig = filter ("jq_" `isPrefixOf`) (tails l) ...
co-dan/ghcjs-jqueryui
util/genNonGhcjs.hs
mit
549
0
21
137
195
96
99
17
2
-- -*- mode: haskell -*- {-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-} module SAT.State where -- $Id$ import SAT.Types import Autolib.ToDoc import Autolib.Reader import Autolib.Set import qualified Autolib.Relation as Relation import Autolib.FiniteMap data State = State { assignment :: Belegung --...
Erdwolf/autotool-bonn
src/SAT/State.hs
gpl-2.0
824
5
10
179
156
101
55
20
0
module Main where import System.Environment(getArgs) primes :: [Int] primes = sieve [2..] where sieve (p:xs) = p : sieve [ x | x <- xs, x `mod` p /= 0 ] countPrimes :: Int -> Int -> Int countPrimes lower upper = length $ takeWhile (<= upper) $ dropWhile (< lower) $ primes processLine :: String -> String pro...
cryptica/CodeEval
Challenges/63_CountingPrimes/main.hs
gpl-3.0
561
0
12
133
244
126
118
17
1
{-# LANGUAGE NamedFieldPuns, BangPatterns #-} module Runtime.PID ( PID , Message(..) , writePID , readPID , tID, newPID, forkPID) where import Control.Concurrent import Control.Concurrent.STM import Data.Map.Strict (Map) import Name import Runtime.Hole data PID obj = PID {q :: TQueue (Message obj), tID :...
antarestrader/sapphire
Runtime/PID.hs
gpl-3.0
890
0
13
202
387
204
183
34
1
----------------------------------------------------------------------------- -- | -- Module : Hoodle.Widget.Clock -- Copyright : (c) 2013 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> -- Stability : experimental -- Portability : GHC -- -- Clock widget drawing and acti...
wavewave/hoodle-core
src/Hoodle/Widget/Clock.hs
gpl-3.0
5,455
0
22
1,677
1,474
771
703
106
3
----------------------------------------------------------------------------- -- | -- Module : Data.Packed.Static.Imports -- Copyright : (c) Reiner Pope 2008 -- License : GPL-style -- -- Maintainer : Reiner Pope <reiner.pope@gmail.com> -- Stability : experimental -- Portability : portable -- -- Usef...
reinerp/hmatrix-static
Data/Packed/Static/Imports.hs
gpl-3.0
826
0
5
131
112
81
31
14
0
module QFeldspar.Nat.TH where import QFeldspar.MyPrelude import Language.Haskell.TH.Syntax nat :: Word32 -> String -> Q Exp nat 0 p = do Just nm <- lookupValueName (p ++ "Zro") return (ConE nm) nat n p = do Just nm <- lookupValueName (p ++ "Suc") AppE (ConE nm) <$> (nat (n - 1) p) natP :: W...
shayan-najd/QFeldspar
QFeldspar/Nat/TH.hs
gpl-3.0
783
0
11
242
385
185
200
19
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/Subnetworks/Insert.hs
mpl-2.0
3,652
0
16
869
470
281
189
73
1
import System.Random main = do putStr . show =<< randomRIO (0, 100 :: Int) putStr ", " print =<< randomRIO (0, 100 :: Int) print =<< (randomIO :: IO Float) f1 <- randomIO :: IO Float putStr $ show (f1 * 5 + 5) ++ ", " f2 <- randomIO :: IO Float print $ f2 * 5 + 5 let s1 ...
daewon/til
haskell/haskell_by_example/random_number.hs
mpl-2.0
628
0
12
210
327
161
166
18
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-glacier/gen/Network/AWS/Glacier/ListVaults.hs
mpl-2.0
6,329
0
12
1,325
711
433
278
76
1
{- | Pipelining is sending multiple requests over a socket and receiving the responses later in the same order (a' la HTTP pipelining). This is faster than sending one request, waiting for the response, then sending the next request, and so on. This implementation returns a /promise (future)/ response for each request ...
mongodb/mongoDB-haskell
System/IO/Pipeline.hs
apache-2.0
4,966
20
14
893
894
454
440
67
4
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PolyKinds #-} module Data.Cont...
wdanilo/container
src/Data/Container/Opts.hs
apache-2.0
6,535
0
12
2,012
2,009
1,116
893
-1
-1
import Data.List (elemIndex) import Data.Maybe (fromJust) collatz :: Integer -> [Integer] collatz n = if n == 1 then [n] else if even n then [n] ++ collatz (quot n 2) else [n] ++ collatz (3*n+1) findMaximum :: [Int] -> Int findMaximum lst = let the...
ulikoehler/ProjectEuler
Euler14.hs
apache-2.0
589
0
12
191
214
110
104
16
3
import Data.List (nub, subsequences, map) import Data.Set (Set) import qualified Data.Set as Set import Data.Map (Map, fromSet, (!)) type State = Set Int type Flips = Set Int type GraphState = Set State type M = Map State State -- Map that sends states to their canonical representation -- Maybe use compositions inste...
peterokagey/haskellOEIS
src/Sandbox/OpenishProblems/Problem79.hs
apache-2.0
1,844
0
11
331
566
310
256
28
1
module Calculus.Opra10 ( module Calculus.Opra , Opra10(..) ) where -- standard modules -- local modules import Basics import Calculus.Opra data Opra10 = Opra10_0_0 | Opra10_0_1 | Opra10_0_2 | Opra10_0_3 | Opra10_0_4 | Opra10_0_5 | Opra10_0_6 | Opra10_0_7 | Opra10_0...
spatial-reasoning/zeno
src/Calculus/Opra10.hs
bsd-2-clause
30,136
0
6
8,891
5,074
3,365
1,709
429
0
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, BangPatterns #-} module Main ( main ) where import Common import Channels import BuggyLazyEvaluation import qualified Optimizations as Optimizations import Control.DeepSeq import System.Random import Data.List as L import qualified Data.Vector.Unboxed as BV i...
massimo-zaniboni/threads-post
src/Main.hs
bsd-2-clause
6,369
0
20
2,131
1,556
741
815
116
13
module Main where import Haggis.Parser import Haggis.Checker import Haggis.Interpreter main :: IO () main = undefined
sivawashere/haggis
src/Main.hs
bsd-2-clause
119
0
6
17
34
20
14
6
1
{-# LANGUAGE RankNTypes, RecordWildCards, FlexibleInstances #-} -- Example of using device-check import Test.DeviceCheck import Control.Concurrent import Data.Monoid import Control.Monad main = do v_in <- newEmptyMVar v_out <- newEmptyMVar let loop :: Int -> IO () loop n = do i <...
ku-fpg/device-check
example/Main.hs
bsd-3-clause
3,555
0
16
1,492
1,134
561
573
86
4
{-# LANGUAGE OverloadedStrings #-} import System.IO import Text.XML.Pipe import Network import HttpPullTlsCl main :: IO () main = do h <- connectTo "localhost" $ PortNumber 443 testPusher (undefined :: HttpPullTlsCl Handle) (One h) (HttpPullTlsClArgs "localhost" 443 "/" (XmlNode (nullQ "poll") [] [] []) pendi...
YoshikuniJujo/forest
subprojects/xml-push/testHttpPullTlsCl.hs
bsd-3-clause
839
4
13
155
401
207
194
24
1
module Main (main) where import qualified Distribution.ModuleName as ModuleName import Distribution.PackageDescription import Distribution.PackageDescription.Check hiding (doesFileExist) import Distribution.PackageDescription.Configuration import Distribution.PackageDescription.Parse import Distribution.Package impor...
siddhanathan/ghc
utils/ghc-cabal/Main.hs
bsd-3-clause
23,916
0
23
8,471
4,668
2,389
2,279
388
14
{-# LANGUAGE PackageImports #-} module Data.Complex (module M) where import "base" Data.Complex as M
silkapp/base-noprelude
src/Data/Complex.hs
bsd-3-clause
106
0
4
18
21
15
6
3
0
module Auth where import Types import System.Environment getConf :: IO [String] getConf = do env <- getEnv "FIREBASE_CONF" file <- readFile env return $ lines file
sphaso/firebase-haskell-client
test/Auth.hs
bsd-3-clause
217
0
8
79
58
29
29
8
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module OpenRTB.Types.Enum.APIFrameworkSpec where import Control.Applicative import Data.Aeson import Data.Aeson.TH import Test.Hspec import Test.QuickCheck import Test.Instances import OpenRTB.Types.Enum.APIFramework data Mock = Mock { api :: APIFra...
ankhers/openRTB-hs
spec/OpenRTB/Types/Enum/APIFrameworkSpec.hs
bsd-3-clause
661
0
18
111
195
106
89
21
1
{-# LANGUAGE FlexibleInstances , BangPatterns , MagicHash , ScopedTypeVariables , TypeFamilies , UndecidableInstances , OverlappingInstances , DeriveDataTypeable , MultiParamTypeClasses , NamedFieldPuns #-} -- State monad transformer is needed for both step & graph: #ifndef MODNAME #define MODNAME...
rrnewton/Haskell-CnC
Intel/Cnc4.hs
bsd-3-clause
3,484
34
14
849
366
219
147
40
5
module Utility.Image ( mapImage , mapImageBits , foldImage , foldImageBits , bestMatchingColors , tileImage ) where import Graphics.Imlib import qualified Data.Map as M import Data.Ix import Foreign import Data.List import Math.Metric --instance Metric ImlibColor where -- distance (ImlibColor _ r1 g1 b1) (ImlibCo...
rakete/ObjViewer
src/Utility/Image.hs
bsd-3-clause
8,474
1
28
3,592
2,926
1,574
1,352
154
27
module CmdLineProcessing ( processCmdLine ) where import System.Environment (getArgs) import Data.List (partition, sort, intercalate) import Data.Tuple (swap) import System.Console.GetOpt import Tags data TemplateOpts = H1 | H2 | Count { count :: Int } de...
ajjaic/dokuwiki-template
src/CmdLineProcessing.hs
bsd-3-clause
2,079
0
17
610
614
324
290
48
2
module Parsers.Tests where import qualified Types.BotTypes as BT import Data.List (nub) import qualified Data.Text.Lazy as Text import Parsers.IRCMessageParser (parseMessage) import qualified Test.Tasty as T import qualified Test.Tasty.QuickCheck as T import Text.ParserCombinators.ReadP (readP_to_S) tests :: T.TestTr...
bus000/Dikunt
test/Parsers/Tests.hs
bsd-3-clause
12,523
0
9
2,131
431
366
65
17
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_HADDOCK show-extensions #-} {-| Module : $Header$ Copyright : (c) 2015 Swinburne Software Innovation Lab License : BSD3 Maintainer : Rhys Adams <rhysadams@swin.edu.au> Stability : unstable Portability : portable API executa...
futufeld/eclogues
eclogues-impl/app/api/Main.hs
bsd-3-clause
6,900
0
17
1,545
1,690
905
785
126
5
{-# LANGUAGE ForeignFunctionInterface, ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | -- Module : System.Win32.Com.Server.ConnectionPoint -- Copyright : (c) Sigbjorn Finne <sof@dcs.gla.ac.uk> 1998-99 -- License : BSD-style (see the file libraries...
jjinkou2/ComForGHC7.4
System/Win32/Com/Server/ConnectionPoint.hs
bsd-3-clause
7,964
64
19
1,960
2,245
1,136
1,109
169
2
----------------------------------------------------------------------------- -- -- Module : Control.Monad.Supervisor -- Copyright : -- License : BSD3 -- -- Maintainer : agocorona@gmail.com -- Stability : -- Portability : -- -- | A supervisor monad that explore the execution tree of an internal monad a...
agocorona/control-monad-supervisor
Control/Monad/Supervisor.hs
bsd-3-clause
4,141
0
19
1,248
608
328
280
40
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.MapBufferAlignment -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : porta...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/MapBufferAlignment.hs
bsd-3-clause
682
0
4
78
37
31
6
3
0
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.EXT.TextureMirrorClamp -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Porta...
haskell-opengl/OpenGLRaw
src/Graphics/GL/EXT/TextureMirrorClamp.hs
bsd-3-clause
751
0
5
99
57
42
15
9
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module ConfigParser (MachineConfig(..), StartConfig(..), Rules, readConfig) where import Data.ByteString (ByteString) import Data.Yaml (FromJSON(..), (.:)) import qualified Data.Yaml as Yaml import Machine (Meta(..)) r...
prSquirrel/turingmachine
src/ConfigParser.hs
bsd-3-clause
1,137
0
13
293
321
184
137
23
1
{-# LANGUAGE Unsafe #-} {-# LANGUAGE MagicHash, UnboxedTuples, TypeFamilies, DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances, NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Exts -- Copyright : (c) The Universit...
vikraman/ghc
libraries/base/GHC/Exts.hs
bsd-3-clause
6,740
0
12
1,825
998
609
389
-1
-1
{-# LANGUAGE OverloadedStrings #-} -- | Profiles as defined by various sources module Text.StringPrep.Profiles ( namePrepProfile , saslPrepProfile ) where import qualified Data.Set as Set import Data.Text (Text, singleton) import Text.StringPrep -- | Nameprep profile (RFC 3491) namePrepPro...
Porges/stringprep-hs
Text/StringPrep/Profiles.hs
bsd-3-clause
1,490
12
10
412
356
222
134
29
2
{-# LANGUAGE GADTs, ScopedTypeVariables, TypeOperators, PolyKinds, DataKinds, PartialTypeSignatures, TypeSynonymInstances, FlexibleInstances, TypeFamilies#-} module TestSurvey where import Data.Typeable type Prompt = String data Survey a where Respond :: Typeable a => Prompt -> (String -> a) -> Survey a Choose ...
homam/fsm-conversational-ui
src/TestSurvey.hs
bsd-3-clause
5,089
0
13
1,288
1,805
890
915
122
4
module Inter.Quora.Strings where import qualified Data.HashMap.Lazy as M import qualified Data.Vector as V import qualified Data.Vector.Mutable as MV import Control.Monad.ST import Data.Foldable (forM_) import Data.Hashable import Data.List (minimumBy) import Inter.Quora.General (occurrenceGroups) import Types {- ...
begriffs/algorithm-freezer
src/Inter/Quora/Strings.hs
bsd-3-clause
2,603
0
14
640
575
306
269
36
2
-- -*- flycheck-disabled-checkers: '(haskell-ghc haskell-stack-ghc); -*- {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-...
conal/reification-rules
test/Basic.hs
bsd-3-clause
3,340
0
13
747
484
285
199
41
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | A project to describe Haskell syntax for newbies and intermediates alike. module Language.Haskell.Describe where import Control.Applicative import Control.Monad.Error import Control.Monad.State import Da...
chrisdone/haskell-describe
src/Language/Haskell/Describe.hs
bsd-3-clause
1,381
0
15
334
428
226
202
42
2
module Numeric.Digamma (digamma) where import Numeric.SpecFunctions (digamma)
bgamari/digamma
Numeric/Digamma.hs
bsd-3-clause
79
0
5
8
21
13
8
2
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} -------------------------------------------------------------------------------- -- | -- Module : Alfred.Query -- Copyright : (c) 2014 Patrick Bahr -- License : BSD3 -- Maintainer : Patrick Bahr <paba@di.ku.dk> -- Stability :...
pa-ba/alfred
src/Alfred/Query.hs
bsd-3-clause
5,706
0
19
1,244
1,027
572
455
64
2
-- https://www.fpcomplete.com/user/bartosz/understanding-algebras module FAlgebra where ---------------- -- Algebra: -- (1) A way to construct expressions -- (2) A way to evaluate expressions (produce a single value) -- define our expressions (non-recursive) -- ExprF :: a -> ExprF a -- ExprF :: * -> * data ExprF a = ...
dterei/Scraps
haskell/freemtl/FAlgebra.hs
bsd-3-clause
3,814
0
11
1,078
1,047
564
483
59
1
{- Model.hs (adapted from model.c which is (c) Silicon Graphics, Inc.) Copyright (c) Sven Panne 2002-2005 <sven.panne@aedion.de> This file is part of HOpenGL and distributed under a BSD-style license See the file libraries/GLUT/LICENSE This program demonstrates modeling transformations. -} import Syste...
FranklinChen/hugs98-plus-Sep2006
packages/GLUT/examples/RedBook/Model.hs
bsd-3-clause
2,378
0
14
575
788
381
407
64
2
module System.Build.Access.Overview where class Overview r where overview :: Maybe FilePath -> r -> r getOverview :: r -> Maybe FilePath
tonymorris/lastik
System/Build/Access/Overview.hs
bsd-3-clause
167
0
8
51
45
24
21
9
0
module Language.LaTeX.Builder.MonoidUtils (ø, (⊕), (<>), (<||>), (<&&>), mapNonEmpty) where import Data.Monoid.Unicode ((⊕)) ø :: Monoid m => m ø = mempty (<||>) :: (Monoid a, Eq a) => a -> a -> a a <||> b | a == ø = b | otherwise = a (<&&>) :: (Monoid a, Eq a, Monoid b) => a -> b -> b a <&&> b | a ==...
np/hlatex
Language/LaTeX/Builder/MonoidUtils.hs
bsd-3-clause
503
0
8
158
265
144
121
13
1
{-# LANGUAGE NoImplicitPrelude #-} module Stack.Options.GhciParser where import Data.Version (showVersion) import Options.Applicative import Options.Applicative.Args import Options.Applicative.Builder.Extra import Paths_stack ...
MichielDerhaeg/stack
src/Stack/Options/GhciParser.hs
bsd-3-clause
3,166
0
29
1,353
459
232
227
50
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.EXT.SecondaryColor -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable ...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/EXT/SecondaryColor.hs
bsd-3-clause
1,380
0
4
154
115
84
31
27
0
-- | Parsing and printing binary XML. module Network.CCNx.BinaryXML ( Block (..) , printBinaryXML , parseBinaryXML ) where import Data.Bits import Data.ByteString (ByteString) import qualified Data.ByteString as B import Data.Char import Data.Word import Text.Printf -- | Binary XML structure. data Block = B...
tomahawkins/ccnx
Network/CCNx/BinaryXML.hs
bsd-3-clause
3,466
0
14
866
1,523
802
721
90
9
{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE FlexibleInstances #-} -- | This module contains miscellaneous functions plus a few pieces of -- functionality that are missing from the standard Haskell libraries. module Data.IterIO.Extra ( -- * Miscellaneous iterLoop , inumSplit -- , fixIterPur...
scslab/iterIO
Data/IterIO/Extra.hs
bsd-3-clause
8,568
0
18
2,553
1,507
785
722
103
3
import Data.List (sortOn, minimumBy) import Data.Function (on) type Point = (Double, Double) ccw :: Point -> Point -> Point -> Double ccw (xa, ya) (xb, yb) (xc, yc) = (xb - xa) * (yc - ya) - (yb - ya) * (xc - xa) grahamScan :: [Point] -> [Point] grahamScan [] = [] grahamScan pts = wrap sortedPts [p0] where p0@(x, ...
Gathros/algorithm-archive
contents/graham_scan/code/haskell/grahamScan.hs
mit
848
6
16
223
473
258
215
18
3
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Serials.Model.Scan where import Data.Time import Data.Text import Data.Aeson import Data.Data import Database.RethinkDB.NoClash import GHC.Generics data Scan = Scan { date :: UTCTime, total :: Int, new :: [Text], updated :: [Text] } d...
seanhess/serials
server/Serials/Model/Scan.hs
mit
440
0
9
72
122
71
51
19
0
module Lib.Makefile.InstantiatePattern ( instantiatePatternByOutput , instantiatePatternByMatch ) where import Prelude.Compat hiding (FilePath) import Control.Monad (guard, msum) import Lib.FilePath ((</>), FilePath, splitFileName) import BMake.Interpreter (interpolateCmds) import Lib.Makefile.Types import qua...
buildsome/buildsome
src/Lib/Makefile/InstantiatePattern.hs
gpl-2.0
1,606
0
11
261
407
212
195
34
2
{-# language ExistentialQuantification #-} module Rasa.Ext.Views.Internal.AnyRenderable ( AnyRenderable(..) ) where import Rasa.Ext data AnyRenderable = forall r. Renderable r => AnyRenderable r instance Renderable AnyRenderable where render width height scrollAmt (AnyRenderable r) = render width height s...
samcal/rasa
rasa-ext-views/src/Rasa/Ext/Views/Internal/AnyRenderable.hs
gpl-3.0
331
0
8
52
82
46
36
9
0
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PolyKinds ...
ezyang/ghc
libraries/base/Data/Type/Coercion.hs
bsd-3-clause
3,477
0
11
646
602
335
267
53
1
-- |Convenient functions for parsing JSON responses. Use these -- functions to write the 'readJSON' method of the 'JSON' class. module Database.CouchDB.JSON ( jsonString , jsonInt , jsonObject , jsonField , jsonBool , jsonIsTrue ) where import Text.JSON import Data.Ratio (numerator,denominator) jsonStr...
arjunguha/haskell-couchdb
src/Database/CouchDB/JSON.hs
bsd-3-clause
1,532
0
10
291
452
233
219
31
2
foo = let (xs, ys) = ([1,2..3], [4,5..6]) in bar
mpickering/ghc-exactprint
tests/examples/ghc710/DroppedComma.hs
bsd-3-clause
55
0
10
16
46
26
20
3
1
{-# LANGUAGE DataKinds, GADTs, LambdaCase, ViewPatterns #-} module Commands.Frontends.Dragon13.Optimize where import Commands.Extra import Commands.Frontends.Dragon13.Lens import Commands.Frontends.Dragon13.Types import Commands.LHS import Control.Lens import ...
sboosali/commands-frontend-DragonNaturallySpeaking
sources/Commands/Frontends/Dragon13/Optimize.hs
bsd-3-clause
10,988
0
19
2,065
2,373
1,249
1,124
-1
-1
{-# language CPP #-} {-# language MultiParamTypeClasses #-} #ifndef ENABLE_INTERNAL_DOCUMENTATION {-# OPTIONS_HADDOCK hide #-} #endif #if __GLASGOW_HASKELL__ >= 800 {-# options_ghc -Wno-redundant-constraints #-} #endif module OpenCV.Internal.ImgProc.MiscImgTransform.ColorCodes where import "base" Data.Int ( Int32 )...
lukexi/haskell-opencv
src/OpenCV/Internal/ImgProc/MiscImgTransform/ColorCodes.hs
bsd-3-clause
43,996
0
9
10,080
13,169
6,710
6,459
-1
-1
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI, MagicHash, UnliftedFFITypes #-} module Data.JSString.RealFloat ( FPFormat(..) , realFloat , formatRealFloat , formatDouble , fo...
tavisrudd/ghcjs-base
Data/JSString/RealFloat.hs
mit
3,626
20
10
914
679
360
319
73
5
{-# OPTIONS_GHC -fno-warn-deprecations #-} module Network.Wai.Handler.Warp.Internal ( Settings (..) , getOnOpen , getOnClose , getOnException ) where import Network.Wai.Handler.Warp.Settings (Settings (..)) import Network.Socket (SockAddr) import Network.Wai (Request) import Control.Exception (Some...
jberryman/wai
warp/Network/Wai/Handler/Warp/Internal.hs
mit
586
0
9
90
149
88
61
16
1
-- | -- Module: FRP.Netwire.Analyze -- Copyright: (c) 2013 Ertugrul Soeylemez -- License: BSD3 -- Maintainer: Ertugrul Soeylemez <es@ertes.de> module FRP.Netwire.Analyze ( -- * Linear graphs lAvg, lGraph, lGraphN, -- * Staircase graphs sAvg, sGraph, sGraphN, ...
jship/metronome
local_deps/netwire/FRP/Netwire/Analyze.hs
bsd-3-clause
8,503
0
19
2,487
1,960
1,067
893
143
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="hu-HU"> <title>SOAP Support Add-on</title> <maps> <homeID>soap</homeID> <mapref locatio...
kingthorin/zap-extensions
addOns/soap/src/main/javahelp/org/zaproxy/zap/extension/soap/resources/help_hu_HU/helpset_hu_HU.hs
apache-2.0
965
77
67
157
413
209
204
-1
-1
module A3 where import D3 import C3 import B3 main :: Tree Int ->Bool main t = isSame (sumSquares (fringe t)) (sumSquares (B3.myFringe t)+sumSquares (C3.myFringe t))
kmate/HaRe
old/testing/moveDefBtwMods/A3.hs
bsd-3-clause
195
0
11
55
79
41
38
7
1
module A3 where import C3 main xs = sumSquares xs + anotherFun xs
kmate/HaRe
old/testing/duplication/A3_TokOut.hs
bsd-3-clause
81
0
6
28
25
13
12
3
1
{-# OPTIONS -fno-warn-unused-imports #-} #include "HsConfigure.h" -- #hide module Data.Time.Calendar.Days ( -- * Days Day(..),addDays,diffDays ) where import Control.DeepSeq import Data.Ix import Data.Typeable #if LANGUAGE_Rank2Types import Data.Data #endif -- | The Modified Julian Day is a standard count of days, ...
beni55/haste-compiler
libraries/time/lib/Data/Time/Calendar/Days.hs
bsd-3-clause
2,782
2
9
401
566
299
267
28
1
-- Generated by protobuf-simple. DO NOT EDIT! module Types.BoolListPacked where import Control.Applicative ((<$>)) import Prelude () import qualified Data.ProtoBufInt as PB newtype BoolListPacked = BoolListPacked { value :: PB.Seq PB.Bool } deriving (PB.Show, PB.Eq, PB.Ord) instance PB.Default BoolListPacked whe...
sru-systems/protobuf-simple
test/Types/BoolListPacked.hs
mit
993
0
13
174
348
186
162
21
0
import Drawing main = drawPicture myPicture myPicture points = coordinates & drawPoints [a,b,a',b'] & drawLabels [a,b,a',b'] ["A","B","A'","B'"] & drawSegment (a,b) & drawSegment (a',b') & message "Translation of AB 3 units right and 1 unit down" where [a,b] = [(1,1),(2,2)]...
alphalambda/k12math
contrib/MHills/GeometryLessons/code/teacher/key_lesson8b.hs
mit
465
0
11
145
222
126
96
15
1
module Chapter08 (Nat(..), mult, Expr(..), folde, Tree(..), complete) where data Nat = Zero | Succ Nat deriving (Show, Eq) add :: Nat -> Nat -> Nat add = undefined mult :: Nat -> Nat -> Nat mult = undefined data Expr = Val Int | Add Expr Expr | Mul Expr Expr folde :: (Int -> a) -> (a -...
EindhovenHaskellMeetup/meetup
courses/programming-in-haskell/pih-exercises/src/Chapter08.hs
mit
487
0
10
145
221
127
94
16
1
{-# LANGUAGE NamedFieldPuns, RecordWildCards #-} import Graphics.SpriteKit import Actions import Constants import Convenience import GameState import Pipes import Random import Scenery lazyLambda :: LambdaScene lazyLambda = (sceneWithSize (Size width height)) { sceneBackgroundColor = skyColour , sceneChi...
mchakravarty/lazy-lambda
LazyLambda.hsproj/LazyLambda.hs
mit
5,177
0
14
1,690
1,298
717
581
104
3
-- ex4.5.hs ex4.6.hs data Client i = GovOrg { clientId :: i, clientName :: String } | Company { clientId :: i, clientName :: String , person :: Person, duty :: String } | Individual { clientId :: i, person :: Person } deriving Show data Person = Perso...
hnfmr/beginning_haskell
ex4.6.hs
mit
1,875
0
12
390
820
450
370
38
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE NoImplicitPrelude #-} module Data.Vector.Generic.Fixed ( toFixed , fromFix...
nickspinale/n-vector
src/Data/Vector/Generic/Fixed.hs
mit
1,792
0
13
577
643
342
301
46
2
-- CommandLineArguments.hs --- -- -- Filename: CommandLineArguments.hs -- Description: -- Author: Manuel Schneckenreither -- Maintainer: -- Created: Thu Sep 4 12:25:37 2014 (+0200) -- Version: -- Package-Requires: () -- Last-Updated: Tue Apr 11 14:34:02 2017 (+0200) -- By: Manuel Schneckenreither -- Upda...
ComputationWithBoundedResources/ara-inference
src/Data/Rewriting/ARA/ByInferenceRules/CmdLineArguments.hs
mit
946
0
5
166
83
72
11
6
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Data.PublicSuffix.TH ( moduleDirectory , mkRules ) where import Control.Applicative import Data.Char import Data.PublicSuffix.Types import Language.Haskell.TH import qualified Language.H...
wereHamster/publicsuffix-haskell
src/Data/PublicSuffix/TH.hs
mit
2,203
0
17
658
678
358
320
55
3
module Zeno.Unification ( Unifiable (..), Unification (..), applyUnification, mergeUnifiers, allUnifiers, ) where import Prelude () import Zeno.Prelude import Zeno.Utils import Zeno.Traversing import qualified Data.Map as Map -- |The result of trying to unify two values where -- 'NoUnifier' indicates that unific...
Gurmeet-Singh/Zeno
src/Zeno/Unification.hs
mit
1,646
0
12
312
507
269
238
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Unit.LayoutSpec (spec) where import Data.Char (isLetter, isNumber) import qualified Data.Text as T import TestImport import Data.List ((!!)) import Layout.Util (removeClass) ---------------------------------------------------------...
rzetterberg/alven
src/test/Unit/LayoutSpec.hs
mit
2,778
0
11
725
456
254
202
41
3
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} module LiveVDom.Types where -- Generic imports import Control.Applicative import Control.Concurrent.STM import Control.Concurrent.STM.Notify import ...
plow-technologies/live-vdom
src/LiveVDom/Types.hs
mit
7,971
0
17
2,003
1,945
1,034
911
123
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleInstances #-} module Systems where import Control.Monad.IO.Class (liftIO) --import Control.Monad (when, liftM, join) import Control.Lens import qualified Data.IntMap.Strict as I import Types import HasComponents -- probably not needed: --newtype Storabl...
TK009/CESH
src/Systems.hs
mit
2,976
0
11
697
665
354
311
46
1
-- | Like Latency, but creating lots of channels import Hypervisor.XenStore import Hypervisor.DomainInfo import Hypervisor.Debug import Data.List import Control.Monad import Control.Applicative import Control.Distributed.Process import Control.Distributed.Process.Node import Network.Transport.IVC (createTransport, wait...
hackern/network-transport-ivc
benchmarks/Channels/Main.hs
mit
1,378
0
14
247
445
217
228
39
2
-- | This module, as the name suggests, serves as a utility module for ciphers -- like the Vigenère cipher, which depends upon shifting alphabet characters by -- some amount. module Text.Cipher.Util where import Data.Char (toLower, toUpper) import Data.List (elemIndex, nub) -- | Checks whether its argument is a membe...
kmein/ciphers
src/Text/Cipher/Util.hs
mit
1,311
0
8
243
217
127
90
13
1
module Palindrome where palindrome :: Eq a => [a] -> Bool palindrome [] = True palindrome [_] = True palindrome xs = (head xs) == (last xs) && (palindrome $ init $ tail xs)
kaveet/haskell-snippets
modules/lists/Palindrome.hs
mit
176
0
8
37
86
45
41
5
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} module Hogldev.CubemapTexture ( CubemapText...
triplepointfive/hogldev
common/Hogldev/CubemapTexture.hs
mit
3,838
0
18
966
926
481
445
103
16
module Paths_snap ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName ) where import qualified Control.Exception as Exception import Data.Version (Version(..)) import System.Environment (getEnv) catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a catchIO = Exception.catch ...
kjgorman/melchior
comparison/snap/dist/build/autogen/Paths_snap.hs
mit
1,102
0
10
164
323
184
139
25
1
-- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. -- In addition, you can configure a number of different aspects of Yesod -- by overriding methods in the Yesod typeclass. That instance is -- declared in the Foundation.hs file....
swamp-agr/carbuyer-advisor
Settings.hs
mit
6,022
0
12
1,629
830
476
354
-1
-1
{-# htermination (succTup0 :: Tup0 -> Tup0) #-} import qualified Prelude data MyBool = MyTrue | MyFalse data List a = Cons a (List a) | Nil data Tup0 = Tup0 ; data MyInt = Pos Nat | Neg Nat ; data Nat = Succ Nat | Zero ; fromEnumTup0 :: Tup0 -> MyInt fromEnumTup0 Tup0 = Pos Zero; primMinusNat :: Nat -> ...
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/succ_1.hs
mit
1,934
0
13
422
927
488
439
48
1
module HaskQuest.Game.State ( module HaskQuest.Game.State.GameStateMonad , module HaskQuest.Game.State.SimpleState ) where import HaskQuest.Game.State.GameStateMonad import HaskQuest.Game.State.SimpleState
pdarragh/HaskQuest
src/HaskQuest/Game/State.hs
mit
219
0
5
27
39
28
11
5
0
{- Copyright (C) 2006-2012 John MacFarlane <jgm@berkeley.edu> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is ...
castaway/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
32,597
0
43
8,566
11,502
5,973
5,529
832
4
{- | Module : ./Isabelle/Isa2DG.hs Description : Import data generated by hol2hets into a DG Copyright : (c) Jonathan von Schroeder, DFKI GmbH 2010 License : GPLv2 or higher, see LICENSE.txt Maintainer : jonathan.von_schroeder@dfki.de Stability : experimental Portability : portable -} module Isa...
gnn/Hets
Isabelle/Isa2DG.hs
gpl-2.0
5,581
0
25
1,739
1,720
885
835
127
12
{-# LANGUAGE OverloadedStrings #-} module QueryHelpers where import qualified Data.ByteString.Char8 as B import Network.HTTP.Types.URI extractQueryParam :: B.ByteString -> B.ByteString -> Maybe B.ByteString extractQueryParam qs paramName = lookup paramName (parseSimpleQuery qs) extractQS :: B.ByteString -> B.ByteSt...
moosingin3space/dailymenu
tests/QueryHelpers.hs
gpl-3.0
959
0
8
119
274
140
134
18
1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE StandaloneDeriving #-} -- | Examples on the effects of newtype deriving. -- module Deriving.Anyclass where newtype Foo a = MkFoo a deriving Show class Show a => Bar a where bar :: a -> String bar = show deriving instance Bar a => Bar (Foo a) instance Bar Int ...
capitanbatata/sandbox
haskell-extensions/src/Deriving/Anyclass.hs
gpl-3.0
734
0
7
133
91
55
36
9
0
{-# LANGUAGE OverloadedStrings , FlexibleContexts #-} module Cabal.Preferred where import Cabal.Types import Imports import Data.Attoparsec.Text.Lazy as A import qualified Data.Text as T import qualified Data.Text.Lazy as LT import qualified Data.Text.Lazy.Encoding as LT import Network.HTTP.Client ...
athanclark/happ-store
src/Cabal/Preferred.hs
gpl-3.0
5,643
0
19
1,799
1,832
940
892
141
17
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} module Lamdu.GUI.DefinitionEdit ( make , diveToNameEdit ) where import Prelude.Compat import qualified Control.Lens as Lens import Control.Lens.Operators import Control.Lens.Tuple import Control.MonadA (MonadA) i...
rvion/lamdu
Lamdu/GUI/DefinitionEdit.hs
gpl-3.0
7,143
0
21
1,784
1,688
912
776
-1
-1
{-| Stability : provisional Portability : haskell98 Simplistic ANSI color support. -} module AnsiColor ( Color(..) , bold , inColor ) where import Data.List data Color = Black | Red | Green | Yellow | Blue | Magenta ...
Heather/hackport
AnsiColor.hs
gpl-3.0
1,018
0
11
356
338
182
156
28
1
{-# LANGUAGE OverloadedStrings #-} module Estuary.Languages.CineCer0.VideoSpec where import Language.Haskell.Exts import Control.Applicative import Data.Time import Data.Text import TextShow import Data.Tempo import Data.Text (Text) import Estuary.Languages.CineCer0.Signal data Colour = Colour (Signal Text) | Colou...
d0kt0r0/estuary
client/src/Estuary/Languages/CineCer0/VideoSpec.hs
gpl-3.0
10,524
0
26
2,094
3,788
2,015
1,773
223
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module Shared where import Reflex.Dom.WebSocket.Message import GHC.Generics import Data.Aeson import Data.Text ...
dfordivam/reflex-websocket-interface
example/shared/Shared.hs
gpl-3.0
1,986
0
7
288
492
269
223
55
0
----------------------------------------------------------------------------- -- -- Module : Data.DICOM.VL -- Copyright : Copyright (c) DICOM Grid 2015 -- License : GPL-3 -- -- Maintainer : paf31@cantab.net -- Stability : experimental -- Portability : -- ----------------------------------------------...
dicomgrid/dicom-haskell-library
src/Data/DICOM/VL.hs
gpl-3.0
726
0
6
137
103
67
36
14
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-securitycenter/gen/Network/Google/Resource/SecurityCenter/Organizations/Operations/Get.hs
mpl-2.0
5,017
0
15
1,078
699
410
289
100
1