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 Mish.ConnectorGenerator(connectRooms) where import qualified Data.Set as S import qualified Data.Map as M import Mish.Config import Mish.Util import Mish.HexagonalGrid import System.Random type Region = S.Set AxialCoordinate -- Having already mad...
halvorgb/mish
src/Mish/ConnectorGenerator.hs
mit
5,155
0
16
1,776
1,433
779
654
85
5
-- first (x:xs) = x --xsの名前ははなんでもいいので_でよい first (x:_) = x main = do print $ first [1..5] print $ first "abcdef"
shigemk2/haskell_abc
first.hs
mit
149
0
9
26
47
23
24
4
1
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module HarmLang.IO where import Data.Ratio import Codec.Midi import HarmLang.InitialBasis import HarmLang.Types tempo = 500000 granularity = 24 notelength = granularity * 2 basenote = 0 -- http://stackoverflow.com/questions/26155872/creation...
cyruscousins/HarmLang
src/HarmLang/IO.hs
mit
2,121
0
18
525
781
421
360
44
1
{-# LANGUAGE OverloadedStrings #-} module Access.AWS ( loadInstancesMetaData , InstanceMetaData ) where import Control.Arrow (first) import Control.Lens import Control.Monad.Trans.AWS import qualified Data.Map.Strict as M import Data.Maybe ...
geraud/access
library/Access/AWS.hs
mit
2,986
0
20
959
651
366
285
-1
-1
module Options where mutationChance :: Float mutationChance = 0.3 elitePart :: Float elitePart = 0.3 maxGeneration :: Int maxGeneration = 30 populationCount :: Int populationCount = 3 individsCount :: Int individsCount = 50
NCrashed/radio-problem
scripts/Options.hs
mit
228
0
4
37
54
33
21
11
1
{-# LANGUAGE OverloadedStrings #-} module Text.Greek.Corpus.Bible.Stats where import Prelude hiding (words) import Control.Lens ((^.)) import Control.Lens.Tuple (_1, _2, _3, _4, _5) import Data.Text (Text) import Data.Text.Format (Only(..), Shown(..), right, left) import Data.Text.Format.Strict (format') import Text....
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Text/Greek/Corpus/Bible/Stats.hs
mit
2,582
0
16
511
1,057
582
475
48
5
{- | module: $Header$ description: OpenTheory QuickCheck interface license: MIT maintainer: Joe Leslie-Hurd <joe@gilith.com> stability: provisional portability: portable -} module OpenTheory.Primitive.Test ( assert, check ) where import qualified Test.QuickCheck as QuickCheck assert :: String -> Bool -> IO () ...
gilith/opentheory
data/haskell/opentheory-primitive/src/OpenTheory/Primitive/Test.hs
mit
846
0
11
225
199
98
101
20
2
module Utils.Addr where import Address.Types import Utils.ToReadable -- Приводит набор компонент адреса к читаемой строке format :: [Component] -> String format = init . tail -- обрезаю фигурные скобки . map newlines . toReadable . show where newlines c | c == ',' = '\n' -- заменяет запятую на перенос ст...
kahless/report-comparator
src/Utils/Addr.hs
mit
444
0
10
80
83
45
38
8
2
{-# LANGUAGE DeriveDataTypeable, CPP, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables, PatternGuards, ViewPatterns #-} {- Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Lic...
poxu/pandoc
src/Text/Pandoc/Shared.hs
gpl-2.0
39,656
687
16
12,347
10,367
5,598
4,769
732
21
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_HADDOCK show-extensions #-} -- | -- Module : Yi.TextCompletion -- License : GPL-2 -- Maintainer : yi-devel@googlegroups.com -- Stability : experimental -- Portability : portab...
atsukotakahashi/wi
src/library/Yi/TextCompletion.hs
gpl-2.0
7,603
0
20
1,876
1,453
773
680
126
4
{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, FlexibleContexts #-} import Control.Exception import Control.Monad import Control.Monad.Trans.Reader import Control.Monad.Trans.State.Strict import qualified Data.ByteString.Lazy as B import Data.Functor.Identity impo...
nomeata/darcs-mirror-arbtt
tests/test.hs
gpl-2.0
8,502
5
16
1,947
2,006
1,032
974
157
2
instance Functor Identity where fmap f (Identity x) = Identity (f x)
hmemcpy/milewski-ctfp-pdf
src/content/1.8/code/haskell/snippet06.hs
gpl-3.0
72
0
8
15
34
16
18
2
0
{-# LANGUAGE ViewPatterns #-} {-# LANGUAGE OverloadedStrings #-} -- | -- Copyright : (c) 2010, 2011 Benedikt Schmidt -- License : GPL v3 (see LICENSE) -- -- Maintainer : Benedikt Schmidt <beschmi@gmail.com> -- -- Pretty printing and parsing of Maude terms and replies. module Term.Maude.Parser ( -- * pretty pr...
tamarin-prover/tamarin-prover
lib/term/src/Term/Maude/Parser.hs
gpl-3.0
12,008
0
18
3,423
2,982
1,527
1,455
216
9
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} module Heqet.Input.English where import Heqet.Input.Parse import Heqet.Tables import Language.Haskell.TH.Quote import Language.Haskell.TH import Text.ParserCombinators.Parsec music :: QuasiQuoter music = QuasiQuoter { quoteExp = \s -> [| handleParseError $ runParser mu...
Super-Fluid/heqet
Heqet/Input/English.hs
gpl-3.0
680
0
7
95
126
84
42
11
1
{-# LANGUAGE LambdaCase, NoImplicitPrelude, GeneralizedNewtypeDeriving, RecordWildCards, TypeFamilies, TemplateHaskell, DeriveGeneric, FlexibleInstances, KindSignatures, NoMonomorphismRestriction #-} module Lamdu.Sugar.Names.Add ( addToDef, addToExpr ) where import qualified Control.Lens as Lens import ...
da-x/lamdu
Lamdu/Sugar/Names/Add.hs
gpl-3.0
14,708
0
18
3,547
4,137
2,151
1,986
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Article where import Control.Exception import qualified Data.Text as T import Site (cursorFor) import Text.XML.Cursor scrapeArticle :: String -> String -> IO [String] scrapeArticle targetId url = do c <- cursorFor url ca...
hrantzsch/get-cn
src/Article.hs
gpl-3.0
974
0
20
291
332
172
160
27
3
module Link(link) where import qualified Control.Monad as Monad import qualified Data.Map as Map import qualified Data.Set as Set import qualified Ast import qualified Scope type Subroutine = Scope.Scope -> [Scope.Var] -> IO Scope.Scope link :: [Ast.Module] -> [(String,Map.Map String Subroutine)] -> Either String (I...
qpliu/esolang
DGOL/hs/interp/Link.hs
gpl-3.0
8,584
0
15
1,936
3,014
1,484
1,530
158
22
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE RecordWildCards #-} module Main where import Control.Applicative ((<$>)) import Data.Bifunctor (Bifunctor (bimap)) import Data.Functor.Extras ((<$$>)) import Data.Maybe (catMaybes) import Data.Monoid ...
rejuvyesh/clippings2md
src/Main.hs
gpl-3.0
1,409
0
16
466
347
199
148
29
2
{- This file is part of HNH. HNH is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. HNH is distributed in the hope that ...
fferreira/hnh
CPSRep.hs
gpl-3.0
5,037
0
12
2,194
1,199
605
594
83
1
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[Foreign]{Foreign calls} -} {-# LANGUAGE DeriveDataTypeable #-} module Language.Haskell.Syntax.ForeignCall ( CExportSpec(..) , CLabelString(..) , CType(..) ...
shayan-najd/HsParser
Language/Haskell/Syntax/ForeignCall.hs
gpl-3.0
5,653
0
8
2,256
363
244
119
49
0
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} -- | -- Module : Sylvia.UI.GTK -- Copyright : GPLv3 -- -- Maintainer : chrisyco@gmail.com -- Portability : portable -- -- Graphical interface based on Cairo and GTK. module Sylvia.UI.GTK ( showInWindow ) where import Data.Default import Data.Void import Graphics.R...
lfairy/sylvia
Sylvia/UI/GTK.hs
gpl-3.0
1,695
0
15
437
468
236
232
49
1
module QFeldspar.Expression.Utils.MiniFeldspar where import QFeldspar.MyPrelude hiding (foldl) import QFeldspar.Expression.MiniFeldspar import QFeldspar.Variable.Typed import qualified QFeldspar.Environment.Typed as ET import qualified QFeldspar.Type.GADT as TG import QFeldspar.Singleton tagFree :: Exp r t -> Exp r t...
shayan-najd/QFeldspar
QFeldspar/Expression/Utils/MiniFeldspar.hs
gpl-3.0
2,193
0
17
771
909
489
420
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-dns/gen/Network/Google/Resource/DNS/ManagedZones/List.hs
mpl-2.0
4,381
0
16
1,049
576
338
238
87
1
{--License: license.txt --} module CCAR.Model.UserTermsAndConditions where import CCAR.Main.DBUtils import GHC.Generics import Data.Aeson as J data CRUD = Create | UT_Update | Read | Query | Delete deriving(Show, Eq, Generic) instance ToJSON CRUD instance FromJSON CRUD
asm-products/ccar-websockets
CCAR/Model/UserTermsAndConditions.hs
agpl-3.0
276
0
6
41
74
44
30
7
0
{-# LANGUAGE MultiWayIf #-} {- Created : 2015 Apr 21 (Tue) 17:59:08 by Harold Carr. Last Modified : 2015 Apr 22 (Wed) 18:02:57 by Harold Carr. -} module Ch_09_9 where import Ch_08_10 hiding (eval, main) import Test.HUnit as T import Test.HUnit.Util as U -- 9.9 Exerci...
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2007-Programming_in_Haskell-1st_Edition-Graham_Hutton/ch_09_9.hs
unlicense
6,157
0
14
2,199
2,214
1,139
1,075
157
3
module Main where import Control.Concurrent import Control.Concurrent.MVar thread_a :: MVar Int -> MVar Float -> IO () thread_a send recv = do putMVar send 72 v <- takeMVar recv putStrLn ("received: " ++ (show v)) thread_b :: MVar Int -> MVar Float -> IO () thread_b recv send = do z <- takeMVar recv ...
Pieterjaninfo/PP
src/pp/block7/cp/phaskell/wait.hs
unlicense
602
0
11
147
217
103
114
19
1
{-# LANGUAGE NoMonomorphismRestriction #-} module LLVM.Slicing.Util.ValueTest where import LLVM.Analysis -- Test for External Functions isMemcpy = isExtFuns ["@llvm.memcpy.p0i8.p0i8.i32","@llvm.memcpy.p0i8.p0i8.i64"] isMemmove = isExtFuns ["@llvm.memmove.p0i8.p0i8.i32","@llvm.memmove.p0i8.p0i8.i64"] isMemset = isE...
zhangyz/llvm-slicing
src/LLVM/Slicing/Util/ValueTest.hs
apache-2.0
3,195
0
11
697
912
462
450
81
4
{-# LANGUAGE BangPatterns,ViewPatterns,DeriveGeneric,TypeSynonymInstances, RankNTypes,MultiParamTypeClasses,TemplateHaskell #-} module LLVM.Slicing.Static.InfoFlow.InfoFlowSlicer ( -- * Types SliceSummary(..), -- * Slice Computing computeSlice, genSliceTable, genSliceTable2, getSliceTabl...
zhangyz/llvm-slicing
src/LLVM/Slicing/Static/InfoFlow/InfoFlowSlicer.hs
apache-2.0
10,912
0
16
2,848
2,977
1,601
1,376
194
6
-- Copyright 2018 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 -- -- https://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in w...
google/cabal2bazel
src/Google/Utils/Env.hs
apache-2.0
1,671
0
10
354
248
137
111
19
1
{-# OPTIONS -fglasgow-exts #-} module Compiler.Semantics where import Text.ParserCombinators.Parsec import Data.Either import Compiler.Syntax import Compiler.CompileError import Compiler.SymbolTable import Compiler.TypeChecking.Nameable import Compiler.TypeChecking.Typeable dupeToErro...
michaelmelanson/cminus-compiler
Compiler/Semantics.hs
bsd-2-clause
3,521
0
14
1,307
865
440
425
66
3
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Unittests for ganeti-htools. -} {- 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 condit...
bitemyapp/ganeti
test/hs/Test/Ganeti/OpCodes.hs
bsd-2-clause
35,547
0
59
10,860
6,021
3,039
2,982
603
2
-- | Efficiently obtain ABC code for a given AO command. -- This is a pure compilation, and ignores metadata. -- -- See Also: AO.Precompile module AO.Compile ( compileAOtoABC , aopToABC ) where import Data.Maybe (fromJust) import qualified Data.List as L import qualified Data.Map as M import ABC.Operato...
dmbarbour/awelon
hsrc/AO/Compile.hs
bsd-3-clause
2,515
0
13
475
735
382
353
57
2
{-# LANGUAGE OverloadedStrings, RecordWildCards, ScopedTypeVariables #-} module Main where import Text.XML.HXT.Core main = do putStrLn "hello"
spacewaffle/ether
exp/htm2/Main.hs
bsd-3-clause
153
0
7
26
23
14
9
5
1
module Azr.Experiments.Workflow where import Control.Monad.State.Strict data Task a = Completed a | Dispatched String a deriving (Eq,Show) data Promise = Index Int deriving (Eq, Show) type Status = (Int, [Task Integer]) update :: Task Integer -> Status -> Status update t (pos,ts) = (pos + 1, ts') where ts' | le...
aztecrex/haskell-workflow
src/Azr/Experiments/Workflow.hs
bsd-3-clause
2,052
0
13
558
904
442
462
64
4
{-| Module : Diplomacy.Order Description : Definition of an order Copyright : (c) Alexander Vieth, 2015 Licence : BSD3 Maintainer : aovieth@gmail.com Stability : experimental Portability : non-portable (GHC only) -} {-# LANGUAGE AutoDeriveTypeable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignature...
avieth/diplomacy
Diplomacy/Order.hs
bsd-3-clause
2,784
0
12
557
740
393
347
63
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE PostfixOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilie...
agacek/tower-camkes-odroid
src/Tower/Odroid/CAN.hs
bsd-3-clause
2,573
0
16
651
599
306
293
70
1
module Snake.Move where import Snake.Type -- | From a direction and a set of coordinates, compute the next possible -- coordinates nextMove :: Direction -> Coord -> Coord nextMove DirUp (Coord x y) = Coord x (1+ y) nextMove DirRight (Coord x y) = Coord (1+ x) y nextMove DirDown (Coord x y) = Coord x (1- y) ...
ardumont/snake
src/Snake/Move.hs
bsd-3-clause
913
0
8
243
382
211
171
-1
-1
{-# LANGUAGE Haskell2010 #-} module Curry.Arrows (split, join, both) where import Control.Arrow (Arrow, arr, (***)) split :: Arrow a => a b (b, b) split = arr $ \x -> (x, x) join :: Arrow a => (b -> c -> d) -> a (b, c) d join = arr . uncurry both f = f *** f
mmarx/curry
Curry/Arrows.hs
bsd-3-clause
263
0
9
62
138
79
59
8
1
-- | A module for conversion from HTML to BlazeHtml Haskell code. -- module Main where import Control.Monad (forM_, when) import Control.Applicative ((<$>)) import Data.Maybe (listToMaybe, fromMaybe) import Data.Char (toLower, isSpace) import Control.Arrow (first) import System.Environment (getArgs) import System.File...
jgm/blaze-html
Util/BlazeFromHtml.hs
bsd-3-clause
11,373
0
19
3,579
2,754
1,467
1,287
215
16
module TestSuite where import Test.Framework (defaultMain, testGroup) import qualified Text.CSS.CSSParserTests main :: IO () main = defaultMain [ testGroup "CSS Parser" Text.CSS.CSSParserTests.tests ]
brentonashworth/css-parser
test/TestSuite.hs
bsd-3-clause
212
0
8
34
54
32
22
6
1
module Generics.GPAH.Cpp ( module Generics.GPAH.Cpp.Base ,module Generics.GPAH.Cpp.Analyze ,module Generics.GPAH.Cpp.PPrint ) where import Generics.GPAH.Cpp.Base import Generics.GPAH.Cpp.Analyze import Generics.GPAH.Cpp.PPrint
bezirg/gpah
src/Generics/GPAH/Cpp.hs
bsd-3-clause
272
0
5
62
54
39
15
7
0
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. module Duckling.Numeral.TE.Tests ( tests ) where import Data.String import Prelude import Test.Tasty import ...
facebookincubator/duckling
tests/Duckling/Numeral/TE/Tests.hs
bsd-3-clause
505
0
9
79
79
50
29
11
1
module Language.Css.AtRules where import Language.Css.Media import Language.Css.Decl import Language.Css.Values type CssCharset = String data CssImport = CssImport String [CssMediaType] deriving (Show, Eq) -- | Only allow @margin@-like properties data CssPage = CssPage (Maybe CssPagePseudo) [Either CssRule CssPag...
athanclark/css-grammar
src/Language/Css/AtRules.hs
bsd-3-clause
1,004
0
12
158
263
148
115
28
0
module GameStage.GameObject where import Control.Monad (when) import Data.Complex import Graphics.Rendering.OpenGL import qualified Class.Sprite as S import Internal.OpenGL import Internal.Texture import GlobalSettings type Pos = Complex GLfloat data GameObject = GameObject { pos :: Pos , radius :: Int , s...
c000/PaperPuppet
src/GameStage/GameObject.hs
bsd-3-clause
2,779
0
20
1,042
1,063
534
529
87
2
-- * Signature module Tableaux ( unifyLiterals , deepen , prawitz , tab , splittab ) where -- * Imports import Util.Prelude import qualified Fol as Fol import qualified Formula as F import FormulaSyn import qualified Prop as Prop import qualified Skolem as Skolem import qualified Unif as Unif import Uti...
etu-fkti5301-bgu/alt-exam_automated_theorem_proving
src/Tableaux.hs
bsd-3-clause
7,365
12
18
1,574
1,527
816
711
88
7
{-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} -- | Stake repartition. -- -- The stake repartition function assigns maps addresses to a portion of the -- total stake. As such, a stake repartition function @r@ satisfies: -- -- - for all address a in its domain @0 <= r a@ -- - @fSum r = 1@ -- -...
input-output-hk/pos-haskell-prototype
node/test/Chain/Abstract/Repartition.hs
mit
2,217
0
11
506
488
277
211
-1
-1
module Simulation ( SimStepOut , SimContext (..) , simulationStep , spawnAgents , mkSimContex , checkTime ) where import Data.Maybe import System.Random import Control.Concurrent import Control.Concurrent.STM import Control.Concurrent.STM.Stats im...
thalerjonathan/phd
thesis/code/concurrent/sugarscape/SugarScapeSTMTVar/src/Simulation.hs
gpl-3.0
6,135
3
17
2,020
1,694
894
800
152
4
{-# 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-config/gen/Network/AWS/Config/StopConfigurationRecorder.hs
mpl-2.0
4,032
0
12
817
401
243
158
63
1
module Main where import HplAssets.Hephaestus.IO import FeatureModel.Types main = buildHpl fcDtmc where fcDtmc = FeatureConfiguration $ Root (f { fId = "HephaestusPL-Code" }) [ Root (f { fId = "SPLAsset" }) [Leaf $ f { fId = "Code" }] ] -- To turn off warnings f ...
alessandroleite/hephaestus-pl
src/meta-hephaestus/HplDrivers/BuildCodeProduct.hs
lgpl-3.0
476
0
14
163
122
74
48
16
1
-- Vectorised "all closest pairs": -- This was {-# LANGUAGE ParallelArrays #-} {-# OPTIONS -fvectorise #-} {-# OPTIONS -fno-spec-constr-count #-} module Vectorised (closestPA, closeststupidPA) where import Points2D.Types import Data.Array.Parallel import Data.Array.Parallel.Prelude.Double as D import qualified ...
mainland/dph
dph-examples/examples/spectral/ClosestPairs/dph/Vectorised.hs
bsd-3-clause
5,838
93
15
1,431
1,804
992
812
-1
-1
{-# LANGUAGE DerivingVia #-} {-# LANGUAGE KindSignatures #-} module T16181 where import Control.Monad.Trans.Class import Control.Monad.Reader import Data.Functor.Const (Const(..)) import Data.Functor.Classes import Data.Kind import Data.Proxy newtype FlipConst a b = FlipConst b deriving (Show1, Eq1) via (Const b) ...
sdiehl/ghc
testsuite/tests/deriving/should_fail/T16181.hs
bsd-3-clause
678
0
10
136
266
152
114
-1
-1
{- Copyright 2015 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
Ye-Yong-Chi/codeworld
codeworld-base/src/GHC/Conc.hs
apache-2.0
731
0
4
136
23
17
6
4
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} module Distribution.Simple.Test.LibV09 ( runTest -- Test stub , simpleTestStub , stubFilePath, stubMain, stubName, stubWriteLog , writeSimpleTestStub ) where import Prelude () import Distribution.Compat.Prelude i...
mydaum/cabal
Cabal/Distribution/Simple/Test/LibV09.hs
bsd-3-clause
11,223
0
24
3,146
2,313
1,180
1,133
188
4
module Main (main) where import HttpBin.Server (serve) import Snap.Http.Server.Config (commandLineConfig) main :: IO () main = serve commandLineConfig
bitemyapp/wreq
httpbin/HttpBin.hs
bsd-3-clause
153
0
6
20
49
29
20
5
1
{-# LANGUAGE OverloadedStrings #-} -- Example of using a PangoLayout import Data.IORef import Data.Monoid ((<>)) import qualified Data.Text as T import Graphics.UI.Gtk import Graphics.Rendering.Cairo loremIpsum = "Lorem ipsum dolor sit amet, consectetur adipisicing elit,\ \ sed do eiusmod tempor incididunt u...
k0001/gtk2hs
gtk/demo/inputmethod/Layout.hs
gpl-3.0
5,417
0
23
1,469
1,482
699
783
-1
-1
module Recursive1 where g :: (Eq a1, Num a1) => a1 -> [a] -> ([a], [a]) g _ [] = ([], []) g 0 xs = ([], xs) g n ((x : xs)) = (x : (fst $ g (n - 1) xs), snd $ g (n - 1) xs) -- source functions f1 :: Int -> [a] -> [a] f1 _ [] = [] f1 0 xs = [] f1 n (x:xs) = x : (f1 (n-1) xs) f2 :: Int -> [a] -> [a] f2 _ [] ...
kmate/HaRe
old/testing/merging/Recursive1_TokOut.hs
bsd-3-clause
554
0
12
162
444
244
200
18
1
{-# LANGUAGE PolyKinds, TypeFamilies, MagicHash, DataKinds, TypeInType, RankNTypes #-} module T11473 where import GHC.Exts import GHC.Types type family Boxed (a :: k) :: * type instance Boxed Char# = Char type instance Boxed Char = Char class BoxIt (a :: TYPE lev) where boxed :: a -> Boxed a instance BoxIt Ch...
ezyang/ghc
testsuite/tests/dependent/should_fail/T11473.hs
bsd-3-clause
621
0
9
144
223
117
106
20
1
module NamedWildcardsNotEnabled where foo :: _a -> _b foo x = not x -- with the NamedWildcards extension enabled this would lead to the -- type Bool -> Bool.
wxwxwwxxx/ghc
testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.hs
bsd-3-clause
160
0
5
31
26
15
11
3
1
{-# LANGUAGE CPP #-} module LambdaCmsOrg.Page.Import ( module Import ) where import Prelude as Import hiding (head, init, last, readFile, tail, writeFile) import ...
lambdacms/lambdacms.org
lambdacmsorg-page/LambdaCmsOrg/Page/Import.hs
mit
1,161
0
6
527
165
120
45
18
1
-- Prime Sextuplets -- https://www.codewars.com/kata/57bf7fae3b3164dcac000352 module PrimesSextuplets (findPrimesSextuplet) where import Data.List(tails) import Data.Array.Unboxed (UArray, accumArray, assocs) findPrimesSextuplet :: Int -> [Int] findPrimesSextuplet sumLimit = head . filter isSextuplet . window6 . dro...
gafiatulin/codewars
src/5 kyu/PrimesSextuplets.hs
mit
928
0
15
227
496
277
219
14
1
-- I Liked the SQL Better... -- http://www.codewars.com/kata/53d2c97d7152a59b64001033/ {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE...
gafiatulin/codewars
src/6 kyu/Movies.hs
mit
1,243
0
10
340
173
98
75
22
1
import System.IO import Control.Monad main = hSetBuffering stdin LineBuffering >> hSetBuffering stdout LineBuffering >> (forever (getLine >>= putStrLn))
SergeyKrivohatskiy/fp_haskell
class/cat.hs
mit
153
0
9
18
47
24
23
3
1
module Version where
BitFunctor/bitfunctor
app/GenesisGenerator/Version.hs
mit
22
0
2
4
4
3
1
1
0
module Handler.TaxSpec (spec) where import TestImport spec :: Spec spec = withApp $ do describe "getTaxR" $ do error "Spec not implemented: getTaxR" describe "postTaxR" $ do error "Spec not implemented: postTaxR"
swamp-agr/carbuyer-advisor
test/Handler/TaxSpec.hs
mit
243
0
11
62
60
29
31
8
1
module Builder ( CcMode (..), GhcMode (..), GhcPkgMode (..), Builder (..), isOptional ) where import Development.Shake.Classes import GHC.Generics import Stage -- | C compiler can be used in two different modes: -- * Compile or preprocess a source file. -- * Extract source dependencies by passing @-MM@ comma...
izgzhen/hadrian
src/Builder.hs
mit
2,590
0
7
760
384
225
159
-1
-1
module Web.Box.View ( ApiKey(..), DocId(..), SessionId(..), DocInfo(..), DocStatus(..), DocEntriesQuery(..), DownloadFormat(..), Dim(..), UpdateInfo(..), UploadRequest(..), SessionInfo(..), SessionUrls(..), SessionTime(..), SessionTheme(..), AssetsInfo(..), WebhookEvent(..), WebhookReq...
docmunch/haskell-box-view
src/Web/Box/View.hs
mit
26,001
0
21
5,679
6,251
3,321
2,930
-1
-1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE Safe #-} -- | -- Module : Data.Trie -- Description : Implemention of prefix trees. -- Copyright : (c) Stefan Haller, 2014 -- -- License : MIT -- Maintainer : s6171690@mail.zih.tu-dresden.de -- Stability : experimental -- Portability : portable -- -- A 'T...
fgrsnau/spell
lib/Data/Trie.hs
mit
5,781
0
15
1,514
1,780
941
839
79
2
{-# LANGUAGE RecordWildCards, OverloadedStrings #-} module ClientSafeDom ( UserInput , Clean , Dirty , sanitize , inject , getInput -- Functions re-exported from Reflex.Dom , module RDExport -- Safe reimplementation of functions from ReflexDom , elDynHtml , _textInput_value , _textInput_input...
haskell-web-intro/secdev
examples/reflex-ghcjs-client/src/ClientSafeDom.hs
mit
1,152
0
10
203
313
173
140
-1
-1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} import Data.Char class Convertible a b | a -> b where convert :: a -> b instance Convertible Int Char where convert = chr instance Convertible Char Int where convert = ord
riwsky/wiwinwlh
src/mparam_fun.hs
mit
262
0
7
51
64
35
29
9
0
import Data.Array import Data.List (intercalate) import Groups main = mapM_ (\x -> putStrLn $ intercalate "\t" $ map (ciska . elemID) $ map (x ·) $ elements group) $ elements group group = mkgroup group' ciska :: Int -> String ciska = (!) strs where strs = array (0, g'size group' - 1) [(g'index group' x, ...
jwodder/groups
haskell/old/grchart.hs
mit
529
2
14
120
239
132
107
14
3
import SFML.Audio import SFML.Graphics import SFML.Window import Foreign.Ptr (nullPtr) import Paths_sfml_demos txtSize = 24 data DemoState = DemoState { xmouse :: Int , ymouse :: Int , key :: String } main = do let ctxSettings = Just $ ContextSettings 24 8 0 1 2 [ContextDefault] wnd <-...
SFML-haskell/SFML
demos/events/main.hs
mit
1,715
0
20
515
614
289
325
47
5
module DataTypes ( URL , LinkResult(..) , Result ) where import qualified Data.Map as M import qualified Data.Set as S import qualified Data.ByteString.Lazy.Char8 as B type URL = B.ByteString data LinkResult = OK (URL,String) | LinkError (URL,String) | FormatError (URL,String) derivin...
marcmo/linkchecker
haskell/DataTypes.hs
mit
522
0
8
142
130
85
45
10
0
----------------------------------------------------------------------- -- -- Haskell: The Craft of Functional Programming, 3e -- Simon Thompson -- (c) Addison-Wesley, 1996-2011. -- -- Index -- ----------------------------------------------------------------------- module Index where import Prelude hiding (Wor...
Numberartificial/workflow
snipets/src/Craft/Index.hs
mit
3,157
0
10
747
761
454
307
49
1
-- The solution of exercise 1.29 -- Simpson's Rule is a more accurate method of numerical integration than -- the method illustrated above. Using Simpson's Rule, the integral of a -- function f between a and b is approximated as -- -- (h / 3) * [y_0 + 4 * y_1 + 2 * y_2 -- + 4 * y_3 + 2 * y_4 -- ...
perryleo/sicp
ch1/sicpc1e29.hs
mit
1,980
0
15
581
446
247
199
18
2
module Spiral ( asSpiral, getDiagonals, getCornerIndexes ) where import Util (partitionBy, everyNth, runningTotal) asSpiral :: [a] -> [[a]] asSpiral xs = let sqrs = map (^2) [1,3..] -- only odd numbers because every square is of odd diameter partSizes = zipWith (-) sqrs $ 0:sqrs in...
liefswanson/projectEuler
src/Spiral.hs
gpl-2.0
681
0
11
177
256
145
111
19
1
module Main where import Config import Data.List as L import Data.List.Split import Data.Time import Data.Char (isDigit) import GHC.Word import Control.Applicative import qualified Data.ByteString.Lazy as B import Network.HTTP.Conduit import Text.XML.Light type Date = (Integer,Int,Int) type MovieInfo = [Content] mai...
johnyhlee/media-tracker
src/Main.hs
gpl-2.0
5,142
0
11
961
1,593
808
785
141
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE...
Hi-Angel/yi
yi-core/src/Yi/Buffer/Misc.hs
gpl-2.0
36,488
0
24
8,849
9,231
4,866
4,365
826
4
{-# LANGUAGE TemplateHaskell #-} {-| Command-line options for the hledger program, and option-parsing utilities. -} module Hledger.Cli.Options where import Data.List import Data.List.Split import Data.Maybe import Data.Time.Calendar import Distribution.PackageDescription.TH (packageVariable, package, pkgName, pkgVer...
Lainepress/hledger
hledger/Hledger/Cli/Options.hs
gpl-3.0
17,856
0
16
4,316
4,292
2,395
1,897
313
2
module H99.Problem11Spec (main, spec) where import H99.Problem11 import Test.Hspec main :: IO() main = hspec spec spec = do describe "Test the Problem11 Module" $do it "Should pack a list with repeating items" $do (encodeModified "aaabbcccd") `shouldBe` [(Multiple 3 'a'), (Multiple 2 'b'), (Multi...
shimanekb/H-99SetTwo
problem11/test/H99/Problem11Spec.hs
gpl-3.0
346
0
10
71
120
64
56
10
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/Productstatuses/Get.hs
mpl-2.0
3,417
0
13
753
399
239
160
62
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/RegionTargetHTTPSProxies/SetSSLCertificates.hs
mpl-2.0
6,491
0
19
1,431
637
379
258
112
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeOperators #-} import Control....
mf59816/cabal-extras
src/Main.hs
agpl-3.0
2,003
0
15
385
397
217
180
46
2
---------------------------------------------------------------- -- Daan Leijen (c) 1999-2001, daan@cs.uu.nl -- -- a helper module that defines some language definitions -- that can be used to instantiate a token parser (see ParsecToken) -- -- $Revision: 1.3 $ -- $Author: daan $ -- $Date: 2001/10/03 09:21:38 $ -----...
amccausl/Swish
Swish/HaskellRDF/ParsecLanguage.hs
lgpl-2.1
4,315
42
8
1,762
627
394
233
64
1
{-# LANGUAGE ScopedTypeVariables #-} import System.Plugins import API src = "../Plugin.hs" wrap = "../Wrapper.hs" apipath = "../api" main = do status <- make src ["-i"++apipath] case status of MakeSuccess _ _ -> f MakeFailure e -> mapM_ putStrLn e where f = do v ...
Changaco/haskell-plugins
testsuite/pdynload/spj1/prog/Main.hs
lgpl-2.1
535
0
14
181
153
76
77
14
3
{- Created : 2014 Mar 03 (Mon) 20:39:50 by Harold Carr. Last Modified : 2014 Mar 20 (Thu) 09:42:04 by Harold Carr. -} {-# LANGUAGE OverloadedStrings #-} module BitlyClientCommon where import Data.List (intercalate) import qualified Network.HTTP as H (urlEncode) bitlyApiV3 :: String bitlyApiV3 = ...
haroldcarr/bitly-client
src/BitlyClientCommon.hs
apache-2.0
611
0
12
132
134
77
57
10
2
kupc = "KUPC" ans s = minimum $ map (\ c -> length $ filter (== c) s) kupc main = do l <- getLine let o = ans l print o
a143753/AOJ
2271.hs
apache-2.0
134
0
11
46
74
36
38
6
1
{- Copyright 2013 Matthew Gordon. 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 to in writing, softwar...
matthewscottgordon/funk
src/Funk/CodeGen.hs
apache-2.0
1,151
0
10
201
186
102
84
16
1
-- | module: Network.Riak.CRDT.Request -- copyright: (c) 2016 Sentenai -- author: Antonio Nikishaev <me@lelf.lu> -- license: Apache -- module Network.Riak.CRDT.Request (get, counterUpdate, setUpdate, mapUpdate) where import Data.ByteString.Lazy (ByteString) import Network....
k-bx/riak-haskell-client
src/Network/Riak/CRDT/Request.hs
apache-2.0
2,366
0
9
788
499
298
201
49
1
{-# LANGUAGE DeriveGeneric #-} module Kubernetes.Config.User where import Data.Aeson import GHC.Generics (Generic) data User = User {name :: String, user :: UserData } deriving (Show, Generic) instance FromJSON User data UserData = UserData {token :: Maybe String, username ::...
satnam6502/haskell-kubernetes
Kubernetes/Config/User.hs
apache-2.0
699
6
9
180
199
108
91
22
2
-------------------------------------------------------------------- -- | -- Copyright : (c) Edward Kmett and Dan Doel 2013-2014 -- License : BSD3 -- Maintainer: Dan Doel <dan.doel@gmail.com> -- Stability : experimental -- Portability: non-portable -- --------------------------------------------------------------...
ekmett/ermine
src/Ermine/Unification/Data.hs
bsd-2-clause
1,342
0
16
226
441
230
211
24
2
{-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor, DeriveGeneric, FlexibleContexts, OverloadedStrings, RecordWildCards #-} module Network.Wreq.Cache ( shouldCache , validateEntry , cacheStore ) where import Control.Applicative import Control.Lens ((^?), (^.), (^..), folded, non, pre, to) i...
bos/wreq
Network/Wreq/Cache.hs
bsd-3-clause
5,648
0
27
1,397
1,696
894
802
-1
-1
import Lib import Test.QuickCheck instance Arbitrary DoublePendulumSystem where arbitrary = do m1 <- fmap ((+0.1).abs) arb m2 <- fmap ((+0.1).abs) arb l1 <- fmap ((+0.1).abs) arb l2 <- fmap ((+0.1).abs) arb g <- arb t1 <- arb t2 <- arb o1 <- arb o2 <- arb ...
GintMist/double-pendulum
test/Spec.hs
bsd-3-clause
1,328
0
23
485
583
295
288
30
2
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} module OpenCV.TypeLevel ( -- * Kinds and types DS(D, S), dsToMaybe , Z(Z) , (:::)((:::)) -- * Type l...
lukexi/haskell-opencv
src/OpenCV/TypeLevel.hs
bsd-3-clause
5,036
1
10
1,210
1,279
721
558
-1
-1
{-# LANGUAGE OverloadedStrings #-} module PropertyChecker.TUI where import Control.Applicative import Control.Monad import Data.List (intercalate) import Data.Maybe import Data.RDF import Data.RDF.MGraph import Data.Text (pack) import qualified Data.Text.IO as Text (readFile) import Data.Traversable (traverse) import O...
maertsen/netPropCheck
PropertyChecker/TUI.hs
bsd-3-clause
5,444
73
16
1,621
1,389
733
656
108
2
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Language.Sexp.Pretty ( format ) where import Data.ByteString.Lazy.Char8 (ByteString) import Data.Functor.Foldable (para) import ...
esmolanka/sexp-grammar
sexp-grammar/src/Language/Sexp/Pretty.hs
bsd-3-clause
2,025
0
15
451
575
298
277
51
9
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE TupleSections #-} module BP.Infer where import BP.Ast import BP.Type import BP.Env import State import Data.IORef import Text.Read (readMaybe) import Control.Monad (when, zipWithM_, foldM) import Control.Monad.Loops (anyM) import qualified Data.Map as M import qualified Data.Set...
zjhmale/HMF
src/BP/Infer.hs
bsd-3-clause
7,188
22
24
3,817
1,735
867
868
122
11
{- The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)^2 = 55^2 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 264...
bgwines/project-euler
src/solved/problem6.hs
bsd-3-clause
675
4
11
145
128
60
68
9
1
import System.Environment (getArgs) import Network.Transport import Network.Transport.Pipes (createTransport) import Control.Concurrent.MVar (MVar, newEmptyMVar, takeMVar, putMVar, newMVar, readMVar, modifyMVar_, modifyMVar) import Control.Concurrent (forkIO) import Control.Monad (forever, forM, unless, when) import qu...
adk9/network-transport-pipes
tests/chat/ChatClient.hs
bsd-3-clause
3,681
0
24
1,048
992
491
501
67
4
{-# LANGUAGE MultiParamTypeClasses, DeriveDataTypeable #-} module Control.Concurrent.Chan.Split ( -- * Chan pairs InChan() , OutChan() -- * Utility functions: , getChanContents , dupChan -- * Supporting module , module Control.Concurrent.Chan.Class ) where -- -- inspired by ...
jberryman/chan-split
Control/Concurrent/Chan/Split.hs
bsd-3-clause
2,803
0
14
734
529
284
245
48
1
{-# LANGUAGE RecordWildCards #-} -- | read/write ImpulseTracker patterns module Codec.Tracker.IT.Pattern ( Pattern (..) , Cell (..) , Command (..) , Note (..) , emptyCell , getPattern , getEmptyPattern , putPattern ) where import Control.Monad import Data.Bina...
riottracker/modfile
src/Codec/Tracker/IT/Pattern.hs
bsd-3-clause
4,596
0
18
1,642
1,370
708
662
114
4