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
data Lista a = Nill | Cost a (Lista a) deriving (Show, Eq, Ord) ordenada :: (Ord a) => [Int] -> Bool ordenada [] = error "La lista esta vacia" ordenada [n] = True ordenada (n:m:p) = if n<m then ordenada (m:p) else False
josegury/HaskellFuntions
Listas/Boolean-ListaOrdenadaAsc.hs
mit
222
0
8
46
123
66
57
5
2
module GHCJS.DOM.SVGComponentTransferFunctionElement ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/SVGComponentTransferFunctionElement.hs
mit
65
0
3
7
10
7
3
1
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Codegen where import Data.Word import Data.String import Data.List import Data.Function import qualified Data.Map as Map import Control.Monad.State import Control.Applicative import LLVM.General.AST import LLVM.General.AST.Global i...
kkspeed/Kaleidoscope
Codegen.hs
mit
6,633
0
13
1,471
2,529
1,326
1,203
177
2
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} module Control.Disruptor.DataProvider where import Control.Disruptor.Sequence class DataProvider p a | p -> a where get :: p -> SequenceId a -> IO a
iand675/disruptor
src/Control/Disruptor/DataProvider.hs
mit
233
0
9
36
51
29
22
6
0
-- Consecutive strings -- http://www.codewars.com/kata/56a5d994ac971f1ac500003e/ module Codewars.G964.Longestconsec where import Data.List (unfoldr, maximumBy) import Control.Arrow ((&&&)) import Data.Function (on) longestConsec :: [String] -> Int -> String longestConsec strarr k | n == 0 || k > n || k <= 0 = "" ...
gafiatulin/codewars
src/6 kyu/Longestconsec.hs
mit
644
0
14
177
249
134
115
9
2
----------------------------------------------------------------------------- -- -- Module : Network.Google.Picasa -- Copyright : (c) 2013 Brian W Bush -- License : MIT -- -- Maintainer : Brian W Bush <b.w.bush@acm.org> -- Stability : Stable -- Portability : Portable -- -- | Functions for accessing ...
rrnewton/hgdata_trash
src/Network/Google/Picasa.hs
mit
3,897
0
12
760
594
341
253
68
2
module Handler.Game where import Import import Api.StatusResponse import Game.GameState import Game.Lexicon import Text.Shakespeare.Text import Util.Message import Yesod.Auth getGameR :: Handler Html getGameR = do mUserId <- maybeAuthId case mUserId of Just userId -> do gameState <- runDB ...
dphilipson/word_guesser_web
Handler/Game.hs
mit
2,008
0
22
701
482
227
255
-1
-1
-- file: ch04/EfficientList.hs -- From chapter 4, http://book.realworldhaskell.org/read/functional-programming.html myDumbExample xs = if length xs > 0 then head xs else 'Z' mySmartExample xs = if not (null xs) then head xs else 'Z' myOt...
Sgoettschkes/learning
haskell/RealWorldHaskell/ch04/EfficientList.hs
mit
365
0
8
124
82
42
40
8
2
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -- | How each type of message is sent (within a Hetcons Transaction). -- In the simplest case, we simply `add_sent`, which merely adds...
isheff/hetcons
src/Hetcons/Send.hs
mit
7,711
0
13
1,874
1,616
858
758
86
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGAnimatedString (js_setBaseVal, setBaseVal, js_getBaseVal, getBaseVal, js_getAnimVal, getAnimVal, SVGAnimatedString, castToSVGAnimatedString, gTypeSVGAnimatedString) where import Pr...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/SVGAnimatedString.hs
mit
2,368
20
11
330
562
334
228
40
1
t1 = [True, True] t2 = [True, False] t3 = [] and0 :: [Bool] -> Bool and0 [] = True and0 (b:bs) = b && and0(bs) concat0 :: [[a]] -> [a] concat0 [] = [] concat0 (a : as) | null as = a | otherwise = a ++ concat0 as replicate0 :: Int -> a -> [a] replicate0 0 x = [] replicate0 n x = x : re...
codingSteve/fp101x
20151019/recursion.hs
cc0-1.0
1,742
2
9
622
810
426
384
-1
-1
module Stack ( Stack (..) , StackElem , poppush , push , top ) where data Stack = Stack { values :: [Double] } type StackElem = Double poppush :: Int -> StackElem -> Stack -> Stack poppush n el st = Stack $ drop n (values st) ++ [el] push :: StackElem -> Stack -> Stack push = poppush 0 top :: Stack -> Maybe StackE...
matthiasbeyer/rpnc
src/Stack.hs
gpl-2.0
423
0
9
113
174
96
78
16
2
{-# LANGUAGE CPP, ScopedTypeVariables, OverloadedStrings #-} module OfficialServer.DBInteraction ( startDBConnection ) where import Prelude hiding (catch); import Control.Concurrent import Control.Monad import Data.List as L import Data.ByteString.Char8 as B #if defined(OFFICIAL_SERVER) import System.Process impor...
jeffchao/hedgewars-accessible
gameServer/OfficialServer/DBInteraction.hs
gpl-2.0
4,779
0
24
1,342
1,407
716
691
25
4
module AntBrain where import AntSkull import Prelude hiding (drop, Right, Left, (&&), (||)) -- The markers _FOEHOME = 0 _FOOD = 1 _PATH = 5 main = debug $ program 0 test _this = do search 0 0 0 -- Our strategy program :: Entry -> M () program _Search = do _TellFoeHome <- alloc _TellFood <- a...
Chiel92/ants
AntBrain.hs
gpl-2.0
6,462
0
10
1,605
1,405
647
758
127
1
-- | Memory for P -- | Juan García Garland module Memory (Index, Memory, lookUp, update, emptyMemory, singletonMemory) where -- | Variables in P are of the form Xk where k is an integer, -- | The memory is a function from Int (the k idex) to ...
jota191/PLang
src/Memory.hs
gpl-3.0
1,532
0
13
543
381
221
160
24
2
{-# LANGUAGE BangPatterns #-} module Main where import Control.Monad.State.Strict (State, evalState, state) import Data.Vector (Vector, replicate, replicateM, sum, zipWith) import System.Environment (getArgs) import System.Exit (die) import System.Random (Random, RandomGen, mkStdGen, randomR) import Text.Read (readMa...
Tuplanolla/ties341-profiling
Step6.hs
gpl-3.0
4,191
7
21
1,765
1,361
713
648
124
3
module Reexport2 where import Reexport3 q = 4
roberth/uu-helium
test/correct/Reexport2.hs
gpl-3.0
48
0
4
10
12
8
4
3
1
-- | -- Copyright : (c) 2010, 2011 Benedikt Schmidt & Simon Meier -- License : GPL v3 (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Portability : GHC only -- -- Support for interaction with the console: argument parsing. {-# LANGUAGE TemplateHaskell #-} module Main.Console ( default...
kmilner/tamarin-prover
src/Main/Console.hs
gpl-3.0
7,752
0
18
1,999
1,397
786
611
143
2
{-# LANGUAGE BangPatterns #-} import System.Directory import System.FilePath import Control.DeepSeq import Criterion.Main import Brnfckr.Parse (parseBrainFuck) import Brnfckr.Eval import Paths_brnfckr sourceBlacklist :: [FilePath] sourceBlacklist = [ "tests.bf" ] runBlacklist = sourceBlacklist ++ [ "mand...
johntyree/brnfckr
src/benchmarks/ParseBench.hs
gpl-3.0
1,491
1
15
351
458
233
225
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Debugger.Types.Sum -- Copyright : (c) 2015-2016 Brenda...
rueshyna/gogol
gogol-debugger/gen/Network/Google/Debugger/Types/Sum.hs
mpl-2.0
6,467
0
11
1,604
1,004
543
461
122
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-serviceusage/gen/Network/Google/Resource/ServiceUsage/Operations/Delete.hs
mpl-2.0
4,853
0
15
1,099
703
413
290
100
1
{-# LANGUAGE FlexibleContexts, FlexibleInstances, TypeFamilies #-} module Math.Topology.KnotTh.Tangle.CascadeCode ( CascadePattern(..) , decodeCascadeCode , decodeCascadeCodeFromPairs ) where import Control.Arrow (first) import Data.Char (isSpace) import Text.Printf import Math.Topology.KnotTh.Knotted ...
mishun/tangles
src/Math/Topology/KnotTh/Tangle/CascadeCode.hs
lgpl-3.0
2,844
0
15
755
915
514
401
67
4
{-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {- | Module : Data.DRS.Show Copyright : (c) Harm Brouwer and Noortje Venhuizen License : Apache-2.0 Maintainer : me@hbrouwer.eu, n.j.venhuizen@rug.nl Stability : provisional Portability : portable DRS pretty printing -} modu...
drbean/pdrt-sandbox
src/Data/DRS/Show.hs
apache-2.0
20,058
0
15
3,888
5,317
2,723
2,594
271
7
import System.Random rndSelect :: [a] -> Int -> IO [a] rndSelect vals n = do g <- newStdGen let indices = take n $ randomRs (0, length vals - 1) g return (map (\i -> vals !! i) indices)
plilja/h99
p23.hs
apache-2.0
231
0
14
84
105
52
53
5
1
module Main where import Digits import Lists import Primes import Data.List import Debug.Trace findPandigitalsWithDivisibility = map digitsToNum $ filter (\pd -> notStartingWith0 pd && subStringDivisible pd) allPandigitals where allPandigitals = permutations [0..9] -- [digits 1406357289] notStartingWith0 = ...
kliuchnikau/project-euler
043/Main.hs
apache-2.0
571
0
11
99
174
94
80
13
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {- | Module : Neovim.User.Choice Description : Ask the user for an answer Copyright : (c) Sebastian Witte License : Apache-2.0 Maintainer : woozletoff@gmail.com Stability : experimental Portability : GHC -} module Neovim.User.C...
neovimhaskell/nvim-hs-contrib
library/Neovim/User/Choice.hs
apache-2.0
2,290
0
17
664
558
284
274
38
4
module Import ( module Import ) where import Prelude as Import hiding (head, init, last, readFile, tail, writeFile) import Yesod as Import hiding (Route (..)) import Control.Applicative as Import (pure, (<$>), (<*>)) import Data.Text ...
HairyDude/heal
Import.hs
bsd-2-clause
1,023
0
6
425
159
116
43
-1
-1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} module System.IO ( IO, Handle, IOMode, SeekMode, FilePath, HandlePosn, IOException (..), IOErrorType (..), stdin, stdout, stderr, withFile, openFile, hClose, readFile, writeFile, appendFile, doesFileExist, hFileSize, hSetFileSize, hIsE...
3of8/mockio
New_IO.hs
bsd-2-clause
1,035
0
5
154
244
164
80
18
0
{-# LANGUAGE BangPatterns, CPP, FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving, InstanceSigs, RankNTypes, ScopedTypeVariables, TypeFamilies, UndecidableInstances #-} module Text.Grampa.ContextFree.SortedMemoizing.Transformer (ResultListT(..), ParserT(..), (<<|>), ...
blamario/grampa
grammatical-parsers/src/Text/Grampa/ContextFree/SortedMemoizing/Transformer.hs
bsd-2-clause
26,644
67
20
6,991
9,826
5,040
4,786
397
4
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QGraphicsSceneWheelEvent.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:24 Warning : this file is machine gen...
uduki/hsQt
Qtc/Gui/QGraphicsSceneWheelEvent.hs
bsd-2-clause
8,775
0
12
1,142
2,162
1,103
1,059
-1
-1
{-# LANGUAGE FlexibleInstances #-} module Model.ImageCache where import Prelude import Data.Convertible import Data.Text (Text) import Database.HDBC import qualified Data.ByteString as B import Model.Query data CachedImage = CachedImage B.ByteString | CachedError String instance Convertible [SqlVal...
jannschu/bitlove-ui
Model/ImageCache.hs
bsd-2-clause
1,376
0
13
378
330
166
164
-1
-1
{-# LANGUAGE OverloadedStrings #-} module HerokuBuild.API ( ApiKey , getHeroku , postHeroku , postHeroku' ) where import Data.Aeson import Data.ByteString (ByteString) import Network.HTTP.Conduit import Network.HTTP.Types import qualified Data.ByteString.Lazy as L type ApiKey = ByteString getHero...
pbrisbin/heroku-build
src/HerokuBuild/API.hs
bsd-3-clause
1,657
0
13
341
575
305
270
37
1
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} {-# LANGUAGE ConstraintKinds #-} module Fragment.If.Rules.Term ( IfEvalConstraint , ifEvalRules ) where import Control.Lens (review, preview) import Rules.Te...
dalaing/type-systems
src/Fragment/If/Rules/Term.hs
bsd-3-clause
1,216
0
11
283
471
245
226
28
2
import Data.List (unfoldr, foldl') import Data.Bool (bool) mapRaw, mapF, mapU :: (a -> b) -> [a] -> [b] mapRaw f (x : xs) = f x : mapRaw f xs mapRaw _ _ = [] mapF f = foldr ((:) . f) [] mapU f = unfoldr $ \l -> case l of x : xs -> Just (f x, xs) _ -> Nothing filterRaw, filterF :: (a -> Bool) -> [a] -> [a] filterR...
YoshikuniJujo/funpaala
samples/18_list_std_fun/stdFun.hs
bsd-3-clause
3,276
6
14
851
2,168
1,185
983
94
2
{-# LANGUAGE OverloadedStrings #-} module CouchGames.ResistanceSpec (resistanceSpec) where import Test.Hspec import Data.Either import Control.Monad import CouchGames.Game import CouchGames.Player import qualified CouchGames.Resistance as R comOnlyConfig = R.GameConfig { R.commander = True, R.bodyGuard = False } bod...
alexlegg/couchgames
test/CouchGames/ResistanceSpec.hs
bsd-3-clause
15,371
0
39
5,318
5,388
2,846
2,542
272
3
{-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {- | Module : Kiosk.Backend.Data.DataTemplateEntry Description : Individual Entries for Da...
plow-technologies/cobalt-kiosk-data-template
src/Kiosk/Backend/Data/DataTemplateEntry.hs
bsd-3-clause
11,240
0
11
3,769
2,035
1,147
888
180
2
{-# LANGUAGE FlexibleContexts #-} module Control.Concurrent.Timer.Lifted ( Timer , TimerIO , oneShotTimer , oneShotStart , oneShotRestart , repeatedTimer , repeatedStart , repeatedRestart , newTimer , stopTimer ) where ------------------------------------------------------------------------------ import ...
uwap/timers
src/Control/Concurrent/Timer/Lifted.hs
bsd-3-clause
7,919
0
14
2,129
1,300
665
635
122
3
module Blog.FrontEnd.Urls where import Blog.Constants as C import List (intersperse) all_posts :: String all_posts = C.base_url ++ "/articles" posts_by_tag :: String -> String posts_by_tag t = "/t/" ++ t posts_by_tags :: [String] -> String posts_by_tags t = "/t/" ++ (tags_fragment t) post :: String -> String post ...
prb/perpubplat
src/Blog/FrontEnd/Urls.hs
bsd-3-clause
1,297
0
7
193
389
208
181
32
1
{-# LANGUAGE TypeOperators , FlexibleContexts , FlexibleInstances , OverloadedStrings #-} module Xml.XPath.Evaluator where import Control.Category import Control.Arrow import Control.Arrow.ArrowF import Control.Arrow.List import Data.Attoparsec.Text (Number) import Data.Text (Text) import Text.XmlHtml (Nod...
silkapp/xmlhtml-xpath
src/Xml/XPath/Evaluator.hs
bsd-3-clause
6,398
0
12
1,770
2,818
1,450
1,368
124
18
{-# LANGUAGE TupleSections #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fspec-constr-count=5 #-} -- | Module used for JPEG file loading and writing. ...
Chobbes/Juicy.Pixels
src/Codec/Picture/Jpg.hs
bsd-3-clause
45,788
0
24
14,839
11,292
6,003
5,289
-1
-1
{-# LANGUAGE RankNTypes #-} module Data.Type.Nat.Util where import Data.Type.Nat withNat :: Integer -> (forall n. Nat n -> Maybe r) -> Maybe r withNat x f = case compare x 0 of LT -> Nothing EQ -> f Z_ GT -> withNat (x - 1) (f . S_)
mstksg/tensor-ops
src/Data/Type/Nat/Util.hs
bsd-3-clause
270
0
10
85
108
57
51
11
3
import Data.List (sort) import Graphics.Rendering.Chart.Simple import Data.Random.Normal -- | The integral of the probability density from -inf to x for -- the normal distribution with mean 0 and standard deviation 1. -- This formula is an approximation taken from Beta. normalDistribution :: Double -> Double normalD...
bjornbm/normaldistribution
Test.hs
bsd-3-clause
707
1
13
149
240
129
111
14
2
module Husky.Network ( allHostAddrs ) where import Network.Info import Control.Monad import Data.Bits import Data.Binary import Data.Binary.Put -- | return all IPv4 address of local computer allHostAddrs :: IO [String] allHostAddrs = (map show . filter wanted . map ipv4) `liftM` getNet...
abaw/husky
Husky/Network.hs
bsd-3-clause
479
1
10
134
134
72
62
12
1
--------------------------------------------------------------- -- | -- Module : Data.Minecraft.Release17.Version -- Copyright : (c) 2016 Michael Carpenter -- License : BSD3 -- Maintainer : Michael Carpenter <oldmanmike.dev@gmail.com> -- Stability : experimental -- Portability : portable -- --...
oldmanmike/hs-minecraft-protocol
src/Data/Minecraft/Release17/Version.hs
bsd-3-clause
613
0
4
101
59
41
18
10
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.Ordinal.KO.Rules ( rules ) where im...
facebookincubator/duckling
Duckling/Ordinal/KO/Rules.hs
bsd-3-clause
890
0
16
174
182
112
70
24
2
{-# LANGUAGE CPP, TypeFamilies #-} -- ----------------------------------------------------------------------------- -- | This is the top-level module in the LLVM code generator. -- module LlvmCodeGen ( llvmCodeGen, llvmFixupAsm ) where #include "HsVersions.h" import Llvm import LlvmCodeGen.Base import LlvmCodeGen.Co...
mcschroeder/ghc
compiler/llvmGen/LlvmCodeGen.hs
bsd-3-clause
7,212
0
20
1,958
1,591
792
799
134
3
{- | Module : Glutton.Subscription.Types Description : data types and instances for @Subscription@ and @ItemState@ -} {-# LANGUAGE DeriveDataTypeable, TemplateHaskell, TypeFamilies #-} module Glutton.Subscription.Types where import Control.Monad.Reader (ask) import Control.Monad.State (put) import Data.Acid impor...
alancocanour/glutton
src/Glutton/Subscription/Types.hs
bsd-3-clause
2,849
0
11
583
668
396
272
83
1
module Parse.PatternTest where import Test.Tasty import Test.Tasty.HUnit import Parse.Pattern import AST.V0_16 import AST.Pattern import Parse.TestHelpers pending = at 0 0 0 0 Anything example name input expected = testCase name $ assertParse expr input expected tests :: TestTree tests = testGro...
nukisman/elm-format-short
tests/Parse/PatternTest.hs
bsd-3-clause
6,554
0
23
1,497
3,016
1,518
1,498
66
1
{-# LANGUAGE TemplateHaskell #-} module Code.LZ.Data where import Code.Type ( BitSize (..), bits ) import Autolib.Reader import Autolib.ToDoc import Autolib.Size import Autolib.Set import Autolib.FiniteMap import Data.Typeable data Lempel_Ziv_Welch = Lempel_Ziv_Welch deriving ( Eq, Ord, Typeable ) data Lempel_Zi...
florianpilz/autotool
src/Code/LZ/Data.hs
gpl-2.0
1,906
0
14
584
726
399
327
-1
-1
{-# LANGUAGE StrictData #-} {-# LANGUAGE Trustworthy #-} module Network.Tox.DHT.DhtRequestPacketSpec where import Test.Hspec import Data.Proxy (Proxy (..)) import Network.Tox.DHT.DhtRequestPacket (DhtRequestPacket (..)) import Network.Tox.EncodingSpec s...
iphydf/hs-toxcore
test/Network/Tox/DHT/DhtRequestPacketSpec.hs
gpl-3.0
482
0
9
117
106
62
44
12
1
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE ViewPatterns #-} module Data.IRC.Znc.Parse where import Control.Applicative import qualified Control.Exception as Ex import Data.Attoparsec (Parser) import qualified Data.Attoparsec as P import Data.ByteString (ByteString) import qualified Data....
plow-technologies/ircbrowse
src/Data/IRC/Znc/Parse.hs
bsd-3-clause
4,784
0
22
1,085
1,548
826
722
101
3
{-# LANGUAGE CPP #-} module System.Console.Haskeline.Backend.Win32.Echo (hWithoutInputEcho) where import Control.Exception (throw) import Control.Monad (void) import Control.Monad.Catch (MonadMask, bracket) import Control.Monad.IO.Class (MonadIO(..)) import System.Exit (ExitCode(..)) import System.IO (Handle, hGetCo...
judah/haskeline
System/Console/Haskeline/Backend/Win32/Echo.hs
bsd-3-clause
7,499
0
16
1,496
1,238
684
554
56
2
{-# LANGUAGE Haskell2010 #-} {-# LINE 1 "System/Posix.hs" #-} {-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | -- Module : System.Posix -- Copyright : (c) The University of Glasgow 2...
phischu/fragnix
tests/packages/scotty/System.Posix.hs
bsd-3-clause
4,209
0
5
563
245
176
69
37
0
module Graphics.Wayland.Scanner.Names ( ServerClient(..), registryBindName, -- apparently we are not allowed to use foreign C names generated by the C scanner requestInternalCName, eventInternalCName, -- requestForeignCName, eventForeignCName, requestHaskName, eventHaskName, interfaceTypeName, interface...
abooij/haskell-wayland
Graphics/Wayland/Scanner/Names.hs
mit
3,992
0
9
627
929
486
443
59
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-rds/gen/Network/AWS/RDS/DescribeEvents.hs
mpl-2.0
8,647
0
12
1,914
1,195
713
482
114
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Code generator utilities; mostly monadic -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmUtils ( cgLit, mkSimpleL...
AlexanderPankiv/ghc
compiler/codeGen/StgCmmUtils.hs
bsd-3-clause
22,985
0
15
5,429
4,876
2,592
2,284
-1
-1
-- ----------------------------------------------------------------------------- -- | -- Module : Text.IPv6Addr -- Copyright : Copyright © Michel Boucey 2011-2015 -- License : BSD-Style -- Maintainer : michel.boucey@gmail.com -- -- Dealing with IPv6 address text representations, canonization and manipu...
beni55/attoparsec
tests/QC/IPv6/Internal.hs
bsd-3-clause
12,259
0
25
3,915
3,059
1,588
1,471
219
18
{-# LANGUAGE GADTs #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wincomplete-patterns #-} module Bug where import Data.Type.Equality data G a where GInt :: G Int GBool :: G Bool ex1, ex2, ex3 :: a :~: Int -> G a -> () ex1 Refl g | GInt <- id g = () ex2 Refl g | GInt <- g = () ex3 Refl g ...
sdiehl/ghc
testsuite/tests/pmcheck/should_compile/T15753a.hs
bsd-3-clause
354
0
9
105
132
70
62
21
1
module SplitAt2 where {- splitIt n xs = splitAt (n - 1) xs -} splitIt n xs = case (n-1, xs) of (0, xs) -> ("", xs) (_, "") -> ("","") (m, (x:xs)) -> (x:xs', xs'') where (xs', xs'') = splitAt (m-1) xs {- this time the where is bound to the case alter...
kmate/HaRe
old/testing/generativeFold/SplitAtIn2.hs
bsd-3-clause
507
0
12
181
122
72
50
6
3
{-# LANGUAGE PatternSynonyms #-} module PolyPat where -- Testing whether type changing updates work correctly. pattern MyTuple :: a -> b -> (a, b) pattern MyTuple{mfst, msnd} = (mfst, msnd) expr1 :: (Int, String) -> (Int, Int) expr1 a = a { msnd = 2} expr3 a = a { msnd = 2} expr2 :: (a, b) -> a expr2 a = mfst a
snoyberg/ghc
testsuite/tests/patsyn/should_compile/records-poly.hs
bsd-3-clause
319
0
8
70
129
75
54
9
1
-- (c) Florian Mayer <flormayer@aim.com> under the ISC license. -- See COPYING for more details. dividesany ns x = any (\y -> rem x y == 0) ns main = print (sum (filter (dividesany [3, 5]) [1..999]))
derdon/euler-solutions
1/1.hs
isc
201
0
12
38
74
39
35
2
1
module Extras.Data.Time.Calendar where import Data.Time.Calendar dateValid :: Integer -> Int -> Int -> Bool dateValid y m d = case fromGregorianValid y m d of Nothing -> False Just _ -> True
fredmorcos/attic
projects/pet/archive/pet_haskell_modular_1/Extras/Data/Time/Calendar.hs
isc
198
0
8
39
69
37
32
6
2
{-# LANGUAGE OverloadedStrings #-} module Y2020.M12.D10.Solution where {-- Okay, I have a confession to make. I cheated. I said, yesterday, that there were unicode-issues and today we would address them so we could realign the alliances from the aliased-countries to the source ones. Well, the only unicode issue wa...
geophf/1HaskellADay
exercises/HAD/Y2020/M12/D10/Solution.hs
mit
9,671
0
13
1,584
651
387
264
67
1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} #if __GLASGOW_HASKELL__ < 710 {-# LANGUAGE OverlappingInstances #-} #endif {-# LANGU...
jbearer/hspl
src/Control/Hspl/Internal/Debugger.hs
mit
23,192
0
20
5,906
5,203
2,676
2,527
360
11
-- Graphter.hs module Graphter where import Graphter.Convert import Graphter.Generate import Graphter.Calculate import Graphter.Representation
martinstarman/graphter
src/Graphter.hs
mit
144
0
4
14
25
16
9
5
0
-- 1. fib n вовзращает n-ое число Фибоначчи. -- Функция должна работать за линейное вермя и определена для всех целых n. -- Для отрицательных n значение определяется по формуле fib n = fib (n + 2) - fib (n + 1). -- (1 балл) fib :: Integer -> Integer fib n = let (_, res, _) = fibRec (1, 0, abs n) in if ...
SergeyKrivohatskiy/fp_haskell
hw04.hs
mit
2,910
0
13
650
719
382
337
30
3
{-# LANGUAGE RankNTypes, GeneralizedNewtypeDeriving, DeriveFunctor, TypeFamilies #-} {-# LANGUAGE TypeSynonymInstances, NullaryTypeClasses #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE GADTs #-} module Constraint.Solver where import Control.Applicative import Data.Foldable import Data.IORef -- data Structure...
cpehle/faust
src/Constraint/Solver.hs
mit
3,162
0
11
1,056
930
491
439
67
4
-- realworldhaskell - WC.hs -- Counts the number of words in its input. -- USAGE: runghc WC < sample.txt main = interact wordCount where wordCount input = show (length (words input)) ++ "\n"
JoshDev/haskell
chapter1/WC.hs
mit
192
0
12
34
41
21
20
2
1
module Main ( main ) where import System.Directory ( createDirectoryIfMissing ) import Core ( Ray(..), Point(..), UnitVector , vector, normal, normalize, translate, to, origin, cross , (|*|), (|+|) ) import Color ( Color(..), saveRender ) i...
stu-smith/rendering-in-haskell
src/experiment02/Main.hs
mit
3,022
0
13
1,009
1,020
540
480
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: Main -- Description: Unit tests executor -- Copyright: (c) 2015-2016, Ixperta Solutions s.r.o. -- License: AllRightsReserved -- -- Stability: stable -- Portability: portable -- -- Unit tests executor. module Main (main) where import System.IO (IO)...
Unoriginal-War/unoriginal-war
test/unit-tests.hs
mit
424
0
6
83
66
43
23
7
1
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI, MagicHash, UnboxedTuples, UnliftedFFITypes, GHCForeignImportPrim #-} {- Low level bindings for JavaScript strings. These expose the underlying encoding. Use Data.JSString for -} module Data.JSString.Raw ( rawHead , rawT...
ghcjs/ghcjs-base
Data/JSString/Raw.hs
mit
4,776
38
16
1,116
1,344
700
644
118
2
module Main where import BFIOlib import System.IO import Control.Concurrent import Control.Monad.State import Control.Monad.Writer import BFLib.Brainfuch (Code, emptyStack, Stack) import BFLib.BrainfuchFollow main :: IO () main = do code <- readCode putStr "\nOutput of script:\n" stacks <- i...
dermesser/Brainfuch
BFdbgIA.hs
mit
1,328
0
12
363
367
187
180
38
1
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE BangPatterns #-} module Data.Digest.Pure.MD4 (md4) where import Control.Applicative import Control.Monad.State import Data.Bits import Data.Binary.Put import Data.Binary.Get import qualified Data.ByteString.Lazy as L import Data.Word f x y z = x .&. ...
mfeyg/md4
Data/Digest/Pure/MD4.hs
mit
3,085
0
16
1,187
1,619
870
749
85
2
module Hickory.Graphics ( module Hickory.Graphics.DrawUtils , module Hickory.Graphics.Drawing , module Hickory.Graphics.GLSupport , module Hickory.Graphics.Shader , module Hickory.Graphics.StockShaders , module Hickory.Graphics.Textures , module Hickory.Graphics.VAO , module Hickory.Graphics.DrawText ...
asivitz/Hickory
Hickory/Graphics.hs
mit
1,113
0
5
112
203
140
63
31
0
{-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------------------ -- | This module is where the main blog is defined. module Blog ( Blog , blogInit ) where import Control.Concurrent.MVar (MVar, newMVar, readMVar) import Control.Monad.IO.Class (liftIO) import Contr...
rybye/blog
src/Blog.hs
mit
2,755
0
13
549
807
445
362
58
1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Kashmir.Github.Types.Hook where import Cases import Data.Aeson import Data.Set as Set import Data.Text import GHC.Generics import ...
krisajenkins/kashmir
src/Kashmir/Github/Types/Hook.hs
epl-1.0
1,450
0
9
400
370
211
159
47
1
-- benchmark/Bench.hs module Main (main) where import Criterion.Main (bgroup, defaultMain) import qualified MataskellBench main :: IO () main = defaultMain [ bgroup "Mataskell" MataskellBench.benchmarks ]
tylerjl/mataskell
benchmark/Bench.hs
gpl-2.0
219
0
8
39
55
32
23
6
1
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- | -- Module : Hoodle.Util -- Copyright : (c) 2013 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> -- Stability : experimental -- Portability : GHC -- ---...
wavewave/hoodle-core
src/Hoodle/Util.hs
gpl-3.0
3,162
0
20
870
1,056
546
510
78
6
#!/usr/bin/env stack {- stack runghc --verbosity info --package hledger --package here --package text --package time -} {-# OPTIONS_GHC -Wno-missing-signatures #-} {-# LANGUAGE QuasiQuotes #-} import Data.Maybe import Data.List import Data.String.Here import Data.Time import qualified Data.Text as T impor...
mstksg/hledger
bin/hledger-prices.hs
gpl-3.0
3,359
0
18
835
962
507
455
64
3
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GADT...
tlaitinen/receipts
backend/Handler/DB/RouteTransferreceipts.hs
gpl-3.0
5,687
0
27
1,570
1,227
694
533
116
9
module SIR.Model where data SIRState = Susceptible | Infected | Recovered deriving (Show, Eq) aggregateSIRStates :: [SIRState] -> (Int, Int, Int) aggregateSIRStates as = (sus, inf, recs) where sus = length $ filter (==Susceptible) as inf = length $ filter (==Infected) as recs = length $ filter...
thalerjonathan/phd
thesis/code/sir/src/SIR/Model.hs
gpl-3.0
467
0
9
94
186
108
78
13
1
module Scyther.Theory.Parser ( -- * Lexing Token , Keyword(..) , scanString , scanFile -- * Parsing , Parser , parseFile -- ** Additional combinators , liftMaybe , liftMaybe' , token -- ** Keyword combinations , kw , betweenKWs , commaSep , commaSep1 , list , braced , paren...
meiersi/scyther-proof
src/Scyther/Theory/Parser.hs
gpl-3.0
36,410
33
28
9,167
10,878
5,490
5,388
649
5
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeFamilies #-} module Object.Account where import Data.Serialize import GHC.Generics import Servant.Server.Experimental.Auth.Cookie data Account = Account { uid :: Integer, username :: String } deriving Generic instance Serialize Account type instance AuthCookieData = Ac...
Ferdinand-vW/collab
server/src/Object/Account.hs
gpl-3.0
325
0
8
41
65
41
24
9
0
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} module QHaskell.Expression.Conversions.Evaluation.ADTUntypedNamed () where import QHaskell.MyPrelude import QHaskell.Expression.ADTUntypedNamed import qualified QHaskell.Expression.ADTValue as FAV import QHaskell.Environment.Map import QHaskell.Conversion instance (S...
shayan-najd/QHaskell
QHaskell/Expression/Conversions/Evaluation/ADTUntypedNamed.hs
gpl-3.0
906
0
20
269
295
168
127
-1
-1
-- Copyright (c) 2010 John Millikin -- -- Permission is hereby granted, free of charge, to any person -- obtaining a copy of this software and associated documentation -- files (the "Software"), to deal in the Software without -- restriction, including without limitation the rights to use, -- copy, modify, merge, publi...
jmillikin/haskell-xmpp
examples/echo.hs
gpl-3.0
5,704
29
18
1,123
867
472
395
73
8
{-# LANGUAGE TemplateHaskell, FlexibleInstances, IncoherentInstances, ScopedTypeVariables, MultiParamTypeClasses, ConstraintKinds #-} module Sh where import Test.QuickCheck import DeriveArbitrary import Language.Bash.Pretty import Language.Bash.Syntax import Text.PrettyPrint import Language.Bash.Word import qualifie...
fcostantini/QuickFuzz
src/Sh.hs
gpl-3.0
2,191
0
14
506
722
386
336
56
1
module S03 where {- Module : S03 Description : Series 03 of the Functionnal and Logic Programming course at UniFR Author : Sylvain Julmy Email : sylvain.julmy(at)unifr.ch -} import Data.Char -- Import for the test import Test.QuickCheck import Control.Monad import qualified Data.List as L import qualified Data.Set a...
SnipyJulmy/mcs_notes_and_resume
fun-and-log-prog/exercices/s03/s03.hs
lgpl-3.0
2,207
0
11
462
868
473
395
43
3
module Main where data Mood = Blah | Woot deriving Show -- 1. Mood -- 2. Blah or Woot -- 3. changeMood :: Mood -> Mood changeMood Blah = Woot changeMood _ = Blah instance Eq Mood where (==) Woot Woot = True (==) Blah Blah = True (==) _ _ = False awesome = ["Papuchon", "curry", ":)"] alsoAwesome = ["Q...
prt2121/haskell-practice
hb-chap04/src/Main.hs
apache-2.0
1,609
0
8
424
514
297
217
35
2
{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-} module Handler.Profile where import Import type UserFormResult = Maybe Text profileEditForm :: User -> Form UserFormResult profileEditForm u = renderTable $ aopt textField "Användarnamn" { fsTooltip = Just "Visas t.ex. vid nyhetsinlägg" ...
dtekcth/DtekPortalen
src/Handler/Profile.hs
bsd-2-clause
1,414
0
12
517
283
141
142
28
2
{-# LANGUAGE DeriveDataTypeable #-} module Application.WebLogger.Client.ProgType where import System.FilePath import System.Console.CmdArgs hiding (name) data WebLogger_client = Create { config :: FilePath, modulename :: String } | GetList { config :: FilePath } deriving (Show,Data,Typ...
wavewave/weblogger-client
lib/Application/WebLogger/Client/ProgType.hs
bsd-2-clause
1,227
0
9
381
144
87
57
14
1
----------------------------------------------------------------------------- -- | -- Module : Application.HXournal.Coroutine.EventConnect -- Copyright : (c) 2011, 2012 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> -- Stability : experimental -- Portability : GHC -- -...
wavewave/hxournal
lib/Application/HXournal/Coroutine/EventConnect.hs
bsd-2-clause
2,057
0
16
374
531
284
247
39
1
{-# LANGUAGE ForeignFunctionInterface, CPP #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.GetProgramBinary -- Copyright : (c) Sven Panne 2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- ...
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/GetProgramBinary.hs
bsd-3-clause
1,824
0
14
192
238
148
90
-1
-1
{-# LANGUAGE GADTs #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -- -- Copyright (c) 2009-2011, ERICSSON AB -- All rights reserved. -- -- Redistribution and use in source and binary ...
rCEx/feldspar-lang-small
src/Feldspar/Vector/Internal.hs
bsd-3-clause
15,315
1
15
3,483
5,258
2,698
2,560
-1
-1
module Abstract.GroupTag(avarGroupTag) where import Abstract.Predicate import Frontend.Inline avarGroupTag :: AbsVar -> Maybe String avarGroupTag (AVarBool t) | (isFairVarName $ show t) = Just "$fair" avarGroupTag (AVarPred (PAtom _ (PTInt t1) (PTInt t2))) | isSimpleTerm t1 && ...
termite2/tsl
Abstract/GroupTag.hs
bsd-3-clause
1,924
0
11
570
655
317
338
33
1
-- conll2counts.hs -- (c) 2015 Jan Snajder -- -- Word counts mapper/reducer for Hadoop streams for CONLL parsed file -- Counts word forms -- -w wordforms -- -l lemmas -- -L lemmas, with fallback to wordforms in case of '<unknown>' -- -p concatenates pos tags -- ----------------------------------------------...
jsnajder/conll-corpus
src/conll2counts.hs
bsd-3-clause
2,665
0
15
639
786
421
365
61
9
module CIS194.HW10.ApplicativeSpec where import CIS194.HW10.AParser import CIS194.HW10.Applicative import Test.Hspec import Test.QuickCheck spec :: Spec spec = do describe "abParser" $ do it "abcdef" $ runParser abParser "abcdef" `shouldBe` Just (('a', 'b'), "cdef")...
sestrella/cis194
test/CIS194/HW10/ApplicativeSpec.hs
bsd-3-clause
954
0
13
247
307
156
151
27
1
module Cloud.AWS.EC2.Types.Route ( CreateRouteRequest(..) ) where import Data.IP (AddrRange, IPv4) import Data.Text (Text) data CreateRouteRequest = CreateRouteToGateway { createRouteTableId :: Text , createRouteDestinationCidrBlock :: AddrRange IPv4 , createRouteGatewayId :: Text ...
worksap-ate/aws-sdk
Cloud/AWS/EC2/Types/Route.hs
bsd-3-clause
724
0
9
187
138
85
53
18
0
{-# LANGUAGE CPP #-} -- |This module contains all the code that depends on a specific -- version of GHC, and should be the only one requiring CPP module Language.Haskell.Refact.Utils.GhcVersionSpecific ( prettyprint , prettyprint2 , ppType -- , lexStringToRichTokens -- , getDataConstructors , setGhcCon...
mpickering/HaRe
src/Language/Haskell/Refact/Utils/GhcVersionSpecific.hs
bsd-3-clause
3,428
0
11
530
345
198
147
21
1
{-# LANGUAGE OverloadedStrings #-} -- | This module provides a native Haskell representation for the JSON Resume -- scheme, as defined at -- <https://github.com/jsonresume/resume-schema/blob/master/schema.json>, as well -- as instances for Aeson's FromJSON/ToJSON classes to make parsing the files -- easy. -- -- Note t...
dpwright/jsonresume.hs
src/Data/JSONResume.hs
bsd-3-clause
15,092
0
34
4,988
3,462
1,906
1,556
323
2
module Language.Iso.Prelude where import Language.Iso.App import Language.Iso.Lam import Language.Iso.Var idiot :: (Var repr, Lam repr) => repr idiot = lam "x" (var "x") kestrel :: (Var repr, Lam repr) => repr kestrel = lam "x" (lam "y" (var "x")) starling :: (Var repr, Lam repr, App repr) => repr s...
joneshf/iso
src/Language/Iso/Prelude.hs
bsd-3-clause
416
0
15
88
205
110
95
10
1