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
-- Intermediate Haskell/Other data structures -- https://en.wikibooks.org/wiki/Haskell/Other_data_structures data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving (Show) tree = Branch (Branch (Leaf 1) (Leaf 2)) (Leaf 3) mapTree :: (a -> b) -> Tree a -> Tree b mapTree f (Leaf x) = Leaf (f x) mapTree f (Branch ...
strburst/haskell-stuff
wikibooks/otherdatastructs.hs
mit
3,902
0
16
1,106
1,371
696
675
66
5
module System.AtomicWrite.Writer.StringSpec (spec) where import Test.Hspec (it, describe, shouldBe, Spec) import System.AtomicWrite.Writer.String (atomicWriteFile) import System.IO.Temp (withSystemTempDirectory) import System.FilePath (joinPath) import System.PosixCompat.Files (setFileMode, setFileCreationMask, ge...
bitemyapp/atomic-write
spec/System/AtomicWrite/Writer/StringSpec.hs
mit
2,955
0
16
738
497
252
245
44
1
{-# LANGUAGE JavaScriptFFI #-} -- | A wrapper over the Electron crash reporter API, as documented -- <https://electron.atom.io/docs/api/crash-reporter here>. -- -- After 'start' is called a crash reporter process will be spawned such that -- if a crash occurs, a POST request with mimetype @multipart/form-data@ w...
taktoa/ghcjs-electron
src/GHCJS/Electron/CrashReporter.hs
mit
4,151
10
10
1,067
282
183
99
34
1
{-# LANGUAGE LambdaCase #-} module Main where import Language.Haskell.Exts import System.Environment import System.Exit runParser :: FilePath -> IO Module runParser f = parseFile f >>= \case ParseOk a -> return a ParseFailed loc err -> do putStrLn ("Parsing failure: " ++ prettyPrint loc) putStrLn...
jozefg/hi
src/Main.hs
mit
427
0
14
99
139
67
72
18
2
head' :: [a] -> a head' xs = case xs of [] -> error "No head for empty lists!" (x:_) -> x describeList :: [a] -> String describeList ls = "The list is " ++ case ls of [] -> "empty." [x] -> "a singleton list." ...
v0lkan/learning-haskell
case.hs
mit
537
0
9
229
158
82
76
12
3
{-# LANGUAGE CPP #-} {-# LANGUAGE TupleSections, LambdaCase, RecordWildCards, OverloadedLists, OverloadedStrings, FlexibleContexts, ScopedTypeVariables, MultiParamTypeClasses, DeriveGeneric #-} module HsToCoq.ConvertHaskell.Declarations.TyCl ( convertM...
antalsz/hs-to-coq
src/lib/HsToCoq/ConvertHaskell/Declarations/TyCl.hs
mit
22,825
7
29
7,034
5,137
2,637
2,500
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} module Notification(ws, notify) where import Network.Wai import Network.Wai.Handler.WebSockets import Network.HTTP.Types import Network.WebSockets import ...
gip/cinq-cloches-ledger
src/Notification.hs
mit
2,951
0
21
670
873
444
429
73
3
module Main where import Criterion.Main import HERMIT.Optimization.StreamFusion.List main = defaultMain [ bgroup "test" [ bench "100" $ whnf test 100 , bench "1000" $ whnf test 1000 -- , bench "10000" $ whnf test 10000 ...
ku-fpg/hermit-streamfusion
Main.hs
mit
419
0
11
163
136
73
63
6
1
-- This prime number generator uses a lazy wheel sieve as described in: -- -- Colun Runciman, "Lazy wheel sieves and sprials of primes", -- <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.55.7096> module PrimeGen (primes) where data Wheel = Wheel Int [Int] primes :: [Int] primes = sieve wheels primes ...
cpettitt/euler
PrimeGen.hs
mit
1,259
0
14
430
492
265
227
24
1
{-# LANGUAGE QuasiQuotes, OverloadedStrings #-} module Server.Model.Histogram ( createHistogram , doesHistogramExist , listHistogramWords , listUrls ) where import Data.Text (Text, pack) import Hasql.Postgres (Postgres) import Histogram (Histogram) import Network.URI (URI) import qualified Data.Map as Map import qua...
Jonplussed/url-text-histogram
src/Server/Model/Histogram.hs
mit
2,068
0
10
511
495
274
221
40
2
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, TypeOperators #-} -- Copyright (c) 2008 Jean-Philippe Bernardy -- | Various high-level functions to further classify. module Yi.Misc where {- Standard Library Module Imports -} import Data.List ( isPrefixOf , (\\) , filter ) import System.FriendlyPat...
codemac/yi-editor
src/Yi/Misc.hs
gpl-2.0
4,241
0
15
963
837
440
397
66
6
-- | -- Module: Utils.RootFinding -- Copyright: (c) Andreas Bock -- License: BSD-3 -- Maintainer: Andreas Bock <bock@andreasbock.dk> -- Stability: experimental -- Portability: portable -- module Utils.RootFinding where -- Bisection method implementation finding the root of f(x) in the interval [a,b] -- ...
andreasbock/hql
src/Utils/RootFinding.hs
gpl-2.0
683
0
12
212
162
89
73
12
3
module Main where import Lib main :: IO () main = do putStrLn "Enter an integer: " input1 <- readLn :: IO Int putStrLn "Enter another integer: " input2 <- readLn :: IO Int putStrLn (show (addTwo input1 input2)) addTwo :: Int -> Int -> Int addTwo x y = x + y
shimanekb/Learn_Haskell
pp2/ppTwoOne/app/Main.hs
gpl-2.0
301
0
11
96
107
52
55
11
1
{- teafree, a Haskell utility for tea addicts Copyright (C) 2013 Fabien Dubosson <fabien.dubosson@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 t...
StreakyCobra/teafree
src/Teafree/Command/Info.hs
gpl-3.0
1,463
0
18
333
198
112
86
20
1
-- -*-haskell-*- -- Vision (for the Voice): an XMMS2 client. -- -- Author: Oleg Belozeorov -- Created: 20 Jun. 2010 -- -- Copyright (C) 2010, 2011 Oleg Belozeorov -- -- 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...
upwawet/vision
src/Playlist.hs
gpl-3.0
1,413
0
14
282
183
107
76
31
1
import Graphics.Rendering.Chart.Easy import Graphics.Rendering.Chart.Backend.Cairo signal :: [Double] -> [(Double,Double)] signal xs = [ (x,(sin (x*3.14159/45) + 1) / 2 * (sin (x*3.14159/5))) | x <- xs ] main = toFile def "example1_big.png" $ do layout_title .= "Amplitude Modulation" setColors [opaque b...
dkensinger/haskell
chart_ex1.hs
gpl-3.0
438
0
14
84
206
110
96
9
1
module Graphics.UI.Bottle.Animation.Id ( AnimId , joinId, subId, augmentId , mappingFromPrefixMap ) where import Control.Lens.Operators import qualified Data.ByteString as SBS import qualified Data.ByteString.Char8 as SBS8 import Data.List.Lens (prefixed) import Data.Map (...
da-x/lamdu
bottlelib/Graphics/UI/Bottle/Animation/Id.hs
gpl-3.0
998
0
10
230
295
167
128
26
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | -- This module facilitates turning parsed surface expressions into the data -- needed by the compiler to generate code. These tasks include: -- [x] Generating unique identifiers for every distinct variable -- [x] Converting surface-level definitions into TopLevel -- [x]...
gatlin/psilo
src/Lib/Preprocessor.hs
gpl-3.0
11,128
0
20
3,325
3,565
1,756
1,809
258
6
{-# LANGUAGE BangPatterns #-} --- | --- | This module contains stuff to handle and convert Filelists alias TreeNodes --- | --- Copyright : (c) Florian Richter 2011 --- License : GPL --- module Filelist where import System.Directory import System.Posix.Directory import System.FilePath import System.Posix.Files i...
f1ori/hadcc
Filelist.hs
gpl-3.0
9,388
6
16
2,728
2,629
1,344
1,285
152
3
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE QuasiQuotes #-} import Control.Monad (unless) import Data.String.Interpolate (i) import Data.Tuple.Operator (pattern (:-)) import Development.Shake (A...
cblp/stack-offline
test/Spec.hs
gpl-3.0
3,837
0
15
926
955
527
428
76
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/RegionAutoscalers/Patch.hs
mpl-2.0
5,406
0
18
1,218
641
382
259
97
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-sqladmin/gen/Network/Google/Resource/SQL/SSLCerts/CreateEphemeral.hs
mpl-2.0
6,182
0
20
1,438
870
508
362
129
1
-- | -- Module: SBP2JSON -- Copyright: Copyright (C) 2015 Swift Navigation, Inc. -- License: LGPL-3 -- Maintainer: Mark Fine <dev@swiftnav.com> -- Stability: experimental -- Portability: portable -- -- SBP to JSON tool - reads SBP binary from stdin and sends SBP JSON -- to stdout. import BasicP...
swift-nav/libsbp
haskell/main/SBP2JSON.hs
lgpl-3.0
1,042
0
9
267
167
101
66
21
1
import Data.List import Control.Monad.Memo data Moves = D | R space' 0 = [[]] space' x = [q:qs | qs <- space' (x-1), q <- ['D', 'R']] space n = permutations $ (take n $ cycle "R") ++ (take n $ cycle "D") latticePaths n = length $ nub $ space n paths 0 0 = 0 paths 0 _ = 1 paths _ 0 = 1 paths r d = (paths (r - 1) d)...
LambdaMx/haskelldojo
session_7/LatticePaths.hs
unlicense
730
0
10
192
387
195
192
21
1
module Hecate.Backend.SQLite.AppContext ( AppContext (..) ) where import qualified Database.SQLite.Simple as SQLite import Hecate.Data (Config) -- | 'AppContext' represents the shared environment for computations which occur -- within our application. Values of this type are created by 'cr...
henrytill/hecate
src/Hecate/Backend/SQLite/AppContext.hs
apache-2.0
448
0
9
91
61
41
20
7
0
-- layout can be stopped by parse error test = let x = 1; y = x in y
metaborg/jsglr
org.spoofax.jsglr/tests-offside/terms/doaitse/layout1.hs
apache-2.0
68
0
8
18
24
13
11
1
1
-- Thinking Functionall with Haskell -- Chapter 4 Homework C -- find common elements for two decreasing list disjoint :: (Ord a) => [a] -> [a] -> Bool disjoint [] ys = False disjoint xs [] = False disjoint (x:xs) (y:ys) = if x == y then True else if x > y then disjoint xs (y:ys) ...
Oscarzhao/haskell
functional_program_design/ch04/disjoint.hs
apache-2.0
355
0
9
112
128
70
58
6
3
module GridPolytopes.A338323Spec (main, spec) where import Test.Hspec import GridPolytopes.A338323 (a338323) main :: IO () main = hspec spec spec :: Spec spec = describe "A338323" $ it "correctly computes the first 5 elements" $ take 5 (map a338323 [0..]) `shouldBe` expectedValue where expectedValue = [0,...
peterokagey/haskellOEIS
test/GridPolytopes/A338323Spec.hs
apache-2.0
338
0
10
63
115
65
50
10
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} import qualified Blaze.ByteString.Builder as Blaze import qualified Blaze.ByteStr...
tanakh/hackage-mirror
crawler.hs
bsd-2-clause
6,619
1
30
1,767
1,995
1,024
971
158
4
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Arity and eta expansion -} {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -Wno-incomplete-record-updates #-} -- | Arity and eta expansion module CoreArity ( manifestArity, joinRhsArity, exprArity, typeArity, ...
sdiehl/ghc
compiler/coreSyn/CoreArity.hs
bsd-3-clause
44,032
0
16
11,940
5,627
2,911
2,716
340
7
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module Autonix.Src (Src, mkSrc, url, sha256, name) where import Control.Lens import Data.Aeson import Data.Aeson.Types import Data.Text (Text) import GHC.Generics data Src = Src { _url :: FilePath , _sha256 :: Text , _name :: Text } ...
ttuegel/autonix-deps
src/Autonix/Src.hs
bsd-3-clause
625
0
8
120
166
97
69
22
1
import DSL.Structured.Api argument1, argument2, argument3 :: Argument argument1 = argument ["kill", "intent"] [] "murder" argument2 = argument ["witness"] ["unreliable"] "intent" argument3 = argument ["witness2"] ["unreliable2"] "-intent" threads1 :: Threads threads1 = threads [argument1, ...
shingoOKAWA/hsarg-haskell
src/DSL/Structured/Test.hs
bsd-3-clause
903
0
8
184
259
143
116
21
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.SGIX.IglooInterface -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/SGIX/IglooInterface.hs
bsd-3-clause
668
0
4
78
37
31
6
3
0
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses #-} module EFA2.Signal.TH where import Control.Monad (liftM) import Language.Haskell.TH type Val = Double class Sample cont dim where fromSample :: dim cont -> cont Val toSample :: cont Val -> dim cont printQ :: Ppr a => Q a -> IO...
energyflowanalysis/efa-2.1
attic/src/EFA2/Signal/TH.hs
bsd-3-clause
1,940
0
18
403
865
441
424
48
1
{-# LANGUAGE BangPatterns, TupleSections, Rank2Types #-} module Evaluator.Deeds where import StaticFlags import Utilities import Data.Ord (comparing) -- | Number of unclaimed deeds. Invariant: always greater than or equal to 0 type Unclaimed = Int -- | A deed supply shared amongst all expressions type Deeds = Int ...
batterseapower/chsc
Evaluator/Deeds.hs
bsd-3-clause
2,601
0
15
577
470
265
205
26
2
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE TypeFamilies #-} -- | 'Patch'es on 'Map' that consist only of insertions (including overwrites) -- and deletions module Reflex.Patch.Map where import Reflex.Patch.Class import Data.Map (Map) import qualified Data.Map as Map import Data.Maybe import Data.Semigroup -- | A set o...
Saulzar/reflex
src/Reflex/Patch/Map.hs
bsd-3-clause
2,374
0
12
466
467
254
213
30
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-| Module : Numeric.AERN.RmToRn.Plot.Simple Description : simple utilities for plotting functions Copyright : (c) Michal Konecny License : BSD3 Maintainer : mikkonecny@gmail.com ...
michalkonecny/aern
aern-realfn-plot-gtk/src/Numeric/AERN/RmToRn/Plot/Simple.hs
bsd-3-clause
4,970
0
14
1,327
1,112
623
489
95
1
module Language.Interpreter.Operators where import Control.Monad.Except ( throwError ) import Data.Fixed ( mod' ) import Language.Ast ( Value(Number, Symbol) ) import Language.Interpreter.Types ( InterpreterProcess ) import ...
rumblesan/improviz
src/Language/Interpreter/Operators.hs
bsd-3-clause
2,165
0
14
694
801
418
383
50
25
-- Copyright : Isaac Jones 2003-2004 {- All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and ...
imeckler/mote
CabalVersions/Cabal21.hs
bsd-3-clause
2,636
0
10
467
240
151
89
29
0
module Test.Sloth.Color ( Color(..), showColor ) where data Color = Red | Green | Magenta | Blue instance Show Color where show Red = "31" show Green = "32" show Magenta = "35" show Blue = "34" -- | Color the result of a show function showColor :: Color -> S...
plancalculus/sloth
Test/Sloth/Color.hs
bsd-3-clause
425
0
11
133
127
69
58
15
1
{-# LANGUAGE ScopedTypeVariables #-} -- | More IO functions. The functions include ones for reading files with specific encodings, -- strictly reading files, and writing files with encodings. There are also some simple -- temporary file functions, more advanced alternatives can be found in -- the <http://hackage...
mgmeier/extra
src/System/IO/Extra.hs
bsd-3-clause
7,115
0
18
1,620
1,430
732
698
116
1
module Data.Carbonara.Time where import Data.Char (isDigit) import Data.Time.Calendar (Day(toModifiedJulianDay), addDays, fromGregorian, toGregorian) --time import Data.Time.Clock (getCurrentTime, UTCTime(utctDay)) import Data.Time.Calendar.Easter (gregorianEaster) addTradingDays :: Integral i => i -> D...
szehk/Haskell-Carbonara-Library
src/Data/Carbonara/Time.hs
bsd-3-clause
6,965
0
15
1,454
1,798
956
842
113
1
module EFA2.Solver.Horn where import qualified Data.Traversable as Trav import qualified Data.Foldable as Fold import qualified Data.List.Key as Key import qualified Data.List as L import qualified Data.Set as S import qualified Data.Map as M import qualified Data.NonEmpty.Mixed as NonEmptyM import qualified Data.NonE...
energyflowanalysis/efa-2.1
attic/src/EFA2/Solver/Horn.hs
bsd-3-clause
9,092
0
18
2,470
3,573
1,874
1,699
198
3
module Main where import Control.Prototype main = flip runProt initProtEnv $ do ( dog, setName, sit ) <- package "dog" $ do honyuurui <- clone object dog <- clone honyuurui sit <- makeMember "sit" setName <- makeMember "setName" name <- makeMember "name" setMethod dog sit $ \obj _ -> do n <- member ob...
YoshikuniJujo/prototype
examples/test.hs
bsd-3-clause
590
0
18
143
246
112
134
20
1
{-# language FlexibleContexts #-} {-# language ScopedTypeVariables #-} {-# language TypeFamilies #-} module VCopy where import Feldspar import Feldspar.Array.Vector import Feldspar.Array.Buffered import Feldspar.Software import Feldspar.Software.Verify import Feldspar.Software as Soft (icompile) --import Feldspar.H...
markus-git/co-feldspar
examples/VCopy.hs
bsd-3-clause
1,774
0
17
324
613
312
301
40
1
module Resolve.DNS.Transport.Helper.LiveTCP where import Resolve.DNS.Transport.Types import qualified Resolve.DNS.Transport.LiveTCP as TCP import Network.Socket data Config = Config { host :: HostName , port :: ServiceName , passive :: Bool } ...
riaqn/resolve
src/Resolve/DNS/Transport/Helper/LiveTCP.hs
bsd-3-clause
797
0
11
283
208
117
91
17
1
-- for TokParsing, MonadicParsing {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE OverloadedStrings #-} -- {-# LANGUAGE GADTs #-} -- {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE DataKinds #-} -- {-# LANGUAGE KindSignatures #-} {-# LANGUAGE CPP #-} -- {-# OPTIONS_GHC -Wall #-} -- {-# OPTIONS_GHC -fno-warn-unu...
reuleaux/pire
src/Pire/Parser/Token.hs
bsd-3-clause
7,967
0
12
2,524
2,508
1,233
1,275
218
1
-- | An abstract pointer to a compiled PCRE Regex structure -- The structure allocated by the PCRE library will be deallocated -- automatically by the Haskell storage manager. -- {-- snippet data --} data Regex = Regex !(ForeignPtr PCRE) !ByteString deriving (Eq, Ord, Show) {-- /snippet dat...
binesiyu/ifl
examples/ch17/PCRE-compile.hs
mit
1,453
0
24
451
299
153
146
-1
-1
-- | Parsing of constants in GIR files. module Data.GI.GIR.Constant ( Constant(..) , parseConstant ) where import Data.Text (Text) import Data.GI.GIR.BasicTypes (Type) import Data.GI.GIR.Type (parseType, parseCType) import Data.GI.GIR.Parser -- | Info about a constant. data Constant = Constant { co...
ford-prefect/haskell-gi
lib/Data/GI/GIR/Constant.hs
lgpl-2.1
1,079
0
10
328
224
133
91
27
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} -------------------------------------------------------...
Kyly/liquidhaskell
src/Language/Haskell/Liquid/ANFTransform.hs
bsd-3-clause
9,457
0
18
2,617
2,762
1,405
1,357
185
3
module Language.Java.Paragon.TypeCheck.TcTypeDecl where import Language.Java.Paragon.Syntax import Language.Java.Paragon.TypeCheck.Monad import Language.Java.Paragon.TypeCheck.Types import Language.Java.Paragon.TypeCheck.Locks import Language.Java.Paragon.TypeCheck.TcDecl import Language.Java.Paragon.TypeCheck.TcExp...
bvdelft/parac2
src/Language/Java/Paragon/TypeCheck/TcTypeDecl.hs
bsd-3-clause
1,339
0
15
270
380
210
170
24
4
main = putStrLn "Hello world!"
dumptyd/hello-world
hello-world.hs
mit
30
0
5
4
9
4
5
1
1
module Dotnet.System.MarshalByRefObject where import Dotnet import qualified Dotnet.System.Object data MarshalByRefObject_ a type MarshalByRefObject a = Dotnet.System.Object.Object (MarshalByRefObject_ a)
FranklinChen/Hugs
dotnet/lib/Dotnet/System/MarshalByRefObject.hs
bsd-3-clause
207
0
7
20
41
27
14
-1
-1
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module Hakyll.Web.Template.Context.Tests ( tests ) where -------------------------------------------------------------------------------- import Test.Framework (Test, t...
Minoru/hakyll
tests/Hakyll/Web/Template/Context/Tests.hs
bsd-3-clause
2,100
0
12
491
340
180
160
38
2
{-# LANGUAGE TypeFamilies, QuasiQuotes, TemplateHaskell, MultiParamTypeClasses, OverloadedStrings #-} module YesodCoreTest.Ssl ( sslOnlySpec, unsecSpec, sameSiteSpec ) where import qualified YesodCoreTest.StubSslOnly as Ssl import qualified YesodCoreTest.StubLaxSameSite as LaxSameSite import qualified YesodCoreTest.Stu...
s9gf4ult/yesod
yesod-core/test/YesodCoreTest/Ssl.hs
mit
3,064
0
13
682
658
351
307
64
3
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Stg to C-- code generation: bindings -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmBind ( cgTopRhsClosure, ...
christiaanb/ghc
compiler/codeGen/StgCmmBind.hs
bsd-3-clause
30,426
4
24
8,989
4,622
2,417
2,205
373
3
-- Test the flage `force-no-intermediates` (issue #4114) module Main (main) where import T4114dSub keep, nokeep :: [FilePath] keep = ["T4114dSub.myhi", "T4114d.myhi"] nokeep = ["T4114dSub.myo", "T4114d.myo"] main :: IO () main = do mapM_ assertNoKeep nokeep mapM_ assertKeep keep
ezyang/ghc
testsuite/tests/driver/T4114d.hs
bsd-3-clause
290
0
7
48
76
44
32
9
1
{-# LANGUAGE KindSignatures, PolyKinds, DataKinds, RankNTypes #-} module T6081 where data KProxy (a :: *) = KP class KindClass (kp :: KProxy k) instance KindClass (KP :: KProxy [k])
urbanslug/ghc
testsuite/tests/polykinds/T6081.hs
bsd-3-clause
187
1
8
34
55
31
24
-1
-1
{-# LANGUAGE RankNTypes #-} module ShouldCompile where f :: forall a. a -> forall b. b -> Int f = error "urk" -- Both these should be ok, but an early GHC 6.6 failed g1 = [ (+) :: Int -> Int -> Int, f ] g2 = [ f, (+) :: Int -> Int -> Int ]
siddhanathan/ghc
testsuite/tests/typecheck/should_compile/tc210.hs
bsd-3-clause
245
0
8
63
85
52
33
6
1
{-# LANGUAGE MagicHash #-} -- tests that expFloat# works (had linking problems on Windows) import GHC.Exts main = do print (F# (expFloat# 3.45#))
wxwxwwxxx/ghc
testsuite/tests/numeric/should_run/expfloat.hs
bsd-3-clause
150
0
11
27
31
16
15
4
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE GADTs #-} module Types ( Tag(..) , Key(..) , ViewCreated(..) , ViewDestroyed(..) , OutputCreated(..) , OutputDestroyed(..) , OutputResolution(..) , WindowManager ...
cocreature/reactand
src/Types.hs
isc
1,856
0
12
360
523
305
218
66
0
quicksort :: (Ord a) => [a] -> [a] quicksort [] = [] quicksort (x:xy) = (quicksort less) ++ (x : equal) ++ (quicksort more) where less = filter (<x) xy equal = filter (==x) xy more = filter (>x) xy
maggy96/haskell
smaller snippets/qs.hs
mit
212
0
8
54
123
67
56
6
1
{-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE TypeFamilies #-} module Observable.Metropolis where import Control.Comonad import Control.Comonad.Cofree import Control.Monad (forever) import Control.Monad.Primitive (PrimMonad, PrimState) import C...
jtobin/observable
Observable/Metropolis.hs
mit
10,242
0
23
2,672
3,845
1,944
1,901
230
18
{-# LANGUAGE ScopedTypeVariables #-} module Random ( random ) where import Test.Tasty (testGroup, TestTree) import Test.Tasty.QuickCheck (testProperty, Arbitrary, (==>)) import System.Random (Random, randoms, randomRs, mkStdGen) random :: forall a. (Arbitrary a, Show a, Ord a, Fractional a, Random a) => a -> Tes...
expipiplus1/exact-real
test/Random.hs
mit
937
0
19
317
358
197
161
17
1
main = do print $ sum $ filter (\n -> f n == n) [2 .. 6*9^5] where f 0 = 0 f n = d^5 + f n' where (n', d) = divMod n 10
dpieroux/euler
0/0030.hs
mit
140
0
12
56
99
50
49
4
2
module Constructions where import Shape import Centres -------------------------------------------------------------------------------- linesIntersect :: Line -> Line -> Point linesIntersect (Line (Point x1 y1) (Point x2 y2)) (Line (Point x3 y3) (Point x4 y4)) = Point x y where a = y1-y2 b ...
clauderichard/Euclaude
Constructions.hs
mit
3,316
0
12
744
1,186
614
572
53
1
{-# LANGUAGE OverloadedStrings #-} module BT.ZMQ where import qualified System.ZMQ3 as ZMQ import qualified Data.ByteString as B import Control.Monad.IO.Class (liftIO) import Data.Pool (withResource, Pool) import BT.Types import Control.Monad (when) import Control.Exception (throw) sendraw :: Data.Pool.Pool (ZMQ.So...
c00w/BitToll
haskell/BT/ZMQ.hs
mit
798
0
15
153
277
145
132
19
1
module Main where import Language.Haskell.Exts import Language.Haskell.Exts.GenericPretty.Instances import Shared import System.Environment import System.IO import Text.PrettyPrint.GenericPretty prettyPrintHs :: String -> IO () prettyPrintHs path = do resu...
adarqui/haskell-src-exts-genericpretty
examples/pretty-ast.hs
mit
624
0
11
174
162
83
79
19
2
module HaskChat where import Network.Socket import System.IO import Control.Concurrent import Control.Concurrent.Chan import Control.Monad import Control.Monad.Fix (fix) import Control.Exception type Msg = (Int,String) main = do chan <- newChan sock <- socket AF_INET Stream 0 setSocke...
HaskellForCats/HaskellForCats
30MinHaskell/_Progs/HaskChat01.hs
mit
1,626
0
19
622
522
249
273
45
2
-- Haskell Revision -- note -- whereのありがたみをちゃんと理解できていない -- Pattern matchの基礎であるMaybe型をしっかりやり直す -- folrの考え方をやり直す -- 型シノニム -- uncurry忘れかけてない? -- 次回復習はここからrepeat replicate cycle -- new workはパーサ: 計算機 -- https://skami.iocikun.jp/computer/haskell/web_lecture/for_programmer/parser_calculator.html import Prelude hiding((*>))...
threetreeslight/learning-haskell
practice/old/20151018.hs
mit
4,032
2
10
754
1,052
596
456
47
1
module Fortran where import Prelude () import Common hiding (Integer, Complex) import qualified C data LetterCase = LowerCase | UpperCase deriving (Eq, Read, Show) toCase LowerCase = toLower toCase UpperCase = toUpper data NameSuffix = NameSuffix String -- ^ fixed suffix ...
Rufflewind/blas-shim
Fortran.hs
mit
3,330
0
14
1,117
737
415
322
80
6
{-# LANGUAGE DeriveGeneric, TemplateHaskell #-} import Game.Cosanostra.Glue.Instances.JSON () import Game.Cosanostra.Glue.Lenses import Game.Cosanostra.Game import Game.Cosanostra.Plan import Control.Lens import Control.Monad.State import qualified Data.ByteString.Char8 as BS import Data.Maybe import qualified Data....
rfw/cosanostra
glue/impulse.hs
mit
1,415
0
20
363
434
225
209
33
2
module Lwch003 where -- fun with GHC -- : retab -- : set +s -- set expandtab ts=4 ruler number spell linebreak ------------------ -- Lists -- ------------------ -- no "any" type lists -- all lists must be SAME type -- recursion is how we loop through lists --------Lists-------------------- {- -------------------...
HaskellForCats/HaskellForCats
ladiesWhoCodeHaskell/ladiesWhoCodeHaskell003.hs
mit
2,594
8
20
532
432
242
190
24
3
-- Type annotation (optional) factorial :: Integer -> Integer -- Using fold (implements product) factorial n = foldl1 (*) [1..n]
butchhoward/xhaskell
factorial_fold.hs
mit
132
0
6
22
32
18
14
2
1
{-# LANGUAGE GeneralizedNewtypeDeriving, OverloadedStrings #-} module Component.Name (Name (..)) where import Core.ECS (Component, stock) import Data.Typeable import Data.Text (Text) import qualified Data.Aeson as J newtype Name = Name Text deriving (Typeable, Monoid, Eq) instance J.ToJSON Name where toJSON (Nam...
jameshsmith/HRL
Server/Component/Name.hs
mit
394
0
8
61
120
69
51
11
0
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.BeforeUnloadEvent (js_setReturnValue, setReturnValue, js_getReturnValue, getReturnValue, BeforeUnloadEvent, castToBeforeUnloadEvent, gTypeBeforeUnloadEvent) where import Prelude ((.),...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/BeforeUnloadEvent.hs
mit
1,929
14
10
250
463
284
179
31
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Data.Track.Commitment where import Control.DeepSeq import Data.Aeson import Data.Data import Data.Text import Data.Time import Data.Track.Rules import GHC.Generics data...
AndrewRademacher/track
src/Data/Track/Commitment.hs
mit
831
0
9
277
153
90
63
22
0
type Subject = String type Verb = String type Object = String data Sentence = Sentence Subject Verb Object deriving (Eq, Show) -- this won't work because Object argument is not applied s1 = Sentence "dogs" "drool" -- this will work because all 3 arguments were applied s2 = Sentence "Julie" "loves" "dogs"
Numberartificial/workflow
haskell-first-principles/haskell-from-first-principles-master/06/06.14.04-does-it-typecheck4.hs
mit
314
0
6
61
67
38
29
8
1
-- Das Module \hsSource{Circuit.Splice} bietet nach außen hin nur eine -- Funktion an, nämlich \hsSource{splice}. Diese Funktion führt zwei -- Schaltungen zu einer neuen zusammen. Dabei ist noch nicht -- festgelegt, wie dieses Zusammenführen tatsächlich aussieht. module System.ArrowVHDL.Circuit.Splice where -- Verwen...
frosch03/arrowVHDL
src/System/ArrowVHDL/Circuit/Splice.hs
cc0-1.0
10,669
0
15
2,305
2,208
1,251
957
98
1
{-# language TemplateHaskell #-} {-# language DeriveDataTypeable #-} {-# language FlexibleInstances #-} {-# language MultiParamTypeClasses #-} module CSP.Derive.Quiz where import CSP.Syntax import CSP.Step import CSP.Property import qualified CSP.Roll import qualified CSP.Property.Guarded import qualified Data.Set a...
marcellussiegburg/autotool
collection/src/CSP/Derive/Quiz.hs
gpl-2.0
4,358
0
18
1,515
1,445
756
689
116
3
module Forging where import Prelude import qualified Postructures as PS import qualified Constants as Const int2nat :: Integer -> PS.Nat int2nat 0 = PS.O int2nat m = PS.S (int2nat (m-1)) data Stream a = Cons0 a (Stream a) hd :: (Stream a1) -> a1 hd x = case x of { Cons0 a s -> a} tl :: (Stream a1) -> Strea...
ConsensusResearch/MultiBranch
forging.hs
gpl-2.0
6,003
0
24
1,493
2,082
1,065
1,017
119
4
{-# LANGUAGE ScopedTypeVariables #-} -- enough rope to evaluate Salsa20 algebraically module Algebraic where { import Data.Maybe(fromJust); import Data.Bits(Bits(..)); data Algebraic a = Atom a | Xor (Algebraic a) (Algebraic a) | Rotate Int (Algebraic a) | Add (Algebraic a) (Algebraic a) deriving (Show,Eq); instance N...
kenta2/yescrypt
Algebraic.hs
gpl-3.0
1,457
0
11
275
647
354
293
37
5
{-# LANGUAGE OverloadedStrings #-} import Control.Applicative import Data.Aeson import Data.Attoparsec.Text as AP import Data.Text as T import Data.Text.IO as TIO import System.Environment import System.Exit data Nick = Nick { nick :: Text , alias_of :: Text } deriving Show instance ToJSON Nick where ...
qpfiffer/normalizer
normalize.hs
gpl-3.0
893
0
11
209
314
165
149
31
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} -- Copyright (C) 2010-2011 John Millikin <jmillikin@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 vers...
jmillikin/anansi
lib/Anansi/Types.hs
gpl-3.0
4,591
47
16
900
948
547
401
83
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/Schemas/List.hs
mpl-2.0
4,493
0
19
1,119
713
415
298
104
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.ContainerBu...
rueshyna/gogol
gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types/Product.hs
mpl-2.0
52,868
0
28
12,873
9,233
5,345
3,888
988
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/FirewallPolicies/AddRule.hs
mpl-2.0
4,654
0
17
1,037
486
292
194
80
1
import Test.Hspec input :: [[Int]] input = [ [08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91, 08], [49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 04, 56, 62, 00], [81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 03, 49, 13, 36, 65], ...
orbitgray/ProjectEuler
haskell/011.hs
lgpl-3.0
4,631
9
20
1,596
2,614
1,573
1,041
-1
-1
-- Copyright (c) 2014-2015 Jonathan M. Lange <jml@mumak.net> -- -- 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 ...
jml/haverer
lib/Haverer/PlayerSet.hs
apache-2.0
2,006
0
10
351
389
218
171
27
1
{-# LANGUAGE FlexibleContexts, MultiParamTypeClasses, OverloadedStrings #-} module Database.MongoDB.Query.Typesafe where import Control.Monad.IO.Class import Control.Monad.Trans.Control import Data.Bson import Data.Word import qualified Database.MongoDB.Query as DB import ...
pkamenarsky/typesafe-query-mongodb
src/Database/MongoDB/Query/Typesafe.hs
apache-2.0
2,736
0
10
633
789
423
366
47
5
module Graham.A305677 (a305677) where import Graham.A321482 (a321482) -- import Data.List (subsequences) -- import HelperSequences.A007913 (a007913) -- This counts the number of subsets of [n + 1..a072905 n - 1] whose product has -- the same squarefree part as n (equivalently a072905 n). -- 1,2,8,1,64,256,2048,4,1,......
peterokagey/haskellOEIS
src/Graham/A305677.hs
apache-2.0
671
0
6
109
54
37
17
4
1
module Main where import Test.Framework import Test.Framework.Providers.HUnit import Test.HUnit import TestXml import TestXmlInternal import TestTemplateBasic import TestTemplateRepeat import TestTemplateHiding import TestTemplateBlogExample tests = hUnitTestToTests $ TestList (TestXml.xmlTests ++ ...
jasonrbriggs/proton
haskell/testsuite/Tests.hs
apache-2.0
727
0
13
270
94
54
40
17
1
import Control.Exception (bracket) import Control.Monad import Data.String.Utils import System.Directory import System.Environment import System.FilePath import System.Find import System.Process import System.Exit import System.IO import Text.Printf import Text.Regex.Posix.Wrap main :: IO () main = do args <- getArg...
jamessanders/hsysadmin
src/renamex/renamex.hs
bsd-2-clause
2,627
0
18
799
864
426
438
66
3
module Problem74 where import Data.Array import Data.Char lim :: Int lim = 1000000 main :: IO () main = print . length . filter (== 60) . map snd . assocs $ chainLengths chainLengths :: Array Int Int chainLengths = array (1, lim) [ (i, chainLengths' i) | i <- [1 .. lim] ] getChainLengths :: Int -> Int getChainLeng...
adityagupta1089/Project-Euler-Haskell
src/problems/Problem74.hs
bsd-3-clause
971
0
10
268
331
174
157
24
1
-- | API entry point module Web.MangoPay ( -- generic functions MangoPayT ,runMangoPayT ,runResourceInMp ,MpException ,getAll -- useful types ,Credentials(..) ,AccessPoint(..) ,AccessToken(..) ,OAuthToken(..) ,Pagination(.....
prowdsponsor/mangopay
mangopay/src/Web/MangoPay.hs
bsd-3-clause
3,894
0
5
1,396
709
494
215
149
0
----------------------------------------------------------------------------- -- | -- Module : TestSuite.Uninterpreted.Axioms -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Test suite for basic axioms and uninterpreted functions --...
josefs/sbv
SBVTestSuite/TestSuite/Uninterpreted/Axioms.hs
bsd-3-clause
1,292
0
10
253
262
141
121
26
1
-- Copyright (c) 2009-2010 -- The President and Fellows of Harvard College. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- 1. Redistributions of source code must retain the above copyright -- notice...
jsa/symbol
Data/Symbol.hs
bsd-3-clause
3,894
4
21
915
562
313
249
44
2
module Envirius.Commands ( Cmd(..), cmdParse, cmdShowHelp, getCommandsDesc ) where import Data.List (find) import Envirius.Types.Command import Envirius.Commands.Ls as Ls import Envirius.Commands.Mk as Mk import Envirius.Commands.Current as Current import Envirius.Commands.LsCommands...
ekalinin/envirius.hs
src/Envirius/Commands.hs
bsd-3-clause
1,237
0
13
329
335
193
142
28
1
-------------------------------------------------------------------------- -- -- -- MinimiseDfa.hs -- -- -- -- Minimising a DFA. -- -- -- -- Regular expressions are defined in RegExp, and the type of -- -- NFAs in NfaTypes. The implementation of sets used is in -- -- Sets. ...
AidanDelaney/Mira
src/Language/Mira/MinimiseDfa.hs
bsd-3-clause
6,159
34
14
1,487
1,194
655
539
55
2
-- | -- Module: Config -- Description: Representation and parsing of configuration file for cd -- subcommand -- Copyright: (c) 2018-2020 Peter Trško -- License: BSD3 -- -- Maintainer: peter.trsko@gmail.com -- Stability: experimental -- Portability: GHC specific language extensions. -- -- Repr...
trskop/command-wrapper
command-wrapper/app-cd/Config.hs
bsd-3-clause
2,502
0
13
517
392
243
149
-1
-1