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 : Dhek.Engine.Misc.LastHistory -- -------------------------------------------------------------------------------- module Dhek.Engine.Misc.LastHistory ( LastHistory , lhNew , lhPush , lhPeek , lhPop )...
cchantep/dhek
Dhek/Engine/Misc/LastHistory.hs
gpl-3.0
1,622
0
9
212
297
162
135
26
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE ScopedTypeVariables #-} module Permute where import GHC.TypeLits -- import Control.Monad (guard) import Control.Monad.ST (ST, runST) import Con...
wavewave/qft
old/lib/trash/Permute.hs
gpl-3.0
3,330
0
22
1,133
1,184
609
575
65
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- | -- Module : Network.Google.AndroidPublisher -- Copyright : (c) 2015-2016 Brendan Hay -- License : Moz...
rueshyna/gogol
gogol-android-publisher/gen/Network/Google/AndroidPublisher.hs
mpl-2.0
24,924
0
60
4,816
2,594
1,910
684
501
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Projects/List.hs
mpl-2.0
7,796
0
25
2,013
1,340
769
571
180
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-redis/gen/Network/Google/Resource/Redis/Projects/Locations/Instances/GetAuthString.hs
mpl-2.0
5,859
0
16
1,251
706
415
291
110
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/Snapshots/List.hs
mpl-2.0
6,381
0
18
1,403
678
409
269
90
1
module QuantLib.Cashflows.CashflowFunctions ( module QuantLib.Cashflows.CashflowFunctions ) where import Data.List import QuantLib.Event import QuantLib.Time.Date -- Date inspectors cfCompareDates :: CashFlow->CashFlow->Ordering cfCompareDates (CashFlow d1 _) (CashFlow d2 _) |...
paulrzcz/hquantlib
src/QuantLib/Cashflows/CashflowFunctions.hs
lgpl-3.0
1,295
0
8
283
419
225
194
27
1
{- The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143? -} -- Keep dividing the dividend by the divisor until it is no -- longer divisible by the divisor. keepDividing dividend divisor | mod dividend divisor == 0 = keepDividing (div dividend divisor) divisor ...
PiJoules/Project-Euler-Haskell
prob3.hs
unlicense
919
0
9
167
160
78
82
10
1
module Reddit.Actions.SearchSpec where import Reddit import Reddit.Types.SearchOptions import Utils import Test.Hspec isRight :: Either a b -> Bool isRight = const False `either` const True isLeft :: Either a b -> Bool isLeft = const True `either` const False main :: IO () main = hspec spec spec :: Spec spec = de...
intolerable/reddit
test-anon/Reddit/Actions/SearchSpec.hs
bsd-2-clause
788
0
17
166
269
135
134
21
2
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE BangPatterns, DeriveDataTypeable, RecordWildCards #-} -- | -- Module : Criterion.Analysis -- Copyright : (c) 2009-2014 Bryan O'Sullivan -- -- License : BSD-style -- Maintainer : bos@serpentine.com -- Stability : experimental -- Portability : GHC -- -- Analysis co...
iu-parfunc/criterion
Criterion/Analysis.hs
bsd-2-clause
9,746
0
18
2,923
2,635
1,427
1,208
196
5
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QTextEdit.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:35 Warning : this file is machine generated - do not...
uduki/hsQt
Qtc/Enums/Gui/QTextEdit.hs
bsd-2-clause
6,285
0
18
1,402
1,699
842
857
150
1
module Drasil.GamePhysics.DesignDec.Vector where import Language.Drasil vR1, vR2, vNMass, vTMass, vBounce, vJnAcc, vJtAcc, vJBias, vBias, vA, vB, vId, vNormal, vCount, vArr, vElast, vSurfaceVal, vAs, vAb, vBodyA, vBodyB, vThreadA, vThreadB, vContacts, vHandler, vHandlerA, vHandlerB, vSwapper, vStamp, vState, vPoi...
JacquesCarette/literate-scientific-software
code/drasil-example/Drasil/GamePhysics/DesignDec/Arbiter.hs
bsd-2-clause
3,037
0
11
818
921
497
424
42
1
module Lambdasim.SimRunner ( startSimulation, ) where import Control.Concurrent import Control.Concurrent.STM import Control.Monad import Control.Parallel.Strategies import Data.Record.Label import Data.Time (UTCTime, getCurrentTime) import Network.Info import Prelude () import Lambdasim.Prelude import Lambdasim....
jystic/lambdasim
src/Lambdasim/SimRunner.hs
bsd-3-clause
1,752
0
11
387
622
314
308
57
1
-- | Defines functions with various level of detail for printing debugging -- information. module Language.Java.Paragon.Interaction.Debugging ( -- * Debug functions with increasing verbosity. normalPrint , detailPrint , finePrint , debugPrint , tracePrint ) where import Control.Monad import Langua...
bvdelft/paragon
src/Language/Java/Paragon/Interaction/Debugging.hs
bsd-3-clause
2,039
0
11
377
278
151
127
24
1
module Backend (LabelData(..) ,createLabelPdf ,createCalibrationPage ,parseLabelData ,offsetLabelPosition ,saveCalibration ,loadCalibration ) where import System.Directory import System.IO import System.Posix.User import Sy...
owestphal/label-generator
src/lib/Backend.hs
bsd-3-clause
3,045
0
13
646
852
458
394
63
5
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE FlexibleContexts #-} module Zero.Registration.Widget ( registrationLayout , registrationWidget ) where import qualified Data.Text as T import Data.Text (Text) import ...
et4te/zero
src/Zero/Registration/Widget.hs
bsd-3-clause
8,798
0
22
1,922
1,799
891
908
137
1
module Main (main) where -- Shared imports import Imports -- Testing import Test.Hspec -- Tests import qualified WebSpec import qualified MarkdownSpec import qualified MergeSpec main :: IO () main = do hspec $ do MarkdownSpec.tests MergeSpec.tests WebSpec.tests -- TODO: it'd be nice if we could do serve...
aelve/guide
back/tests/Main.hs
bsd-3-clause
1,166
0
10
248
76
47
29
12
1
{-# language DeriveFunctor, DeriveFoldable, DeriveTraversable #-} module Khronos.Render where import qualified Data.HashMap.Strict as Map import Data.Vector ( Vector ) import qualified Data.Vector as V import Data.Vector.TopTraverse import Po...
expipiplus1/vulkan
generate-new/khronos-spec/Khronos/Render.hs
bsd-3-clause
7,445
0
29
2,412
1,729
916
813
-1
-1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.NV.CopyImage -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- ---------------------...
haskell-opengl/OpenGLRaw
src/Graphics/GL/NV/CopyImage.hs
bsd-3-clause
597
0
4
86
44
34
10
6
0
-- | Simplify static Networking tasks. module Network.NetSpec ( -- * Types and Constructors NetSpec (..) , SpecState (..) -- * Functions -- ** Running a NetSpec , runSpec -- ** Continue and Stop Combinators , continue , continue_ , continueIf , continueIf' , continueIf_ , stop , s...
DanBurton/netspec
src/Network/NetSpec.hs
bsd-3-clause
5,277
0
13
1,295
1,545
843
702
93
3
{- A positive fraction whose numerator is less than its denominator is called a proper fraction. For any denominator, d, there will be d−1 proper fractions; for example, with d = 12: 1/12 , 2/12 , 3/12 , 4/12 , 5/12 , 6/12 , 7/12 , 8/12 , 9/12 , 10/12 , 11/12 . We shall call a fraction that cannot be cancelled down a ...
bgwines/project-euler
src/solved/problem243.hs
bsd-3-clause
2,699
6
11
452
316
186
130
35
1
module FoldyInstances where import Data.Monoid data Constant a b = Constant a instance Foldable (Constant a) where foldr _ b _ = b data Two a b = Two a b instance Foldable (Two a) where foldr f target (Two _ source) = f source target data Three a b c = Three a b c instance Foldable (Three a ...
nicklawls/haskellbook
src/FoldyInstances.hs
bsd-3-clause
779
0
9
211
369
194
175
25
2
data Item = Banana | Club | Shield | Armor | Sord | Star deriving (Show, Eq, Ord, Bounded) type Baggage = [Item] data Stage = Fork Stage Stage | Goal Item deriving Show point :: Item -> Integer point Banana = 10 point Club = 20 point Shield = 50 point Armor = 80 point Sord = 100 point Star = 200 baggage1, baggage2...
YoshikuniJujo/funpaala
samples/41_foldable/forkGame0.hs
bsd-3-clause
2,191
34
11
490
1,141
602
539
71
1
{-# LANGUAGE CPP, BangPatterns, RecordWildCards, NamedFieldPuns, DeriveGeneric, DeriveDataTypeable, GeneralizedNewtypeDeriving, ScopedTypeVariables #-} -- | -- module Distribution.Client.ProjectBuilding ( BuildStatus(..), BuildStatusMap, BuildStatusRebuild(..), BuildReason(.....
gbaz/cabal
cabal-install/Distribution/Client/ProjectBuilding.hs
bsd-3-clause
54,242
0
22
16,128
7,553
3,889
3,664
768
12
module Common where import Control.Exception ( bracket_ ) import qualified Control.Exception as Exception import Control.Monad ( when ) import System.IO import System.Process ( rawSystem, runProcess, waitForProcess ) import System.Exit ( ExitCode(..), exitWith ) import System...
DavidAlphaFox/ghc
utils/hsc2hs/Common.hs
bsd-3-clause
2,520
0
17
664
729
365
364
49
2
import Test.DocTest main :: IO () main = doctest ["{{project.name}}"]
abailly/haskell-template
test/project-test.hs
bsd-3-clause
71
0
6
11
27
14
13
3
1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Application ( makeApplication , getApplicationDev , makeFoundation ) where import Import import Settings import Yesod.Auth import Yesod.Default.Config import Yesod.Default.Main import Yesod.Default.Handlers import Network.Wai.Middleware.RequestLogger ( m...
jabaraster/YetShop
Application.hs
bsd-3-clause
3,834
0
13
744
665
368
297
-1
-1
{-# LANGUAGE StandaloneDeriving, NoMonomorphismRestriction, ViewPatterns #-} import Dependency.Graph (Graph (..), Request (..), Operation , IndexError (..)) import qualified Dependency.Graph as G import Control.Monad import Control.Arrow import Control.Applicative import Data.List hiding (delete) import Test.HUnit t...
paolino/dependencies-sm
Test.hs
bsd-3-clause
3,726
0
14
863
1,908
1,018
890
91
2
-- | -- Copyright : (c) Sam Truzjan 2013 -- License : BSD3 -- Maintainer : pxqr.sta@gmail.com -- Stability : experimental -- Portability : little endian arch -- -- Fast conversion from or to lazy and strict bytestrings. -- Serialized IntSets are represented as single continious bitmap. -- --...
pxqr/intset
src/Data/IntervalSet/ByteString.hs
bsd-3-clause
5,980
0
19
2,064
1,110
575
535
-1
-1
module StringCompressorKata.Day5Spec (spec) where import Test.Hspec import StringCompressorKata.Day5 (compress) spec :: Spec spec = do it "compresses nothing inot another nothing" $ do compress Nothing `shouldBe` Nothing it "compresses an empty string into another empty st...
Alex-Diez/haskell-tdd-kata
old-katas/test/StringCompressorKata/Day5Spec.hs
bsd-3-clause
735
0
13
211
182
88
94
15
1
{-# LANGUAGE TupleSections #-} module Solver where import Types import Parser import Pretty import Control.Arrow import Control.Monad import Control.Monad.State import Control.Lens import qualified Data.HashSet as S import qualified Data.Sequence as Sq import Data.Maybe import Data.List (foldl', transpose, sortBy) im...
Frefreak/solitaire-solver
src/Solver.hs
bsd-3-clause
16,012
0
27
5,369
6,466
3,329
3,137
-1
-1
module Main where main = undefined
tonicebrian/pigha
tests/Main.hs
apache-2.0
36
0
4
7
9
6
3
2
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Program : helloworld.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:46 Warning : this file is machine generated - do no...
uduki/hsQt
examples/helloworld.hs
bsd-2-clause
2,019
0
12
373
504
260
244
47
2
module Propellor.Spin ( commitSpin, spin, update, gitPushHelper, mergeSpin, ) where import Data.List import System.Exit import System.PosixCompat import System.Posix.IO import System.Posix.Directory import Control.Concurrent.Async import Control.Exception (bracket) import qualified Data.ByteString as B import qua...
avengerpenguin/propellor
src/Propellor/Spin.hs
bsd-2-clause
10,767
124
19
2,141
3,310
1,624
1,686
265
6
{-# LANGUAGE Haskell2010 #-} {-# LINE 1 "dist/dist-sandbox-261cd265/build/System/Posix/DynamicLinker/Prim.hs" #-} {-# LINE 1 "System/Posix/DynamicLinker/Prim.hsc" #-} {-# LANGUAGE Trustworthy #-} {-# LINE 2 "System/Posix/DynamicLinker/Prim.hsc" #-} {-# LINE 3 "System/Posix/DynamicLinker/Prim.hsc" #-} {-# OPTIONS_GHC -...
phischu/fragnix
tests/packages/scotty/System.Posix.DynamicLinker.Prim.hs
bsd-3-clause
4,043
0
11
630
518
314
204
49
1
{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} ...
Icelandjack/lens
src/Control/Lens/At.hs
bsd-3-clause
15,104
0
17
3,578
5,545
3,005
2,540
314
1
{-# OPTIONS_GHC -fno-warn-missing-methods #-} module SubHask.Algebra.Matrix ( Matrix (..) , unsafeToModuleM , ValidMatrix , mmult , transpose , row , col , (!!) , Matrix'(..) ) where import Data.Primitive hiding (sizeOf) import Control.Monad.Primitive import Control.Monad ...
Drezil/subhask
src/SubHask/Algebra/Matrix.hs
bsd-3-clause
8,470
8
18
2,067
3,790
2,077
1,713
-1
-1
-- | -- Module : Crypto.Hash.%%MODULENAME%% -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- Module containing the binding functions to work with the -- %%MODULENAME%% cryptographic hash. -- {-# LANGUAGE ForeignFunctionInte...
vincenthz/cryptonite
gen/template/hash-len.hs
bsd-3-clause
2,046
18
26
361
484
284
200
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-| Common functionality for htools-related unittests. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are me...
leshchevds/ganeti
test/hs/Test/Ganeti/TestHTools.hs
bsd-2-clause
5,791
0
16
1,579
932
542
390
81
2
{-# LANGUAGE PackageImports #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE CPP #-} module Data.Data #ifndef FAY (Data,Typeable) #endif where import "base" Data.Data
fpco/fay-base
src/Data/Data.hs
bsd-3-clause
175
0
4
27
25
18
7
6
0
#!/usr/bin/env stack -- stack --resolver snapshot.yaml script import Acme.Missiles main :: IO () main = launchMissiles
juhp/stack
test/integration/tests/relative-script-snapshots/files/subdir/script.hs
bsd-3-clause
120
0
6
17
23
13
10
3
1
module PackageTests.BuildDeps.InternalLibrary2.Check where import qualified Data.ByteString.Char8 as C import PackageTests.PackageTester import System.FilePath import Test.Tasty.HUnit suite :: FilePath -> FilePath -> Assertion suite ghcPath ghcPkgPath = do let spec = PackageSpec { directory = "Packag...
Helkafen/cabal
Cabal/tests/PackageTests/BuildDeps/InternalLibrary2/Check.hs
bsd-3-clause
1,192
0
14
276
299
154
145
24
1
module A1 where data Data a = C1 a Int Char | C2 a Int | C3 Float f :: Data a -> Int f (C1 a b c) = b f (C2 c2_1 a) = a f (C3 a) = 42 (C1 (C1 x y z) b c) = 89
kmate/HaRe
old/testing/addField/A1_TokOut.hs
bsd-3-clause
198
2
8
90
118
62
56
9
1
{-# LANGUAGE CPP, MagicHash, NondecreasingIndentation, TupleSections, RecordWildCards #-} {-# OPTIONS -fno-cse #-} -- -fno-cse is needed for GLOBAL_VAR's to behave properly ----------------------------------------------------------------------------- -- -- GHC Interactive User Interface -- -- (c) The GHC ...
wxwxwwxxx/ghc
ghc/InteractiveUI.hs
bsd-3-clause
131,279
1
103
37,873
32,228
16,017
16,211
-1
-1
import qualified Data.Vector as U import Data.Word main = print (U.length (U.replicate 1 (7 :: Word)))
dolio/vector
old-testsuite/microsuite/length-word.hs
bsd-3-clause
104
0
10
17
46
26
20
3
1
{-# LANGUAGE GADTs, StandaloneDeriving #-} module T4528 where data Foo a where A, B :: Foo Int C :: Foo Bool deriving instance Enum (Foo a) deriving instance Bounded (Foo a)
holzensp/ghc
testsuite/tests/deriving/should_fail/T4528.hs
bsd-3-clause
184
2
7
41
56
31
25
-1
-1
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-} module Data.Expression where import Data.Unification data Expression recur = Application recur recur | Lambda recur recur deriving (Functor, Show, Eq, Foldable, Traversable) instance Unifiable Expression where unifyBy f expected actual = case ...
antitypical/Surface
src/Data/Expression.hs
mit
514
0
12
99
184
96
88
12
0
module Euler7.Euler7 ( main ) where divisible :: Integer -> Integer -> Bool divisible n r = n `mod` r == 0 concatPrimes :: [Integer] -> [Integer] -> [Integer] concatPrimes ps [] = ps concatPrimes ps (n:ns) = if any (\p -> divisible n p) ps then concatPrimes ps ns else...
ublubu/euler
Euler7/Euler7.hs
mit
739
0
10
212
316
166
150
18
2
module WearyExaminer.SensorServer.TimeSeries where
proegssilb/weary-examiner
server/src/WearyExaminer/SensorServer/TimeSeries.hs
mit
50
0
3
2
7
5
2
1
0
module Y2018.M02.D20.Solution where {-- From our favorite Prolog problem archive, P99: http://www.ic.unicamp.br/~meidanis/courses/mc336/2009s2/prolog/problemas/ P14 (*) Duplicate the elements of a list. Example: ?- dupli([a,b,c,c,d],X). X = [a,a,b,b,c,c,c,c,d,d] --} dupli :: [a] -> [a] dupli list = list >>= replica...
geophf/1HaskellADay
exercises/HAD/Y2018/M02/D20/Solution.hs
mit
990
0
6
164
87
56
31
5
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} module Data.HighJson.SwaggerSpec ( spec ) where import Data.HighJson import Data.HighJson.Swagger import Control.Lens.TH import Data.Proxy import Data.Swagger import Test.Hspec impor...
agrafix/highjson
highjson-swagger/test/Data/HighJson/SwaggerSpec.hs
mit
3,904
0
15
999
1,040
547
493
121
1
module BinarySearch (find) where import Data.Array find :: Ord a => Array Int a -> a -> Maybe Int find array x = error "You need to implement this function."
exercism/xhaskell
exercises/practice/binary-search/src/BinarySearch.hs
mit
160
0
8
32
55
28
27
4
1
module Y2017.M03.D07.Solution where import Data.Ratio (numerator) -- below import available via 1HaskellADay git repository import Analytics.Math.Combinatorics (choose) {-- url: http://rosalind.info/problems/aspc/ Introduction to Alternative Splicing solved by 927 as of February 28th, 2017 The Baby and the Bathwa...
geophf/1HaskellADay
exercises/HAD/Y2017/M03/D06/Solution.hs
mit
2,855
0
8
519
123
75
48
11
1
module Cards where data Suit = Hearts | Diamonds | Clubs | Spades deriving (Show, Read, Eq) data Advantage = Six | Seven | Eight | Nine | Ten | J | Q | K | A deriving (Show, Read, Eq, Ord) data Card = Card Suit Advantage deriving (Show, Read) type Hand = [Card] --Для сортировки карт по ...
NickolayStorm/usatu-learning
Logical programming/CourseWork/Control/Cards.hs
mit
1,441
0
11
425
540
288
252
40
1
import Control.Applicative import Data.Generics.Random.Boltzmann.GeneratingFunctions import Numeric.LinearAlgebra import Test.HUnit main = runTestTT $ TestList [ test_solve ] test_solve = "F(x) = 1 + x F(x)^2" ~: do print xs print (evalDeltas <$> xs <*> pure es) where x : fx : f'x : _ = fmap X [0 .....
Lysxia/generic-random
test/Spec.hs
mit
540
4
13
152
220
117
103
16
1
{-# LANGUAGE ScopedTypeVariables #-} module Main where import Prelude hiding (lookup) import ReadArgs import Data.Char import Graphics.Font import Codec.Picture main :: IO () main = do ( fontFile :: FilePath, theChar :: Char, fontSize :: Int ) <- readArgs withNewLibrary $ \lib -> do let descr...
MaxDaten/typography-ft2
examples/CharRenderer.hs
mit
789
0
18
252
241
124
117
21
1
module Chess.Color where -- | The 'Color' class represents one of the two colors ('Black' or 'White') -- used in the game of Chess. data Color = White | Black deriving (Eq,Show,Ord) -- | The 'other' method returns the opposite color. other :: Color -> Color other White = Black other Black = White -- | The 'firstRo...
grzegorzbalcerek/chess-haskell
Chess/Color.hs
mit
618
0
6
123
87
50
37
9
1
import Data.List import Data.Maybe main = print(maximum (prime_factors 600851475143)) -- Get the prime factors -- prime_factors n = until (\v -> n == product v) (\v -> v ++ [min_prime_factor(div n (product v))]) [] -- Get the minimum prime factor for the given number -- min_prime_factor n = fromJust (find (\v -> (mo...
mhseiden/euler-haskell
src/p3.hs
mit
521
1
17
105
268
143
125
6
1
{-# LANGUAGE ForeignFunctionInterface, TemplateHaskell, Rank2Types #-} module Language.SQL.SQLite.CTH ( exportType, exportShowTokensForType, showTokensGeneric, getGeneric ...
IreneKnapp/language-sqlite
Language/SQL/SQLite/CTH.hs
mit
8,510
0
29
3,252
1,687
856
831
144
2
import Prelude hiding (lookup, filter) import Data.Map hiding (foldl, map) type State = (Map Int (Int, Int), Map Int (Int, Int)) give :: Int -> Int -> State -> State give bot value (bots, tos) = case lookup bot bots of Just (value', -1) -> let state' = (insert bot (value', value) bots, tos) in case ...
seishun/aoc2016
day10.hs
mit
2,595
3
14
616
1,100
599
501
58
7
module Data.Rational where import Data.Natural import Data.Ratio truncateRational :: Natural -> Rational -> (Integer, Integer) truncateRational n rat = (int, decimals dec den n 0) where (int, dec) = num `quotRem` den num = numerator rat den = denominator rat decimals :: Integer -> Int...
gallais/dailyprogrammer
easy/006/Data/Rational.hs
mit
632
0
11
164
254
136
118
15
2
{-# OPTIONS_GHC -w #-} ----------------------------------------------------------------------------- -- | -- Module : Preprocessor.Hsx.Pretty -- Original : Language.Haskell.Pretty -- Copyright : (c) Niklas Broberg 2004, -- (c) The GHC Team, Noel Winstanley 1997-2000 -- License : BSD-style (see the...
timthelion/fenfire
Preprocessor/Hsx/Pretty.hs
gpl-2.0
32,655
383
19
6,922
12,228
6,126
6,102
701
5
-- Copyright (C) 2011 Petr Rockai -- -- Permission is hereby granted, free of charge, to any person -- obtaining a copy of this software and associated documentation -- files (the "Software"), to deal in the Software without -- restriction, including without limitation the rights to use, copy, -- modify, merge, publish...
DavidAlphaFox/darcs
src/Darcs/Patch/Prim/V3/ObjectMap.hs
gpl-2.0
1,913
0
14
474
264
166
98
-1
-1
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} module QHaskell.Expression.Utils.GADTFirstOrder (sucAll,prdAll,prdAllM,mapVar,sbs,replaceOne,cntVar,pattern TF ,isVal,val,pattern V,pattern NV,substitute) where import QHaskell.MyPrelude import QHaskell.Expression.GADTFirstOrder as GFO import QHaskell.Var...
shayan-najd/QHaskell
QHaskell/Expression/Utils/GADTFirstOrder.hs
gpl-3.0
4,132
0
19
1,528
1,940
1,025
915
-1
-1
{-# LANGUAGE OverloadedStrings #-} module GF.Predictability.Options where import System.Log.Logger (Priority(..)) import Options.Applicative import Shelly (FilePath(..)) import Prelude hiding (FilePath) import Data.String (fromString) data Options = Options { gfBin :: Maybe FilePath , priority :: Priorit...
gdetrez/gf-predictability
src/GF/Predictability/Options.hs
gpl-3.0
1,972
0
17
580
483
252
231
51
1
import XMonad import XMonad.Hooks.DynamicLog import XMonad.Util.SpawnOnce import qualified Data.Map as M import XMonad.Layout.NoBorders import XMonad.Layout.Spacing import XMonad.Layout.Named import XMonad.Config.Desktop import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.ManageHelpers baseConfig = deskt...
Head-on-a-Stick/configs
xmonad.hs
gpl-3.0
2,615
10
12
924
510
309
201
47
1
-- | -- Module : Sylvia.Render.Backend.Cairo -- Copyright : GPLv3 -- -- Maintainer : chrisyco@gmail.com -- Portability : non-portable (requires FFI) -- -- Render using the Cairo graphics library. module Sylvia.Render.Backend.Cairo ( -- * Types Image , Context(..) -- * Drawing the image ...
lfairy/sylvia
Sylvia/Render/Backend/Cairo.hs
gpl-3.0
5,493
0
15
1,556
1,298
681
617
112
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-blogger/gen/Network/Google/Resource/Blogger/Posts/Revert.hs
mpl-2.0
2,931
0
15
727
385
231
154
60
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/AccountUserProFiles/Update.hs
mpl-2.0
5,589
0
19
1,286
806
467
339
121
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/Connect/Get.hs
mpl-2.0
5,225
0
20
1,345
872
505
367
125
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/Get.hs
mpl-2.0
4,295
0
16
1,035
705
412
293
100
1
{-# LANGUAGE RecordWildCards, TypeOperators, StandaloneDeriving, FlexibleContexts, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-} module Language.Pascal.SSVM.Types where import Control.Monad.State import Control.Monad.Exception import qualified Data.Map as M import Data.List (intercalate) ...
portnov/simple-pascal-compiler
spc-ssvm/Language/Pascal/SSVM/Types.hs
lgpl-3.0
1,180
0
10
216
264
164
100
28
1
{-# LANGUAGE TypeFamilies, FlexibleContexts #-} {-# LANGUAGE UndecidableInstances, GeneralizedNewtypeDeriving #-} -- The last two extensions are needed for the Fix example, memoizing -- data types defined as fix-points of functors module Memo where import Tree -- Start class class Memo a where data Table a :: * -> ...
egaburov/funstuff
Haskell/fun-with-types/codes/Memo.hs
apache-2.0
2,679
2
16
634
1,259
661
598
57
1
-- Copyright 2018-2021 Google LLC -- -- 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 agreed t...
google/hs-ten
ten/src/Data/Ten/Internal.hs
apache-2.0
3,380
0
15
639
683
371
312
49
3
module AlecSequences.A271773Spec (main, spec) where import Test.Hspec import AlecSequences.A271773 (a271773) main :: IO () main = hspec spec spec :: Spec spec = describe "A271773" $ it "correctly computes the first 20 elements" $ take 20 (map a271773 [1..]) `shouldBe` expectedValue where expectedValue = [...
peterokagey/haskellOEIS
test/AlecSequences/A271773Spec.hs
apache-2.0
365
0
10
59
160
95
65
10
1
module NestedRoots.A338268 (a338268, a338268_row, a338268_t) where import Data.MemoCombinators (memo2, integral) import Math.NumberTheory.Powers.Squares (integerSquareRoot') a338268_t :: Integer -> Integer -> Integer a338268_t = memo2 integral integral f' where f' 0 0 = 1 f' n k | (n + k) `mod` 2 == 1 = 0 ...
peterokagey/haskellOEIS
src/NestedRoots/A338268.hs
apache-2.0
721
0
15
191
301
160
141
18
2
----------------------------------------------------------------------------- -- | -- Module : Data.ByteString.Parser -- Copyright : Lennart Kolmodin, George Giorgidze -- License : BSD3 -- -- Maintainer : George Giorgidze <http://cs.nott.ac.uk/~ggg/> -- Stability : experimental -- Portability : Portable ...
astro/haskell-torrent
src/Data/ByteString/Parser.hs
bsd-2-clause
18,207
0
19
4,639
5,380
2,840
2,540
401
3
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE Rank2Types #-} -- | A monad for joining nodes in a feature graph. module NLP.FeatureStructure.Join ( -- * Result Res (..) -- * JoinT , JoinT , Join , runJoinT , runJoin , execJoinT , execJoin , evalJoinT , evalJoin -- * Graph operations , getRepr , mkReprOf , getNo...
kawu/feature-structure
src/NLP/FeatureStructure/Join.hs
bsd-2-clause
8,761
0
16
2,126
2,600
1,379
1,221
149
4
module Text.Highlighter.Lexers.Logtalk (lexer) where import Text.Regex.PCRE.Light import Text.Highlighter.Types lexer :: Lexer lexer = Lexer { lName = "Logtalk" , lAliases = ["logtalk"] , lExtensions = [".lgt"] , lMimetypes = ["text/x-logtalk"] , lStart = root' , lFlags = [multiline] } qu...
chemist/highlighter
src/Text/Highlighter/Lexers/Logtalk.hs
bsd-3-clause
7,734
0
10
1,205
1,958
986
972
129
1
module SignedAuth.Util where import Data.Aeson import Data.Char import qualified Data.List as List -- | Convert the first character in a String to lower case downcase :: String -> String downcase [] = [] downcase (x:xs) = toLower x : xs -- | Convert the first character in a String to upper ca...
nejla/auth-service
auth-service-core/src/SignedAuth/Util.hs
bsd-3-clause
1,160
0
10
346
252
137
115
23
2
module Language.Interpreter.StdLib.PostEffects ( addPostEffectsStdLib ) where import Gfx.PostProcessing ( AnimationStyle(..) ) import Language.Ast ( Value(Symbol, Null) ) import Gfx.Context ( setAnimationStyle ) import Langua...
rumblesan/proviz
src/Language/Interpreter/StdLib/PostEffects.hs
bsd-3-clause
1,312
0
11
408
280
155
125
24
3
module Machine.Memory (dff ,bit ,register ,RAM8 ,ram8 ,RAM64 ,ram64 ,Addr8 ,Addr4 ,RAM512 ,ram512 ...
btipling/machine-vm
src/Machine/Memory.hs
bsd-3-clause
8,322
29
14
2,345
3,042
1,723
1,319
122
8
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.Compatibility42 -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- ...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Compatibility42.hs
bsd-3-clause
52,993
0
4
7,127
7,093
4,736
2,357
2,352
0
module Main where import Control.Exception (Exception, throwIO) import Data.Monoid (mempty) import qualified Data.Text.Lazy.IO as Text import Morte.Core (typeOf, pretty, normalize) import Morte.Parser (exprFromText) import Options.Applicative hiding (Const) import System.IO (stderr) import System.Exit (exitFailure) i...
bitemyapp/Haskell-Morte-Library
exec/Main.hs
bsd-3-clause
1,168
0
12
290
321
165
156
26
1
{- (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 \section{Code output phase} -} {-# LANGUAGE CPP #-} module CodeOutput( codeOutput, outputForeignStubs ) where #include "HsVersions.h" import GhcPrelude import AsmCodeGen ( nativeCodeGen ) import LlvmCodeGen ( llvmCodeGen ) import UniqSupply ...
sdiehl/ghc
compiler/main/CodeOutput.hs
bsd-3-clause
9,900
5
22
3,745
1,459
750
709
158
7
module Main (main) where import Control.Monad import Data.List (intersperse) import Data.Map (Map) import qualified Data.Map as Map import Ersatz import Ersatz.Solver.Toysat import RegexpGrid.Problem import RegexpGrid.Types main :: IO () main = do (res, msol) <- solveWith toysat problem when (res /= Satisfied) (...
msakai/ersatz-toysat
examples/regexp-grid/Main.hs
bsd-3-clause
929
0
13
298
365
191
174
33
2
-- -- >>> Hub.CommandLine <<< -- -- This module parses the command line. -- -- (c) 2011-2012 Chris Dornan module Hub.CommandLine ( commandLine , CommandLine(..) ) where import Text.Printf import Control.Monad import System.Environment import System.FilePath import ...
Lainepress/hub-src
Hub/CommandLine.hs
bsd-3-clause
10,418
1
14
4,809
3,263
1,684
1,579
158
66
{-# LANGUAGE FlexibleContexts #-} -- | This module provides functions for interoperability with the time -- library ("Data.Time" module hierarchy). module Astro.Time.Interop where import Astro import Astro.Time import Astro.Time.Convert import Data.Maybe (fromJust) import Data.Time import Data.Time.Clock.TAI import C...
bjornbm/astro
src/Astro/Time/Interop.hs
bsd-3-clause
2,805
0
11
563
608
326
282
42
1
-------------------------------------------------------------------- -- | -- Module : Web.Twitter.Types -- Description : Main types introduced by the Twitter API -- Copyright : (c) Sigbjorn Finne, 2008 -- License : BSD3 -- -- Maintainer: Sigbjorn Finne <sof@forkIO.com> -- Stability : provisional -- Portabili...
sof/twitter
Web/Twitter/Types.hs
bsd-3-clause
6,841
0
10
2,207
1,070
694
376
165
1
{-# LANGUAGE OverloadedStrings #-} module NewPackageList (newPackages, addIfNew) where import qualified Data.Aeson as Json import qualified Data.Aeson.Encode.Pretty as Json import qualified Data.List as List import qualified Data.ByteString.Lazy.Char8 as LBS import qualified System.Directory as Dir import System.IO i...
mgold/package.elm-lang.org
src/backend/NewPackageList.hs
bsd-3-clause
1,361
0
25
416
304
168
136
33
4
import Numeric.MCMC.Langevin import System.Random.MWC import System.Environment import System.Exit import System.IO import Numeric.AD import Control.Monad target :: RealFloat a => [a] -> a target [m, v] = ((+ (- n * log v)) . (/ (-2 * v^2)) . sum . map ((^2) . (+ (- m)))) initData where n = fromIntegral (l...
jtobin/lazy-langevin
Examples/code/Gaussian1D_MALA.hs
bsd-3-clause
2,121
2
16
766
599
310
289
41
1
{-# LANGUAGE OverloadedStrings #-} module Internal.Parser ( openTagParser , attributesParser , elemTypeParser , closeTagParser , textParser , elemParser , htmlParser ) where import Data.Char import qualified Data.Map.Strict as M import qualified Data.Text as T import Data.Attoparsec.Tex...
qnnguyen/howser
src/Internal/Parser.hs
bsd-3-clause
2,046
0
14
502
566
289
277
59
2
-- -- | -- Module : Codec.Binary.UTF8.String -- Copyright : (c) Eric Mertens 2007 -- License : BSD3-style (see LICENSE) -- -- Maintainer: emertens@galois.com -- Stability : experimental -- Portability : portable -- -- Support for encoding UTF8 Strings to and from @[Word8]@ -- module Codec.Binary....
abuiles/turbinado-blog
tmp/dependencies/utf8-string-0.3.3/Codec/Binary/UTF8/String.hs
bsd-3-clause
3,163
0
20
1,071
964
510
454
56
5
module Worker ( Worker, WorkerResult, WorkerHandle, forkWorker, stopWorker, waitForWorker ) where import Control.Concurrent import Control.Exception.Base (SomeException) type Worker = IO () type WorkerResult = Either SomeException () type WorkerHandle = (ThreadId, MVar WorkerResult) ...
danielksb/eventlog
src/Worker.hs
bsd-3-clause
700
0
10
139
217
114
103
24
1
{-# LANGUAGE OverloadedStrings #-} module GCode (makeXYZ) where import Prelude hiding (lines, unlines, length, head) import Control.Monad ((<=<)) import Data.ByteString.Base64.Lazy (encode) import Data.ByteString.Lazy.Char8 (ByteString, lines, unlines, length, head, snoc) makeXYZ :: ByteString -> Either String ...
mwm/xyzify
GCode.hs
bsd-3-clause
1,219
0
11
283
367
200
167
-1
-1
{-# OPTIONS -Wall #-} module FiniteStateMachine.Programs.FSM4 ( mach ) where import Basic.MemoryImpl (ListMem, fillMem) import FiniteStateMachine.Machine2 -------------------------------------------------------------------------- --------------------------specilized model operations & models --------------------...
davidzhulijun/TAM
FiniteStateMachine/Programs/FSM4.hs
bsd-3-clause
958
0
7
169
299
167
132
26
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/CancelReservedInstancesListing.hs
mpl-2.0
5,259
0
15
959
574
345
229
75
1
----------------------------------------------------------------------------- -- | -- Module : Control.Functor.Limit -- Copyright : (C) 2008 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Portability : non-...
urska19/MFP---Samodejno-racunanje-dvosmernih-preslikav
Control/Functor/Limit.hs
apache-2.0
1,172
4
8
212
275
156
119
-1
-1
{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module Network.Riak.Protocol.MapUpdate.FlagOp (FlagOp(..)) where import Prelude ((+), (/), (.)) import qualified Prelude as Prelude' import qualifie...
tmcgilchrist/riak-haskell-client
protobuf/src/Network/Riak/Protocol/MapUpdate/FlagOp.hs
apache-2.0
2,375
0
11
369
626
343
283
52
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleContexts #-} module Graphics.GL.Pal.Experimental.StreamingArrayBuffer where import Graphics.GL import Graphics.GL.Pal.Types import Graphics.GL.Pal.Shape import Graphics.GL.Pal.WithActions import ...
lukexi/gl-pal
src/Graphics/GL/Pal/Experimental/StreamingArrayBuffer.hs
bsd-3-clause
5,208
0
18
1,349
1,111
560
551
84
1