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 Elems where import Prelude hiding (elem) import Data.Set (Set (..)) ----------------------------------------------------------------------------- -- | 1. Reasoning about the Set of Elements in a List ----------------------- ----------------------------------------------------------------------------- -- | ...
mightymoose/liquidhaskell
docs/slides/BOS14/hs/start/01_Elements.hs
bsd-3-clause
2,909
0
10
651
375
207
168
21
2
import Control.Monad import Data.List.Extra import Data.Maybe elf n = e where e = n*10 : replicate (n-1) 0 ++ e elves n = zipWith (+) (elf n) (0 : elves (n+1)) presents n = sum [if n `mod` i == 0 then i*10 else 0 | i <- [1..n `div` 2]] + (n*10) -- This is vastly too slow.
msullivan/advent-of-code
2015/A20a.hs
mit
282
2
10
68
170
89
81
9
2
import AI import Text.CSV import Data.List import System.Random import Text.Printf dataRowToTestData :: Record -> ([Double],[Double]) dataRowToTestData row = let nums = map (\(x,i) -> case i of -- convert 55th,56th and 57th column into range 0..1 -- otherwise large values cause trou...
abresas/ai
tests/spambase/spambase.hs
mit
1,640
1
18
467
543
279
264
35
4
{-# LANGUAGE GADTs #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE AllowAmbiguousTypes #-} ...
plclub/cis670-16fa
code/Ch21.hs
mit
5,053
0
21
1,584
1,774
967
807
117
3
module Handler.Mooc.Admin.ReviewRequest ( getAdminReviewRequestR , postAdminReviewRequestR ) where import Data.Time.Calendar (addDays, showGregorian) import qualified Database.Persist.Sql as P import Text.Shakespeare.Text (st) import Database.Esqueleto import Handler.Mooc.Admin import Import hiding ((/=.)...
achirkin/qua-kit
apps/hs/qua-server/src/Handler/Mooc/Admin/ReviewRequest.hs
mit
6,246
0
23
1,586
1,438
726
712
-1
-1
{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module Hadoop.Protos.ResourceTracker.ResourceTrackerService (ResourceTrackerService, resourceTrackerService, RegisterNodeManager, NodeHeartbeat, UnRegisterNodeManage...
alexbiehl/hoop
hadoop-protos/src/Hadoop/Protos/ResourceTracker/ResourceTrackerService.hs
mit
2,700
0
7
260
304
201
103
42
1
{-# LANGUAGE OverloadedStrings #-} -- | -- Module : Text.XML.Mapping -- Copyright : (c) Joseph Abrahamson 2013 -- License : MIT -- . -- Maintainer : me@jspha.com -- Stability : experimental -- Portability : non-portable -- . module Text.XML.Mapping ( decode, Tag, module X, PE.ParseError ) wher...
tel/xml-mapping
src/Text/XML/Mapping.hs
mit
981
0
10
255
204
129
75
17
2
import Test.QuickCheck import Test.QuickCheck.Checkers import Test.QuickCheck.Classes data List a = Nil | Cons a (List a) deriving (Eq, Show) instance Functor List where fmap _ Nil = Nil fmap f (Cons x xs) = Cons (f x) (fmap f xs) instance Applicative List where pure x = Cons x Nil (<*>) Nil _ = Nil ...
JustinUnger/haskell-book
ch17/list-app.hs
mit
1,148
2
12
303
567
280
287
34
1
---------------------------------------- -- Eval.hs -- 評価器 -- -- 新入生SG お手本インタプリタ -- 2012/05/23 高島尚希 ---------------------------------------- module Eval where import Control.Monad import Control.Monad.Fix import Syntax -- 値 data Value = CONST ConstId | PRIM PrimId [Value] | LIST [Value] | TUPLE [Value] ...
lambdataro/Dive
Eval.hs
mit
6,842
0
15
1,553
3,609
1,798
1,811
155
4
module System.Himpy.Recipes.Load where import System.Himpy.Recipes.Utils import System.Himpy.Mib import System.Himpy.Types import System.Himpy.Logger import System.Himpy.Output.Riemann import Control.Concurrent.STM.TChan (TChan) load_tuple :: (Int, Double) -> (String, Double) load_tuple (x, y) = ("load-" ++ (show x), ...
pyr/himpy
System/Himpy/Recipes/Load.hs
mit
678
0
13
112
249
139
110
16
1
{-# OPTIONS_HADDOCK show-extensions #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Safe #-} {-| Module : MPD.Core.CommandArg Copyright : (c) Joachim Fasting, 2014 License : MIT Maintainer : joachifm@fastmail.fm Stability : unstable Portability : unportable -} module MPD.Core.CommandArg ( CommandAr...
joachifm/nanompd
src/MPD/Core/CommandArg.hs
mit
1,006
0
8
188
256
140
116
24
0
import Test.Hspec import RaytracerEtapa3_1113331018 main :: IO () main = hspec $ do describe "Setup of .ppm image" $ do it "returns a string with x, y and z" $ do pixelToString (1, 2, 3) `shouldBe` "1 2 3\n" it "returns the value of p3" $ do p3 `shouldBe` "P3\n" it "return a line of commen...
lipemorais/haskellando
RaytracerEtapa3_1113331018Spec.hs
mit
2,325
1
18
573
817
427
390
42
1
module Y2021.M02.D24.Solution where import Data.Time {-- What's today's date? Today's Haskell problem is to get the current date as a YYYY-mm-dd-formatted string from ... wherever you get the current date. --} today :: IO String today = take 10 . show <$> getCurrentTime {-- >>> today "2021-02-24" --}
geophf/1HaskellADay
exercises/HAD/Y2021/M02/D24/Solution.hs
mit
307
0
7
53
39
23
16
4
1
{-# LANGUAGE OverloadedStrings #-} module Test where import Crypto.Cipher.RC4 import Control.Monad.ST import Data.Bits import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as C import Data.List import Data.Word import System.Exit --...
nickspinale/rc4
tests/Test.hs
mit
1,033
0
9
247
332
183
149
26
2
{-# LANGUAGE TemplateHaskell #-} module Main where import Test.Framework.TH import Test.Framework.Providers.HUnit import Test.HUnit import Discussion main :: IO () main = $(defaultMainGenerator) -------------------------------------------------------------------------------- x = Var "x" y = Var "y" z = Var "z" s...
todays-mitsui/discussion
test/UnitConverter.hs
mit
1,237
0
14
232
595
314
281
34
1
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Y2018.M05.D25.Exercise where import Database.PostgreSQL.Simple import Database.PostgreSQL.Simple.FromRow import Database.PostgreSQL.Simple.Types import Network.HTTP.Conduit import Network.HTTP.Types hiding (Query) -- below imports available via 1HaskellADay im...
geophf/1HaskellADay
exercises/HAD/Y2018/M05/D25/Exercise.hs
mit
1,635
0
10
264
264
156
108
25
1
-- Generic: yes -- Type checked: yes data Node a = Node {value :: a, l :: Node a, r :: Node a} | Nil contains :: (Ord a) => Node a -> a -> Bool Nil `contains` x = False node `contains` x | x == value node = True | x < value node = l node `contains` x | x > valu...
wyager/ManyBSTs
bst.hs
mit
679
1
10
251
365
184
181
13
1
{-# LANGUAGE TemplateHaskell #-} -- | Defines texture helper structures for the library. module Codec.Soten.Scene.Texture ( Texel(..) , texelA , texelR , texelG , texelB , Texture(..) , textureWidth , textureHeight , textureTexels , textureFormatHint , newTexture , checkFormat ) where import...
triplepointfive/soten
src/Codec/Soten/Scene/Texture.hs
mit
1,654
0
12
433
283
174
109
58
1
module Main where import qualified Lib main :: IO () main = Lib.startServer
GetContented/substance
app/Main.hs
mit
78
0
6
15
25
15
10
4
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE QuasiQuotes #-} -- | -- Checks that you cannot chain Actions module Chaining where import Control.Biegunka chained_script_0 :: Script 'Actions () chained_script_0 = [sh| echo hello |] <~> [sh| echo bye |] -- STDERR -- Couldn't match type ‘'Sources’ with ‘'Actions’ --...
biegunka/biegunka
test/typecheck/should_fail/Fail2.hs
mit
408
0
6
82
48
34
14
9
1
{-# language NoMonomorphismRestriction #-} module CSP.Property.Right_Linear where import CSP.Syntax import Autolib.Reporter import Autolib.ToDoc import Control.Monad ( guard, sequence, void ) import Data.Maybe ( isJust ) ok = isJust . result . check check :: ToDoc a => Process a -> Reporter () ch...
marcellussiegburg/autotool
collection/src/CSP/Property/Right_Linear.hs
gpl-2.0
1,365
1
16
502
430
199
231
40
8
{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-} -- Hello-World of the cordova/phonegap application using Haskell. -- So that Haste-Haskell can be used to create hybrid smartphone applications -- The original JavaScript hello world is installed following the instructions of this page -- -- ...
agocorona/tryhplay
examples/cordova-hplayground-copy.hs
gpl-3.0
2,992
7
30
798
785
374
411
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.IAM.Types.P...
brendanhay/gogol
gogol-iam/gen/Network/Google/IAM/Types/Product.hs
mpl-2.0
129,943
0
19
27,933
19,204
11,158
8,046
2,122
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/Subnetworks/Delete.hs
mpl-2.0
4,564
0
17
1,047
552
330
222
84
1
{-# LANGUAGE FlexibleContexts #-} import Data.IORef import RedBlack import Control.Monad.Identity import Control.Monad import Control.Monad.State test1 :: RedBlackMonad Int () m => m () test1 = do update (Nothing::(Maybe (Visit Int ()))) test2 :: RedBlackMonad Int () m => m () test2 = do update $ Just $ Visit (...
amiller/redblackmerkle
haskell/test_redblack.hs
agpl-3.0
857
2
16
187
373
178
195
27
1
{-# LANGUAGE OverloadedStrings, RecordWildCards, DataKinds #-} module Model.Slot ( module Model.Slot.Types , lookupSlot , lookupContainerSlot , auditSlotDownload , slotJSON ) where import Database.PostgreSQL.Typed.Types import qualified Data.String import qualified JSON import Service.DB import Model.Id i...
databrary/databrary
src/Model/Slot.hs
agpl-3.0
3,581
0
19
1,025
616
354
262
65
2
module ProjectM36.TupleSet where import ProjectM36.Base import ProjectM36.Tuple import ProjectM36.Error import qualified Data.HashSet as HS import qualified Data.Vector as V import qualified Control.Parallel.Strategies as P import Data.Either emptyTupleSet :: RelationTupleSet emptyTupleSet = RelationTupleSet [] singl...
agentm/project-m36
src/lib/ProjectM36/TupleSet.hs
unlicense
1,788
0
13
252
428
227
201
26
2
--init using length module Main where initUsingLength xs = take ( (length xs) - 1) xs
Crossroadsman/ProgrammingInHaskell
02/initUsingLength.hs
apache-2.0
92
0
9
22
31
17
14
2
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ViewPatterns #-} -- | This module provides a typed interface for handling IRC commands. -- It lets you work in term...
lfairy/hircine
Hircine/Command.hs
apache-2.0
6,000
0
12
1,169
1,774
945
829
116
1
module Delahaye.A337659 (a337659_list, a337659) where import Delahaye.A337655 (a337655) import Helpers.Delahaye (rowTable) a337659 :: Int -> Integer a337659 n = a337659_list !! (n-1) a337659_list :: [Integer] a337659_list = rowTable (+) a337655
peterokagey/haskellOEIS
src/Delahaye/A337659.hs
apache-2.0
247
0
7
32
82
48
34
7
1
{-# LANGUAGE Haskell2010 #-} module Example where -- | Example use. -- -- >>> split 1 -- () -- -- >>> split 2 -- () split :: Int -> () split _ = ()
haskell/haddock
latex-test/src/Example/Example.hs
bsd-2-clause
149
0
6
35
33
22
11
4
1
module Main where -- do a quick test for Darcs: import System.Directory.Tree import Control.Applicative import qualified Data.Foldable as F import System.Directory import System.Process import System.IO.Error(ioeGetErrorType,isPermissionErrorType) import Control.Monad(void) testDir :: FilePath testDir = "/tmp...
jberryman/directory-tree
Test.hs
bsd-2-clause
4,367
0
21
1,208
1,087
542
545
67
7
{-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses #-} module Data.TrieMap.ProdMap.Searchable () where import Data.TrieMap.ProdMap.Base import Data.TrieMap.ProdMap.Zippable () import Prelude hiding (lookup) instance (Searchable (TrieMap k1) k1, Searchable (TrieMap k2) k2, TrieKey k2) => Sea...
lowasser/TrieMap
Data/TrieMap/ProdMap/Searchable.hs
bsd-3-clause
994
0
12
216
430
224
206
18
0
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoImplicitPrelude #-} -- | Given a Copper files, change every Cleared posting to -- a Reconciled one. module Penny.Reconciler where import qualified Control.Exception as Exception import qualified Control.Lens as Lens import qualified ...
massysett/penny
penny/lib/Penny/Reconciler.hs
bsd-3-clause
2,035
0
16
340
468
248
220
55
1
module Types.Session ( module RPC.Util , SessionId (..) , SessionMap (..) , Session (..) , ShellRead (..) , SessionWriteCount (..) , DirSep , ReadPointer , HostName , PortNumber ) where import RPC.Util import Control.Applicative ((<$>),(<*>)) import qualified Data.Map as Map -------------------...
GaloisInc/msf-haskell
src/Types/Session.hs
bsd-3-clause
3,107
0
26
679
714
405
309
78
0
{-# LANGUAGE OverloadedStrings #-} module Cauterize.Specification.ParserSpec ( spec ) where import Cauterize.Specification.Types import Cauterize.Specification.Parser import Cauterize.CommonTypes import Test.Hspec import Data.Either spec :: Spec spec = do describe "parseSpecification" $ do it...
cauterize-tools/cauterize
tests/Cauterize/Specification/ParserSpec.hs
bsd-3-clause
1,188
0
21
426
254
131
123
32
2
{-# LANGUAGE RecordWildCards #-} module Day13 where import Data.Bits import Data.Dequeue import Data.Maybe import Data.Set (Set) import qualified Data.Set as Set type Pos = (Int, Int) input0 = 10 input1 = 1358 input2 = 1362 expr :: Pos -> Int expr (x, y) = x*x + 3*x + 2*x*y + y + y*y isOpen :: Pos -> Bool isOpen p...
mbernat/aoc16-haskell
src/Day13.hs
bsd-3-clause
1,264
0
15
280
640
363
277
38
2
{- OPTIONS_GHC -fplugin Brisk.Plugin #-} {- OPTIONS_GHC -fplugin-opt Brisk.Plugin:main #-} {-# LANGUAGE TemplateHaskell #-} module SpawnSym (main) where import Control.Monad (forM, foldM) import Control.Distributed.Process import Control.Distributed.BriskStatic import Control.Distributed.Process.Closure import Control...
abakst/brisk-prelude
tests/pos/SpawnSym.hs
bsd-3-clause
1,093
0
12
310
346
173
173
30
2
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings #-} module Generate (html, js) where import Control.Monad (forM_, when) import Data.Maybe (fromMaybe) import System.Directory import System.Exit import System.FilePath import System.Process import System.IO (hGetContents) import Text.Blaze ...
alisheikh/elm-server
server/Generate.hs
bsd-3-clause
4,449
0
18
1,372
1,163
583
580
97
4
{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANG...
zerobuzz/servant
servant/src/Servant/API/ContentTypes.hs
bsd-3-clause
13,854
0
15
3,326
2,300
1,315
985
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} -- | This module implements the Curved servers to receive/serve metrics. -- Note these are simple TCP (and later, UDP) servers, not an HTTP server -- to provide beautiful rendering of the metrics. -- TODO Probably call this module Protocol instead ...
noteed/curved
Curved/Carbon.hs
bsd-3-clause
5,002
0
27
1,157
1,395
726
669
100
5
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE UnicodeSyntax #-} {-| [@ISO639-1@] pt [@ISO639-2@] por [@ISO639-3@] por [@Native name@] Português [@English name@] Portuguese -} ...
telser/numerals
src/Text/Numeral/Language/POR.hs
bsd-3-clause
11,734
66
16
5,618
3,289
1,786
1,503
224
29
-- | Some styles for choice calculus expressions. module Language.TTF.CC.Pretty where import System.Console.ANSI (Color(..)) import Language.TTF.Pretty styleOp = color Blue styleKey = color Blue ++ bold styleDim = color Green styleTag = color Green styleVar = color Red
walkie/CC-TaglessFinal
src/Language/TTF/CC/Pretty.hs
bsd-3-clause
276
0
6
43
74
43
31
8
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE BangPatterns #-} module Main where import Network.Protocol.Snmp.AgentX import Data.ByteString.Char8 (ByteString, pack, unpack) import System.Directory import System.FilePath import Control.Monad.IO.Class (liftIO) import Control.Applic...
chemist/script-to-snmp
src/Main.hs
bsd-3-clause
11,165
0
22
3,057
3,513
1,800
1,713
234
15
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module Templates.Components where import Control.Lens ((^.)) import Data.Monoid ((<>)) import Data.Text (Text, intercalate, pack) import Text.Interpolated...
tpoulsen/generate-component
src/Templates/Components.hs
bsd-3-clause
1,231
0
16
352
401
216
185
32
2
module Control.Monad.Code.Opcode where import Data.Word nop :: Word8 nop = 0x00 aconst_null :: Word8 aconst_null = 0x01 iconst_m1 :: Word8 iconst_m1 = 0x02 iconst_0 :: Word8 iconst_0 = 0x03 iconst_1 :: Word8 iconst_1 = 0x04 iconst_2 :: Word8 iconst_2 = 0x05 iconst_3 :: Word8 iconst_3 = 0x06 iconst_4 :: Word8 i...
sonyandy/tnt
Control/Monad/Code/Opcode.hs
bsd-3-clause
6,531
0
4
1,440
2,063
1,239
824
412
1
module Main where import Control.Applicative ((<$>)) import Control.Arrow ((&&&)) import Control.Monad (join) import Data.Char (isNumber, toLower, toUpper) import Data.Function (on) import Data.List (intersperse, isPrefixOf, isInfixOf, notElem, sortBy) import Data.Map (Map, elems, filterWithKey, fromList, ...
metachord/netlink-hs
scripts/Generate.hs
bsd-3-clause
6,154
0
18
1,728
2,114
1,122
992
129
3
{-# LANGUAGE FlexibleInstances,FlexibleContexts #-} module AI.Testing where import AI.Classification import AI.DataLoader import AI.RandomUtils -- import AI.Classification.SemiBoost import AI.Classification.Boosting import Control.Monad import Control.Monad.Writer import qualified Data.Map as Map import Data.Ma...
mikeizbicki/Classification
src/AI/Testing.hs
bsd-3-clause
3,850
0
17
801
1,218
622
596
75
2
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, DeriveFunctor, TypeSynonymInstances, PatternGuards #-} module Idris.AbsSyntaxTree where import Idris.Core.TT import Idris.Core.Evaluate import Idris.Core.Elaborate hiding (Tactic(..)) import Idris.Core.Typecheck import Idris.Docstrings import IRTS.La...
andyarvanitis/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
76,770
0
22
25,727
24,552
12,746
11,806
1,436
78
module DirUtils where import Prelude hiding (catch,ioError) import MUtils import List(isSuffixOf,nub) import AbstractIO import PathUtils(pathSep) optCreateDirectory d = unlessM (doesDirectoryExist d) (createDirectory d) getModificationTimeMaybe path = maybeM (getModificationTime path) {- do ifM (doesFileExist path)...
forste/haReFork
tools/base/lib/DirUtils.hs
bsd-3-clause
1,721
4
14
374
303
161
142
22
2
{-# LANGUAGE ScopedTypeVariables, ImplicitParams, RecordWildCards #-} module Debug.GraphView(graphViewNew) where import Data.IORef import Data.List import Data.Maybe import Data.Tuple.Select import Data.Bits import Control.Monad import qualified Graphics.UI.Gtk as Gt import Util import Implicit import qualified Data...
termite2/debug
Debug/GraphView.hs
bsd-3-clause
16,900
0
19
4,882
6,081
3,127
2,954
275
3
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} -- | This module defines a collection of simplification rules, as per -- "Futhark.Optimise.Simplifier.Rule". They are used in the -- simplifier. module Futhark.Optimise.Simplifier.Rules ( standardRules , IndexResult (..) ) where import Control.Appli...
mrakgr/futhark
src/Futhark/Optimise/Simplifier/Rules.hs
bsd-3-clause
40,645
0
25
11,322
13,670
6,667
7,003
807
21
{-# LANGUAGE FlexibleContexts #-} module Language.Gator.Ops.XOR ( doXOr, doXOrN, (<^^>), ) where import Control.Monad.State import Language.Gator.Logic import Language.Gator.IO import Language.Gator.Gates import Language.Gator.Gates.XOR import Language.Gator.Ops.General nextXOR :: (MonadState Logic m) =>...
sw17ch/gator
src/Language/Gator/Ops/XOR.hs
bsd-3-clause
867
0
10
213
366
193
173
30
1
{- | - Module : Monitoring - Description : Monitor execution of Dikunt plugins. - Copyright : (c) Magnus Stavngaard, 2016 - License : BSD-3 - Maintainer : magnus@stavngaard.dk - Stability : experimental - Portability : POSIX - - Responsible for opening and maintaining a running copy of each execu...
bus000/Dikunt
src/Monitoring.hs
bsd-3-clause
7,747
0
18
1,757
1,443
763
680
119
2
{-# LANGUAGE PackageImports #-} import "hs-yesod-proto-builder" Application (develMain) import Prelude (IO) main :: IO () main = develMain
Greif-IT/hs-yesod-proto
hs-yesod-proto-builder/app/devel.hs
bsd-3-clause
140
0
6
19
34
20
14
5
1
module B1.Program.Chart.Screen ( drawScreen ) where import Control.Concurrent import Control.Concurrent.MVar import Control.Monad import Data.Maybe import Debug.Trace import Graphics.Rendering.OpenGL import Graphics.UI.GLFW import System.Directory import System.FilePath import System.IO import B1.Control.TaskMana...
madjestic/b1
src/B1/Program/Chart/Screen.hs
bsd-3-clause
8,516
0
21
2,252
2,032
1,124
908
197
3
{-# LANGUAGE DeriveDataTypeable #-} module Elm.Internal.Name where import Control.Applicative import Control.Monad.Error import Data.Aeson import Data.Binary import qualified Data.Text as T import qualified Data.Maybe as Maybe import Data.Typeable data Name = Name { user :: String, project :: String } deriving (T...
deadfoxygrandpa/Elm
compiler/Elm/Internal/Name.hs
bsd-3-clause
1,413
0
12
310
460
240
220
39
2
{-# LANGUAGE RecordWildCards #-} {-# OPTIONS -Wall #-} ---------------------------------------------------------------------- {- | Module : Scope.Layer Copyright : Conrad Parker License : BSD3-style (see LICENSE) Maintainer : Conrad Parker <conrad@metadecks.org> Stability : unstable Por...
kfish/scope
Scope/Layer.hs
bsd-3-clause
8,453
0
18
2,643
2,685
1,389
1,296
151
5
{-- snippet all --} module Main where import qualified PodMainGUI import Paths_pod(getDataFileName) main = do gladefn <- getDataFileName "podresources.glade" PodMainGUI.main gladefn {-- /snippet all --}
binesiyu/ifl
examples/ch23/PodCabalMain.hs
mit
217
0
8
39
41
23
18
6
1
-- | Extra information for blocks. -- * Forward links. -- * InMainChain flags. -- * Slots of the last 'blkSecurityParam' (at most) blocks -- (for chain quality check). module Pos.DB.Block.GState.BlockExtra ( resolveForwardLink , isBlockInMainChain , calcLastBlkSlots , upgradeLastS...
input-output-hk/pos-haskell-prototype
db/src/Pos/DB/Block/GState/BlockExtra.hs
mit
10,778
0
21
2,721
2,418
1,273
1,145
-1
-1
{-# LANGUAGE GeneralizedNewtypeDeriving, RecordWildCards #-} module GMEParser (parseTipToiFile) where import qualified Data.ByteString.Lazy as B import qualified Data.ByteString.Lazy.Char8 as BC import qualified Data.Binary.Get as G import Text.Printf import Data.List import Data.Functor import Control.Applicative (A...
christiannolte/tip-toi-reveng
src/GMEParser.hs
mit
12,407
0
19
3,454
4,393
2,163
2,230
322
5
module Graphics.Shaders (makeProgram) where import Graphics.Rendering.OpenGL import Control.Monad (guard, unless) import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Maybe (MaybeT) import Data.ByteString as BS (readFile, ByteString) makeShader :: ShaderType -> ByteString -> MaybeT IO Shader makeShader ...
sgillis/HaskHull
src/Graphics/Shaders.hs
gpl-3.0
1,763
0
14
413
512
251
261
45
1
{-| Module : Devel.Watch Description : Watch for changes in the current working direcory. Copyright : (c) 2015 Njagi Mwaniki License : MIT Maintainer : njagi@urbanslug.com Stability : experimental Portability : POSIX Actually checks only for modified files. Added or removed files don't trigger rebuilds. ...
urbanslug/yesod-devel
src/Devel/Watch.hs
gpl-3.0
2,513
0
18
659
449
236
213
33
2
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- Module : Test.AWS.Route53.Internal -- Copyright : (c) 2013-2015 Brendan Hay -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL...
fmapfmapfmap/amazonka
amazonka-route53/test/Test/AWS/Route53/Internal.hs
mpl-2.0
621
0
4
140
25
21
4
4
0
{-# 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-autoscaling/gen/Network/AWS/AutoScaling/DescribeLifecycleHookTypes.hs
mpl-2.0
4,241
0
15
840
497
298
199
69
1
{- Copyright 2010-2012 Cognimeta Inc. 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 writ...
bitemyapp/perdure
src/Database/Perdure/Package.hs
apache-2.0
704
0
4
126
23
15
8
4
1
module Main (main) where import Criterion.Main (bgroup, defaultMain) import qualified API.IBBench main :: IO () main = defaultMain [ bgroup "API.IB" API.IBBench.benchmarks ]
cmahon/interactive-brokers
benchmark/Bench.hs
bsd-3-clause
194
0
8
43
57
33
24
6
1
{-# LANGUAGE OverloadedStrings #-} module Bead.View.Content.SubmissionList.Page ( submissionList ) where import Control.Monad import Control.Monad.Trans.Class import Control.Monad.IO.Class import Data.String (fromString) import Data.Time import Text.Bl...
pgj/bead
src/Bead/View/Content/SubmissionList/Page.hs
bsd-3-clause
5,325
0
26
1,283
1,346
688
658
108
4
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE CPP #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE...
SuetakeY/nomnichi_yesod
db_migrate_first_20141016.hs
bsd-2-clause
3,686
5
17
867
781
404
377
72
2
-- test reification of explicit foralls in type families {-# LANGUAGE TypeFamilies, ExplicitForAll #-} module TH_reifyExplicitForAllFams where import System.IO import Language.Haskell.TH import Text.PrettyPrint.HughesPJ import Data.Proxy import Data.Kind $([d| data family F a data instance forall a. F (Maybe ...
sdiehl/ghc
testsuite/tests/th/TH_reifyExplicitForAllFams.hs
bsd-3-clause
853
0
16
264
197
107
90
-1
-1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeSynonymInstances #-} module IHaskell.Display.Widgets.Selection.Select ( -- * The Select Widget Select, -- * Constructor mkSelect) where -- To keep `cabal repl` happy when running from the...
artuuge/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Selection/Select.hs
mit
2,163
0
17
554
474
248
226
51
1
{-| Module: Tidl.Generate.Pretty Description: Helpers for the pretty-printer Copyright 2015, Google Inc. 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/li...
VishalRohra/orp
software/tools/tidl/src/Tidl/Generate/Pretty.hs
apache-2.0
1,348
0
10
264
308
163
145
19
1
{-# LANGUAGE DerivingVia #-} {-# LANGUAGE StandaloneDeriving #-} module DerivingViaFail2 where class C a data A = A deriving via Maybe instance C A
sdiehl/ghc
testsuite/tests/deriving/should_fail/deriving-via-fail2.hs
bsd-3-clause
149
0
5
25
32
18
14
-1
-1
module Main where import Test.Tasty import Test.Tasty.Options import qualified UnitTests.Distribution.Client.Sandbox import qualified UnitTests.Distribution.Client.UserConfig import qualified UnitTests.Distribution.Client.Targets import qualified UnitTests.Distribution.Client.GZipUtils import qualified UnitTes...
trskop/cabal
cabal-install/tests/UnitTests.hs
bsd-3-clause
1,470
0
8
177
221
143
78
30
1
{-# LANGUAGE TypeFamilies #-} module A2 where type family F a type instance F Int = Bool
olsner/ghc
testsuite/tests/driver/recomp016/A2.hs
bsd-3-clause
89
0
4
17
21
14
7
4
0
{-# LANGUAGE TypeFamilies, PolyKinds #-} module T11361a where class C a where type F (a :: k) :: * type F (x :: *) = x -- Not right!
ezyang/ghc
testsuite/tests/indexed-types/should_compile/T11361a.hs
bsd-3-clause
142
0
8
38
43
27
16
5
0
{-# LANGUAGE DeriveGeneric #-} module GenCannotDoRep1_3 where import GHC.Generics -- We do not support occurrences of the type variable except as the last -- argument data B a b = B (a, b) data T a = T (B a Int) deriving Generic1
olsner/ghc
testsuite/tests/generics/GenCannotDoRep1_3.hs
bsd-3-clause
240
0
8
53
50
32
18
5
0
{-# LANGUAGE GADTs #-} module ShouldCompile where data T where T1 :: Int -> T T2 :: Bool -> Bool -> T data S a where S1 :: a -> S a S2 :: Int -> S Int f (T1 i) = i>0 f (T2 a b) = a && b g :: S a -> a g (S1 x) = x g (S2 i) = i
urbanslug/ghc
testsuite/tests/gadt/gadt3.hs
bsd-3-clause
239
0
7
80
138
74
64
13
1
import System.Environment main = do [x] <- getArgs print (read x < (1e400 :: Double)) print (read x < (-1e400 :: Double)) print (read x == (0/0 :: Double)) -- the last doesn't get constant-folded to NaN, so we're not really -- testing properly here. Still, we might man...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/codeGen/should_run/T1861.hs
bsd-3-clause
402
0
11
125
96
50
46
5
1
-- Mathematics/Fundamentals/Is Fibo {-# language TypeApplications #-} module HackerRank.Mathematics.IsFibo where import Sandbox.Util import Sandbox.Util.IO data IF = IsFibo | IsNotFibo deriving (Show) mkIF :: Bool -> IF mkIF True = IsFibo mkIF False = IsNotFibo main :: IO () main = do xs <- readInput @Integer ...
4e6/sandbox
haskell/HackerRank/Mathematics/IsFibo.hs
mit
385
0
13
71
125
66
59
13
1
{-# htermination tanh :: Float -> Float #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_tanh_1.hs
mit
44
0
2
8
3
2
1
1
0
{-# LANGUAGE OverloadedStrings, TypeOperators, FlexibleContexts, FlexibleInstances, ExistentialQuantification #-} module Wf.Network.Wai ( FromWaiRequest(..) , ToWaiResponse(..) , toWaiApplication , UrlEncoded(..) ) where import Control.Exception (throwIO) import qualified Data.ByteString.Lazy as L (ByteString, empty, ...
bigsleep/Wf
src/Wf/Network/Wai.hs
mit
4,185
0
13
746
1,230
661
569
74
1
import LTL main :: IO () main = putStrLn "Hello World"
jrraymond/ltl
app/Main.hs
mit
57
0
6
13
22
11
11
3
1
-- | -- Module: Math.NumberTheory.EisensteinIntegers -- Copyright: (c) 2018 Alexandre Rodrigues Baldé -- Licence: MIT -- Maintainer: Alexandre Rodrigues Baldé <alexandrer_b@outlook.com> -- -- This module exports functions for manipulating Eisenstein integers, including -- computing their prime factorisation...
cartazio/arithmoi
Math/NumberTheory/Quadratic/EisensteinIntegers.hs
mit
13,281
0
17
3,674
3,218
1,786
1,432
174
4
{-# OPTIONS_GHC -Wall #-} module Main where import Log as L -- Skip 'n' words and interpret the next one as a number. wordsToNum :: String -> Int -> Int wordsToNum s n = read ((words s) !! n) -- Return the tail of a string. dropWords :: String -> Int -> String dropWords s n = unwords ( drop n (words s)) -- Convert...
MiroslavVitkov/voiceid
misc/hw2.hs
mit
2,741
0
12
780
935
478
457
53
4
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Exception (catch) import Control.Monad (when) import Data.ByteString.Char8 (unpack) import System.Environment (getArgs, getProgName) import System.Exit ...
ouspg/trytls
stubs/haskell-http-client-tls/src/Main.hs
mit
3,157
0
18
1,250
735
380
355
71
4
{-# LANGUAGE JavaScriptFFI, OverloadedStrings #-} import GHCJS.Marshal import GHCJS.Foreign import GHCJS.Types import Control.Concurrent (threadDelay) import Data.Text (pack, unpack) import Data.Default import JavaScript.JQuery (click, select) import Protocol (Re...
MichaelBaker/sartorial-client
src/Main.hs
mit
3,924
16
25
827
1,020
480
540
-1
-1
module Geometry ( sphereVolume , sphereArea , cubeVolume , cubeArea , cuboidArea , cuboidVolume ) where sphereVolume :: Float -> Float sphereVolume radius = (4.0 / 3.0) * pi * (radius ^ 3) sphereArea :: Float -> Float sphereArea radius = 4 * pi * (radius ^ 2) cubeVolume :: Float -> Float cubeVolume side = cu...
rglew/lyah
Geometry.hs
mit
684
0
10
151
272
142
130
21
1
module Storyteller.Parser ( eol , escaping , stringWithout ) where import Control.Applicative import Storyteller.Symbols ( esc ) import Text.ParserCombinators.Parsec hiding ( (<|>), many, optional ) eol :: GenParser Char st () eol = try (newline *> pure ()) <|> eof -- Parses a character not present in...
Soares/Storyteller.hs
src/Storyteller/Parser.hs
mit
741
0
13
172
199
106
93
16
1
module Feature.CorsSpec where -- {{{ Imports import Test.Hspec import Test.Hspec.Wai import Network.Wai.Test (SResponse(simpleHeaders, simpleBody)) import qualified Data.ByteString.Lazy as BL import SpecHelper import Network.HTTP.Types import Network.Wai (Application) import Protolude -- }}} spec :: SpecWith Appli...
begriffs/postgrest
test/Feature/CorsSpec.hs
mit
2,840
0
20
728
514
275
239
62
1
{-# LANGUAGE QuasiQuotes #-} {-| Module : BreadU.Pages.JS.Own Description : Own JavaScript. Stability : experimental Portability : POSIX Owr own JavaScript. The core idea is to keep our JavaScript as simple as possible. For example, we don't build DOM here, but in Haskell side only, because of compilation guar...
denisshevchenko/breadu.info
src/lib/BreadU/Pages/JS/Own.hs
mit
4,974
0
8
1,538
203
122
81
20
1
{-| Module : BreadU.Tools.Validators Description : Validators for food values. Stability : experimental Portability : POSIX Validators for all food values submitted by user. -} module BreadU.Tools.Validators ( valueOfCarbsIsValid , minCarbs , maxCarbs , validate ) where import Br...
denisshevchenko/breadu.info
src/lib/BreadU/Tools/Validators.hs
mit
8,026
0
17
2,778
1,261
702
559
-1
-1
import Crypto.Cipher import Crypto.Cipher.AES import Crypto.Cipher.Types import qualified Data.ByteString as ByteString import qualified Data.ByteString.Char8 as Char8 import Data.ByteString.Base64 import Data.List.Split stringToKey string = result where keyBytes = Char8.pack string Right key = makeKey keyBy...
mozkeeler/cryptopals
set1/challenge7/aes.hs
mit
939
0
15
195
286
149
137
24
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-apistage.html module Stratosphere.ResourceProperties.ApiGatewayUsagePlanApiStage where ...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ApiGatewayUsagePlanApiStage.hs
mit
2,623
0
12
256
365
208
157
33
1
import Utils.IntegerOps import Utils.ListOps import Data.Set (Set, toList, fromList, empty, insert, (\\)) main = print problem23Value problem23Value :: Integer problem23Value = sum $ toList resultSet -- to compute the result set of numbers (every positive integer which is NOT a sum of 2 abundant numbers), we take al...
jchitel/ProjectEuler.hs
Problems/Problem0023.hs
mit
1,723
0
12
323
379
204
175
22
3
#!/usr/bin/env runhaskell -- Run this script from the root of the exercism checkout! module Main where import System.Exit (ExitCode(..), exitFailure) import System.Posix.Temp (mkdtemp) import System.Environment (getArgs) import System.Directory ( removeDirectoryRecursive, getTemporaryDirectory , getCurrentDirectory...
pminten/xhaskell
_test/check-exercises.hs
mit
2,468
0
17
523
748
392
356
60
4
{- dfsbuild: CD image builder Copyright (c) 2006 John Goerzen Please see COPYRIGHT for more details -} module Bootloader.Yaboot where import Utils import System.Cmd.Utils import System.Path import System.Posix.Files import System.Posix.Directory import System.Path.Glob import Data.ConfigFile import System.FilePath ya...
jgoerzen/dfsbuild
Bootloader/Yaboot.hs
gpl-2.0
4,517
0
33
796
471
240
231
45
1
module Fun.State where import Fun.Type import Fun.Cache import Autolib.Reader import Autolib.ToDoc hiding ( empty ) import Machine.History import Data.Typeable data State = State { schritt :: Int , todo :: [ Exp ] , stack :: [ Integer ] -- die werden nicht angezeigt , past :: [ State ] , c...
marcellussiegburg/autotool
collection/src/Fun/State.hs
gpl-2.0
1,053
23
8
283
330
182
148
27
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: $HEADER$ -- Description: Low level FFI. -- Copyright: -- License: GPL-2 -- -- Maintainer: Jan Sipr <jan.sipr@ixperta.com> -- Stability: experimental -- Portability: GHC specific language extensions. module Phone.Config ...
IxpertaSolutions/hsua
src/Phone/Config.hs
gpl-2.0
1,536
0
14
311
421
244
177
38
0
{- Chapter 14.5 Exercises -} import Data.Monoid import Data.Foldable {- 1. Commented out for 'Duplicate instance declarations' instance (Monoid a, Monoid b) => Monoid (a,b) where -- mempty :: (a,b) mempty = (mempty, mempty) -- mappend :: (a,b) -> (a,b) -> (a,b) (x1,y1) `mappend` (x2,y2) = (x1 `map...
rad1al/hutton_exercises
ch14.hs
gpl-2.0
3,974
0
10
1,176
888
453
435
38
1