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 Data.HashPSQ.Tests ( tests ) where import Prelude hiding (lookup) import Data.Maybe (isNothing) import Test.Framework (Test) import Test.Framework.Providers.HUnit (testCase) import Test.HUnit ...
meiersi/psqueues-old
tests/Data/HashPSQ/Tests.hs
bsd-3-clause
1,267
0
9
315
215
127
88
22
1
{-# LANGUAGE PatternGuards #-} module Idris.CaseSplit(splitOnLine, replaceSplits, getClause, getProofClause, mkWith, nameMissing, getUniq, nameRoot) where -- splitting a variable in a pattern clause import Idris.AbsSyntax impo...
shlevy/Idris-dev
src/Idris/CaseSplit.hs
bsd-3-clause
18,135
0
23
7,169
6,368
3,178
3,190
345
18
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------- -- | -- Module : Irreverent.Bitbucket.Json.Pipelines.UpdateConfig -- Copyright : (C) 2017 Irreverent Pixel Feats -- License : BSD-style (see the file /LICENSE.md) -- Ma...
irreverent-pixel-feats/bitbucket
bitbucket-json/src/Irreverent/Bitbucket/Json/Pipelines/UpdateConfig.hs
bsd-3-clause
1,456
0
11
213
208
130
78
22
1
module Proplists where import Data.List import Data.Char type Property = (String, PropVal) type Proplist = [ Property ] data PropVal = Int Integer | Str String | Undefined | Obj Proplist | Arr [PropVal] deriving (Show, Eq) testList :: Proplist testList = [("a",Int 1), ("b", Str "Foo")] testList2 :: Proplist ...
tty/joy-of-coding
src/Proplists.hs
bsd-3-clause
442
0
7
89
185
106
79
15
1
import System.Environment (getArgs) import Data.Bits ((.|.)) import Data.List.Split (splitOn) lak :: Int -> Int -> [Int] -> [Int] lak _ _ [] = [] lak x y (z:zs) | z == x = y : lak x y zs | otherwise = z : lak x y zs lake :: Int -> [Int] -> [String] -> [[String]]...
nikai3d/ce-challenges
hard/lakes.hs
bsd-3-clause
1,284
0
13
597
631
324
307
24
1
{-# LANGUAGE NegativeLiterals #-} module Singletons.NegativeLiterals where import Data.Singletons.Base.TH import Numeric.Natural (Natural) $(singletons [d| f :: Natural f = -1 |])
goldfirere/singletons
singletons-base/tests/compile-and-dump/Singletons/NegativeLiterals.hs
bsd-3-clause
189
0
7
30
38
24
14
-1
-1
module IRC.UrlHandler where import IRC import MissileLauncher import Text.ParserCombinators.Parsec import Network.Curl import Text.Regex import Control.Monad urlHandler = defaultHandler { _onMessage = onMessage } -- The message handler onMessage :: IRCConnection -> String -> String -> String -> IO () onMessage con...
Catchouli/robo
src/IRC/UrlHandler.hs
bsd-3-clause
806
0
17
212
218
111
107
19
3
module Parser where import Text.Parsec hiding ((<|>), many, optional) import Text.Parsec.Combinator hiding (optional) import Text.Parsec.String import Text.Parsec.Token import Text.Parsec.Char import Data.Monoid import Control.Applicative import Control.Monad import RewriteSystem parseRuleFile :: FilePath -> IO ([(St...
edgarklerks/rewrite_systems
Parser.hs
bsd-3-clause
4,342
0
19
1,289
1,489
793
696
96
5
module ImportNotAtTop where main = 3 + 4 + 4 import Int f = 4
roberth/uu-helium
test/staticerrors/ImportNotAtTop.hs
gpl-3.0
65
0
6
18
25
15
10
-1
-1
module Haskus.System.PCI.Types ( Vendor (..) , Device (..) , Class (..) , SubClass (..) ) where import Data.IntMap.Strict data Vendor = Vendor { vendorName :: String , vendorDevices :: IntMap Device } deriving (Show) data Device = Device { deviceName :: String , deviceSubDevice...
hsyl20/ViperVM
haskus-system/src/lib/Haskus/System/PCI/Types.hs
bsd-3-clause
594
0
9
159
168
103
65
22
0
-- Copyright (c) 2016 Eric McCorkle. All rights reserved. -- -- 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, this list of conditions...
saltlang/compiler-toolbox
src/Control/Monad/Positions.hs
bsd-3-clause
8,898
0
15
1,941
1,981
1,061
920
157
1
module GHC.Driver.Monad (module GhcMonad) where import GhcMonad
google/ghc-source-gen
compat/GHC/Driver/Monad.hs
bsd-3-clause
64
0
4
7
16
11
5
2
0
-- | -- 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...
tekul/cryptonite
gen/template/hash.hs
bsd-3-clause
1,738
21
15
353
351
216
135
-1
-1
{-# LANGUAGE CPP, NoImplicitPrelude #-} {-# LANGUAGE ForeignFunctionInterface #-} -- | Miscellaneous information about the system environment. module System.Environment.Compat ( getArgs , getProgName , getEnv , lookupEnv , setEnv , unsetEnv , withArgs , withProgName , getEnvironment ) where import System.E...
beni55/base-compat
src/System/Environment/Compat.hs
mit
4,200
46
7
849
504
307
197
26
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/SwapEnvironmentCNAMEs.hs
mpl-2.0
5,714
0
9
1,013
552
336
216
70
1
{-# Language RankNTypes, PatternSynonyms, TypeOperators, DataKinds, PolyKinds, KindSignatures, GADTs #-} module T15694 where import Data.Kind import Data.Type.Equality data Ctx :: Type -> Type where E :: Ctx(Type) (:&:) :: a -> Ctx(as) -> Ctx(a -> as) data ApplyT(kind::Type) :: kind -> Ctx(kind) -> Type wher...
sdiehl/ghc
testsuite/tests/patsyn/should_fail/T15694.hs
bsd-3-clause
831
0
12
284
362
204
158
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE StandaloneDeriving #-} module PlaceHolder where import Type ( Type ) import Outputable import Name import NameSet import RdrName import Var import Coercion import Con...
snoyberg/ghc
compiler/hsSyn/PlaceHolder.hs
bsd-3-clause
4,085
0
10
850
589
339
250
70
1
module WithRenamingIn2 where sumSquares pow y = (let pow_1 = 2 in pow ^ pow_1) + (sq y) sq x = x ^ pow where pow = 2
kmate/HaRe
old/testing/unfoldDef/WithRenamingIn2_AstOut.hs
bsd-3-clause
124
0
10
35
61
32
29
4
1
module T12192 where
ezyang/ghc
testsuite/tests/driver/T12192.hs
bsd-3-clause
20
0
2
3
4
3
1
1
0
import Test.Cabal.Prelude -- Test unneed version bound on internal build-tools deps main = setupAndCabalTest $ do setup' "configure" [] assertOutputContains "extraneous version range" =<< setup' "sdist" []
mydaum/cabal
cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.test.hs
bsd-3-clause
222
0
10
43
44
21
23
5
1
{-# OPTIONS_GHC -Wall -fwarn-tabs -Werror #-} -- check that all warnings are emitted before failing due to -Werror (#1666) -- missing type sig warning (type checker) main = do let main = main -- shadowing warning (renamer) putStrLn "hello" -- tab warning (lexer) f [] = [] f [] = [] -- overlapping pattern --...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/driver/werror.hs
bsd-3-clause
341
0
10
70
51
28
23
6
1
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE OverloadedStrings #-} -- convert account transactions in c...
johannesgerer/buchhaltung
src/Buchhaltung/Common.hs
mit
16,087
0
18
4,240
4,550
2,455
2,095
-1
-1
module FeatureModel.Parsers.GenericParser ( parseFeatureModel, parseInstanceModel, FmFormat ( FMPlugin, FMIde, FMGrammar, SXFM, SPLOT ) ) where import FeatureModel.Types import qualified BasicTypes as Core -- modules related to the FMPlugin parser import FeatureModel.Parsers.FMPlugin.XmlFeatureParser import F...
hephaestus-pl/hephaestus
alexandre/feature-modeling/src/FeatureModel/Parsers/GenericParser.hs
mit
5,323
2
21
1,301
1,018
582
436
93
3
{-# LANGUAGE DeriveDataTypeable #-} import CompatibilityShims import Superscripts (superScriptNum) {- - Sub all unqualified usages of xK_{...}: :%s/\W\@<=\%(Key\.\)\@<!\%(xK\)\@=/Key./g -} import Numeric (showHex) import XMonad -- (ExtensionClass(..), xmonad) import XMonad.Actions.CycleWS import XMonad.Actio...
benizi/dotfiles
.xmonad/xmonad.hs
mit
26,147
0
21
6,107
6,379
3,603
2,776
428
5
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Hummingbird.Logging ( Config (..) , Appender (..) , setup ) where -------------------------------------------------------------------------------- -- | -- Module : Hummingbird.Logging -- Copyright : (c) Lars Petersen 2017 -- L...
lpeterse/haskell-hummingbird
src/Hummingbird/Logging.hs
mit
2,702
0
19
686
640
336
304
62
2
skips :: [a] -> [[a]] skips [] = [] skips list = skipsAux [1..(length list)] list skipsAux :: [Int] -> [a] -> [[a]] skipsAux [] _ = [] skipsAux _ [] = [] {- 1) Create list of tuples [(index, value)] 2) Filter tuples whose indexes are multiples a particular value 3) Extract the value out of the tuples via map 4) Keep ...
julitopower/HaskellLearning
hopscotch.hs
mit
594
0
14
189
211
116
95
10
1
module Y2017.M02.D09.Exercise where {-- Today's problem is inspired by http://rosalind.info/problems/fibo/ Fibonacci Numbers solved by 2850 as of February 8th, 2017 Problem The Fibonacci numbers 0,1,1,2,3,5,8,13,21,34,... are generated by the following simple rule F(0) = 0 F(1) = 1 F(n) = F(n-1) + F(n-2) for n > ...
geophf/1HaskellADay
exercises/HAD/Y2017/M02/D09/Exercise.hs
mit
1,662
0
6
309
115
72
43
15
1
{-| Low-Level IPC flows for interacting with the serf process. - Serf process can be started and shutdown with `start` and `stop`. - You can ask the serf what it's last event was with `serfLastEventBlocking`. - A running serf can be asked to compact it's heap or take a snapshot. - You can scry into a run...
urbit/urbit
pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs
mit
19,993
0
24
5,096
5,827
2,870
2,957
-1
-1
{-#LANGUAGE AllowAmbiguousTypes #-} {-#LANGUAGE ScopedTypeVariables #-} import Criterion.Main import Criterion.Types import TestCases import Foreign.Marshal.Alloc import Foreign.Marshal.Array (mallocArray, peekArray, pokeArray) import Foreign.Ptr import Foreign.Storable import Foreign.Storable.Generic import Foreign.S...
mkloczko/derive-storable
benchmark/Main.hs
mit
4,702
0
15
1,611
1,608
807
801
81
1
module ElasticSearch.Query where data Query = Query match :: Query match = undefined multiMatch :: Query multiMatch = undefined bool :: Query bool = undefined boosting :: Query boosting = undefined common :: Query common = undefined constantScore :: Query constantScore = undefined disMax :: Query disMax = undef...
SaneApp/elastic-search-api
src/ElasticSearch/Query.hs
mit
1,549
0
5
269
383
230
153
76
1
{- | Module : Language.Egison.Parser Licence : MIT This module provides the parser interface. -} module Language.Egison.Parser ( -- * Parse readTopExprs , readTopExpr , readExprs , readExpr , parseTopExpr -- * Parse a file , loadLibraryFile ...
egison/egison
hs-src/Language/Egison/Parser.hs
mit
3,672
0
13
955
1,053
540
513
86
3
module Physie.Colors( colorsWhite , colorsBlack , colorsRed ) where import Graphics.UI.SDL.Color (Color (..)) colorsBlack :: Color colorsBlack = Color 0 0 0 255 colorsWhite :: Color colorsWhite = Color 255 255 255 255 colorsRed :: Color colorsRed = Color 255 0 0 255
pmiddend/physie
src/Physie/Colors.hs
mit
297
0
6
73
90
52
38
11
1
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} module Test.Smoke.Types.Base where import Control.Monad (when) import Data.Aeson import Data.Aeson.Types (Parser, typeMismatch) imp...
SamirTalwar/Smoke
src/lib/Test/Smoke/Types/Base.hs
mit
3,747
0
16
680
1,029
572
457
113
1
module Eval where import Syntax import TypeCheck import Unbound.Generics.LocallyNameless import Control.Monad.Except type Eval a = ExceptT Error FreshM a eval :: Term -> Eval Term eval TmTrue = return TmTrue eval TmFalse = return TmFalse eval v@Var{} = return v eval a@Abs{} = return a eval (If b t1 t2) = do b' ...
kellino/TypeSystems
simpleBool/Eval.hs
mit
797
0
15
250
323
156
167
30
4
{- | Module : Game.Physics Copyright : Copyright (c) 2016 Michael Litchard License : MIT Maintainer : Michael Litchard Stability : experimental Portability: not portable This module provides the functions describing the physics. ...
mlitchard/cosmos
library/Game/Physics.hs
mit
1,003
0
7
290
191
111
80
19
1
----------------------------------------------------------------------------- -- | -- Module : Core.AST -- Copyright : (c) Leonidas Lampropoulos, 2016, -- -- License : ?? -- -- Standard AST for the Core language for generators. -- Heavily influenced by Language.Haskell.Src -- ---------------------------...
QuickChick/Luck
luck/src/Outer/AST.hs
mit
5,842
0
11
1,619
1,463
826
637
115
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-routeresponse.html module Stratosphere.Resources.ApiGatewayV2RouteResponse where import Stratosph...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/ApiGatewayV2RouteResponse.hs
mit
4,587
0
15
469
619
352
267
52
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalyticsv2-application-applicationcodeconfiguration.html module Stratosphere.ResourceProperties.Kines...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/KinesisAnalyticsV2ApplicationApplicationCodeConfiguration.hs
mit
3,251
0
13
221
262
153
109
30
1
{-# LANGUAGE ViewPatterns #-} module Quark.Optimize (optimize) where import Quark.Type import qualified Data.Sequence as Seq import Data.Sequence (viewl, viewr, (><), (<|)) import Data.Sequence (ViewL(..)) import Data.Sequence (ViewR(..)) --- Utils --- recQProgOpt :: (QProg -> QProg) -> (QItem -> QItem) recQProgOpt...
henrystanley/Quark
Quark/Optimize.hs
cc0-1.0
1,882
0
16
365
748
403
345
35
5
{- Copyright (C) 2017 WATANABE Yuki <magicant@wonderwand.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is ...
magicant/flesh
src/Flesh/Language/Syntax/Print.hs
gpl-2.0
9,282
0
16
2,338
2,479
1,199
1,280
217
1
{- | Module : $Header$ Description : Tools for CommonLogic static analysis Copyright : (c) Eugen Kuksa, Uni Bremen 2011 License : GPLv2 or higher, see LICENSE.txt Maintainer : eugenk@informatik.uni-bremen.de Stability : experimental Portability : portable Tools for CommonLogic static analysis -} ...
nevrenato/Hets_Fork
CommonLogic/Tools.hs
gpl-2.0
8,269
0
12
2,220
2,086
1,023
1,063
168
5
module HFlint.NMod.Base where import Control.DeepSeq ( NFData(..) ) import HFlint.NMod.FFI instance Show (NMod ctxProxy) where show (NMod a) = show a instance Eq (NMod ctxProxy) where {-# INLINE (==) #-} (NMod a) == (NMod a') = a == a' instance Ord (NMod ctxProxy) where {-# INLINE compare #-} compare (N...
martinra/hflint
src/HFlint/NMod/Base.hs
gpl-3.0
418
0
8
89
177
92
85
13
0
module Substitution ( Substitution, comboSubs, applySubs, applyOneSubs, foteSet2Subs, mapTuple, headTuple ) where import ReadPrintTerms (Term(..), isVariable, occursAt) import FOTEset (FOTEset) import Data.Tuple (swap) -------------------------------------------------------...
YueLiPicasso/unification
Substitution.hs
gpl-3.0
4,772
0
10
1,056
715
416
299
40
1
{- Copyright (C) 2014 Richard Larocque <richard.larocque@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 2 of the License, or (at your option) any later version. This progr...
richardlarocque/latin-db-builder
Wiki/DumpReader.hs
gpl-3.0
2,274
3
11
377
594
312
282
39
2
--samenvoegen :: Ord a => [a]->[a]->[a] samenvoegen :: [Int]->[Int]->[Int] samenvoegen [] l = l samenvoegen l [] = l samenvoegen (x:xs) (y:ys) | x<y = (x : samenvoegen xs (y:ys)) | x>y = (y : samenvoegen (x:xs) ys) | True = (x : samenvoegen xs ys) hamming :: [Int] ha...
jorenverspeurt/joren-assignments-haskell
hamming.hs
gpl-3.0
410
0
12
110
232
121
111
8
1
module JunctionSimulation where import Hammer.VTK (writeMultiVTKfile) import Linear.Vect import Texture.Bingham import Texture.Orientation import Texture.Symmetry import VirMat.Core.FlexMicro import VirMat.Distributions.Texture.ODFSampling import ...
lostbean/VirMat
src/JunctionSimulation.hs
gpl-3.0
3,386
0
18
940
1,220
606
614
83
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE Rank2Types #-} module Reviewer.LinkRange where import ClassyPrelude import Control.Lens(makeLenses,(^.),Getter,to) data LinkRange = LinkRange { _linkThis :: Int , _linksTotal :: Int } $(makeLenses ''LinkRange) linkPercentage :: Int -> Getter LinkRange Int linkPe...
pmiddend/reviewer
src/Reviewer/LinkRange.hs
gpl-3.0
650
0
14
140
232
125
107
16
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/GetIAMPolicy.hs
mpl-2.0
6,831
0
16
1,395
806
471
335
125
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/FhirStores/Create.hs
mpl-2.0
6,556
0
18
1,413
862
502
360
134
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-books/gen/Network/Google/Resource/Books/Onboarding/ListCategoryVolumes.hs
mpl-2.0
7,147
0
22
1,666
1,066
613
453
153
1
{- Habit of Fate, a game to incentivize habit formation. Copyright (C) 2017 Gregory Crosswhite This program is free software: you can redistribute it and/or modify it under version 3 of the terms of the GNU Affero General Public License. This program is distributed in the hope that it will be usef...
gcross/habit-of-fate
sources/library/HabitOfFate/Server/Requests/Web/GetQuestStatus.hs
agpl-3.0
1,446
0
11
273
155
93
62
23
1
-- Copyright (C) 2016-2017 Red Hat, Inc. -- -- This library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- -- This libr...
dashea/bdcs
importer/BDCS/Exceptions.hs
lgpl-2.1
1,867
0
10
392
260
144
116
18
1
------------------------------------------------------------------------------ -- Copyright 2012 Microsoft Corporation. -- -- This is free software; you can redistribute it and/or modify it under the -- terms of the Apache License, Version 2.0. A copy of the License can be -- found in the file "license.txt" at the root...
lpeterse/koka
src/Kind/Newtypes.hs
apache-2.0
3,533
0
15
724
733
398
335
63
2
module Miscellaneous.A328863Spec (main, spec) where import Test.Hspec import Miscellaneous.A328863 (a328863) main :: IO () main = hspec spec spec :: Spec spec = describe "A328863" $ it "correctly computes the first 20 elements" $ map a328863 [1..20] `shouldBe` expectedValue where expectedValue = [1,2,4,6,...
peterokagey/haskellOEIS
test/Miscellaneous/A328863Spec.hs
apache-2.0
376
0
8
57
154
92
62
10
1
-- -- Copyright : (c) T.Mishima 2014 -- License : Apache-2.0 -- {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP, ForeignFunctionInterface #-} module Main where import Bindings.OculusRift import Bindings.OculusRift.Types import Control.Exception ( bracket ) import Debug.Trace ( traceIO ) import Foreign.C.String ( peek...
lukexi/bindings-Oculus
test/case2/Main.hs
apache-2.0
8,940
0
22
2,367
2,131
1,062
1,069
180
4
{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances, TypeSynonymInstances #-} module Type where import qualified Data.Map as M import Data.Monoid (Monoid(..)) import Prelude import Error import Pretty newtype TVar = TV String deriving (Show, Eq, Ord) instance Pretty ...
ahodgen/archer-calc
src/Type.hs
bsd-2-clause
3,833
0
12
1,168
1,340
694
646
100
4
{-# LANGUAGE DataKinds, RecordWildCards, TypeOperators #-} module Sprockell where import CLaSH.Prelude hiding (Word) {------------------------------------------------------------- | SPROCKELL: Simple PROCessor in hasKELL :-) | | j.kuper@utwente.nl | October 28, 2012 -----------------------------------------...
ggreif/clash-compiler
examples/Sprockell.hs
bsd-2-clause
11,235
4
11
4,777
1,467
923
544
123
15
-- | Project Euler No. 2 -- -- The prime factors of 13195 are 5, 7, 13 and 29. -- -- What is the largest prime factor of the number 600851475143 ? primes = 2 : filter ((==1) . length . primeFactors) [3,5..] primeFactors n = factor n primes where factor n (p:ps) | p*p > n = [n] | n `mod...
mazelife/project_euler
three.hs
bsd-3-clause
502
0
12
151
193
100
93
10
1
{-# LANGUAGE TemplateHaskell, RecordWildCards,ScopedTypeVariables,FlexibleContexts #-} module Network.AuthorizeNet.Response where import qualified Data.ByteString.Lazy as BSL import qualified Data.Text as T import Network.AuthorizeNet.Request import Network.AuthorizeNet.TH import Network.AuthorizeNet.Types import Ne...
MichaelBurge/haskell-authorize-net
src/Network/AuthorizeNet/Response.hs
bsd-3-clause
8,742
0
10
1,370
1,282
726
556
132
1
module HEP.Data.LHCO.PipesUtil ( getLHCOEvent , eventFromHandle , eventFromBS ) where import Control.Monad.Trans.State.Strict import Data.ByteString.Char8 (ByteString) import Pipes import Pipes.Attoparsec (parse) im...
cbpark/lhco-tools
src/HEP/Data/LHCO/PipesUtil.hs
bsd-3-clause
1,044
0
12
385
276
149
127
21
2
{-# LANGUAGE ViewPatterns #-} -- -- This module gives certain backend objects types on the front so that they -- are easier to work with, eg Files, Folders etc -- module ThirdLight.Assets.Types ( ID(..), -- unique ID for each unique "asset" AssetUID(..), -- asset type to distinguish overlapping ids: ...
jsdw/hs-thirdlight-api
src/ThirdLight/Assets/Types.hs
bsd-3-clause
10,427
0
19
3,329
2,616
1,410
1,206
-1
-1
{- A binomial option pricing model Assume a put option with strike price $110 currently trading at $100 and expiring in one year. Annual risk free rate is at 5%. Price is expected to increase 20% and decrease 15% every six months. It is necessary to estimate the price of the put option. -} import Control....
dsorokin/aivika-lattice
examples/BinomialPricingModel.hs
bsd-3-clause
2,292
0
17
733
569
290
279
51
3
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS -Wall #-} -- | -- Module : Network.Mail.Client.Gmail -- License : BSD3 -- Maintainer : Enzo Haussecker -- Stability : Experimental -- Portability : Unknown -- -- A dead simp...
nikita-volkov/smtps-gmail
Network/Mail/Client/Gmail.hs
bsd-3-clause
24,843
0
17
6,923
4,523
2,329
2,194
590
449
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE BangPatterns #-} -- | TUF security features module Distribution.Server.Features.Security ( initSecurityFeature ) where -- Standard libraries import Control.Exception import Data.Time import qualified Data.ByteString.Lazy.Char8 as ...
edsko/hackage-server
Distribution/Server/Features/Security.hs
bsd-3-clause
11,319
0
25
3,149
2,063
1,096
967
179
8
module Network.Orchid.Core.Format where import Data.ByteString.Lazy (ByteString) import Data.FileStore (FileStore) -- Formats produce proper UTF-8 text or binary docs. (TODO: ascii for tex?) data Output = TextOutput String | BinaryOutput ByteString -- Wiki format description data type. data WikiFormat = Wi...
sebastiaanvisser/orchid
src/Network/Orchid/Core/Format.hs
bsd-3-clause
555
0
13
153
94
58
36
15
0
import System import MyApp1.TokyoCabinet main :: IO () main = do args <- getArgs case head args of "-h" -> (new :: IO HDB) >>= main' "-b" -> (new :: IO BDB) >>= main' "-f" -> (new :: IO FDB) >>= main' _ -> putStrLn "./myapp1 [-h|-b|-f]" where main'...
tom-lpsd/tokyocabinet-haskell
examples/myapp1.hs
bsd-3-clause
639
0
15
286
216
102
114
19
4
-- | Interval-based implementation of preview polling -- module Hakyll.Web.Preview.Poll ( previewPoll ) where import Control.Applicative ((<$>)) import Control.Concurrent (threadDelay) import Control.Monad (filterM) import System.Time (getClockTime) import System.Directory (getModificationTime, doesFileExist) ...
sol/hakyll
src/Hakyll/Web/Preview/Poll.hs
bsd-3-clause
1,046
0
14
285
239
128
111
24
3
-- ------------------------------------------------------------ {- | Module : Yuuko.Text.XML.HXT.DTDValidation.TypeDefs Copyright : Copyright (C) 2008 Uwe Schmidt License : MIT Maintainer : Uwe Schmidt (uwe@fh-wedel.de) Stability : experimental Portability: portable This module provides...
nfjinjing/yuuko
src/Yuuko/Text/XML/HXT/DTDValidation/DTDValidation.hs
bsd-3-clause
17,540
442
21
4,392
2,825
2,101
724
286
1
module Perceptron where import qualified Prelude andb :: Prelude.Bool -> Prelude.Bool -> Prelude.Bool andb b1 b2 = case b1 of { Prelude.True -> b2; Prelude.False -> Prelude.False} negb :: Prelude.Bool -> Prelude.Bool negb = (Prelude.not) data Nat = O | S Nat data Option a = Some a | None snd :: ((...
tm507211/CoqPerceptron
Benchmarks/hs/Perceptron.hs
bsd-3-clause
11,938
22
29
4,121
6,408
3,338
3,070
477
10
module Data.Genetics.Core where import Control.Monad import Control.Monad.Random import Data.Function import Data.Ord import qualified Data.List as L import Data.Genetics.Class type Population a = [a] data EvOptions a = EvOptions{ ePopSize :: Int , eMaxGen :: Int , eMutaRate :: Double , eElites :: Double , eTarge...
Teaspot-Studio/genmus
src/Data/Genetics/Core.hs
bsd-3-clause
2,545
0
15
601
1,129
576
553
-1
-1
module GameInfo where import Control.DeepSeq import Data.Map (Map) data GameInfo = GameInfo { name :: String, state :: GameState, turn :: Int, timeToHost :: Int, era :: Maybe Era, ...
Ornedan/dom3statusbot
GameInfo.hs
bsd-3-clause
3,679
0
13
1,166
962
508
454
130
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Freeze -- Copyright : (c) David Himmelstrup 2005 -- Duncan Coutts 2011 -- License : BSD-like -- -- Maintainer : cabal-devel@gmail.com -- Stability ...
sopvop/cabal
cabal-install/Distribution/Client/Freeze.hs
bsd-3-clause
9,795
0
20
2,491
1,724
925
799
184
3
{-# LANGUAGE CPP, ConstraintKinds, DeriveDataTypeable, FlexibleContexts, MultiWayIf, NamedFieldPuns, OverloadedStrings, PackageImports, RankNTypes, RecordWildCards, ScopedTypeVariables, TemplateHaskell, TupleSections #-} -- | Run commands in Docker containers module Stack.Docker (cleanup ...
Fuuzetsu/stack
src/Stack/Docker.hs
bsd-3-clause
43,091
0
34
14,339
9,594
4,877
4,717
848
22
import System header = "#include <stdio.h>\n\ntypedef struct info_table {\n\tconst int srt;\n\tconst int type;\n\tconst int args;\n} info_table;\n\nint empty_entry() {return 1;}" table :: String -> Int -> String table name id = "const info_table " ++ name ++ "_info_tb __attribute__ " ++ "((section (\"...
dterei/Scraps
ghc/testAsSubLimit.hs
bsd-3-clause
1,743
0
13
557
442
217
225
34
2
#!/usr/bin/env runghc module Main where import Control.DeepSeq import Control.Exception import Test.Tasty import Test.Tasty.HUnit import Graphics.OpenSCAD import Data.Colour (withOpacity) import Data.List.NonEmpty (fromList) import Data.Monoid ((<>), Monoid,mconcat, mempty, mappend) assertRaises :: (Show a, Contro...
andreyk0/HSOpenSCAD
UnitTest.hs
bsd-3-clause
15,180
0
19
4,157
5,092
2,841
2,251
262
3
{-#LANGUAGE TypeFamilies#-} {-#LANGUAGE TemplateHaskell#-} {-#LANGUAGE QuasiQuotes#-} {-#LANGUAGE OverloadedStrings#-} module HsVerilog.Type where import qualified Data.Text as T import qualified Data.Map as M class Verilog a where toVerilog :: a -> T.Text data Range = Range Integer Integer | RangeBit Integ...
junjihashimoto/hsverilog
src/HsVerilog/Type.hs
bsd-3-clause
1,539
0
11
359
585
341
244
70
0
module Playground18 where import Playground17 import qualified Data.Map as Map import Data.Maybe import Data.List possibleDrawers :: [Int] possibleDrawers = [1 .. 50] getDrawerContents :: [Int] -> Map.Map Int a -> [Maybe a] getDrawerContents ids' catalog = map getIdsContents ids' where getIdsContents = \ drawerI...
stefanocerruti/haskell-primer-alpha
src/Playground18.hs
bsd-3-clause
2,236
0
12
416
732
383
349
54
1
{-# LANGUAGE OverloadedStrings, RecordWildCards #-} module DB.CardUserSession.Queries where import Prelude hiding (id) import Control.Monad.IO.Class (liftIO) import Data.Functor ((<$>)) import Data.Maybe (listToMaybe) import Data.Monoid import Data.String (fromString) import Data.UUID hiding (fromString) i...
ppseafield/backend-flashcard
src/DB/CardUserSession/Queries.hs
bsd-3-clause
1,983
0
13
554
432
232
200
45
2
module Pos.Infra.Communication.Relay ( module Pos.Infra.Communication.Relay.Class , module Pos.Infra.Communication.Relay.Logic , module Pos.Infra.Communication.Relay.Types , module Pos.Infra.Communication.Relay.Util ) where import Pos.Infra.Communication.Relay.Class import ...
input-output-hk/pos-haskell-prototype
infra/src/Pos/Infra/Communication/Relay.hs
mit
471
0
5
100
78
59
19
9
0
type A = Int data B = B A deriving Show main = show (B 100)
roberth/uu-helium
test/correct/DerivableSyn.hs
gpl-3.0
61
0
7
17
33
18
15
3
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-opsworks/gen/Network/AWS/OpsWorks/RegisterInstance.hs
mpl-2.0
7,483
0
13
1,615
1,085
650
435
128
1
{-# LANGUAGE FlexibleContexts #-} -- | This module collects several function for converting Hagl values to -- strings and printing out the current state of an execution. Note that -- some other pretty printing functions are located in the modules they are -- specific to. module Hagl.Print where import Control....
pparkkin/Hagl
Hagl/Print.hs
bsd-3-clause
4,275
0
12
945
1,349
693
656
71
2
{-# LANGUAGE TemplateHaskell #-} import Network.Socket import Network.Wai.Ghcjs import Network.Wai.Handler.Warp import System.IO main :: IO () main = do (port, socket) <- openFreePort app <- $(serveGhcjs $ BuildConfig { mainFile = "Main.hs", customIndexFile = Nothin...
soenkehahn/wai-shake
test/test-project/Main.hs
bsd-3-clause
833
0
15
222
242
124
118
29
1
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-} module Distribution.Client.Dependency.Modular.Tree ( FailReason(..) , POption(..) , Tree(..) , TreeF(..) , ana , anaM , cata , cataM , choices , inn , innM , lchoices , para , trav ) where impo...
randen/cabal
cabal-install/Distribution/Client/Dependency/Modular/Tree.hs
bsd-3-clause
6,861
0
11
2,013
1,930
1,022
908
-1
-1
module Main where import Test.Invariant import Test.Tasty import Test.Tasty.QuickCheck main :: IO () main = defaultMain $ testGroup "Tests" [ testGroup "Arity 1" [ testProperty "Idempotence" $ idempotent (* (0 :: Int)) , testProperty "Idempotence" $ (/=0) &> not . idempotent (* (2 :...
knupfer/test-invariant
test/Test.hs
bsd-3-clause
697
0
14
202
224
128
96
-1
-1
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/Text/Internal/Unsafe.hs" #-} {-# LANGUAGE CPP, MagicHash, UnboxedTuples #-} {-# OPTIONS_HADDOCK not-home #-} -- | -- Module : Data.Text.Internal.Unsafe -- Copyright : (c) 2009, 2010, 2011 Bryan O'Sullivan...
phischu/fragnix
tests/packages/scotty/Data.Text.Internal.Unsafe.hs
bsd-3-clause
1,895
1
12
407
206
129
77
18
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeSynonymInstances #-} module IHaskell.Display.Widgets.Float.BoundedFloat.BoundedFloatText ( -- * The BoundedFloatText -- Widget BoundedFloatText, -- * Constructor mkBoun...
artuuge/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Float/BoundedFloat/BoundedFloatText.hs
mit
1,918
0
13
423
353
192
161
40
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="pl-PL"> <title>Active Scan Rules - Blpha | ZAP Extension</title> <maps> <homeID>top</homeID...
veggiespam/zap-extensions
addOns/wavsepRpt/src/main/javahelp/org/zaproxy/zap/extension/wavsepRpt/resources/help_pl_PL/helpset_pl_PL.hs
apache-2.0
990
89
29
163
410
218
192
-1
-1
-- (c) The University of Glasgow 2012 {-# LANGUAGE CPP, DataKinds, DeriveDataTypeable, GADTs, KindSignatures, ScopedTypeVariables, StandaloneDeriving, RoleAnnotations #-} -- | Module for coercion axioms, used to represent type family instances -- and newtypes module CoAxiom ( BranchFlag, Branched...
ml9951/ghc
compiler/types/CoAxiom.hs
bsd-3-clause
18,558
0
14
4,558
2,462
1,367
1,095
199
1
-- | You don't need to import this module to enable bash completion. -- -- See -- <http://github.com/pcapriotti/optparse-applicative/wiki/Bash-Completion the wiki> -- for more information on bash completion. module Options.Applicative.BashCompletion ( bashCompletionParser ) where import Control.Applicative ((<$>),...
d12frosted/optparse-applicative-kb
Options/Applicative/BashCompletion.hs
bsd-3-clause
2,980
0
16
727
797
422
375
68
8
{-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} #endif #if !defined(TESTING) && __GLASGOW_HASKELL__ >= 703 {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- -- | -- Module : Data.Set.Base -- Copyri...
technogeeky/d-A
include/containers-0.5.0.0/Data/Set/Base.hs
gpl-3.0
48,659
0
21
12,805
10,463
5,390
5,073
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Lamdu.GUI.ExpressionEdit.ListEdit(make) where import Control.Applicative ((<$>), (<|>), Applicative(..)) import Control.Lens.Operators import Control.MonadA (MonadA) import Data.Monoid (Monoid(..)) import Lamdu.GUI.ExpressionGui (ExpressionGui) import Lamdu.GUI.ExpressionGui.M...
schell/lamdu
Lamdu/GUI/ExpressionEdit/ListEdit.hs
gpl-3.0
6,068
0
27
1,296
1,658
860
798
-1
-1
import Control.Exception import GHC.Compact import qualified Data.Map as Map import Data.Time.Clock import Text.Printf import System.Environment import System.Mem import Control.DeepSeq -- Benchmark compact against compactWithSharing. e.g. -- ./compact_bench 1000000 main = do [n] <- map read <$> getArgs let m =...
ezyang/ghc
libraries/ghc-compact/tests/compact_bench.hs
bsd-3-clause
750
1
15
130
276
138
138
22
1
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} module Tc170_Aux where class ReadMode mode data Attr m w a = Attr (w -> IO a) (w -> a -> IO ()) mapAttr :: ReadMode m => (a -> b) -> (a -> b -> a) -> Attr m w a -> Attr m w b mapAttr get set (Attr getter setter) = Attr (\w -> do a <- getter w; return (get ...
urbanslug/ghc
testsuite/tests/typecheck/should_compile/Tc170_Aux.hs
bsd-3-clause
651
0
12
174
310
158
152
-1
-1
{-# LANGUAGE NoMonomorphismRestriction, FlexibleContexts, TypeFamilies #-} module Main where import Diagrams.Prelude import Diagrams.Backend.SVG.CmdLine rearrange :: [a] -> [a] rearrange = uncurry (++) . divide where divide [] = ([],[]) divide (x:y:as) = (x:xs', y:ys') where (xs',ys') = divide...
Javran/misc
butterfly/src/Main.hs
mit
453
0
12
97
182
99
83
12
3
module Ch07Spec where import Test.Hspec import Ch07 spec :: Spec spec = do describe "indexJ" $ it "select the nth element" $ do indexJ 2 yeah `shouldBe` Just 'a' indexJ 5 yeah `shouldBe` Nothing describe "dropJ" $ it "drops first n elements" $ do jlToList (dropJ 1 yeah) `shouldBe` "eah" ...
isaiah/cis194
test/Ch07Spec.hs
mit
518
0
13
135
186
91
95
17
1
-- roman2decimal module Roman2Decimal ( RomanAlg(..), romanAlgToDecimal, RomanNum, romanToDecimal, strToRoman, romanStrToDecimal ) where data RomanAlg = I | V | X | L | C | D | M deriving(Eq, Ord, Show, Read) type RomanNum = [RomanAlg] romanAlgToDecimal :: RomanAlg -> Int romanAlgToDecimal ...
yamadapc/general-roman2decimal
haskell/Roman2Decimal.hs
mit
1,094
0
12
395
378
204
174
32
7
{- Copyright (c) 2015 Nils 'bash0r' Jonsson 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, distr...
project-horizon/framework
src/lib/Language/JavaScript/DSL/Operators/Bitwise.hs
mit
2,014
0
6
346
149
97
52
15
1
-- Esolang: MiniBitMove -- https://www.codewars.com/kata/587c0138110b20624e000253 module Haskell.SylarDoom.MiniBitMove where import Data.List (foldl') import Data.Foldable(toList) import qualified Data.Sequence as Seq interpreter :: String -> String -> String interpreter tape array = toList . fst . foldl' (\(a, i) c...
gafiatulin/codewars
src/6 kyu/MiniBitMove.hs
mit
651
0
15
148
241
136
105
11
4
module Either where lefts' :: [Either a b] -> [a] lefts' = foldr (\a b -> leftToList a ++ b) [] rights' :: [Either a b] -> [b] rights' = foldr (\a b -> rightToList a ++ b) [] partitionEithers' :: [Either a b] -> ([a], [b]) partitionEithers' = foldr (\a (b, c) -> (leftToList a ++ b, rightToList a ++ c)) ([], []) eit...
JoshuaGross/haskell-learning-log
Code/Haskellbook/Either.hs
mit
810
0
10
184
474
248
226
21
1