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
import Test.HUnit import Q01 assertEqualMaybeInt::String -> Maybe Int -> Maybe Int -> Assertion assertEqualMaybeInt = assertEqual test1 = TestCase (assertEqualMaybeInt "myLastTest [] should be Nothing." Nothing (myLastTest [] )) test2 = TestCase (assertEqual "myLastTest [0] should be Just 0. " (Ju...
cshung/MiscLab
Haskell99/q01.test.hs
mit
504
0
10
102
153
80
73
8
1
import Math.NumberTheory.Primes.Sieve(primes) import Data.List(sort) import Debug.Trace(trace) -- Generate the polygonal number polygonalNumber :: Int -> Int -> Int polygonalNumber b n = n*((b-2)*n+(4-b)) `div` 2 -- Returns the number of decimal digits of a number nbrDigits :: Integral a => a -> Int nbrDigits = (+1)...
dpieroux/euler
euler.hs
mit
3,324
8
16
833
1,273
663
610
-1
-1
module SpecHelper where import Network.Wai import Test.Hspec import Data.String.Conversions (cs) import Data.Time.Clock.POSIX (getPOSIXTime) import Control.Monad (void) import Network.HTTP.Types.Header (Header, ByteRange, renderByteRange, hRange, hAuthorization, hAccept) import Code...
motiz88/postgrest
test/SpecHelper.hs
mit
2,765
0
19
476
868
474
394
-1
-1
module BranchExample where import Numeric.Limp.Rep.Rep as R import Numeric.Limp.Rep.Arbitrary as R import Numeric.Limp.Program as P import Numeric.Limp.Canon as C import Numeric.Limp.Solve.Simplex.Maps as SM import Numeric.Limp.Solve.Simplex.StandardForm as ST import Numeric.Limp.Solve.Branch.Simple as ...
amosr/limp
tests/BranchExample.hs
mit
2,413
0
14
915
780
412
368
69
1
module Main where import System.Environment (getArgs) import System.IO main = do { args <- getArgs; ih <- openFile (head args) ReadMode; input <- hGetContents ih; putStrLn $show $ length $ words input; hClose(ih); }
dicander/progp_haskell
word_count_with_environment.hs
mit
229
0
10
47
93
48
45
10
1
-- Copyright (c) 2016-present, SoundCloud Ltd. -- All rights reserved. -- -- This source code is distributed under the terms of a MIT license, -- found in the LICENSE file. {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} module Kubern...
soundcloud/haskell-kubernetes
lib/Kubernetes/Model/V1/ComponentCondition.hs
mit
1,751
0
14
486
324
192
132
39
1
module Nunavut.Layer.Weights where import Control.Lens (to, (%=), (^.), _1, _2) import Control.Monad.Identity (Identity, runIdentity) import Control.Monad.Trans (lift) import Control.Monad.Trans.RWS (ask, get, mapRWST, tell) import Data.Monoid ...
markcwhitfield/nunavut
src/Nunavut/Layer/Weights.hs
mit
3,203
0
14
1,041
761
416
345
-1
-1
module SMCDEL.Examples.WhatSum where import SMCDEL.Examples.SumAndProduct (nmbr) import SMCDEL.Language import SMCDEL.Internal.Help import SMCDEL.Symbolic.S5 wsBound :: Int wsBound = 50 wsTriples :: [ (Int,Int,Int) ] wsTriples = filter ( \(x,y,z) -> x+y==z || x+z==y || y+z==x ) [ (x,y,z) | x <- [1..wsBound], y <...
jrclogic/SMCDEL
src/SMCDEL/Examples/WhatSum.hs
gpl-2.0
1,594
0
15
278
777
434
343
36
1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_HADDOCK show-extensions #-} -- | -- Module : Yi.Keymap.Vim.NormalOperatorPendingMap -- License : GPL-2 -- Maintainer : yi-devel@googlegroups.com -- Stability : experimental -- Portability : portable module Yi.Keymap.Vim.NormalOperatorPendingMap (d...
atsukotakahashi/wi
src/library/Yi/Keymap/Vim/NormalOperatorPendingMap.hs
gpl-2.0
7,030
129
11
2,302
1,751
932
819
146
9
module Poll ( watch ) where import System.Directory import Data.Time.Clock import Data.Time.Calendar import Control.Monad (forever) import qualified Control.Concurrent as C import System.IO.Error watch :: (String -> IO ()) -> [String] -> IO () watch fun fs = let wait = C.threadDelay 1000000 in do ...
beni55/lit
src/Poll.hs
gpl-2.0
946
0
15
237
344
172
172
29
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Grammatik.Type ( module Grammatik.Type , module Autolib.Set ) where import Autolib.Set import Autolib.Size import Autolib.Hash import Autolib.ToDoc import Autolib.Reader import Data.Typeable import GHC.Gene...
marcellussiegburg/autotool
collection/src/Grammatik/Type.hs
gpl-2.0
1,480
15
13
404
410
240
170
43
1
module AccessLogger (startAccessLogger, stopAccessLogger, logAccess) where { import ErrorLogger; import Request; import Response; import Config; import Global; import Util; import IO; import Char (toLower); import System.IO.Unsafe; import System.Time; import Network.Socket; import Network.B...
ckaestne/CIDE
CIDE_Language_Haskell/test/WSP/Webserver/AccessLogger.hs
gpl-3.0
5,592
0
18
1,901
1,670
901
769
125
19
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} module Texture.SH.RotationSO4 where import qualified D...
lostbean/sphermonics
src/Texture/SH/RotationSO4.hs
gpl-3.0
12,547
0
18
3,219
5,098
2,746
2,352
227
2
-- grid is a game written in Haskell -- Copyright (C) 2018 karamellpelle@hotmail.com -- -- This file is part of grid. -- -- grid 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 Lice...
karamellpelle/grid
source/MEnv/Foreign/IOS.hs
gpl-3.0
1,464
0
10
282
168
100
68
20
2
{-# LANGUAGE OverloadedStrings, DeriveGeneric, TupleSections #-} module StandOff.External.StandoffModeDump ( StandoffModeRange(..) , StandoffModeAnnotations(..) , runJsonParser , elDump , runELispDumpParser ) where -- | This module provides functions for parsing external annotations -- that where genera...
lueck/standoff-tools
src/StandOff/External/StandoffModeDump.hs
gpl-3.0
7,350
0
21
1,603
2,061
1,059
1,002
201
2
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE Fle...
capitanbatata/sandbox
computing-abstract-sizes/src/Example.hs
gpl-3.0
5,095
0
12
1,093
1,550
810
740
90
2
module Dragonfly.Authorization.Authorities where -- | Name of administrator group administratorAuthority :: String administratorAuthority = "admin" -- | Capabilities known to always exist knownCapabilities :: [String] knownCapabilities = [readGalleryCapabilityName, uploadImageCapabilityName, administerGalleryCapabili...
colin-adams/dragonfly-website
Dragonfly/Authorization/Authorities.hs
gpl-3.0
822
0
5
85
74
48
26
11
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-containeranalysis/gen/Network/Google/Resource/ContainerAnalysis/Projects/Notes/Occurrences/List.hs
mpl-2.0
6,514
0
19
1,467
964
558
406
136
1
---------------------------------------------------------------------- -- | -- Module : Graphics.UI.Awesomium -- Copyright : (c) 2012 Maksymilian Owsianny -- License : LGPL-3 (see the file LICENSE) -- -- Maintainer : Maksymilian.Owsianny+Awesomium@gmail.com -- Stability : Experimental -- Portability...
MaxOw/awesomium
src/Graphics/UI/Awesomium.hs
lgpl-3.0
965
0
5
122
110
83
27
13
0
{-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE TemplateHaskell #-} module ...
alanz/annotations-play
src/ASTExpr.hs
unlicense
3,391
0
8
1,107
140
84
56
24
0
data Context = Home | Mobile | Business deriving (Eq, Show) type Phone = String rahul = [(Home, "123-123-1234"), (Mobile, "833-202-3233")] milind = [(Mobile, "+91 8554036966"), (Business, "+91 20 1234 1234"), (Home, "+91 20 4565 3453"), (Business, "+91 20 2323 3434")] anna = [(Business, "+260-23-1212")] -- lookup ::...
dongarerahul/lyah
chapter11-functorApplicativeMonad/AddressBook1.hs
apache-2.0
918
0
10
217
273
153
120
15
2
--import Prelude.Maybe hiding (Just, Nothing) data Maybe' a = Just' a | Nothing' instance Monad Maybe' where --return :: a -> Maybe a return x = Just' x --(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b Nothing' >>= _ = Nothing' Just' x >>= f = f x newtype Parser a = P (String -> [(a, String)]) parse :: Pa...
dongarerahul/edx-haskell
maybe-state-monad.hs
apache-2.0
578
0
13
183
236
125
111
13
1
{-| Module: Crypto.Spake2.Util Description: Miscellany. Mostly to do with serialization. -} module Crypto.Spake2.Util ( expandData , expandArbitraryElementSeed , bytesToNumber , numberToBytes , unsafeNumberToBytes ) where import Protolude import Crypto.Hash.Algorithms (SHA256) import Crypto.Number.Seriali...
jml/haskell-spake2
src/Crypto/Spake2/Util.hs
apache-2.0
2,129
0
10
368
303
180
123
27
1
module Util where import Control.Monad import qualified Graphics.UI.GLFW as GLFW import System.Exit import System.IO import Control.Concurrent (threadDelay) -- Resize window import qualified Graphics.Rendering.OpenGL as GL import Graphics.Rendering.OpenGL (($=)) import Debug.Trace -- type ErrorCallback = Error ->...
pharaun/hCraft
src/Util.hs
apache-2.0
2,633
0
17
740
715
347
368
57
3
-- Simple Interpreter -- from The essence of functional programming by Philip Wadler type Name = String data Term = Var Name | Con Int | Add Term Term | Lam Name Term | App Term Term data Value = Wrong | Num Int | Fun (Value -> M Value) typ...
cbare/Etudes
haskell/interpretter_00.hs
apache-2.0
1,678
0
13
583
786
406
380
47
2
-- Copyright 2016 TensorFlow authors. -- -- 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 agree...
tensorflow/haskell
tensorflow-ops/tests/EmbeddingOpsTest.hs
apache-2.0
7,343
77
12
1,860
1,601
917
684
120
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE RecordWildCards #-} module WaTor.Simulation ( step ) where import Control.Applicative import Control.Monad hiding (mapM) import Data.Monoid import Data.Traversable import qualified Data.Vector ...
erochest/wa-tor
src/WaTor/Simulation.hs
apache-2.0
4,174
5
17
1,545
1,447
738
709
105
5
module SqrtMultiples.A327953 (a327953, a327953_list) where import Data.List (genericLength) a327953 :: Integer -> Integer a327953 n = genericLength $ recurse 2 ((n+1)^2 `div` 4) where recurse m k | k < 1 = [] | m^2 * k <= n^2 = recurse (m + 1) k | m^2 * k >= upper = recurse m ((upper-1) `div...
peterokagey/haskellOEIS
src/SqrtMultiples/A327953.hs
apache-2.0
467
0
13
126
247
131
116
12
1
-- Copyright 2020 Google LLC -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in ...
google/cabal2bazel
bzl/tests/ffi/HeadersTest.hs
apache-2.0
783
0
9
141
78
50
28
8
1
module LogAnalysis where import Data.Char import Log parseMessage :: String -> LogMessage parseMessage str@(prefix:_:rhs@(timestamp:_:rest)) | prefix == 'I' = LogMessage Info (digitToInt timestamp) rest | prefix == 'E' = parseError rhs | prefix == 'W' = LogMessage Warning (digitToInt timesta...
markmandel/cis194
src/week3/homework/LogAnalysis.hs
apache-2.0
568
0
13
105
193
98
95
11
1
-- http://www.codewars.com/kata/54492291ec342c4a440008c5 module Combinations where import Data.List combinations :: Int -> [a] -> [[a]] combinations n = filter ((==n) . length) . subsequences
Bodigrim/katas
src/haskell/B-Combinations.hs
bsd-2-clause
193
0
9
24
58
34
24
4
1
-- Euler project with haskell solutions module Euler where import Data.List import Data.Char import Data.Array import Data.Scientific (fromRationalRepetend, formatScientific, FPFormat(..)) import Data.Ratio ((%)) import Data.Function (on) import Numeric (showIntAtBase) -- $setup -- >>> import Control.Applicative -- >...
niexshao/Exercises
src/Euler.hs
bsd-3-clause
13,466
0
18
3,944
5,446
2,995
2,451
266
5
-- Copyright : (C) 2009 Corey O'Connor -- License : BSD-style (see the file LICENSE) module Bind.Marshal.StaticProperties where import Bind.Marshal.Prelude import Bind.Marshal.Action.Base import Bind.Marshal.Action.Static import Bind.Marshal.DataModel import Bind.Marshal.DesAction.Base import Bind.Marshal.S...
coreyoconnor/bind-marshal
src/Bind/Marshal/StaticProperties.hs
bsd-3-clause
579
0
8
120
98
62
36
-1
-1
module CloudWatchTests.Util ( testCloudWatch ) where import Control.Monad.Trans.Resource(ResourceT, runResourceT) import Data.Text (Text) import Cloud.AWS.CloudWatch testCloudWatch :: Text -> CloudWatch (ResourceT IO) a -> IO a testCloudWatch region request = do runResourceT $ runCloudWat...
worksap-ate/aws-sdk
test/CloudWatchTests/Util.hs
bsd-3-clause
369
0
10
85
99
53
46
13
1
{-# LANGUAGE TupleSections, PatternGuards, ExistentialQuantification #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Utilities ( module IdSupply, module Utilities, module Control.Arrow, module Control.DeepSeq, module Control.Monad, module Data.Maybe, module Data.List, mod...
batterseapower/supercompilation-by-evaluation
Utilities.hs
bsd-3-clause
9,807
0
14
2,519
4,692
2,524
2,168
231
2
{-# LANGUAGE BangPatterns, FlexibleContexts, NoMonomorphismRestriction #-} {-# LANGUAGE OverloadedStrings, Rank2Types, TemplateHaskell #-} module Lens where import ClassyPrelude.Yesod import Control.Lens import Language.Haskell.Exts (Module (..), ModuleName, SrcLoc) import Language.Haskell.Exts (ExportSpec) ...
konn/leport
leport-web/Lens.hs
bsd-3-clause
1,414
0
10
290
420
229
191
33
1
-- 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. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE GADT...
rfranek/duckling
Duckling/Numeral/DE/Rules.hs
bsd-3-clause
10,638
0
19
2,864
3,088
1,679
1,409
316
32
{-| Module : Ch01 Description : 第1章 関数プログラミングとは何か Copyright : (c) Shinya Yamaguchi, 2017 Stability : experimental Portability : POSIX -} module Ch01 ( -- * 1.3 例題: 頻出単語 (p.17-p.20) -- ** 型 Text, Word -- ** 関数 , commonWords, sortWords, countRuns, sortRuns, showRun -- * 1.4 例題: 数を言葉に変換する (p.20-p.25) ...
waddlaw/TFwH
src/Ch01.hs
bsd-3-clause
9,317
0
12
1,894
2,184
1,332
852
123
3
import Test.Hspec import Test.QuickCheck import Euler202 import Data.List main :: IO () main = hspec $ do describe "bounces" $ do it "satisfies sample" $ do bounces 11 `shouldBe` 2 bounces 7 `shouldBe` 2 bounces 17 `shouldBe` 0 -- is leaky bounces 1000001 `s...
hackle/euler
test/Euler202Spec.hs
bsd-3-clause
3,719
1
22
1,371
749
406
343
41
3
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} module Monad.RelMonad where class (Functor r, Monad m) => RelMonad r m where rPoint :: r a -> m a instance Monad m => RelMonad m m where rPoint = id
shmookey/pure
src/Monad/RelMonad.hs
bsd-3-clause
232
0
8
48
71
37
34
7
0
{-# LANGUAGE OverloadedStrings #-} module Data.Json.Visualization where import qualified Data.Aeson as A (Value (String)) import qualified Data.Graph.Inductive as G import qualified Data.GraphViz as GV import qualified Data.GraphViz.Attributes.Complete as GV imp...
haroldcarr/data-json-validation
src/Data/Json/Visualization.hs
bsd-3-clause
1,359
0
16
512
383
221
162
24
2
{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE ImpredicativeTypes ...
j-mueller/hldb
webapp/Graphics/Rendering/SVG.hs
bsd-3-clause
9,919
0
16
2,537
2,717
1,426
1,291
204
7
-- | -- Module: Data.Chimera.WheelMapping -- Copyright: (c) 2017 Andrew Lelechenko -- Licence: MIT -- Maintainer: Andrew Lelechenko <andrew.lelechenko@gmail.com> -- -- Helpers for mapping to <http://mathworld.wolfram.com/RoughNumber.html rough numbers> -- and back. This has various applications in number th...
Bodigrim/bit-stream
Data/Chimera/WheelMapping.hs
bsd-3-clause
7,907
0
11
1,592
931
575
356
71
2
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Drive.Trello.Types ( TrelloF (..) , TrelloAuth (..) , User (..) , Organization (..) , Board (..) ) where import Data.Aeson ((.:)) import qualified Data.Aeson as A import ...
palf/free-driver
packages/drive-trello/lib/Drive/Trello/Types.hs
bsd-3-clause
831
0
9
210
239
147
92
30
0
{-# LANGUAGE DeriveDataTypeable #-} module Text.HTML.TagSoup.Options where import Data.Typeable import Text.HTML.TagSoup.Type import Text.HTML.TagSoup.Entity import Text.StringLike -- | These options control how 'parseTags' works. The 'ParseOptions' type is usually generated by one of -- 'parseOptions', 'parseOpt...
ndmitchell/tagsoup
src/Text/HTML/TagSoup/Options.hs
bsd-3-clause
4,297
0
16
861
566
322
244
32
2
{-# LANGUAGE DeriveDataTypeable #-} {-# OPTIONS_GHC -fno-warn-missing-fields #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} ------------------------------------------------------...
csabahruska/GFXDemo
Thrift/ContentConsumer.hs
bsd-3-clause
3,858
15
14
753
852
476
376
90
4
-- 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.Ordinal.HE.Tests ( tests ) where import Data.String import Prelude import Test.Tasty import Du...
facebookincubator/duckling
tests/Duckling/Ordinal/HE/Tests.hs
bsd-3-clause
503
0
9
77
79
50
29
11
1
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : $Header$ Description : Morphisms in Propositional logic extended with QBFs Copyright : (c) Jonathan von Schroeder, DFKI GmbH 2010 License : GPLv2 or higher, see LICENSE.txt Maintainer : <jonathan.von_schroeder@dfki.de> Stability : experimental Porta...
keithodulaigh/Hets
QBF/Morphism.hs
gpl-2.0
5,797
0
24
1,459
1,551
807
744
111
10
(a, b) = (3, 4)
roberth/uu-helium
test/simple/correct/PatternBindBug1.hs
gpl-3.0
16
0
5
5
19
11
8
1
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-ssm/gen/Network/AWS/SSM/DeleteDocument.hs
mpl-2.0
3,006
0
9
659
359
220
139
48
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- Module : Gen.Types.Waiter -- Copyright : (c) 2013-2015 Brendan Hay -- License : This Source Code Form is subject to the terms of -...
fmapfmapfmap/amazonka
gen/src/Gen/Types/Waiter.hs
mpl-2.0
2,319
0
15
699
503
277
226
75
0
{-# LANGUAGE OverloadedStrings #-} module Network.Haskoin.Network.Units (tests) where import Data.ByteString (ByteString) import Data.Maybe (fromJust) import Data.Serialize (encode) import Data.Word (Word32)...
xenog/haskoin
test/bitcoin/Network/Haskoin/Network/Units.hs
unlicense
2,503
0
10
645
506
263
243
51
1
-- Copyright (c) 2015 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 conditi...
saltlang/compiler-toolbox
src/Data/Position/Class.hs
bsd-3-clause
2,849
0
14
512
210
139
71
18
0
{-# LANGUAGE ExistentialQuantification, TemplateHaskell, DeriveDataTypeable, Rank2Types, OverloadedStrings #-} module SecondTransfer.Http2.TransferTypes ( SessionOutputPacket , SessionOutputCommand (..) , GlobalStreamId , SessionToFramerBlock ...
shimmercat/second-transfer
hs-src/SecondTransfer/Http2/TransferTypes.hs
bsd-3-clause
3,600
0
8
1,307
287
190
97
47
0
{-# LANGUAGE DeriveDataTypeable #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GL.Tensor -- Copyright : (c) Sven Panne 2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- ...
IreneKnapp/direct-opengl
Graphics/Rendering/OpenGL/GL/Tensor.hs
bsd-3-clause
10,606
0
12
2,385
4,819
2,497
2,322
237
1
{-# LANGUAGE RecordWildCards #-} -- | -- This is the main entry point into our logic, with everything already nicely -- in the world of Haskell, i.e. no JS dependencies. module Entry where import qualified Data.Map as M import qualified Data.Set as S import Types import Lint import Rules import Analysis import Shape...
eccstartup/incredible
logic/Entry.hs
mit
1,404
0
14
299
368
194
174
30
3
-- (c) The University of Glasgow 2006 {-# LANGUAGE CPP, DeriveDataTypeable #-} -- | Module for (a) type kinds and (b) type coercions, -- as used in System FC. See 'CoreSyn.Expr' for -- more on System FC and how coercions fit into it. -- module Coercion ( -- * Main data type Coercion(..), Var, CoVar, ...
nathyong/microghc-ghc
compiler/types/Coercion.hs
bsd-3-clause
78,821
1,008
12
20,814
11,656
7,214
4,442
937
16
{- (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 \section[StgLint]{A ``lint'' pass to check for Stg correctness} -} {-# LANGUAGE CPP #-} module StgLint ( lintStgTopBindings ) where import GhcPrelude import StgSyn import Bag ( Bag, emptyBag, isEmptyBag, snocBag, bagToList ) import Id ...
ezyang/ghc
compiler/stgSyn/StgLint.hs
bsd-3-clause
17,628
1
19
5,130
4,709
2,393
2,316
-1
-1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 2000 FunDeps - functional dependencies It's better to read it as: "if we know these, then we're going to know these" -} {-# LANGUAGE CPP #-} module FunDeps ( FunDepEqn(..), pprEquation, improveFromInstEnv, improve...
olsner/ghc
compiler/typecheck/FunDeps.hs
bsd-3-clause
26,607
0
19
8,718
2,787
1,511
1,276
-1
-1
module A3 where import C3 main xs = case xs of [] -> 0 [(x : xs)] -> (x ^ pow) + (case xs of (x : xs) -> (sq x) + (sumSquares1 xs) [] -> 0)
kmate/HaRe
old/testing/unfoldDef/A3AST.hs
bsd-3-clause
270
0
15
167
98
53
45
10
3
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Traversable -- Copyright : Conor McBride and Ross Paterson 2005 -- License : BSD-style (see the LICENSE file in the distribution) -- -- Maint...
acowley/ghc
libraries/base/Data/Traversable.hs
bsd-3-clause
10,316
0
12
2,284
2,033
1,140
893
106
1
module Pair () where import Language.Haskell.Liquid.Prelude {-@ data Pair a b <p :: x0:a -> x1:b -> Prop> = P (x :: a) (y :: b<p x>) @-} data Pair a b = P a b incr x = let p = P x ((x+1)) in p chk (P x (y)) = liquidAssertB (x<y) prop = chk $ incr n where n = choose 0 incr2 x = let p1 = (P True (x+1)) in ...
ssaavedra/liquidhaskell
tests/pos/pair.hs
bsd-3-clause
582
0
12
173
329
169
160
19
1
import System.IO main = do hSetBuffering stdout NoBuffering putStr "Enter an integer: " x1 <- readLine putStr "Enter another integer: " x2 <- readLine putStr ("Their sum is " ++ show (read x1 + read x2 :: Int) ++ "\n") where readLine = do eof <- isEOF if eof then return [] else do ...
urbanslug/ghc
libraries/base/tests/IO/hGetChar001.hs
bsd-3-clause
468
6
14
168
163
78
85
-1
-1
module M where
ezyang/ghc
testsuite/tests/backpack/cabal/bkpcabal07/M.hs
bsd-3-clause
15
0
2
3
4
3
1
1
0
{-# LANGUAGE InstanceSigs #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE GADTs #-} -- https://www.cs.ox.ac.uk/jeremy.gibbons/publications/itera...
eulerfx/learnfp
essence_iterator.hs
mit
14,745
40
19
3,636
7,154
3,697
3,457
-1
-1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiParamTypeClasses #-} module TwitterMarkov.Tests.MarkovModel (tests) where import Test.Tasty import Test.Tasty.QuickCheck as QC import TwitterMarkov.MarkovModel import qualified Data.Map as Map import Data.Monoid (Sum(..)) import qualified Data.List.NonEmpty as NE...
beala/twitter-markov
tests/TwitterMarkov/Tests/MarkovModel.hs
mit
3,348
1
18
742
1,048
555
493
68
1
-- | The problem described by Bertsekas p. 210. module Algorithms.MDP.Examples.Ex_3_2 where import Algorithms.MDP.Examples.Ex_3_1 hiding (mdp) import Algorithms.MDP -- | The MDP representing the problem. mdp :: MDP State Control Double mdp = mkUndiscountedMDP states controls transition costs (\_ -> controls)
prsteele/mdp
src/Algorithms/MDP/Examples/Ex_3_2.hs
mit
313
0
7
44
64
39
25
5
1
-------------------------------------------------------------------- -- | -- Copyright : (c) 2015 Smelkov Ilya -- License : MIT -- Maintainer: Smelkov Ilya <triplepointfive@gmail.com> -- Stability : experimental -- Portability: non-portable -- -- This step adjusts the output face winding order to be CW. -- The de...
triplepointfive/soten
src/Codec/Soten/PostProcess/FlipWindingOrder.hs
mit
902
0
9
155
115
75
40
10
1
module Main where import Data.Char (toLower) import Data.Maybe (catMaybes, isNothing) import Parser data Register = RegA | RegB | RegC | RegD deriving Show data Target = ToRegister Register | ToValue Int deriving Show data Command = Cpy Target Register | Inc Register | Dec Register | Jnz...
CarstenKoenig/AdventOfCode2016
Day12/Main.hs
mit
4,749
0
15
1,321
1,884
949
935
183
5
{-| Module : Day7 Description : <http://adventofcode.com/2016/day/7 Day 7: Internet Protocol Version 7> -} {-# OPTIONS_HADDOCK ignore-exports #-} module Day7 (main) where import Common (readDataFile) import Control.Monad (guard, replicateM) import Data.Char (isAlphaNum) import Data.Set (empty, insert, member) imp...
ephemient/aoc2016
src/Day7.hs
mit
1,540
0
18
399
620
321
299
37
2
{-# LANGUAGE RecordWildCards #-} import Data.Foldable (for_) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Data.String (fromString) import TwelveDays (recite) main :: IO () main = hspecWith defaultConfig {configFastFail = ...
exercism/xhaskell
exercises/practice/twelve-days/test/Tests.hs
mit
9,737
1
9
3,386
750
468
282
107
1
{-# LANGUAGE BangPatterns #-} module Statistics.SGT.Observations ( fromFile ) where import qualified Data.ByteString.Lazy.Char8 as L import qualified Data.Vector as V import Statistics.SGT.Types -- Fill new vector from file containing [(Int,Int)]. fromFile :: FilePath -> IO (V.Vector Row) f...
marklar/Statistics.SGT
Statistics/SGT/Observations.hs
mit
824
0
10
177
292
153
139
22
1
module Y2016.M12.D12.Solution where import Control.Monad (guard) {-- Today's Haskell exercise is from the Mensa Genuis Quiz-a-Day book. And I quote: "Aha," said the math professor to her husband, "it's a very simple problem, but I see that our two sons have now reached interesting ages. The product of their ages is ...
geophf/1HaskellADay
exercises/HAD/Y2016/M12/D12/Solution.hs
mit
2,250
0
16
419
256
146
110
13
1
{-# LANGUAGE OverloadedStrings #-} import Test.HUnit import qualified Data.Text as ST import qualified Data.Text.Lazy as LT import Data.Binary import Data.Tree -- TODO: rm when debugged import TestFileUtils import NewickParser import FastA import Alignment import Classifier import MlgscTypes import Output fastaInp...
tjunier/mlgsc
test/TestClassifier.hs
mit
3,373
18
12
774
764
380
384
92
1
module Ch21.HttpStuff where import Data.ByteString.Lazy hiding (map) import Network.Wreq urls :: [String] urls = [ "http://httpbin.org/ip" , "http://httpbin.org/bytes/5" , "https://parkinsons-and-me.herokuapp.com/api/quotes-services-weightings" ] mappingGet :: [IO (Response ByteString)] mappingGet = map get ...
andrewMacmurray/haskell-book-solutions
src/ch21/HttpStuff.hs
mit
402
0
8
53
96
55
41
12
1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANG...
ublubu/shapes
shapes/src/Physics/Broadphase/Aabb.hs
mit
6,304
0
14
1,659
1,565
859
706
117
3
{- - Whidgle.CompositeMap - - Describes operations on the type representing the pathfinding knowledge of all heroes. -} module Whidgle.CompositeMap ( generateMaps ) where import Control.Parallel.Strategies import qualified Data.Map as M import Whidgle.Pathfinding import Whidgle.Types -- Generates a RouteMap for...
Zekka/whidgle
src/Whidgle/CompositeMap.hs
mit
568
0
12
93
120
70
50
10
1
-- | This module provides some higher-level types and infrastructure to make it easier to use. {-# LANGUAGE PatternGuards, ScopedTypeVariables, NoMonomorphismRestriction,FlexibleInstances, FlexibleContexts, RankNTypes, ScopedTypeVariables #-} -- {-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleCont...
sol/uu-parsinglib
src/Text/ParserCombinators/UU/Utils.hs
mit
9,883
0
17
2,557
2,592
1,419
1,173
180
6
somme n = sum[1..n]
Debaerdm/L3-MIAGE
Programmation Fonctionnel/TP/TP1/test.hs
mit
20
0
6
4
17
8
9
1
1
-- Does loop_eachE work? module T where import Prelude () import Tests.KesterelBasis -- c = unitA *** id >>> runE (bool2sig $ \r -> loopEachE r nothingE) -- c = unitA *** id >>> runE (bool2sig $ \r -> loopE (abortE r haltE)) -- c = unitA >>> runE (signalE $ \r -> abortE r haltE) c = unitA >>> runE (signalE $ \r -> lo...
peteg/ADHOC
Tests/08_Kesterel/112_loopEach.hs
gpl-2.0
495
0
11
95
118
66
52
7
1
module Types.JSON where import Web.Vorple import Types.Entry import Types.Request import Types.Response import Types.Session import Types.Tag import Types.User deriveJSON (drop 2) ''Entry deriveJSON (drop 2) ''EntryFilter deriveJSON (drop 3) ''Request deriveJSON id ''Error deriveJSON (drop 4) ''Response derive...
ktvoelker/todo
src/Types/JSON.hs
gpl-3.0
407
0
7
60
163
78
85
-1
-1
{- The Delve Programming Language Copyright 2009 John Morrice Distributed under the terms of the GNU General Public License v3, or ( at your option ) any later version. This file is part of Delve. Delve is free software: you can redistribute it and/or modify it under the terms of the GNU Gene...
elginer/Delve
src/VarCore.hs
gpl-3.0
1,833
0
7
461
217
133
84
40
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE UnicodeSyntax #-} module Main where import Brick.AttrMap import Brick.Main import Brick.Types import Brick.Widgets.Border import Brick.Widgets.Bo...
eigengrau/haskell-sodium-vty
src/Main.hs
gpl-3.0
5,967
6
15
2,198
1,291
678
613
112
6
module Hadolint.Rule.DL3030 (rule) where import Hadolint.Rule import qualified Hadolint.Shell as Shell import Language.Docker.Syntax rule :: Rule Shell.ParsedShell rule = simpleRule code severity message check where code = "DL3030" severity = DLWarningC message = "Use the -y switch to avoid manual input...
lukasmartinelli/hadolint
src/Hadolint/Rule/DL3030.hs
gpl-3.0
698
0
11
122
177
97
80
14
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/SubAccounts/Insert.hs
mpl-2.0
3,285
0
14
739
406
242
164
63
1
-- -- Minio Haskell SDK, (C) 2017 Minio, 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 ...
donatello/minio-hs
src/Network/Minio/Data/Crypto.hs
apache-2.0
2,332
0
10
447
479
265
214
41
1
{-# LANGUAGE OverloadedStrings #-} module Main where import qualified Data.Aeson as DA import qualified Data.Text as DT import qualified Network.HTTP.Types as NHT import qualified Network.Wai as NW import qualified Network.Wai.Application.Static ...
dysinger/aeson-wai-example
Main.hs
apache-2.0
1,871
0
12
512
507
280
227
35
3
newtype Trace a = Trace ([String], a) instance Functor Trace where fmap k (Trace (msgs, x)) = Trace (msgs, (k x)) instance Applicative Trace where (<*>) (Trace (msgs', k)) (Trace (msgs'', x)) = Trace (msgs' ++ msgs'', (k x)) pure x = Trace ([], x) instance Monad Trace where (>>=) (Trace (msgs, x)) k = ...
cbare/Etudes
haskell/trace.hs
apache-2.0
768
0
13
254
411
211
200
25
2
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} -------------------------------------------------------------------- ---- | ---- Copyright : (c) Edward Kmett and Dan Doel 2013-2014 ---- Li...
PipocaQuemada/ermine
src/Ermine/Syntax/Class.hs
bsd-2-clause
2,608
0
14
564
765
415
350
62
0
{- EEL -- Extensible Experimental Language by Lukáš Kuklínek, 2013 -} module Parser.Parser(runEel, runEelExt, initState, initStack, emitModule, semaCheck) where import Sema.Term import Sema.Error import Sema.Infer import Parser.State import Parser.Core import Parser.Dump import Builtins.Eval import Builtins.T...
iljakuklic/eel-proto
src/Parser/Parser.hs
bsd-3-clause
2,831
0
14
642
748
396
352
47
4
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.OES.ByteCoordinates -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/OES/ByteCoordinates.hs
bsd-3-clause
1,235
0
4
161
124
91
33
28
0
module Experiment.AtomicOps where import qualified Data.IORef as Ref import qualified Data.Atomics as Atm import qualified Data.Primitive.Array as Arr atomicModifyIORef :: IO () atomicModifyIORef = do ref <- Ref.newIORef (0 :: Int) v1 <- Ref.atomicModifyIORef' ref (\ v -> (1, v)) v2 <- R...
asakamirai/experiment-atomic-primops-with-fhpc
src/Experiment/AtomicOps.hs
bsd-3-clause
1,049
0
11
264
419
216
203
32
1
{-# LANGUAGE DeriveGeneric, FlexibleContexts, TypeFamilies #-} module Tutorial.Chapter7.Plant (Plant(..), FlowerColour(..), buildPlant, run) where import ALife.Creatur (Agent, agentId, isAlive) import ALife.Creatur.Database (Record, key) import ALife.Creatur.Genetics.BRGCBool (Genetic, Reader, Sequence, getWithDe...
mhwombat/creatur-examples
src/Tutorial/Chapter7/Plant.hs
bsd-3-clause
2,475
0
15
416
751
407
344
60
1
module Paths_phong where import Data.Version version :: Version version = Version {versionBranch = [0,1,0,0], versionTags = []}
CodosaurusRex/Phong
Paths_phong.hs
bsd-3-clause
130
0
7
19
47
30
17
4
1
safeSqrt x = sqrtBool (x >= 0) x sqrtBool True x = Just (sqrt x) sqrtBool False _ = Nothing
YoshikuniJujo/funpaala
samples/05_function/guards0.hs
bsd-3-clause
93
0
7
21
50
24
26
3
1
{-# LANGUAGE OverloadedStrings #-} module GenC2 -- Uncomment the below line to expose all top level symbols for -- repl testing {- (gen) -- -} where import Ast (Block(..)) import TypeCheck -- import Control.Monad.State.Lazy -- import Control.Monad.Reader -- import Control.Monad import Control.Monad.RWS.Lazy -- i...
ethanpailes/bbc
src/GenC2.hs
bsd-3-clause
2,406
0
18
681
648
355
293
54
1
module Check (checkSyntax) where import Cabal import Control.Applicative import CoreMonad import ErrMsg import Exception import GHC import GHCApi import Prelude hiding (catch) import Types ---------------------------------------------------------------- checkSyntax :: Options -> String -> IO String checkSyntax opt f...
johntyree/ghc-mod
Check.hs
bsd-3-clause
811
0
10
161
214
112
102
22
1
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE Qua...
seanparsons/app-base
src/Entities.hs
bsd-3-clause
9,916
10
30
2,124
2,862
1,493
1,369
-1
-1
module Tak.AI.Random where import Control.Lens import System.Random import Tak.AI.Types import Tak.Types ai :: AIGameState -> IO Move ai gs = do let validMoves = moves (gs^.aiGameState) m <- randomRIO (0,length validMoves - 1) return $ validMoves !! m
z0isch/htak
src/Tak/AI/Random.hs
bsd-3-clause
306
0
12
92
101
53
48
10
1
{-# LANGUAGE TypeFamilies #-} {-# OPTIONS -funbox-strict-fields #-} module Data.TrieMap.UnionMap.Base ( module Data.TrieMap.UnionMap.Base, module Data.TrieMap.TrieKey) where import Data.TrieMap.TrieKey data instance TrieMap (Either k1 k2) a = Empty | MapL (TrieMap k1 a) | MapR (TrieMap k2 a) | Union !I...
lowasser/TrieMap
Data/TrieMap/UnionMap/Base.hs
bsd-3-clause
2,155
10
10
464
1,099
549
550
50
1