code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
module HN.Curl where import Network.Curl -- | Download a string from a URI. downloadString :: String -> IO (Either (CurlCode,String) String) downloadString uri = do withCurlDo $ do (code,resp) <- curlGetString_ uri opts case code of CurlOK -> return (Right resp) _ -> return (Left (code,resp)) ...
lwm/haskellnews
src/HN/Curl.hs
bsd-3-clause
462
0
16
100
129
68
61
10
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="id-ID"> <title>Encode/Decode/Hash Add-on</title> <maps> <homeID>encoder</homeID> <mapre...
thc202/zap-extensions
addOns/encoder/src/main/javahelp/org/zaproxy/addon/encoder/resources/help_id_ID/helpset_id_ID.hs
apache-2.0
974
77
69
156
419
212
207
-1
-1
{-# LANGUAGE TypeOperators #-} -- #2993 module T2993 where foo b a = a <**> b . b
sdiehl/ghc
testsuite/tests/rename/should_fail/T2993.hs
bsd-3-clause
86
0
6
22
24
14
10
-1
-1
module HAD.Y2014.M03.D18.Exercise where -- $setup -- >>> import Data.Maybe -- >>> let backPartner = (>>= partner) . (>>= partner) data Person a = Single a | Married a (Person a) partner :: Person a -> Maybe (Person a) partner (Married _ p) = Just p partner _ = Nothing get :: Person a -> a get (Single x) = x get ...
1HaskellADay/1HAD
exercises/HAD/Y2014/M03/D18/Exercise.hs
mit
975
0
9
197
179
101
78
10
1
{-# LANGUAGE CPP, OverloadedStrings #-} module LoadCache where import Haxl.Core import ExampleDataSource #include "LoadCache.txt"
GaussDing/Haxl
tests/LoadCache.hs
bsd-3-clause
132
0
4
16
14
10
4
4
0
module Distribution.Client.Dependency.Modular.Validate (validateTree) where -- Validation of the tree. -- -- The task here is to make sure all constraints hold. After validation, any -- assignment returned by exploration of the tree should be a complete valid -- assignment, i.e., actually constitute a solution. impor...
enolan/cabal
cabal-install/Distribution/Client/Dependency/Modular/Validate.hs
bsd-3-clause
12,175
0
22
3,508
2,329
1,199
1,130
128
14
{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving #-} module ShouldCompile where import Control.Applicative (Applicative) data family S a newtype instance S Int = S Int deriving Eq data family S2 a b newtype instance S2 Int b = S2 (IO b) deriving (Functor, Appl...
snoyberg/ghc
testsuite/tests/indexed-types/should_compile/DerivingNewType.hs
bsd-3-clause
337
0
7
98
78
47
31
9
0
{-# OPTIONS_GHC -XLiberalTypeSynonyms #-} module ShouldCompile where type T a b = a type S m = m () f :: S (T Int) f = undefined
urbanslug/ghc
testsuite/tests/typecheck/should_compile/tc234.hs
bsd-3-clause
136
0
7
34
44
27
17
6
1
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE ScopedTypeVariables #-} module Floating ( floating ) where import Fractional (fractional) import System.Random (Random) import Test.QuickCheck.Checkers (EqProp, (=-=), inverseL) import Test.QuickCheck.Extra (UnitInterval(..), Tiny(..), BiunitInterval) import...
expipiplus1/exact-real
test/Floating.hs
mit
3,332
0
17
1,388
1,035
557
478
-1
-1
import Data.List (foldl1') import Math.NumberTheory.Primes.Testing (isPrime) --import Control.Parallel.Strategies (using, parList, rseq) -- isPrime :: Integer -> Bool -- isPrime n -- | n < 2 = False -- | n == 2 = True -- | otherwise = -- let sqn = (floor (sqrt (fromIntegral n))) + 1 -- in and [ n `mod...
feliposz/project-euler-solutions
haskell/euler27.hs
mit
1,153
0
10
275
298
165
133
17
1
-- ($) :: (a -> b) -> a -> b -- f $ x = f x -- f a b c === (((f a) b) c) test1 = sum (map sqrt [1..130]) test2 = sum $ map sqrt [1..130] test3 = sqrt (3 + 4 + 9) test4 = sqrt $ 3 + 4 + 9 test5 = sum (filter (> 10) (map (*2) [2..10])) test6 = sum $ filter (> 10) (map (*2) [2..10]) test7 = sum $ filter (> 10) $ map (...
v0lkan/learning-haskell
session-archive/007-dollar.hs
mit
377
0
10
101
224
128
96
8
1
main = putStrLn "สวัสดีครับ"
merxer/kata
haskell/14.hs
mit
49
0
5
4
9
4
5
1
1
{-# LANGUAGE TupleSections #-} module SoOSiM.Components.ResourceManager.Behaviour where import Control.Arrow (first,second) import Data.Char (toLower) import qualified Data.HashMap.Strict as HashMap import Data.List (mapAccumL,intersect,(\\),partition) import So...
christiaanb/SoOSiM-components
src/SoOSiM/Components/ResourceManager/Behaviour.hs
mit
2,912
0
19
780
1,013
538
475
57
3
module Unison.Typechecker.Components (components, minimize, minimize') where import Data.Bifunctor (first) import qualified Data.Graph as Graph import qualified Data.Map as Map import Data.Maybe import Data.Set (Set) import qualified Data.Set as Set import qualified Unison.ABT as ABT import ...
paulp/unison
parser-typechecker/src/Unison/Typechecker/Components.hs
mit
3,618
0
18
815
847
476
371
39
4
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Y2017.M11.D27.Exercise where {-- Okay, we have a set of recommended articles, now we want to add some new articles to the list. So, given an article id as a basis and a set of article ids to add, add those articles to the source article's recommended list. Yes:...
geophf/1HaskellADay
exercises/HAD/Y2017/M11/D27/Exercise.hs
mit
1,299
0
9
203
121
75
46
14
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} module TimeUnitsJSONInstance where import Data.Aeson.TH ...
joe9/streaming-betfair-api
src/TimeUnitsJSONInstance.hs
mit
1,044
2
9
185
152
92
60
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-deltatime.html module Stratosphere.ResourceProperties.IoTAnalyticsDatasetDeltaTime where...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/IoTAnalyticsDatasetDeltaTime.hs
mit
2,243
0
13
220
265
151
114
29
1
module Main where import Filter.Abstract (abstract) import Filter.Attr (simplifyAttr) import Filter.Bib (bibliography) import Filter.Float (float) import Filter.Hyperref (hyperref) import Filter.LinksAsNotes (linksAsNotes) import Filter.Macros (processMacros) import Filter.MultiBib (multibib) import Filter.Multicol (m...
Thhethssmuz/ppp
src/Main.hs
mit
2,510
0
20
662
757
410
347
74
5
-- Paradigme de programare, laboratorul 2: functii recursive -- 1. Factorialul unui număr dat, fără restricții și tail recursive. -- -- TDA-ul număr se aseamănă cu TDA-ul listă: -- - 0 (caz de bază) <- 0! = 1 -- - n (pas de inducție) <- n! = n * (n - 1)! factorial 0 = 1 factorial n = n * factorial (n - 1) -- Cum se ...
spyked/slides
misc-notes/pp-cb-labs/lab-02/lab-02.hs
cc0-1.0
8,319
2
16
2,359
995
568
427
46
4
-- Project Euler Problem 30 - digit fifth powers -- -- sum all numbers that are the sum of the fifth powers of their digits -- -- (does not include 1) -- import Data.List import Data.Char digits x = [ digitToInt y | y <- (show x)] p5dsum x = sum [ y^5 | y <- digits x] max_possible = (9^5)*10 -- assuming no more tha...
yunwilliamyu/programming-exercises
project_euler/p030_digit_fifth_powers.hs
cc0-1.0
468
2
14
106
140
75
65
7
1
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-} module Brainfuck.Machine where -- $Id$ import Machine.Class import Machine.Akzeptieren import qualified Challenger as C import qualified Machine.Acceptor.Type as A import Brainfuck.Syntax.Data import qualified Brainfuck.Env as E --import Brainfuck.Nachfo...
Erdwolf/autotool-bonn
src/Brainfuck/Machine.hs
gpl-2.0
1,896
0
11
446
307
171
136
29
0
{-# LANGUAGE TemplateHaskell #-} module Toy.Backend.Classify where import AI.SVM.Base import AI.SVM.Simple import Data.Aeson import Data.Aeson.TH import Data.Text (pack) data Classify = Classify FilePath Double deriving Show deriveJSON defaultOptions ''Classify c...
Qinka/reimagined-pancake
toy-backend/toy-backend-classify/src/svm/Toy/Backend/Classify.hs
gpl-3.0
630
0
13
164
197
105
92
16
2
-- Haskell Practical 4 Code - Domain Functions -- By James Cowgill module Prac4.DomFunc where -- Domain function lists -- Contain a list with the domain and a function to map the domain to values type DomFunc n v = ([n], n -> v) -- The empty list empty :: DomFunc n v empty = ([], undefined) -- Return list of name...
jcowgill/cs-work
syac/compilers/Prac4/DomFunc.hs
gpl-3.0
1,145
0
11
340
405
215
190
19
1
{- ---------------------------------------------------------------------------------- - Copyright (C) 2010-2011 Massachusetts Institute of Technology - Copyright (C) 2010-2011 Yuan Tang <yuantang@csail.mit.edu> - Charles E. Leiserson <cel@mit.edu> - - This program is free software:...
rrnewton/pochoir-first-history-fix-attempt
PMain.hs
gpl-3.0
9,712
0
16
2,620
2,608
1,378
1,230
165
3
-- P21 Insert an element at a given position into a list. -- Using "splitAt" f1 :: Int -> a -> [a] -> [a] f1 n x ys = let (a, b) = splitAt (pred n) ys in a ++ x : b -- By index (inefficient) f2 :: Int -> a -> [a] -> [a] f2 n x ys = take (pred n) ys ++ x : drop (pred n) ys -- Recursion f3 :: Int -> a -> [a] -> [a] f3...
pavelfatin/ninety-nine
haskell/p21.hs
gpl-3.0
531
1
11
161
341
171
170
11
2
{- Guess Copyright (C) 2017 Jonathan Lamothe <jlamothe1980@gmail.com> 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 (at your option) any later version. This pro...
jlamothe/guess
tests.hs
gpl-3.0
911
0
12
162
80
42
38
10
1
{-# LANGUAGE GeneralizedNewtypeDeriving, TemplateHaskell, QuasiQuotes #-} -- | Compile Lamdu vals to Javascript module Lamdu.Eval.JS.Compiler ( Actions(..) , ValId(..) , compileRepl, Mode(..), MemoDefs(..), loggingEnabled ) where import qualified Control.Lens as Lens import Control.Monad.Sta...
lamdu/lamdu
src/Lamdu/Eval/JS/Compiler.hs
gpl-3.0
26,635
0
24
7,884
8,222
4,225
3,997
-1
-1
module Examples where import Music (Name(..), Accidental(..), Scale(..), Tuning(..), Timing(..), Metronome(..), AbstractInt1(..), AbstractPitch1(..), AbstractDur1(..), AbstractInt2(..), AbstractPitch2(..), AbstractDur2(..), AbstractInt3(..), AbstractPitch3(..), AbstractDur3(....
ejlilley/AbstractMusic
Examples.hs
gpl-3.0
3,504
0
14
752
1,220
707
513
72
1
{-# OPTIONS -Wall -fsimpl-tick-factor=1024 #-} {-# LANGUAGE OverloadedStrings #-} import qualified Web.Twitter.Conduit as WTC import qualified Web.Authenticate.OAuth as WAO import qualified Control.Monad.Logger as CML import qualified System.Environment as SE import qualified Control.Lens as CL import qualified Control...
minamiyama1994/mirror-tweet
Main.hs
gpl-3.0
1,774
0
15
331
576
307
269
42
2
module Data.Dns.Types ( DnsType(..) , DnsClass(..) , DnsRecord(..) , DomainName(..) , HinfoCPU(..) , HinfoOS(..) , SOASerial(..) , SOAExpire(..) , SOARefresh(..) , SOARetry(..) , SOAMinimum(..) , SOAMName(..) , SOARName(..) ) where import Data.ByteString import Data.Word -- my naming schem...
cabrera/haskell-parsing-tutorial
src/Data/Dns/Types.hs
gpl-3.0
1,860
0
8
529
492
309
183
44
0
module HSubst where import Data.Void import Data.Bifunctor import Language import Context -------------------- --- Hereditary Substitution -------------------- -- Hereditary Substitution is mostly functor-preserving -- (except for `Ne`utral terms which are turned into -- Normal ones) so we introduce this type alias....
gallais/potpourri
haskell/hsubst/HSubst.hs
gpl-3.0
5,934
0
12
1,733
3,114
1,535
1,579
128
1
<h3>Example 48 (palettes with ng-repeat)</h3> <palette ng-repeat="(nm,body) in pals" name="[[nm]]"> [[body]] </palette> <plot height=300 aspect=3 stroke-width=2 x="[[seq(0,4*PI,101)]]" axis-x-label="Time" axis-y-label="sin(x) / cos(x)"> <lines y="[[sin(x)]]" stroke="[[bgr(y)]]"></lines> <lines y="[[cos(x)...
openbrainsrc/hRadian
examples/Example/defunct/Eg48.hs
mpl-2.0
361
27
16
42
194
91
103
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.S3.Types.Product -- Copyr...
olorin/amazonka
amazonka-s3/gen/Network/AWS/S3/Types/Product.hs
mpl-2.0
82,877
0
16
18,089
16,510
9,447
7,063
1,605
1
{-# LANGUAGE OverloadedStrings #-} module Lib where import Control.Lens ((&), (.~), (^.)) import Data.ByteString.Lazy.Char8 as BSLC8 import Data.List as L import Data.Text as T import Data.Text.IO ...
haroldcarr/learn-haskell-coq-ml-etc
haskell/playpen/zillow/src/Lib.hs
unlicense
7,346
0
16
1,790
2,099
1,088
1,011
151
3
{-# LANGUAGE TemplateHaskell #-} module Cache ( Cache(..) , newCache , destroyCache -- , cacheChunks TODO: what, this is never used? , cacheStars ) where import Control.Lens import Data.IORef -- import qualified Data.Map as M import qualified SDL as SDL -- import Coordinate data Cache = MkCac...
nitrix/lspace
legacy/Cache.hs
unlicense
695
0
10
154
144
84
60
19
1
module Constant where newtype Constant a b = Constant { getConstant :: a } deriving (Eq, Ord, Show) instance Functor (Constant a) where fmap _ (Constant a) = Constant a instance Monoid a => Applicative (Constant a) where pure b = Constant mempty (Constant a) <*> (Constant a') = Constant (a `mappend` a')
thewoolleyman/haskellbook
17/05/maor/Constant.hs
unlicense
318
0
8
66
134
71
63
9
0
module Problem011 where main = do str <- readFile "problem-011.txt" let xs = map (read :: String -> Int) $ words str print $ maximum $ [prod xs is | i <- [0..400], o <- offsets, let is = map (+ i) o, last is < 400] offsets = [[0, 1, 2, 3] ,[0,20,40,60] ,[0,21,42,63] ,...
vasily-kartashov/playground
euler/problem-011.hs
apache-2.0
384
0
14
130
206
114
92
9
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} module Main where import Data.Monoid import Data.String import Web.Spock.Safe import Data.Aeson import GHC.Generics main :: IO () data User = User { name :: String, height :: Int } deriving Generic instance ToJSON User main = runSpock 8080 $ spo...
justinholmes/haskell-playground
src/Main.hs
apache-2.0
491
0
13
117
171
94
77
17
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="ru-RU"> <title>Form Handler | ZAP Extension</title> <maps> <homeID>top</homeID> <mapref...
secdec/zap-extensions
addOns/formhandler/src/main/javahelp/org/zaproxy/zap/extension/formhandler/resources/help_ru_RU/helpset_ru_RU.hs
apache-2.0
973
83
52
159
396
209
187
-1
-1
module AlecSequences.A271328Spec (main, spec) where import Test.Hspec import AlecSequences.A271328 (a271328) main :: IO () main = hspec spec spec = describe "A271328" $ it "correctly computes the first 20 elements" $ take 20 (map a271328 [1..]) `shouldBe` expectedValue where expectedValue = [1,5,10,17,28,...
peterokagey/haskellOEIS
test/AlecSequences/A271328Spec.hs
apache-2.0
377
0
10
56
155
92
63
9
1
module Web.Socdiff.Github.Github where import Control.Applicative import qualified Data.Text as T import Haxl.Core import Web.Socdiff.Github.DataSource -- | Fetch a list of followers for the given username getFollowers :: T.Text -> GenHaxl u [T.Text] getFollowers u = dataFetch (GetFollowers u) -- | Fetch a list of r...
relrod/socdiff
src/Web/Socdiff/Github/Github.hs
bsd-2-clause
785
0
10
131
245
133
112
13
1
module GTKMainWindow where import GTKContext import Control.Monad.Trans import Control.Monad.Trans.Reader import qualified GI.Gtk as Gtk setupMainWindow :: ReaderT GTKContext IO () setupMainWindow = do o <- gtkGetObj Gtk.Window "window1" _ <- liftIO $ Gtk.widgetShow o _ <- liftIO $ Gtk.onWidgetDestroy o Gtk....
nbrk/ld
executable/GTKMainWindow.hs
bsd-2-clause
342
0
10
57
105
55
50
11
1
import Network.Wai.Handler.Snap import Controller main :: IO () main = putStrLn "Loaded" >> withLounge (run 3000)
fortytools/lounge
snap-server.hs
bsd-2-clause
116
0
8
18
42
22
20
4
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} module HERMIT.Dictionary.Function ( externals , appArgM , buildAppM , buildAppsM , buildCompositionT , buildFixT , buildIdT , staticArgR , staticArgPosR , staticArgPredR , stat...
beni55/hermit
src/HERMIT/Dictionary/Function.hs
bsd-2-clause
9,522
0
23
2,746
2,641
1,353
1,288
143
5
module REPL.REPL ( repl ) where import System.IO (hFlush, stdout) import Control.Monad (when) import System.Exit (exitSuccess) import Data.Char (toLower) import Rating import REPL.Commands import REPL.Exit import REPL.List import REPL.NPC import REPL.Set import REPL.Unset import REPL.Lock impor...
sandmark/AlbanKnights
src/REPL/REPL.hs
bsd-3-clause
1,203
0
15
316
495
237
258
44
3
module Purescript.Ide.CodecJSON where import Purescript.Ide.Externs (ExternDecl(..)) import Data.Aeson instance ToJSON ExternDecl where toJSON (FunctionDecl n t) = object ["name" .= n, "type" .= t] toJSON (ModuleDecl n t) = object ["name" .= n, "type" .= t] toJSON (DataDecl n t) = obj...
passy/psc-ide
lib/Purescript/Ide/CodecJSON.hs
bsd-3-clause
526
0
9
121
212
113
99
9
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} module HaskellCI.Config.ConstraintSet where import HaskellCI.Prelude import qualified Distribution.FieldGrammar as C import HaskellCI.Newtypes import HaskellCI.OptionsGrammar data ConstraintSet = ConstraintSe...
hvr/multi-ghc-travis
src/HaskellCI/Config/ConstraintSet.hs
bsd-3-clause
1,838
0
15
518
351
190
161
31
1
-- Compiler Toolkit: finite maps -- -- Author : Manuel M. T. Chakravarty -- Created: 23 March 95 -- -- Version $Revision: 1.12 $ from $Date: 2003/04/16 11:11:46 $ -- -- Copyright (c) [1995..2000] Manuel M. T. Chakravarty -- -- This file is free software; you can redistribute it and/or modify -- it under the term...
mwotton/ctkl
src/Text/CTK/FiniteMaps.hs
bsd-3-clause
16,301
174
15
4,750
4,342
2,248
2,094
219
6
import GL import Compile0 example :: GCM () example = do a <- createPort :: GCM (Port Int) b <- createPort component $ do assert $ val a === val b + 1 output a "a" output b "b"
GRACeFUL-project/DSL-WP
deliverables/d4.3/test.hs
bsd-3-clause
194
0
13
56
92
42
50
10
1
{-| Module : Idris.Core.Evaluate Description : Evaluate Idris expressions. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE BangPatterns, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, PatternGuards #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module...
ben-schulz/Idris-dev
src/Idris/Core/Evaluate.hs
bsd-3-clause
52,168
0
28
19,303
18,211
9,304
8,907
927
80
module Codec.Crypto.DSA( module Codec.Crypto.DSA.Exceptions ) where import Codec.Crypto.DSA.Exceptions
GaloisInc/DSA
src/Codec/Crypto/DSA.hs
bsd-3-clause
121
0
5
26
24
17
7
3
0
-- -- 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. -- {-# LANGUAGE OverloadedStrings ...
glasnt/selecto
src/Selecto/NagiosSearch.hs
bsd-3-clause
2,187
0
15
477
468
233
235
40
3
{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} module Test.Async.IO ( ioTestGroup ) where import Control.Monad (when, void) import Data.Maybe (isJust, isNothing) import Control.Concurrent.Lifted import Control.Exception.Lifted as E #if MIN_VERSION_monad_control(1, 0, 0) import Control.Concurrent.Async.Lift...
dmjio/lifted-async
tests/Test/Async/IO.hs
bsd-3-clause
2,374
0
14
504
762
366
396
73
2
module CodeGeneration.CodeGenerator (generateCode) where import Control.Monad.Reader import Control.Monad.Writer import Tree.HtmlTree import CodeGeneration.JavascriptCode import qualified Data.Map as Map type CodeGeneration = WriterT String (Reader JavascriptCode) () -- | Generate the JS code to creat...
sergioifg94/Hendoman
src/CodeGeneration/CodeGenerator.hs
bsd-3-clause
2,414
0
17
509
648
336
312
37
1
module Horbits.Orbit (module X, module Horbits.Orbit) where import Control.Lens import Horbits.Body import Horbits.Orbit.Class as X import Horbits.Orbit.Data as X import Horbits.Orbit.Geometry as X import Horbits.Orbit.Position as X import ...
chwthewke/horbits
src/horbits/Horbits/Orbit.hs
bsd-3-clause
481
0
5
147
95
64
31
11
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveDataTypeable #-} module Harihara.Options ( parseOptions , HariharaOptions (..) , HariharaException (..) ) where import Control.Exception import Data.Foldable (foldrM) import qualified Data.Set as S import Data.Typeable (Typeable()) import System.Console.Ge...
kylcarte/harihara
src/Harihara/Options.hs
bsd-3-clause
4,324
0
12
929
1,156
613
543
115
11
{-# LANGUAGE OverloadedStrings #-} module Application where import Web.Routes.Nested import Network.HTTP.Types defApp :: Application defApp _ respond = respond (textOnlyStatus status404 "404 Not Found")
athanclark/clark-mining-tech
src/Application.hs
bsd-3-clause
213
0
7
34
43
25
18
7
1
module Test.Collision (testCollision) where import Test.Framework import Test.Framework.Providers.QuickCheck2 import Test.QuickCheck import Data.List hiding (insert) import Collision import Environment import Test.ArbitraryInstances testCollision = testGroup "Collision" [testProperty "same result as naive" pNaive]...
alexisVallet/haskell-shmup
Test/Collision.hs
bsd-3-clause
872
0
14
168
243
127
116
26
1
{-# LANGUAGE FlexibleContexts #-} module LogMan.Processor ( run ) where import Control.Monad.State import LogMan.Filters import LogMan.LogEntry import LogMan.LogFile import LogMan.Options import LogMan.Output processEntries :: (MonadIO m, MonadState Options m) => [String] -> m () processEntries n = do es <...
cwmunn/logman
src/LogMan/Processor.hs
bsd-3-clause
500
0
9
89
168
87
81
18
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveFunctor #-} module Parser241.Parser.ProductionRule.Internal.Manager where import Parser241.Parser.ProductionRule.Internal.Maker import Control.Monad.Writer (Writer(..), runWriter, tell, MonadWriter(..)) import Parser24...
YLiLarry/parser241-production-rule
src/Parser241/Parser/ProductionRule/Internal/Manager.hs
bsd-3-clause
1,721
0
12
346
594
320
274
40
2
-- Copyright 2021 Google LLC -- -- Use of this source code is governed by a BSD-style -- license that can be found in the LICENSE file or at -- https://developers.google.com/open-source/licenses/bsd {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LAN...
google-research/dex-lang
src/lib/Err.hs
bsd-3-clause
17,510
0
16
4,122
5,326
2,736
2,590
-1
-1
{-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} module Signal.Core.Stream where import Control.Monad.Operational.Compositional import Control.Applicative import Control.Monad import Prelude ((.), ($)) -------------------------------------------------------------------------------- -- * Streams -----...
markus-git/signal
src/Signal/Core/Stream.hs
bsd-3-clause
1,276
0
9
199
296
166
130
16
1
module Sound.Synthesis (module X) where import Sound.Synthesis.Amplitude as X import Sound.Synthesis.Combinator as X import Sound.Synthesis.Constant as X import Sound.Synthesis.Envelope as X import Sound.Synthesis.Frequency as X import Sound.Synthesis.Interval as X import Sound.Synthesis.Type as X import Sound.Synthesi...
pskrz/Synthesis
src/Sound/Synthesis.hs
bsd-3-clause
366
0
4
41
84
62
22
10
0
module OpenCV.Unsafe ( unsafeCoerceMat , unsafeCoerceMatM -- * Mutable Matrix , unsafeFreeze , unsafeThaw , unsafeRead , unsafeWrite ) where import "base" Foreign.Storable ( Storable, peek, poke ) import "primitive" Control.Monad.Primitive ( PrimMonad, PrimState, unsafePrimToPrim ...
Cortlandd/haskell-opencv
src/OpenCV/Unsafe.hs
bsd-3-clause
1,043
0
13
235
322
174
148
-1
-1
-- | The main prover loop. {-# LANGUAGE RecordWildCards, MultiParamTypeClasses, GADTs, BangPatterns, OverloadedStrings, ScopedTypeVariables, GeneralizedNewtypeDeriving, PatternGuards, TypeFamilies #-} module Twee where import Twee.Base import Twee.Rule hiding (normalForms) import qualified Twee.Rule as Rule import Twe...
nick8325/kbc
src/Twee.hs
bsd-3-clause
25,575
0
19
5,607
7,355
3,833
3,522
-1
-1
module HplAssets.Clouds ( transformCloud, emptyCloud ) where import BasicTypes import HplAssets.Cloud.Types import FeatureModel.Types import Data.Generics import Data.List emptyCloud :: CloudModel -> CloudModel emptyCloud cloudmodel = cloudmodel { clouds = [] } transformCloud :: CloudTransformation -> CloudMode...
alessandroleite/hephaestus-pl
src/meta-hephaestus/HplAssets/Clouds.hs
lgpl-3.0
799
0
13
170
264
146
118
17
1
type Matrix a = [Row a] type Row a = [a] type Grid = Matrix Digit type Digit = Char digits :: [Char] digits = ['1' .. '9'] blank :: Digit -> Bool blank = (== '0') solve :: Grid -> [Grid] solve = filter valid . completions completions :: Grid -> [Grid] completions d = [] valid :: Grid -> Bool valid d = False
trymilix/cookbooks
Software/haskell/sudoku.hs
apache-2.0
316
0
6
73
139
81
58
14
1
module EditWebhook where import Github.Repos.Webhooks import qualified Github.Auth as Auth import Github.Data.Definitions main :: IO () main = do let auth = Auth.OAuth "oauthtoken" let editWebhookDef = EditRepoWebhook { editRepoWebhookRemoveEvents = Just [WebhookWildcardEvent], editRepoWebhookAddE...
jwiegley/github
samples/Repos/Webhooks/EditWebhook.hs
bsd-3-clause
839
0
13
162
226
120
106
19
2
module Jana.ErrorMessages where import Text.Printf import Jana.Error import Jana.Ast aliasError :: Ident -> Ident -> Message aliasError id1 id2 = Message $ printf "Identifiers `%s' and `%s' are aliases" (ident id1) (ident id2) unboundVar :: String -> Message unboundVar name = Message $ printf "Variable `%s' ha...
mbudde/jana
src/Jana/ErrorMessages.hs
bsd-3-clause
4,465
0
9
961
993
508
485
96
4
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/Text/Internal/Encoding/Fusion.hs" #-} {-# LANGUAGE BangPatterns, CPP, Rank2Types #-} -- | -- Module : Data.Text.Internal.Encoding.Fusion -- Copyright : (c) Tom Harper 2008-2009, -- (c) Bryan...
phischu/fragnix
tests/packages/scotty/Data.Text.Internal.Encoding.Fusion.hs
bsd-3-clause
7,791
0
15
2,439
2,367
1,233
1,134
147
3
-- | Create a bundle to be uploaded to Stackage Server. {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Stackage.ServerBundle ( serverBundle , epochTime , bpAllPackages , docsListing ) where import qualified Codec.Archive.Tar a...
myfreeweb/stackage
Stackage/ServerBundle.hs
mit
4,251
0
22
1,550
1,024
538
486
91
3
{- Copyright 2015 Google Inc. All rights 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 law or a...
Ye-Yong-Chi/codeworld
codeworld-base/src/GHC/Exception.hs
apache-2.0
741
0
4
136
23
17
6
4
0
module WaiAppStatic.Types ( -- * Pieces Piece , toPiece , fromPiece , unsafeToPiece , Pieces , toPieces -- * Caching , MaxAge (..) -- * File\/folder serving , FolderName , Folder (..) , File (..) , LookupResult (..) , Listing -- * Settings , St...
sordina/wai
wai-app-static/WaiAppStatic/Types.hs
bsd-2-clause
5,370
0
11
1,296
622
391
231
63
1
{-# LANGUAGE RankNTypes #-} module Main (main) where import Common (commonMain) import Control.DeepSeq import Control.Monad.Identity import qualified Control.Monad.Trans.Reader as R import qualified Control.Monad.Trans.State.Strict as S import Criterion.Main import Data.Monoid import Pipes import Pipes.Lift defaultMa...
FranklinChen/Haskell-Pipes-Library
benchmarks/LiftBench.hs
bsd-3-clause
2,050
0
20
580
848
434
414
51
1
{-# OPTIONS -w #-} module Plugin.Free.Theorem where import Plugin.Free.Type import Plugin.Free.Expr import Plugin.Free.Util data Theorem = ThForall Var Type Theorem | ThImplies Theorem Theorem | ThEqual Expr Expr | ThAnd Theorem Theorem deriving (Eq,Show) precIMPLIES, precAND ...
zeekay/lambdabot
Plugin/Free/Theorem.hs
mit
6,106
0
17
1,940
2,122
1,060
1,062
155
9
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1993-1998 This is useful, general stuff for the Native Code Generator. Provide trees (of instructions), so that lists of instructions can be appended in linear time. -} module OrdList ( OrdList, nilOL, isNilOL, unitOL, a...
shlevy/ghc
compiler/utils/OrdList.hs
bsd-3-clause
3,258
0
9
945
1,499
763
736
91
6
<?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="fa-IR"> <title>Alert Filters | ZAP Extension</title> <maps> <homeID>top</homeID> <mapre...
thc202/zap-extensions
addOns/alertFilters/src/main/javahelp/org/zaproxy/zap/extension/alertFilters/resources/help_fa_IR/helpset_fa_IR.hs
apache-2.0
974
78
66
159
413
209
204
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.JHC -- Copyright : Isaac Jones 2003-2006 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This module contains most of the JHC-specific code for...
martinvlk/cabal
Cabal/Distribution/Simple/JHC.hs
bsd-3-clause
8,758
0
17
2,103
2,077
1,144
933
155
2
{-# OPTIONS_GHC -fwarn-unsafe #-} {-# LANGUAGE FlexibleInstances #-} module SH_Overlap9_A ( C(..) ) where import SH_Overlap9_B instance {-# OVERLAPS #-} C [Int] where f _ = "[Int]"
urbanslug/ghc
testsuite/tests/safeHaskell/overlapping/SH_Overlap9_A.hs
bsd-3-clause
198
0
6
44
38
24
14
9
0
-- !!! Test passing doubles to a ccall import Foreign.C foreign import ccall unsafe "math.h sin" c_sin :: CDouble -> IO CDouble main = c_sin 1.0 >>= print
urbanslug/ghc
testsuite/tests/ffi/should_run/ffi003.hs
bsd-3-clause
160
0
7
33
40
21
19
4
1
{-# LANGUAGE UnicodeSyntax, MultiParamTypeClasses, FlexibleInstances #-} module T2902_B_PairingSum (Sum(..), PSum) where import T2902_Sum data PSum a b = Empty | Tree a b [PSum a b] instance (Ord a, Eq b, Num b) ⇒ Sum PSum a b where insert v r = union $ Tree v r [] union x Empty = x union Empty x = x uni...
ghc-android/ghc
testsuite/tests/perf/should_run/T2902_B_PairingSum.hs
bsd-3-clause
876
0
12
255
453
234
219
25
0
module Main where checkSort :: Ord a => [a] -> Bool checkSort [] = True checkSort [_] = True checkSort (x:y:xs) = (x <= y) && checkSort (y:xs) checkSort' :: Ord a => [a] -> Bool checkSort' = and . (drop 1 >>= zipWith (>=)) checkSort'' xs = and $ (drop 1 >>= zipWith (>=)) xs checkSort''' xs = and $ zipWith (>=) (drop...
fredmorcos/attic
snippets/haskell/CheckSort.hs
isc
814
0
11
390
353
199
154
-1
-1
module Main where import HIRST (mainH) main = mainH
mihaimaruseac/hirst-v00
src/Main.hs
mit
54
0
5
11
17
11
6
3
1
{-# LANGUAGE OverloadedStrings #-} module Main where import qualified SDL.Image as Img import qualified SDL as SDL import Control.Concurrent (threadDelay) import Control.Monad (unless) import Linear.Affine import Linear.V2 import Linear.V4 frameRate = 25 main :: IO () main = do SDL.initialize [SDL.InitVideo] ...
jaiyalas/sdl2-image
example/unsorted/Example02.hs
mit
1,241
0
18
336
438
221
217
34
3
import Data.List (sort) import Text.ParserCombinators.ReadP (ReadP) import Text.ParserCombinators.ReadPrec (lift) import Text.Read (readPrec) import qualified Text.ParserCombinators.ReadP as RP import Common (rpInt) main :: IO () main = do partOne >>= print partTwo >>= prin...
wizzup/advent_of_code
2015/haskell/exe/Day02.hs
mit
1,330
0
12
339
522
287
235
37
1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Core.InputGLFW() where import Core.Input import qualified Graphics.UI.GLFW as GLFW instance ToKey GLFW.Key where toKey k = case k of GLFW.Key'Space -> CharKey ' ' GLFW.Key'Apostrophe -> CharKey '\'' GLFW.Key'Comma -> CharKey ',' GLFW.Key'Minus -> Char...
NCrashed/sinister
src/client/Core/InputGLFW.hs
mit
5,161
0
11
1,148
1,488
721
767
155
0
module GOL where import Data.Array.IArray import Data.Array.Unboxed data World = World { gridWidth :: Int, gridHeight :: Int, grid :: Grid } deriving (Show) type Grid = UArray (Int, Int) Bool setupGrid :: Int -> Int -> World setupGrid x y = let cells = replicate (x*y) False grid = li...
Lateks/gol
src/GOL.hs
mit
1,414
0
12
432
586
325
261
31
3
-- xmonad config used by Vic Fryzel -- Author: Vic Fryzel -- https://github.com/vicfryzel/xmonad-config import System.IO import System.Exit import XMonad import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers import XMonad.Hooks.SetWMName import XMonad.Layout.Fullscreen import...
evan886/myxmonad
4bsd/2020/xmonad.hs
mit
12,793
0
17
2,566
1,989
1,231
758
169
1
module MattermostBot.Data ( module MattermostBot.Data.Config , module MattermostBot.Data.Slack ) where import MattermostBot.Data.Config import MattermostBot.Data.Slack
marcelbuesing/mattermost-bot
src/MattermostBot/Data.hs
mit
177
0
5
23
34
23
11
5
0
{-# LANGUAGE OverloadedStrings #-} module Test.Smoke.App.PrintResults ( printResult, ) where import Control.Monad (forM_, when) import Control.Monad.IO.Class (liftIO) import Control.Monad.Trans.Reader (ask) import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Data.String (fromString) import...
SamirTalwar/Smoke
src/app/Test/Smoke/App/PrintResults.hs
mit
5,383
0
15
846
1,572
772
800
115
2
module Mockups.Parsers.Box where import Control.Applicative import Data.Attoparsec.Char8 import qualified Data.ByteString.Char8 as BS import Mockups.Parsers.Combinators import Mockups.Elements.Element boxParser :: Parser ContainerAttr boxParser = vboxParser <|> hboxParser vb...
ostapneko/tiny-mockups
src/main/Mockups/Parsers/Box.hs
mit
609
0
8
116
139
78
61
16
1
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Main where import Nanomsg import Test.Framework.TH (defaultMainGenerator) import Test.Framework.Providers.QuickCheck2 (testProperty) import Test.QuickCheck import Test.QuickCheck.Monadic import Data.ByteString (ByteString) import qualified D...
christianlavoie/nanomsg-haskell
tests/Properties.hs
mit
6,271
0
21
2,349
2,047
912
1,135
189
1
longest :: [String] -> String -> String longest (word:rest) current = if length word > length current then longest rest word else longest rest current longest [] current = current longestWord :: String -> String longestWord text = longest (words text) "" main :: IO () main = do contents <- getContents print $ l...
considerate/progp
Haskell/longest.hs
mit
349
6
8
66
144
71
73
12
2
{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} module KMC.SymbolicFST (FST(..) ,Edge ,fstStateSize ,fstTransSize ,edgesToList ,edgesFromList ,fstEvalEpsilonEdges ,fstEdges ...
diku-kmc/kleenexlang
src/KMC/SymbolicFST.hs
mit
17,283
0
21
5,322
5,930
3,149
2,781
296
5
{-# LANGUAGE OverloadedStrings #-} -- | Legacy types from Keter version 0.4. Retained to keep backwards -- compatibility in config file format. module Keter.Types.V04 where import Control.Applicative import Data.Aeson import Data.Bool import Data.Conduit.Network (Ho...
tolysz/keter
Keter/Types/V04.hs
mit
5,798
0
29
1,866
1,272
698
574
129
1
{- | Module : $Header$ Description : Conversion to core CspCASL Copyright : (c) Andy Gimblett and Uni Bremen 2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : a.m.gimblett@swansea.ac.uk Stability : provisional Portability : portable Converting sugared CspCASL to core CspCASL. The foll...
nevrenato/Hets_Fork
CspCASL/Core_CspCASL.hs
gpl-2.0
2,439
0
14
585
773
392
381
32
19
{- | Module : $Header$ Description : Guarded Dependency Store Copyright : (c) Ewaryst Schulz, DFKI Bremen 2011 License : GPLv2 or higher, see LICENSE.txt Maintainer : Ewaryst.Schulz@dfki.de Stability : experimental Portability : portable Definition of guarded dependencies resulting from the use o...
nevrenato/Hets_Fork
CSL/GuardedDependencies.hs
gpl-2.0
3,713
0
15
1,079
817
428
389
50
2
{-# LANGUAGE Arrows, NoMonomorphismRestriction #-} {- -} module Main ( main , mkH1 , mkH2 , mkH3 , mkH4 , mkH5 , mkH6 ) where {- Standard Library Modules Imported -} import Control.Arrow ( (>>>) ) import System.Console.GetOpt ( getOpt , usageInfo , ArgOrder ( .. ) , OptDescr ( .. ) ,...
allanderek/ipclib
web/ipc_web_gen/IpcWeb.hs
gpl-2.0
22,718
0
14
8,370
4,399
2,271
2,128
418
2
module QLogic.Examples (Lantern(..) , module QLogic.Poset.Examples , lanternLogic , boolean3Logic , booleanLogic , concreteLogic , evenSubsets ...
ttylec/QLogic
src/QLogic/Examples.hs
gpl-3.0
3,622
0
9
1,252
856
456
400
76
12
{-# language TypeFamilies, FlexibleInstances, DeriveFunctor #-} module Data.Sparse.Internal.SList where import Data.Sparse.Utils import Numeric.LinearAlgebra.Class -- | Sparse list newtype SList a = SL {unSL :: [(Int, a)]} deriving (Eq, Show, Functor) emptySL :: SList a emptySL = SL [] consSL :: (Int, a) -> SLi...
ocramz/sparse-linear-algebra
src/Data/Sparse/Internal/SList.hs
gpl-3.0
1,853
0
9
426
678
382
296
33
1