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
yes = foo (elem x y)
mpickering/hlint-refactor
tests/examples/Default41.hs
bsd-3-clause
20
0
7
5
17
8
9
1
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Generating machine code (instruction selection) -- -- (c) The University of Glasgow 1996-2013 -- ----------------------------------------------------------------------------- {-# LANGUAGE GADTs #-} module SPARC.Co...
holzensp/ghc
compiler/nativeGen/SPARC/CodeGen.hs
bsd-3-clause
22,539
0
29
7,505
4,566
2,268
2,298
382
44
-------------------------------------------------------------------------------- -- | -- Module : LoadShaders -- Copyright : (c) Sven Panne 2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- -- Utilities for shader handling, ...
fujiyan/toriaezuzakki
haskell/opengl/uniform-matrix/LoadShaders.hs
bsd-2-clause
3,108
0
13
569
622
329
293
52
1
{-# LANGUAGE NoImplicitPrelude #-} -- | Args parser test suite. module Stack.ArgsSpec where import Control.Monad import Data.Attoparsec.Args (EscapingMode(..), parseArgsFromString) import Data.Attoparsec.Interpreter (interpreterArgsParser) import qualified Data.Attoparsec.Text as P import Data.Text (pack) import Stac...
MichielDerhaeg/stack
src/test/Stack/ArgsSpec.hs
bsd-3-clause
6,133
0
18
1,798
1,529
792
737
130
3
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : System.Mem.Weak -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@h...
jtojnar/haste-compiler
libraries/ghc-7.8/base/System/Mem/Weak.hs
bsd-3-clause
5,526
14
11
1,101
317
204
113
18
1
-- !!! opening a file in WriteMode better truncate it import System.IO main = do h <- openFile "openFile006.out" AppendMode hPutStr h "hello, world" size <- hFileSize h print size hClose h h <- openFile "openFile006.out" WriteMode size <- hFileSize h print size
urbanslug/ghc
libraries/base/tests/IO/openFile006.hs
bsd-3-clause
282
0
8
63
82
34
48
10
1
module Foo where data F = A | B data G = A | C
hferreiro/replay
testsuite/tests/rename/should_fail/rnfail009.hs
bsd-3-clause
49
0
5
17
24
15
9
3
0
import Data.Char import Data.List import Data.String import Network import System.IO import System.Time import System.Exit import Control.Monad.Reader import Control.Exception import Text.Printf import Prelude hiding (catch) server = "irc.freenode.org" port = 6667 chan = "#rosedu" nick = "irCri" type Net = ReaderT Bo...
mihaimaruseac/blog-demos
ircri/bot.hs
mit
3,951
0
13
872
809
403
406
67
2
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Memento.Types ( Memento(..) , runMemento , startMemento , lookupEnv , requireEnv , newMementoEnv , liftIO ) where import Control.Monad.State import Memento.Config import Control.Applicative import qualified Data.Text as...
adinapoli/memento
src/Memento/Types.hs
mit
1,691
0
12
231
381
202
179
40
1
module Types where import Control.Monad.Error import Text.ParserCombinators.Parsec (ParseError) data LispVal = Atom String | List [LispVal] | DottedList [LispVal] LispVal | Number Integer | Float Double | String String | Char Char ...
dstruthers/WYAS
Types.hs
mit
2,221
0
9
651
661
342
319
56
5
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Codec.Xlsx.Types ( Xlsx(..), xlSheets, xlStyles , def , Styles(..) , emptyStyles , ColumnsWidth(..) , Worksheet(..), wsColumns, wsRowPropertiesMap, wsCells, wsMerges , CellMa...
lookunder/xlsx
src/Codec/Xlsx/Types.hs
mit
4,035
0
16
1,066
1,067
621
446
88
4
comb :: Int -> [a] -> [[a]] comb 0 _ = [[]] comb _ [] = [] comb m (x:xs) = map (x:) (comb (m-1) xs) ++ comb m xs readInts :: IO [Int] readInts = fmap (map read . words) getLine listToString :: Show a => [a] -> String listToString xs = unwords (map show xs) main :: IO () main = do [k, n] <- readInts ...
da-eto-ya/trash
haskell/simplest/binomial.hs
mit
371
0
11
96
231
120
111
12
1
{-# LANGUAGE OverloadedStrings #-} module Network.MPD.Applicative.PlaybackControlSpec (main, spec) where import TestUtil import Network.MPD.Applicative.PlaybackControl import Network.MPD.Commands.Types main :: IO () main = hspec spec spec :: Spec spec = do describe "next" $ do ...
matthewleon/libmpd-haskell
tests/Network/MPD/Applicative/PlaybackControlSpec.hs
mit
1,491
0
17
472
505
259
246
34
1
module Accumulate (accumulate) where accumulate :: (a -> b) -> [a] -> [b] accumulate f xs = error "You need to implement this function."
exercism/xhaskell
exercises/practice/accumulate/src/Accumulate.hs
mit
138
0
7
25
48
27
21
3
1
module Main where import Control.Monad.Trans.Free (FreeF(..), FreeT(..)) import Network.Http.Client (Connection) import Web.Stripe.Client (StripeConfig(..), StripeError(..)) import Web.Stripe.Client.HttpStreams (withConnection, callAPI) import ...
dmjio/stripe
stripe-http-streams/tests/Main.hs
mit
1,094
0
17
355
344
186
158
28
3
import Data.List fibs :: [Int] fibs = unfoldr (\(a,b) -> Just (a, (b,a+b)) ) (0,1) result :: Int result = sum $ filter (\x -> odd x) $ takeWhile (\x -> x < 4000000) fibs main = putStrLn $ show(result)
nbartlomiej/haskeuler
002/problem-002.hs
mit
204
0
11
43
127
71
56
6
1
module TestReentrantLock where import Control.Concurrent.ReentrantLock import Test.QuickCheck import Test.QuickCheck.Monadic import Test.Tasty import Test.Tasty.QuickCheck test_lockThenUnlock = do lock <- run new mAcq <- run $ tryAcquire lock assert $ isJust mAcq...
iand675/disruptor
test/TestReentrantLock.hs
mit
589
0
12
149
136
68
68
17
2
module Main where import Test.Tasty as Tasty import Aeson ( callbackTests , requestTests , responseTests , staticTests ) import UnitTest main :: IO () main = Tasty.defaultMain $ Tasty.testGroup "\nWeb.Facebook.Messenger" [ aesonTests , unitTes...
Vlix/facebookmessenger
test/Spec.hs
mit
723
0
7
253
126
75
51
27
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DuplicateRecordFields #-} module Language.LSP.Types.DocumentSymbol where import Data.Aeson import Data.Aeson.TH import Data.Scientific import Data.Text (Text) import Lan...
alanz/haskell-lsp
lsp-types/src/Language/LSP/Types/DocumentSymbol.hs
mit
9,369
0
11
2,250
1,629
864
765
165
0
module Iseq where import Types iNil :: Iseq iNil = INil iStr :: String -> Iseq iStr s = IStr s iAppend :: Iseq -> Iseq -> Iseq iAppend seq1 seq2 = IAppend seq1 seq2 iNewline :: Iseq iNewline = INewline iComma :: Iseq iComma = IComma iSemiColon :: Iseq iSemiColon = ISemiColon iSpace :: I...
typedvar/hLand
hcore/Iseq.hs
mit
1,850
0
11
435
853
458
395
49
1
-- Problem 6 main :: IO () main = print result result :: Integer result = sum [1..100] ^ (2 :: Integer) - sum [x * x | x <- [1..100]]
chetaldrich/euler
haskell/006/6.hs
mit
136
0
10
33
75
40
35
4
1
module Main where import qualified Patat.Presentation.Interactive.Tests import qualified Patat.Presentation.Read.Tests import qualified Test.Tasty as Tasty main :: IO () main = Tasty.defaultMain $ Tasty.testGroup "patat" [ Patat.Presentation.Interactive.Tests.tests , Patat.Presentati...
jaspervdj/patat
tests/haskell/Main.hs
gpl-2.0
346
0
8
69
72
47
25
8
1
{-# LANGUAGE DeriveDataTypeable, RecordWildCards #-} module Synth where import Instruments import Midi import Play import Rendering import Types import Wave import Control.Monad import Data.Maybe import System.Console.CmdArgs import qualified System.FilePath as Path data Args = Args {input :: String, outputArg :: St...
garncarz/synth-haskell
Synth.hs
gpl-2.0
1,171
16
15
214
420
219
201
37
2
-- | This module provides access to the songs which can be played with /Easy Notes/ module SongCollection where import Songs.Fun import Songs.HaenschenKlein import Songs.AlleMeineEntchen import Songs.MadWorld import Euterpea -- | A song should be a list of /single/, /sequential/ Music Pitches type Song = [Music Pitc...
flofehrenbacher/music-project
EasyNotes/SongCollection.hs
gpl-3.0
883
0
8
179
150
92
58
16
1
{-# LANGUAGE FlexibleContexts,MultiParamTypeClasses,FlexibleInstances, TypeSynonymInstances,ScopedTypeVariables,FunctionalDependencies #-} -- | Some common utilites for a MonadReader that keeps track of variables in scope module Lang.Scope where import Control.Monad.Reader import Data.Set (Set) import qu...
danr/tfp1
Lang/Scope.hs
gpl-3.0
1,604
0
11
326
531
286
245
29
1
{-# LANGUAGE NoImplicitPrelude, FlexibleContexts, OverloadedStrings, TypeFamilies, Rank2Types #-} module Lamdu.Sugar.Convert.Expression ( convert ) where import Control.Lens.Operators import qualified Data.ByteString as SBS import Data.Store.Property (Property(..)) import qualified Data.Sto...
da-x/lamdu
Lamdu/Sugar/Convert/Expression.hs
gpl-3.0
3,218
0
15
608
864
481
383
-1
-1
module Status ( isIdle, isBusy, setIdle, setBusy , pushTask, waitTask ) where import System.IO.Unsafe import Control.Monad.STM import Control.Concurrent.STM.TVar import Control.Concurrent.STM.TChan {-# NOINLINE busyState #-} busyState :: TVar Bool busyState = unsafePerformIO $ newTVarIO False isBusy, isIdle ::...
shouya/poi
src/Status.hs
gpl-3.0
871
0
13
186
255
137
118
30
2
-- P08 Eliminate consecutive duplicates of list elements. import Data.List -- Built-in functions composition f1 :: Eq a => [a] -> [a] f1 = map head . group -- Recursion with dropWhile f2 :: Eq a => [a] -> [a] f2 [] = [] f2 (x:xs) = x : (f2 $ dropWhile (== x) xs) -- Recursion with pattern matching (look-ahead) f3 ::...
pavelfatin/ninety-nine
haskell/p08.hs
gpl-3.0
883
0
12
240
513
272
241
22
4
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} module Lamdu.GUI.ExpressionEdit.GetFieldEdit ( make ) where import Control.Lens.Operators import qualified Graphics.UI.Bottle.Widget as Widget import qualified Lamdu.GUI.ExpressionEdit.TagEdit as TagEdit import Lamdu.GUI.ExpressionGui (E...
da-x/lamdu
Lamdu/GUI/ExpressionEdit/GetFieldEdit.hs
gpl-3.0
1,470
0
15
298
353
204
149
-1
-1
{-# LANGUAGE DeriveFunctor #-} module Predicate ( Condition(..), ECondition(..), Var, Val(..), Op(..), Tree, parse, interpret, eval, eval', evalString ) where import Data.Functor import Control.Monad.Free import Predicate.Parser (Var, Val, Op, Expr) import qualified Predicate.Parser as P data OpBranch a = And a...
ffwng/tagfs
Predicate.hs
gpl-3.0
1,382
12
11
282
705
367
338
38
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-games/gen/Network/Google/Resource/Games/TurnBasedMatches/Rematch.hs
mpl-2.0
4,445
0
15
1,011
496
295
201
77
1
module NGramCrackers.Ops.Text ( bigrams , trigrams , getNGramsFromText , getNGramsFromTextList , getAlphasOnlyToText , normToList , getWordFrequency , countWords ) where import qualified Data.Text as T import Data.Char (isAlpha, isAlphaNum, isSpace, toLower) import Data.List (map, nub) import Data.Monoid ((<>)) im...
R-Morgan/NGramCrackers
src/NGramCrackers/Ops/Text.hs
agpl-3.0
2,326
0
10
431
430
241
189
37
1
{-# LANGUAGE TypeFamilies #-} module MaybeSet where import Set -- A type `Set (MaybeSet s)' denotes the same subsets as a type of class `Set s', except the value -- `Nothing' may be contained in any of them. data MaybeSet s = OnlyJust s | WithNothing s deriving(Show,Eq) withoutNothing :: LatticeSet s => Mayb...
ntoronto/drbayes
drbayes/direct/haskell-impl/MaybeSet.hs
lgpl-3.0
1,233
0
8
265
480
230
250
27
1
module BarthPar.Parallel where import Control.Parallel.Strategies smartMap :: NFData y => Int -> (x -> y) -> [x] -> [y] smartMap 0 f xs = map f xs smartMap 1 f xs = parMap rdeepseq f xs smartMap cs f xs = map f xs `using` parListChunk cs rdeepseq smartList :: NFData y => Int -> [y] -> [y] smartList 0 ...
erochest/barth-scrape
src/BarthPar/Parallel.hs
apache-2.0
428
0
9
99
189
99
90
10
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} module Main where import Control.Error import Options.Applicative import Prelude hiding (FilePath, mapM) import ...
erochest/popvox-scrape
Main.hs
apache-2.0
1,275
0
7
303
273
147
126
29
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Spark.Core.CachingSpec where import Test.Hspec import qualified Data.Text import Spark.Core.Context import Spark.Core.Functions import Spark.Core.Column import qualified Spark.Core.ColumnFunctions as C import Spark.Core.StructuresIntern...
tjhunter/karps
haskell/test-integration/Spark/Core/CachingSpec.hs
apache-2.0
1,229
0
13
240
341
179
162
31
1
-- Copyright 2013 Mario Pastorelli (pastorelli.mario@gmail.com) Samuel Gélineau (gelisam@gmail.com) -- -- 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.o...
gelisam/hawk
tests/RunTests.hs
apache-2.0
1,379
0
10
268
157
93
64
19
1
module Tiling.A301976 where import Helpers.LeafFreeGrids (leafFreeGridsList) a301976_list :: [Integer] a301976_list = leafFreeGridsList 3 a301976 :: Int -> Integer a301976 n = a301976_list !! (n - 1)
peterokagey/haskellOEIS
src/Tiling/A301976.hs
apache-2.0
202
0
7
28
60
34
26
6
1
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Token ( TokenResp(..) , Vars (..) , AppConfig (..) , askNewAccessToken , currentTokenConfig , tokenCachedFileName , newTokenIfNonLocalExisted )...
songpp/pcs-cli
src/Token.hs
apache-2.0
7,007
0
17
2,203
1,620
877
743
173
3
{-# LANGUAGE DeriveDataTypeable #-} module Application.XournalConvert.ProgType where import System.Console.CmdArgs data Xournal_convert = Test | MakeSVG { xojfile :: FilePath , dest :: Maybe FilePath } deriving (Show,...
wavewave/xournal-convert
lib/Application/XournalConvert/ProgType.hs
bsd-2-clause
582
0
9
209
125
72
53
13
1
import Controller (withOR) import Network.Wai.Handler.Warp (run) main :: IO () main = withOR $ run 3000
snoyberg/orangeroster
production.hs
bsd-2-clause
105
0
6
17
43
24
19
4
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} -------------------------------------------------------------------- -- | -- Copyright : (c) Edward Kmett and Dan Doel 2012 -- License : BSD2 -- Maintainer: Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Portability: non-portable...
PipocaQuemada/ermine
src/Ermine/Unification/Type.hs
bsd-2-clause
7,590
0
24
2,317
2,598
1,276
1,322
-1
-1
{-# LANGUAGE TemplateHaskell #-} {-| Implementation of the Ganeti Instance config object. -} {- Copyright (C) 2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of s...
ganeti-github-testing/ganeti-test-1
src/Ganeti/Objects/Nic.hs
bsd-2-clause
1,995
0
11
327
181
110
71
18
0
module Settings.Builders.Common ( includesArgs, cIncludeArgs, ldArgs, cArgs, cWarnings, argSetting, argSettingList, argStagedBuilderPath, argStagedSettingList ) where import Base import Expression import Oracles.Config.Flag import Oracles.Config.Setting import Oracles.PackageData import Settings includes ...
quchen/shaking-up-ghc
src/Settings/Builders/Common.hs
bsd-3-clause
1,907
0
13
421
514
277
237
46
1
{-# LANGUAGE CPP, DeriveGeneric, DeriveFunctor, RecordWildCards #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.TargetSelector -- Copyright : (c) Duncan Coutts 2012, 2015, 2016 -- License : BSD-like -- -- Maintainer : duncan@communit...
themoritz/cabal
cabal-install/Distribution/Client/TargetSelector.hs
bsd-3-clause
81,010
0
26
20,978
19,102
9,854
9,248
1,446
13
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# 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 #-} -------------------...
futufeld/eclogues
eclogues-impl/gen-hs/ReadOnlyScheduler_Client.hs
bsd-3-clause
9,918
0
12
1,459
3,111
1,535
1,576
224
1
-- |A type describing potentially pure or impure values (to preserve laziness when possible) module ELisp.Joinable(Joinable,joined,impure,getPure) where import Utils -- |A type describing potentially pure or impure values (to preserve laziness when possible) newtype Joinable a = Joinable (Either a (IO a)) instance Fu...
lih/Epsilon
src/ELisp/Joinable.hs
bsd-3-clause
1,002
0
11
193
329
167
162
17
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Main where import Protolude ...
tau-tao/pbs-web
src/Main.hs
bsd-3-clause
8,371
0
23
2,510
1,820
940
880
144
5
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DataKinds #-} module Parse.Helpers where import Prelude hiding (until) import Control.Monad (guard) import qualified Data.Indexed as I import Data.Map.Strict hiding (foldl) import Parse.ParsecAdapter hiding (newline, spaces, State) import AST.V0_16 import qualified AST.H...
avh4/elm-format
elm-format-lib/src/Parse/Helpers.hs
bsd-3-clause
15,548
0
28
4,433
5,306
2,660
2,646
380
3
-- |JavaScript's syntax. module BrownPLT.JavaScript.Syntax(Expression(..),CaseClause(..),Statement(..), InfixOp(..),CatchClause(..),VarDecl(..),JavaScript(..), AssignOp(..),Id(..),PrefixOp(..),Prop(..), ForInit(..),ForInInit(..),unId , UnaryAssignOp (..) , LValue (..) ) where import Te...
ducis/flapjax-fixed
WebBits-1.0/src/BrownPLT/JavaScript/Syntax.hs
bsd-3-clause
4,477
0
10
945
1,717
963
754
105
1
{-# LANGUAGE LambdaCase, RecordWildCards #-} module Transformations.Optimising.DeadParameterElimination where import Data.Set (Set) import Data.Map (Map) import Data.Vector (Vector) import qualified Data.Set as Set import qualified Data.Map as Map import qualified Data.Vector as Vec import Data.List import qualifie...
andorp/grin
grin/src/Transformations/Optimising/DeadParameterElimination.hs
bsd-3-clause
1,618
0
15
308
477
249
228
41
3
------------------------------------------------------------------------------ -- | This module contains the documented data type. -- module Autotool.XmlRpc.Types.Documented ( Documented (..) ) where ------------------------------------------------------------------------------ import Network.XmlRpc.Internals i...
j-hannes/autotool-xmlrpc-client
src/Autotool/XmlRpc/Types/Documented.hs
bsd-3-clause
987
0
11
221
207
112
95
17
0
module Zipper () where import Prelude hiding (reverse) import Data.Set data Stack a = Stack { focus :: !a -- focused thing in this set , up :: [a] -- jokers to the left , down :: [a] } -- jokers to the right {-@ type UListDif a N = {v:[a] | ((not (Se...
ssaavedra/liquidhaskell
tests/pos/zipper000.hs
bsd-3-clause
2,066
0
9
541
296
173
123
23
1
-- | A renderer that produces a native Haskell 'String', mostly meant for -- debugging purposes. -- {-# LANGUAGE OverloadedStrings #-} module Text.Blaze.Renderer.String ( fromChoiceString , renderHtml ) where import Data.List (isInfixOf) import qualified Data.ByteString.Char8 as SBC import qualified Data....
jgm/blaze-html
Text/Blaze/Renderer/String.hs
bsd-3-clause
3,220
0
13
902
919
487
432
60
9
module Json.Internal where import Data.Char (isSpace) import qualified Text.Parse as Parse import qualified Text.ParserCombinators.Poly.Plain as PolyPlain import qualified Text.ParserCombinators.Poly.Base as PolyBase comp2 :: (a -> b) -> (c -> d -> a) -> c -> d -> b comp2 f1 f2 x y = f1 $ f2 x y runParser :: Parse.T...
dyreshark/learn-haskell
Json/Internal.hs
bsd-3-clause
1,487
0
11
268
496
262
234
34
2
{-# LANGUAGE UnicodeSyntax, DeriveDataTypeable, FlexibleContexts #-} module Data.Dates.Internal where import Data.Char import Text.Parsec -- | Parser version of Prelude.read tryRead :: (Read a, Stream s m Char) => String -> ParsecT s st m a tryRead str = case reads str of [(res, "")] -> return res _ -> fa...
portnov/dates
Data/Dates/Internal.hs
bsd-3-clause
1,487
0
13
430
577
292
285
44
2
{-#LANGUAGE TransformListComp #-} module Language.Asdf.Parser where import Text.Parsec import Text.Parsec.Expr import Text.Parsec.Indent import Control.Monad import Control.Monad.Trans.State import Control.Applicative ((<*)) import Data.Functor.Identity import GHC.Exts import Language.Asdf.Lexer import Language.A...
sw17ch/Asdf
src/Language/Asdf/Parser.hs
bsd-3-clause
3,295
29
17
654
937
481
456
75
1
module Ghazan.Area ( -- Convert Square Inches to Square Kilometer sqInTOsqKm -- Convert Square Inches to Square Meters , sqInTOsqM -- Convert Square Inches to Square Feet , sqInTOsqFt -- Convert Square Inches to Hectares , sqInTOhec -- Convert Square Inches to Acres , sqInTOacre -- Convert Squar...
Cortlandd/ConversionFormulas
src/Ghazan/Area.hs
bsd-3-clause
1,308
0
6
293
369
196
173
31
1
-- This is the leftmost column -- Its' fine for top level declarations to start in any column... firstGoodIndentation = 1 -- ...provided all subsequent declarations do, too! secondGoodIndentation = 2
NeonGraal/rwh-stack
ch03/GoodIndent.hs
bsd-3-clause
210
0
4
41
14
9
5
2
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. {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Distance.Rules ( rules ) where i...
facebookincubator/duckling
Duckling/Distance/Rules.hs
bsd-3-clause
897
0
16
173
178
109
69
23
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE...
boothead/hierarchy
src/Hierarchy.hs
bsd-3-clause
7,455
0
15
2,063
2,603
1,435
1,168
-1
-1
{- $Id: IdentityList.hs,v 1.2 2003/11/10 21:28:58 antony Exp $ ****************************************************************************** * I N V A D E R S * * * * Module: Ide...
markgrebe/Blankeroids
IdentityList.hs
bsd-3-clause
5,842
9
13
1,591
1,386
789
597
75
3
{-# Language OverloadedStrings #-} {-| Module : Client.State.Extensions Description : Integration between the client and external extensions Copyright : (c) Eric Mertens, 2018 License : ISC Maintainer : emertens@gmail.com This module implements the interaction between the client and its extensions. This in...
dolio/irc-core
src/Client/State/Extensions.hs
isc
8,285
0
20
2,487
2,063
1,067
996
-1
-1
module CIDemo.Api.Reverse.Internal where import Prelude hiding (reverse) import Rest import qualified Rest.Resource as R import CIDemo.Types resource :: Resource CIDemo CIDemo () Void Void resource = mkResourceId { R.name = "reverse" , R.schema = noListing $ name...
AndrewRademacher/ci-demo-cloudfoundry
src/CIDemo/Api/Reverse/Internal.hs
mit
546
0
10
159
176
100
76
15
1
-- | -- Module: Math.NumberTheory.Primes.Factorisation.Utils -- Copyright: (c) 2011 Daniel Fischer -- Licence: MIT -- Maintainer: Daniel Fischer <daniel.is.fischer@googlemail.com> -- Stability: Provisional -- Portability: Non-portable (GHC extensions) -- -- Some utilities related to factorisation, defined...
shlevy/arithmoi
Math/NumberTheory/Primes/Factorisation/Utils.hs
mit
2,860
0
16
596
808
461
347
45
6
{-# LANGUAGE ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- -- Module : Base -- Copyright : -- License : MIT -- -- Maintainer : agocorona@gmail.com -- Stability : -- Portability : -- -- | Transient provides high level concurrency allowing you to...
agocorona/transient
src/Transient/Base.hs
mit
12,207
0
5
2,169
440
384
56
14
0
wabbits factor = map fst $ iterate (\(n0, n1) -> (n1, n0 * factor + n1)) (1, 1) wabbitCount factor months = last $ take months $ wabbits factor main = do putStrLn "huh?"
abingham/rosalind
wabbits.hs
mit
174
0
11
38
90
46
44
4
1
module DetalhesSobreListasERecursao where import IntroducaoAProgramacaoFuncionalEHaskell -- notação alternativa procIndice l i = case l of [] -> [] (e:l) -> if (i == 0) then [e] else procIndice l (i-1) -- Testando i1 = procurarIndice [12,3,4,5,...
henvic/plc
src/DetalhesSobreListasERecursao.hs
cc0-1.0
1,782
0
11
501
794
428
366
36
3
module SimilarNegation where test :: Float test = - (3.0 + 6.0) test' :: Int test' = - 3 {- dit zijn nu syntax errors: test'' :: Float -> Float test'' (- 1.0) = 1.0 test'' x = x +. 1.0 test''' :: Int -> Bool test''' (-. 1) = True test''' _ = False -}
roberth/uu-helium
test/typeerrors/Heuristics/SimilarNegation.hs
gpl-3.0
265
0
7
70
36
22
14
5
1
main = 3/0
roberth/uu-helium
test/simple/thompson/Thompson33.hs
gpl-3.0
11
0
5
3
10
5
5
1
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
olorin/amazonka
amazonka-ec2/gen/Network/AWS/EC2/ImportSnapshot.hs
mpl-2.0
6,545
0
14
1,395
1,102
652
450
127
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-iam/gen/Network/AWS/IAM/DeleteGroup.hs
mpl-2.0
2,872
0
9
606
364
223
141
51
1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ur-PK"> <title>Code Dx | ZAP Extension</title> <maps> <homeID>top</homeID> <mapref loc...
veggiespam/zap-extensions
addOns/codedx/src/main/javahelp/org/zaproxy/zap/extension/codedx/resources/help_ur_PK/helpset_ur_PK.hs
apache-2.0
969
80
66
160
415
210
205
-1
-1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : Clr.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:43 Warning : this file is machine generated - do not modif...
keera-studios/hsQt
extra-pkgs/Glome/Qt/Glome/Clr.hs
bsd-2-clause
1,373
0
9
323
551
296
255
35
4
-- | -- Module : Crypto.Random.Entropy.Unix -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : Good -- {-# LANGUAGE ScopedTypeVariables #-} module Crypto.Random.Entropy.Unix ( DevRandom , DevURandom ) where import Foreign.Ptr ...
nomeata/cryptonite
Crypto/Random/Entropy/Unix.hs
bsd-3-clause
2,355
0
14
518
710
371
339
50
2
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Update -- Copyright : (c) David Himmelstrup 2005 -- License : BSD-like -- -- Maintainer : lemmih@gmail.com -- Stability : provisional -- Portability : portable -- -- -------------------...
randen/cabal
cabal-install/Distribution/Client/Update.hs
bsd-3-clause
2,667
0
19
572
562
305
257
49
3
{-# LANGUAGE OverloadedStrings #-} {-| A WAI adapter to the HTML5 Server-Sent Events API. -} module Network.Wai.EventSource ( ServerEvent(..), eventSourceAppChan, eventSourceAppIO ) where import Blaze.ByteString.Builder (Builder) import Data.Function (fix) import Contr...
jberryman/wai
wai-extra/Network/Wai/EventSource.hs
mit
1,330
0
16
324
276
154
122
26
2
{-# OPTIONS -XOverloadedStrings #-} import Network.AMQP import qualified Data.ByteString.Lazy.Char8 as BL import qualified Data.Text as DT import System.Environment (getArgs) import Text.Printf logsExchange = "direct_logs" main :: IO () main = do args <- getArgs let body = bodyFor args severi...
bwong199/rabbitmq-tutorials
haskell/emitLogDirect.hs
apache-2.0
1,048
0
13
309
280
147
133
28
1
import Data.List main = print $ fst $ max' [ (n,d) | d <- [1..1000000], n <- [3*d `div` 7 .. d `div` 2], gcd d n == 1, toFloat (n,d) < toFloat (3,7) ] toFloat :: (Int, Int) -> Float toFloat (a,b) = (fromIntegral a) / (fromIntegral b) max' :: [(Int, Int)] -> (Int, Int) max' [x] = x max' [(a,b),(c,d)] = if a*d > c*b ...
lekto/haskell
Project-Euler-Solutions/problem0071.hs
mit
387
0
12
84
291
164
127
8
2
{-# LANGUAGE TypeFamilies #-} module SoOSiM.Components.ResourceManager.Interface where import Data.HashMap.Strict (empty) import SoOSiM import SoOSiM.Components.Common import SoOSiM.Components.ResourceDescriptor import {-# SOURCE #-} SoOSiM.Components.ResourceManager.Behaviour (behaviour) import SoOSiM.Components.Re...
christiaanb/SoOSiM-components
src/SoOSiM/Components/ResourceManager/Interface.hs
mit
1,878
0
14
310
512
266
246
32
2
module CFDI.Types.Locality where import CFDI.Types.Type import Control.Error.Safe (justErr) import Text.Read (readMaybe) newtype Locality = Locality Int deriving (Eq, Read, Show) instance Type Locality where parseExpr c = justErr NotInCatalog maybeLocality where maybeLocality = Locality <$> (rea...
yusent/cfdis
src/CFDI/Types/Locality.hs
mit
555
0
13
152
204
105
99
14
0
{-# LANGUAGE Safe #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} -- | Common types for the FP15 compiler. module FP15.Compiler.Types ( ImportedNames(..) , module FP15.Compiler.Types , module FP15.Compiler.Lookup , module FP15.Comp...
Ming-Tang/FP15
src/FP15/Compiler/Types.hs
mit
4,905
0
10
1,069
1,067
594
473
-1
-1
n = a `div` length xs where a = 10 xs = [1, 2, 3, 4, 5] last xs = drop (length xs - 1) xs
jugalps/edX
FP101x/week1/ex1.hs
mit
105
0
8
41
65
36
29
4
1
replaceWithP :: b -> Char replaceWithP = const 'p' lms :: [Maybe [Char]] lms = [Just "Ave", Nothing, Just "woohoo"] replaceWithP' :: [Maybe [Char]] -> Char replaceWithP' = replaceWithP liftedReplace :: Functor f => f a -> f Char liftedReplace = fmap replaceWithP liftedReplace' :: [Maybe [Char]] -> [Char] liftedRepl...
JustinUnger/haskell-book
ch16/functor-ex.hs
mit
813
0
9
170
304
151
153
24
1
{-# OPTIONS_GHC -F -pgmF htfpp #-} import Test.Framework import {-@ HTF_TESTS @-} TestLabyrinthServer import {-@ HTF_TESTS @-} TestLabyrinthServer.JSON main = htfMain htf_importedTests
koterpillar/labyrinth-server
testsuite/TestMain.hs
mit
188
0
5
25
25
15
10
5
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} -- | provide backends for `katip` module Pos.Util.Log.Scribes ( mkStdoutScribe , mkStderrScribe , mkDevNullScribe , mkTextFileScribe , mkJsonFileScribe ) where import Universum import Control.AutoUpdate (Up...
input-output-hk/pos-haskell-prototype
util/src/Pos/Util/Log/Scribes.hs
mit
7,555
0
20
2,072
1,936
996
940
144
8
module BlogToolsSpec where import Test.Hspec import Test.QuickCheck import Control.Exception (evaluate) import Web.Blog.Tools spec :: Spec spec = do describe "hoge" $ do it "return hoge" $ do "hoge" `shouldBe` "hoge"
suzuki-shin/blogtools
test/BlogToolsSpec.hs
mit
231
0
13
44
69
38
31
10
1
module Main where import LLVM.Context import LLVM.Pretty (ppllvm) import qualified LLVM.Module as M import Control.Monad (filterM) import Control.Monad.Except import Data.Functor import qualified Data.Text.Lazy as T import qualified Data.Text.Lazy.IO as T import System.IO import System.Exit import System.Directory ...
llvm-hs/llvm-hs-pretty
tests/Main.hs
mit
1,467
0
21
251
413
215
198
40
1
{-# LANGUAGE EmptyDataDecls #-} module Grid ( Grid(..), InUse, Won, Tied, GridIndex, Either3(..), emptyGrid, showGrid, printGrid, getSquareAt, isSquareX, isSquareEmpty, isValidMove, setSquare, isGridFull, isGridWon, finalizeGridIfGameFinished ) where import Prelude hiding (Either(..)) import Dat...
Purlox/Foxe-Wolf-Pone
src/Grid.hs
mit
3,452
38
11
864
1,318
729
589
-1
-1
module Main where import Lib main :: IO () main = someFunc cup f1Oz = \message -> message f1Oz coffeeCup = cup 12 getOz aCup = aCup (\f1Oz -> f1Oz) drink aCup ozDrank = if ozDiff >= 0 then cup ozDiff else cup 0 where flOz = getOz aCup ozDiff = flOz - ozDrank isEmpty aCup = getOz aCup == 0 afte...
NickAger/LearningHaskell
GetProgrammingWithHaskell/10-FunctionalOOWithRobots/FunctionalOOWithRobots/app/Main.hs
mit
1,848
0
12
345
740
405
335
38
2
module Main (main) where import qualified Gennoise main :: IO () main = Gennoise.main
danplubell/color-noise
executable/Main.hs
mit
88
0
6
16
30
18
12
4
1
module Database.Kayvee.Common where import Prelude hiding (catch) import Control.Applicative((<$>)) import Control.Exception import Data.Hash.MD5 import Data.Word import Data.Binary.Get import Data.Binary.Put import Data.Bits import Data.List (genericLength) import Data.ByteString.Char8 (pack) import qualified Data.By...
deweyvm/kayvee
src/Database/Kayvee/Common.hs
mit
4,752
0
17
1,386
1,801
913
888
142
3
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.PerformanceObserverEntryList (getEntries, getEntries_, getEntriesByType, getEntriesByType_, getEntriesByN...
ghcjs/jsaddle-dom
src/JSDOM/Generated/PerformanceObserverEntryList.hs
mit
3,685
0
12
598
743
428
315
55
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/SecretKeySelector.hs
mit
1,574
0
14
444
277
166
111
31
1
module Feature.AuthSpec where import Network.Wai (Application) import Network.HTTP.Types import Test.Hspec import Test.Hspec.Wai import Test.Hspec.Wai.JSON import Text.Heredoc import PostgREST.Types (PgVersion, pgVersion112) import Protolude hiding (get) import SpecHelper spec :: PgVersion -> SpecWith Applica...
diogob/postgrest
test/Feature/AuthSpec.hs
mit
8,581
0
17
1,642
1,135
622
513
-1
-1
module Types ( Mass ) where type Mass = Float
ThatSnail/hs-softbody
Types.hs
mit
57
0
4
21
15
10
5
3
0
data BExp = T | F | Var Int | Neg BExp | Disj BExp BExp | Conj BExp BExp deriving Show eval :: (Int -> Bool) -> BExp -> Bool eval _ T = True eval _ F = False eval f (Var i) = f i eval f (Neg e) = not (eval f e) eval f (Disj a b) = (eval f a) || (eval f b) ev...
kdungs/coursework-functional-programming
07/bool.hs
mit
990
0
12
306
551
282
269
29
1
import Data.MotionPlanningProblem import Data.Spaces.StandardSpace import Planners.RRT fk :: [(Double, Double)] -> [(Double, Double)] fk links = let (jointAngles, linkLengths) = unzip links angleSums = scanl1 (+) jointAngles xs = scanl1 (+) $ zipWith (*) linkLengths $ map cos angleSums ys = scanl1 ...
giogadi/hs-motion-planning
app-src/Examples/RRTPSMExample.hs
mit
1,792
0
14
424
657
344
313
45
1
-- That's mean -- http://www.codewars.com/kata/54b709b811ac249fdb000296 module Mean where mean :: (Integral a, Fractional b) => [a] -> b mean xs = fromIntegral (sum xs) / fromIntegral (length xs)
gafiatulin/codewars
src/Beta/Mean.hs
mit
198
0
8
30
63
34
29
3
1
{-# LANGUAGE Arrows, FlexibleContexts #-} module QNDA.Toc where import Text.XML.HXT.Core hiding (xshow) import Data.Hashable ( hash ) import Control.Monad.State as S hiding (when) import Data.Char (chr) --import qualified Debug.Trace as DT (trace) type HeaderTag = String -- h1, h2, and so on. type Heade...
k16shikano/wikipepub
QNDA/Toc.hs
mit
6,445
0
24
1,387
2,588
1,398
1,190
123
3