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
-- By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. -- -- 3 -- 7 4 -- 2 4 6 -- 8 5 9 3 -- -- That is, 3 + 7 + 4 + 9 = 23. -- -- Find the maximum total from top to bottom of the triangle below: -- -- 75 -- 95 64 -- 17 47 82 -- 18...
daniel-beard/projecteulerhaskell
Problems/p18.hs
mit
1,547
0
12
386
298
167
131
16
1
{-# OPTIONS_GHC -Wall #-} module HW01 where -- Exercise 1 ----------------------------------------- -- Get the last digit from a number lastDigit :: Integer -> Integer lastDigit x = x `mod` 10 -- Drop the last digit from a number dropLastDigit :: Integer -> Integer dropLastDigit x = x `div` 10 -- Exercise 2 -------...
minimal/cis194-intro-to-haskell
HW01.hs
mit
1,386
0
11
234
331
187
144
22
1
-- Convert a String to a Number! -- http://www.codewars.com/kata/544675c6f971f7399a000e79 module Numberfy where stringToNumber :: String -> Integer stringToNumber = read
gafiatulin/codewars
src/8 kyu/Numberfy.hs
mit
172
0
5
22
20
13
7
3
1
{-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE FlexibleInstances #-} module Graphics.Rendering.WebGL.EnumConvert where import Data.Bits import Data.Monoid import Graphics.Rendering.WebGL.Types import Graphics.Rendering.WebGL.Constants class ToGLEnum a where toGLEnum...
isomorphism/webgl
src/Graphics/Rendering/WebGL/EnumConvert.hs
mit
18,182
0
11
4,713
4,494
2,219
2,275
395
1
{-# LANGUAGE OverloadedStrings #-} module ErdMain where -- Stolen from the ERD project: https://github.com/BurntSushi/erd import Control.Monad (forM_) import qualified Data.ByteString as SB import Data.Maybe (fromMaybe) import qualified Data.Text.Lazy as L import System.Exit (exitFailure) import System.IO (hClose, hP...
ftomassetti/erd-web-server
src/ErdMain.hs
mit
4,117
0
19
983
1,141
608
533
65
3
/*Owner & Copyrights: Vance King Saxbe. A.*//* Copyright (c) <2014> Author Vance King Saxbe. A, and contributors Power Dominion Enterprise, Precieux Consulting and other contributors. Modelled, Architected and designed by Vance King Saxbe. A. with the geeks from GoldSax Consulting and GoldSax Technologies email @vsaxbe...
VanceKingSaxbeA/GoldSaxMachineStore
GoldSaxMachineModule13/src/Chapter13/CheckRangesPromoted.hs
mit
5,874
23
16
1,664
1,278
649
629
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Bio.GO ( GO(..) , GOId , GOMap , getGOLevel ) where import qualified Data.HashMap.Strict as M import Data.Maybe import qualified Data.Text as T data GO = GO { _oboId :: !GOId , _label :: !T.Text , _subProcessOf :: ![GOId...
kaizhang/bioinformatics-toolkit
bioinformatics-toolkit/src/Bio/GO.hs
mit
2,012
0
12
620
231
129
102
30
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Ringo.ArgParser (ProgArgs(..), parseArgs) where import qualified Data.Text as Text import Data.List (intercalate) import Data.Monoid ((<>)) import Options.Applicative import System.Environment (getProgName) import Ringo.Ty...
abhin4v/ringo
ringo/src/Ringo/ArgParser.hs
mit
4,881
0
30
1,796
805
396
409
108
1
module Database.LevelDB.MonadResource ( DB , Options(..) , ReadOptions(..) , WriteOptions(..) -- * Defaults , defaultOptions , defaultWriteOptions , defaultReadOptions , open , put , get , MonadResource (..) ) where import Data.ByteString ...
kejace/leveldb-ghcjs
src/Database/LevelDB/MonadResource.hs
mit
1,055
0
11
341
263
151
112
25
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/experiment04/Main.hs
mit
3,783
0
13
1,410
1,105
591
514
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Application ( getApplicationDev , appMain , develMain , makeFoundation , makeLogWare -- * for DevelMain , getApplicationRepl , shutdownApp -- * for GHCI , handler , db ) where import Control.Monad.Logger (liftL...
SimSaladin/hajong
hajong-site/Application.hs
mit
8,886
0
21
2,392
1,531
797
734
-1
-1
module Hasql.TH.Prelude ( module Exports, showAsText, suffixRec, ) where import Control.Applicative as Exports import Control.Arrow as Exports hiding (first, second) import Control.Category as Exports import Control.Concurrent as Exports import Control.Exception as Exports import Control.Foldl as Exports (...
nikita-volkov/hasql-th
library/Hasql/TH/Prelude.hs
mit
3,998
0
10
531
1,090
741
349
88
1
-- Thinkful - String Drills: Repeater -- https://www.codewars.com/kata/585a1a227cb58d8d740001c3 module Kata where repeater :: String -> Int -> String repeater s n = concat . replicate n $ s
gafiatulin/codewars
src/7 kyu/Repeater.hs
mit
192
0
7
30
40
22
18
3
1
module FrequencyMap (FrequencyMap, frequency, fromMap, frequencyMap) where import qualified Data.Map.Strict as Map import Shared (sortCount, FrequencyCount) type FrequencyMap a = Map.Map a Int frequency :: Ord a => [a] -> FrequencyCount a frequency = fromMap . frequencyMap fromMap :: Ord a => FrequencyMap a -> Fre...
apauley/parallel-frequency
src/FrequencyMap.hs
mit
477
0
8
80
178
98
80
10
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-topicrule-kinesisaction.html module Stratosphere.ResourceProperties.IoTTopicRuleKinesisAction where impo...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/IoTTopicRuleKinesisAction.hs
mit
2,580
0
13
268
356
202
154
34
1
import System.IO main :: IO () main = do helloFile <- openFile "hello.txt" ReadMode hasLine <- fmap not (hIsEOF helloFile) firstLine <- if hasLine then hGetLine helloFile else return "empty" putStrLn firstLine hasSecondLine <- fmap not (hIsEOF helloFile) secondLine <- if hasSecondLine then hGetLine hello...
raventid/coursera_learning
haskell/will_kurt/24_worksheet.hs
mit
566
0
10
102
157
70
87
14
3
module HaskQuest.Game.State.SimpleState where import Control.Monad {- A very simple stateful monad. Primarily based on the tutorial from: https://en.wikibooks.org/wiki/Haskell/Understanding_monads/State Augmented to better support failure. Successful executions are marked Right, while failures are marked Left. ...
pdarragh/HaskQuest
src/HaskQuest/Game/State/SimpleState.hs
mit
1,502
0
14
419
434
231
203
29
2
module ChapterExercises206 where import Data.Foldable import Data.Monoid -- foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b -- foldMap :: (Monoid m, Foldable t) => (a -> m) -> t a -> m -- {-# MINIMAL foldMap | foldr #-} -- fold :: (Monoid m, Foldable t) => t m -> m -- 1 Constant data Constant a b = Const...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter20.hsproj/ChapterExercises206.hs
mit
1,403
0
11
376
586
311
275
28
2
{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {- | Write your grammar once and get both parser and pretty-printer, for free. > data Person = Person > { pName :: String > , pAddress :: String > , pAge :: Maybe Int > } deriving (Show) > > personGrammar :: SexpG Person > personGrammar = > $(g...
ricardopenyamari/ir2haskell
clir-parser-haskell-master/lib/sexp-grammar/src/Language/SexpGrammar.hs
gpl-2.0
5,381
0
10
1,343
692
386
306
75
1
-- | This is a separate pretty-printer for HTML documents, recognising -- some of the differences between HTML and true XML. module Text.XML.HaXml.Html.Pretty ( document , element , attribute , content ) where import Prelude hiding (maybe,either) import Maybe hiding (maybe) import List (intersperse) impor...
jgoerzen/dtmconv
HaXml-1.12/src/Text/XML/HaXml/Html/Pretty.hs
gpl-2.0
10,206
0
14
3,807
3,208
1,550
1,658
177
2
{-# LANGUAGE DeriveDataTypeable #-} module Faktor.Type where import Data.Typeable import Autolib.Size data Faktor = Faktor deriving ( Show , Read, Typeable ) instance Size Integer where size = fromIntegral
Erdwolf/autotool-bonn
src/Faktor/Type.hs
gpl-2.0
210
0
6
33
52
30
22
6
0
module Tema_15a_ColaConListas_Spec (main, spec) where import Tema_15.ColaConListas import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "ColaConListas.hs" $ do it "e1" $ show (foldr inserta vacia [1..10]) `shouldBe` "C [10,9,8,7,6,5,4,3,2,1]" it "e1" $ show (vacia :...
jaalonso/I1M-Cod-Temas
test/Tema_15a_ColaConListas_Spec.hs
gpl-2.0
756
0
17
178
291
148
143
22
1
----------------------------------------------------------------------------- -- | -- Module : Hoodle.Type.Widget -- Copyright : (c) 2013 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> -- Stability : experimental -- Portability : GHC -- -- Types for Widgets -- -------...
wavewave/hoodle-core
src/Hoodle/Type/Widget.hs
gpl-3.0
5,663
0
9
1,401
1,026
620
406
93
1
module Experiments where import DMX import Timing import LightSource onOffColors = cycle [Color 255 255 255,Color 0 0 0] onOffActions light = map (setLightInstantly light) onOffColors switchAction bus (on,off) = do setLight (Light on bus) (Color 255 255 255) setLight (Light off bus) (Color 0 0 0) sendDMX bus ...
zouppen/valo
Experiments.hs
gpl-3.0
512
0
9
84
192
99
93
13
1
{-# LANGUAGE Arrows #-} module Agent ( sirAgentBehaviour ) where import Control.Monad.Random import FRP.Chimera import FRP.Yampa import Model ------------------------------------------------------------------------------------------------------------------------ -- Non-Reactive Functions -------------------...
thalerjonathan/phd
coding/libraries/chimera/examples/ABS/SIRExamples/FrSIR/Agent.hs
gpl-3.0
3,180
3
14
428
637
321
316
47
2
module SymLens.Map where import SymLens import Data.Maybe (fromMaybe, fromJust) import qualified Data.Map as Map appendInto :: (Enum k, Ord k, Show k) => SymLens (Map.Map k a, Map.Map k a) (Map.Map k a) appendInto = SymLens Map.empty (\(m1, m2) mc -> fst $ Map.foldlWithKey (\((m, mc'), nextkey) k a -> (...
cornell-pl/evolution
SymLens/Map.hs
gpl-3.0
1,852
0
17
771
812
428
384
27
2
module Change where import Data.List (sortBy,minimumBy) import Data.Function (on) findFewestCoins :: Integer -> [Integer] -> Maybe [Integer] findFewestCoins a c | a == 0 = Just [] | null ans = Nothing | otherwise = Just ans where ans = makeChange a c -- swap in more efficient algorithim if we ge...
ciderpunx/exercismo
src/Change.hs
gpl-3.0
2,103
0
13
431
540
286
254
30
2
{-# LANGUAGE DeriveDataTypeable #-} {- The purpose of class Unique is to identify a Haskell object by means of a string. E.g. instance Unique Pattern where showUnique = optionalQuote . name -} module Ampersand.Basics.Unique (Unique(..),Named(..)) where import Ampersand.Basics.Prelude import Dat...
AmpersandTarski/ampersand
src/Ampersand/Basics/Unique.hs
gpl-3.0
1,735
0
11
474
316
177
139
29
0
import Data.List type Note = Int type NoteName = String data Scale = Scale { scaleName :: String, scaleIntervals :: [Int] } deriving (Show) knownScales :: [Scale] knownScales = [ Scale "Major" [0, 2, 4, 5, 7, 9, 11] , Scale "Minor" [0, 2, 3, 5, 7, 8, 10] ...
siddhanathan/jianpu
change.hs
gpl-3.0
1,367
0
9
370
513
289
224
32
1
{-# OPTIONS_GHC -fdefer-typed-holes #-} module Documentator.Descriptors where import Language.Haskell.Exts.Syntax import Documentator.Types import Documentator.Utils allTyCon :: Located Type -> [Located QName] allTyCon (TyForall _ _ _ _) = [] allTyCon (TyFun _ t1 t2) = allTyCon t1 ++ allTyCon t2 allTyCon (TyTuple _ ...
Arguggi/documentator
src/Documentator/Descriptors.hs
gpl-3.0
3,496
0
13
659
1,851
946
905
85
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/Resources/Features/List.hs
mpl-2.0
5,886
0
22
1,470
899
519
380
130
1
downloadRepoPackage = case repo of RepoLocal {..} -> return () RepoLocal { abc } -> return () RepoLocal{} -> return ()
lspitzner/brittany
data/Test278.hs
agpl-3.0
134
0
9
36
59
28
31
-1
-1
-- ----------------------------------------------------------------------------- -- This file is part of Skema. -- Skema is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -...
SkemaPlatform/skema-common
src/test/skema_common_test.hs
agpl-3.0
9,332
0
22
1,577
2,333
1,268
1,065
172
2
{-# LANGUAGE CPP #-} {-# LANGUAGE PatternGuards #-} -- -- Copyright (C) 2004-5 Don Stewart - http://www.cse.unsw.edu.au/~dons -- -- This program 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...
stepcut/plugins
src/System/Plugins/Parser.hs
lgpl-2.1
7,744
0
18
2,191
1,666
887
779
107
4
{-# LANGUAGE Safe #-} --------------------------------------------------------------------------- -- | -- Module : Data.Queue.Simple -- Maintainer : sturdyi12@mail.wlu.edu -- Stability : provisional -- Portability : non-portable (GHC extensions to 'Text.Read') -- -- An efficient purely functional FIFO queu...
isturdy/q
Data/Queue/Simple.hs
unlicense
3,430
0
10
780
802
418
384
47
1
----------------------------------------------------- -- | -- Module : Crypto.Noise.Validation -- Maintainer : John Galt <jgalt@centromere.net> -- Stability : experimental -- Portability : POSIX module Crypto.Noise.Validation ( -- * Types InspectionError(..) , ErrorPosition -- * Functions , valida...
centromere/cacophony
src/Crypto/Noise/Validation.hs
unlicense
400
0
5
64
38
29
9
6
0
module Main where import Test.Hspec import Data.Map.Strict import World main :: IO () main = hspec $ do describe "buildWorld" $ do it "places live cells: top left" $ do let world = buildWorld 3 3 [Position 1 1 ] fromList [(Position 1 1, Live), (Position 1 2, Dead), (Position 1 3, Dead), ...
mac10688/GameOfLife-Haskell
test/Tests.hs
apache-2.0
4,365
0
20
1,133
1,454
721
733
70
1
-- Copyright 2021 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/mlir-hs
src/MLIR/AST/Builder.hs
apache-2.0
8,733
0
18
1,934
2,512
1,270
1,242
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Language.K3.Transform.Hints where import Control.DeepSeq import Data.Typeable import GHC.Generics (Generic) import qualified Data.Set as S import Language.K3.Core.Common data OptHint -- | The sets of identifiers which can be bound by ref...
yliu120/K3
src/Language/K3/Transform/Hints.hs
apache-2.0
1,090
0
9
223
167
99
68
17
0
-- http://www.codewars.com/kata/52705ed65de62b733f000064 module Sorted where import Data.List import Data.Ord sortList :: Ord b => (a -> b) -> [a] -> [a] sortList = sortBy . comparing
Bodigrim/katas
src/haskell/7-Return-a-sorted-list-of-objects.hs
bsd-2-clause
185
0
8
27
57
33
24
5
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QStyleOptionRubberBand.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:36 Warning : this file is machine gener...
keera-studios/hsQt
Qtc/Enums/Gui/QStyleOptionRubberBand.hs
bsd-2-clause
4,765
0
18
921
1,080
532
548
90
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QToolBox.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:28 Warning : this file is machine generated - do not ...
keera-studios/hsQt
Qtc/Gui/QToolBox.hs
bsd-2-clause
50,292
0
16
8,486
17,170
8,718
8,452
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE OverloadedStrings #-} module Tersus.Global where import Prelude import Data.Aeson as J import qualified Data.Text as T import Data.Text.Lazy (fromChunks) import Data.Text.Lazy.Encoding (decode...
kmels/tersus
Tersus/Global.hs
bsd-2-clause
1,779
0
9
395
365
209
156
31
2
module RTS.PreC where -- A representation close to the code we'll be outputting import Core.TT import RTS.Bytecode import RTS.SC import Control.Monad.State data CAtom = CP Name Int | CL Local | CC Const deriving Show data CExp = CAtom CAtom | CApp CAtom [CAtom] | CExactApp Name [CAtom] ...
byorgey/Idris-dev
src/RTS/PreC.hs
bsd-3-clause
3,417
0
16
1,256
1,560
816
744
79
19
module Raven.Server ( initServer ) where import Network import Network.Transport import Network.Transport.TCP import Raven.Server.ServerNode -- |Start the server and listen for connections at the supplied ip:port number. -- Third value is the database address. initServer :: String -> String -> String -> IO () in...
denumerate/raven
src/Raven/Server.hs
bsd-3-clause
704
0
17
150
156
82
74
15
3
import Data.List import Data.Char import qualified Data.Map as Map -- 6.1 モジュールをインポートする numUniques :: (Eq a) => [a] -> Int numUniques = length . nub -- 6.2 標準モジュールの関数で問題を解く wordNums :: String -> [(String, Int)] wordNums = map (\ws -> (head ws, length ws)) . group . sort . words isIn :: (Eq a) => [a] -> [a] -> Bool n...
ku00/h-book
src/ModulePractice.hs
bsd-3-clause
2,339
0
12
495
1,007
569
438
60
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeOperators #-} module LockAPIClient where import Data.Proxy import Servant.API import S...
davidheg/Cs4032-use-haskell-api
src/LockAPIClient.hs
bsd-3-clause
828
0
8
184
91
54
37
16
1
{-# 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/ContentProvider_Iface.hs
bsd-3-clause
1,157
0
9
256
180
122
58
21
0
module DoublyRandomValue where import RandomValue data DRValue a b c = DDone c | NeedA (a -> DRValue a b c) | NeedB (b -> DRValue a b c) instance Functor (DRValue a b) where fmap f (DDone x) = DDone (f x) fmap f (NeedA g) = NeedA $ \a -> fmap f (g a) fmap f (NeedB g) = NeedB $ \b -> fmap f (g b) instanc...
cullina/Extractor
src/DoublyRandomValue.hs
bsd-3-clause
1,437
0
11
393
788
397
391
30
3
{-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# LANGUAGE CPP, DeriveDataTypeable #-} #if __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- -- | -- Module : Control.Concurrent.STM.TChan -- Copyright : (c) The Universit...
gridaphobe/packages-stm
Control/Concurrent/STM/TChan.hs
bsd-3-clause
6,159
0
14
1,345
1,240
618
622
3
0
{-# LANGUAGE TemplateHaskell, GeneralizedNewtypeDeriving, ScopedTypeVariables #-} module CNC.Declarative(module CNC.Figure, mirrorX, mirrorY, rotate, scale, posToExpr, renderPath) where import CNC.Figure import CNC.Geometry(RealT, eps) import CNC.HCode(HCode, frame, g, x, y, Exp...
akamaus/gcodec
src/CNC/Declarative.hs
bsd-3-clause
1,097
0
14
241
424
234
190
22
1
-- |Implementations of semantic rules for evaluating expressions in hasp. module Semantics ( evalExpr ) where import qualified Data.Map as Map import Error import Expressions import DataTypes import Control.Monad evalArgExprs_recurse :: [HData] -> Env -> [Expr] -> ThrowsError [HData] evalArgExprs_recurse acc env []...
aldld/hasp
src/Semantics.hs
bsd-3-clause
8,920
0
16
2,036
2,788
1,433
1,355
151
5
{-# LANGUAGE OverloadedStrings #-} module Notation where import qualified Data.Text.Lazy as L --------------------------------------------------------------- pikiReserved :: String pikiReserved = "#=*-+?!@{}>|" pikiHr,pikiComment,pikiTitle,pikiUl,pikiOl,pikiDlT,pikiDlD,pikiImg,pikiAOpen,pikiAClose,pikiDivOpen,piki...
kazu-yamamoto/piki
src/Notation.hs
bsd-3-clause
802
0
5
143
150
106
44
23
1
{-# OPTIONS_GHC -Wall #-} import Control.Monad import Data.Char import Distribution.PackageDescription import Distribution.Simple import Distribution.Simple.LocalBuildInfo import Distribution.Simple.Program import Distribution.Simple.Setup import Distribution.Simple.Utils import Distribution.Verbosity import System.Dir...
scrive/hpqtypes
Setup.hs
bsd-3-clause
2,239
0
16
362
597
301
296
54
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: $HEADER$ -- Description: TODO -- Copyright: (c) 2016, Peter Trško -- License: BSD3 -- -- Maintainer: peter.trsk...
trskop/data-analysis
src/DataAnalysis/MaxSample.hs
bsd-3-clause
1,420
0
8
224
337
201
136
27
0
{-# LANGUAGE TemplateHaskell #-} -- | Provides the infrastructure that is common to all types of parameterized -- vectors. module Data.Params.Vector ( -- * Type lenses _len , _elem -- * Classes , Param_len (..) , Param_elem (..) , Def (..) ) where import Language.Haskell.TH ...
mikeizbicki/typeparams
src/Data/Params/Vector.hs
bsd-3-clause
659
0
8
125
142
81
61
19
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module Test.StarWars.QueryTests (test) where import qualified Data.Aeson as Aeson (Value(Null), toJSON) import Data.Aeson (object, (.=)) import Data.Text (Text) import Text.RawString.QQ (r) import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit ...
jdnavarro/graphql-haskell
tests/Test/StarWars/QueryTests.hs
bsd-3-clause
10,560
0
25
4,814
1,951
1,094
857
160
4
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.GPUShader5 -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- -...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/GPUShader5.hs
bsd-3-clause
835
0
4
93
52
41
11
8
0
module Network.Hawk.Util ( parseHostnamePort , parseHeader , AuthAttrs , AuthScheme , authAttr , authAttrMaybe , readTs , readTsMaybe ) where import Control.Applicative (liftA, (<|>)) import Control.Monad ...
rvl/hsoz
src/Network/Hawk/Util.hs
bsd-3-clause
3,512
0
12
880
1,005
540
465
71
2
{-# LANGUAGE RecursiveDo #-} module Mire.Reactive.Autocomplete ( buildAutocompletion, AutocompleteState (..) ) where import Mire.Prelude import Mire.Data.Autocomplete import Mire.Reactive.Utils import Reactive.Banana import Reactive.Banana.Frameworks -- | Class used by 'buildAutocompletion' to read and write...
ellej/mire
src/Mire/Reactive/Autocomplete.hs
bsd-3-clause
2,127
1
20
555
440
233
207
34
1
module Evaluator.Syntax where import Core.Syntax import Renaming import Utilities import Data.Function type In a = (Renaming, a) type Out a = a -- | Special representation of (In Var) so we can use it as a key in a Map. -- -- TODO: we don't actually compare by the invar (this is necessary because e.g. several --...
batterseapower/core-haskell
Evaluator/Syntax.hs
bsd-3-clause
1,287
0
9
336
325
188
137
27
1
{-# LANGUAGE OverloadedStrings #-} module Clock.CarSpec (spec) where import Test.Hspec import Test.QuickCheck import Cache import Clock.Car import Request initialCache = ((0, 0), empty 1000 AddToCache :: Car) onlyReadsWhichShouldHit = [ (Read, "1", 500) -- fail ...
wochinge/CacheSimulator
test/Clock/CarSpec.hs
bsd-3-clause
3,253
0
10
1,209
751
471
280
60
1
{-# LANGUAGE OverloadedStrings #-} module Main where import System.Environment import qualified Text.Markdown as MD import qualified Data.Text.Lazy as T() import qualified Data.Text.Lazy.IO as TIO import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A import Text.Blaze.Html...
soupi/m2h
src/Main.hs
bsd-3-clause
1,009
0
17
224
380
209
171
26
2
{-# LANGUAGE OverloadedStrings #-} module ProveBits (prove) where import Theory hiding (Type,apSubst) import CSE (cse) import SimpleSMT as SMT import Data.Map ( Map ) import qualified Data.Map as Map import qualified Data.Text as Text import qualified Data.Set as Set import Control.Exception (br...
GaloisInc/verification-game
web-prover/src/ProveBits.hs
bsd-3-clause
12,259
0
29
5,160
4,544
2,241
2,303
285
50
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE BangPatterns #-} {-| Rasterization algorithms. -} module Graphics.Algorithms.Rasterization ( bresenham ) where import qualified Data.Vector.Generic as V -- | Bersenham's line algorithm. -- -- Produce a vector of points on two-dimensional raster which -- app...
dzhus/hs-canvas
src/Graphics/Algorithms/Rasterization.hs
bsd-3-clause
1,439
0
15
533
394
228
166
28
5
module Sync.Remote.Filetransfer where {- -- | Server: Receive unmatched file positions, returns a list of local blocks to -- send upstream srvRcvUnmatched :: Monad m => LookupLocations -> Sink FileLoc m SrvLookupMatched srvRcvUnmatched m = do -- delete any unmatched blocks SrvLookupMatched `liftM` CL.fold (\m' l -...
mcmaniac/sync
src/Sync/Remote/Filetransfer.hs
bsd-3-clause
2,046
0
3
680
8
6
2
1
0
module LDrive.Client where
sorki/odrive
client/src/ODrive/Client.hs
bsd-3-clause
27
0
3
3
6
4
2
1
0
-- Advent of Code ---- Day 15: Science for Hungry People module AOC2015.Day15 where data Ingredient = I { name :: String , capacity :: Int , durability :: Int , flavor :: Int , texture :: Int , calories :: Int} i...
bitrauser/aoc
src/AOC2015/Day15.hs
bsd-3-clause
1,863
1
13
846
591
346
245
49
1
{-# LANGUAGE TemplateHaskell #-} import MkParser main :: IO () main = do case dv_pegFile $ parse $ "some\n[papillon|\nheko :: Int\n\t= h:hage p:[aAdxy hoge]h:hige { hoge }/" ++ "p:posoZ{ boka }\n;hage::Boke=b:bo { boke };\n|]\nother" of Just ((_, (n, _, _) : _, _), _d) -> print n _ -> putStrLn "bad"
YoshikuniJujo/papillon
test/testTHFile.hs
bsd-3-clause
311
2
14
61
90
48
42
8
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeFamilies #-} -- -- RegTypes.hs --- Types for register fields in PWR driver -- -- Copyright (C) 2014, Galois, Inc. -- All Rights Reserved. -- module Ivory.BSP.STM32.Peripheral.PWR.RegTypes where import ...
GaloisInc/ivory-tower-stm32
ivory-bsp-stm32/src/Ivory/BSP/STM32/Peripheral/PWR/RegTypes.hs
bsd-3-clause
584
0
4
137
32
26
6
7
0
module Couch ( publishPosting , deletePosting , fetch , fetchMeta , limitTo , byDateTimeR , byDateTime , bySubject , byId , allCategories , allAuthors , allSubjects , PublishCouch , runCouch , onlySubjects , getAllEntrys , getSomeEntrys ) w...
frosch03/frogblog
Couch.hs
bsd-3-clause
5,029
0
19
1,344
1,688
886
802
133
1
module Network.InnerChange.SoapTypes where {- import qualified Crypto.Hash as Hash (Digest, SHA1, hash) import qualified Data.ByteString.UTF8 as BS (fromString) import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map (empty, singleton, fromList, lookup, (!), toList, keys) import D...
lancelet/inner-change
src/Network/InnerChange/SoapTypes.old.hs
bsd-3-clause
38,462
0
3
8,874
8
6
2
1
0
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} module Aws.Core ( -- * Logging Loggable(..) -- * Query , SignedQuery(..) , ...
RayRacine/aws
Aws/Core.hs
bsd-3-clause
7,133
0
19
1,895
1,356
818
538
-1
-1
-- Poster refers to post-parsing processes. It performs several functions: -- 1. Check certian invalid occurences of tokens, like normal operators inside -- patterns. -- 2. Adjust AST according to operator fixity information. -- 3. Group equations into function definitions. -- 4. Check redefinitions. -- ...
notcome/indescript
src/Language/Indescript/Parser/Poster.hs
bsd-3-clause
8,776
0
20
2,694
3,188
1,603
1,585
187
9
{-# LANGUAGE OverloadedStrings #-} module Main where import Haxl.Neo4j (runNeo4j,Neo4j,Node,nodesByLabel,typedEdges,Direction(In),edgeSource) main :: IO () main = runNeo4j (usages) >>= print type DeclarationNode = Node type SymbolNode = Node usages :: Neo4j (DeclarationNode,SymbolNode) usages = do symbol <- nod...
phischu/haxl-neo4j
src/Haxl/Neo4j/Main.hs
bsd-3-clause
465
0
10
67
138
77
61
12
1
module Database.PostgreSQL.PQTypes.Notification ( Channel(..) , Notification(..) , listen , unlisten , unlistenAll , notify ) where import Data.Text (Text) import Data.Monoid.Utils import Database.PostgreSQL.PQTypes.Class import Database.PostgreSQL.PQTypes.Internal.Notification import Database.Postgre...
scrive/hpqtypes
src/Database/PostgreSQL/PQTypes/Notification.hs
bsd-3-clause
1,134
0
9
181
260
148
112
22
1
module End.Header.Object.Temp where import qualified Data.ByteString.Char8 as B import End.Collection import End.Header.Animation import End.Header.Object data Temp = Temp { _tempIden :: Int , _tempName :: B.ByteString , _tempLifeTime :: Int , _tempFu...
kwrooijen/sdl-game
End/Header/Object/Temp.hs
gpl-3.0
645
0
11
238
134
83
51
-1
-1
-- 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/src/TensorFlow/Internal/FFI.hs
apache-2.0
10,313
0
24
2,435
2,437
1,290
1,147
177
2
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} module Snap.Internal.Http.Server.Date ( getDateString , getLogDateString , getCurrentDateTime) where import Control.Exception import Control.Monad import Data.ByteString (ByteString) import Data.IORef import Foreign.C...
beni55/snap-server
src/Snap/Internal/Http/Server/Date.hs
bsd-3-clause
2,560
0
11
463
560
288
272
62
1
-- {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} -- !!! Test polymorphic recursion -- With polymorphic recursion this one becomes legal -- SLPJ June 97. {- To: Lennart Augustsson <augustss@cs.chalmers.se> Cc: partain@dcs.gla.ac.uk, John Peterson (Yale) <peterson-john@cs.yale.edu>, simonpj@dcs.gla.ac....
rahulmutt/ghcvm
tests/suite/typecheck/compile/tc091.hs
bsd-3-clause
1,998
0
12
419
236
133
103
11
2
{-# LANGUAGE TupleSections #-} module TupleSec where main = do print $ (,2) 1 print $ (,2,,4,,6) 1 3 5 print $ fst (((1,),) 3) 2
beni55/fay
tests/tupleSec.hs
bsd-3-clause
142
0
12
39
76
43
33
6
1
{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} ...
danidiaz/lens
src/Control/Lens/At.hs
bsd-3-clause
16,740
0
17
3,913
5,794
3,151
2,643
330
1
{-@ LIQUID "--no-termination" @-} module GhcSort () where import Language.Haskell.Liquid.Prelude {-@ type OList a = [a]<{\fld v -> (v >= fld)}> @-} {-@ type DList a = [a]<{\fld v -> (fld >= v)}> @-} --------------------------------------------------------------------------- --------------------------- Official...
mightymoose/liquidhaskell
tests/pos/GhcListSort.hs
bsd-3-clause
3,893
0
13
973
1,512
809
703
70
8
import Test.Cabal.Prelude main = setupAndCabalTest $ do skipUnless =<< ghcVersionIs (>= mkVersion [8,1]) r <- fails $ setup' "configure" [] assertOutputContains "UnfilledSig" r return ()
themoritz/cabal
cabal-testsuite/PackageTests/Backpack/Fail3/setup.test.hs
bsd-3-clause
203
0
12
41
73
35
38
6
1
{-# LANGUAGE ScopedTypeVariables #-} module Main where import Data.IORef main :: IO () main = do { (r :: IORef (t -> t)) <- newIORef id -- r <- newIORef i -- => Type-check error ; writeIORef r (\v -> if v then False else True) ; c <- readIORef r ; print $ c T...
TomMD/ghc
testsuite/tests/typecheck/should_fail/T5689.hs
bsd-3-clause
355
0
12
135
113
60
53
9
2
{-# LANGUAGE DataKinds, KindSignatures, PolyKinds, GADTs, ExistentialQuantification #-} module T6049 where data SMaybe :: (k -> *) -> Maybe k -> * where SNothing :: forall (s :: k -> *). SMaybe s Nothing SJust :: forall (s :: k -> *) (a :: k). SMaybe s (Just a)
siddhanathan/ghc
testsuite/tests/polykinds/T6049.hs
bsd-3-clause
272
0
9
59
93
54
39
5
0
contains :: Ord a => a -> [a] -> Bool contains _ [] = False contains x [y] | x == y = True | otherwise = False contains x ys | x == m = True | x < m = contains x (take p ys) | x > m = contains x (drop p ys) where p = (length ys) `div` 2 m = ys !! p
bati11/study-algorithm
catalog/binary_search/binary_search.hs
mit
289
0
9
109
168
82
86
11
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} module Solar.Asteroid.Core.Valuable.Class where -- base import Prelude(Either(..),String) -- bytestring import qualified Data.ByteStri...
Cordite-Studios/asteroid-core
src/Solar/Asteroid/Core/Valuable/Class.hs
mit
1,160
0
9
227
283
162
121
-1
-1
{-# LANGUAGE OverloadedStrings #-} module ConnectGithub where import qualified Control.Exception as E import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy as BL import Data.Monoid import qualified Data.Text as T import Data.Text.Encodi...
zeqing-guo/gin-haskell
src/ConnectGithub.hs
mit
1,978
0
17
635
482
261
221
34
4
module Bob (responseFor) where import Data.Char data EmotionalContent = Silence | Aggression | Question | Meh responseFor :: String -> String responseFor = display . classify display :: EmotionalContent -> String display Silence = "Fine. Be that way!" display Aggression = "Woah, chill out!" display Question = "...
JonRowe/exercism_exercises
haskell/bob/Bob.hs
mit
809
3
9
163
234
122
112
22
1
{-# LANGUAGE GADTs #-} module Orville.PostgreSQL.Internal.ReturningOption ( ReturningOption (..), ReturningClause, NoReturningClause, ) where data ReturningClause data NoReturningClause {- | Specifies whether or not a @RETURNING@ clause should be included when a query expression is built. This type i...
flipstone/orville
orville-postgresql-libpq/src/Orville/PostgreSQL/Internal/ReturningOption.hs
mit
563
0
6
91
53
35
18
-1
-1
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# LANGUAGE QuasiQuotes #-} module Grammar.Greek.Morph.Smyth.Verbs.Verbs where import Grammar.Greek.Morph.QuasiQuoters -- i. (a) vowel verbs: not contracted verbs -- Smyth 383 luo = -- indicative present [ [verbParadigm| λύ̄ω λύ̄εις λύ̄ει λύ̄ετον λύ̄ετον λύ̄ομε...
ancientlanguage/haskell-analysis
greek-morph/src/Grammar/Greek/Morph/Smyth/Verbs/Verbs.hs
mit
3,791
0
5
1,029
152
131
21
20
1
{-# LANGUAGE OverloadedStrings #-} module Idle.Ore where import Control.Applicative import Data.Char import Data.List.NonEmpty import qualified Data.Text as T import Graphics.Vty.Attributes import Idle.Ore.Parse import Paths_idle import Prelude hiding (readFile) import Text.Trifecta rockOf_ :: Color -> Color -> [(T....
pikajude/idle
src/Idle/Ore.hs
mit
10,874
0
16
3,393
3,502
1,859
1,643
200
3
{-| Module : Web.Facebook.Messenger.Internal Copyright : (c) Felix Paulusma, 2018 License : MIT Maintainer : felix.paulusma@gmail.com Stability : semi-experimental This module contains some functions that help in keeping 'FromJSON' instances concise. -} module Web.Facebook.Messenger.Internal ( -- * He...
Vlix/facebookmessenger
src/Web/Facebook/Messenger/Internal.hs
mit
4,573
0
17
1,079
837
478
359
60
2
-- | This module defines the command DSL. module System.Flannel.Command ( CommandM , Command , runCommand , isSet , getOption , getArg , getRemaining , run ) where import Control.Monad.Reader import qualified System.Flannel.Params as P -- | To build a Command, a 'ReaderT' is used. ...
nahiluhmot/flannel
src/System/Flannel/Command.hs
mit
1,117
0
8
237
236
135
101
25
1
----------------------------------------------------------------------------- -- -- Module : Cell -- Copyright : -- License : MIT -- -- Maintainer : agocorona@gmail.com -- Stability : experimental -- Portability : -- -- | -- -----------------------------------------------------------------...
geraldus/ghcjs-hplay
src/GHCJS/HPlay/Cell.hs
mit
9,384
0
24
3,055
2,308
1,189
1,119
150
4
{-| Dictionary functions. -} module Shikensu.Contrib ( clearMetadata , clearMetadataDef , clone , copyPropsToMetadata , copyPropsToMetadataDef , exclude , insertMetadata , insertMetadataDef , permalink , permalinkDef , prefixDirname , prefixDirnameDef , rename , ...
icidasset/shikensu
src/Shikensu/Contrib.hs
mit
6,308
0
13
1,374
1,156
629
527
125
2
{-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} ...
alanz/haskell-lsp
lsp-test/src/Language/LSP/Test/Session.hs
mit
18,334
0
21
4,037
4,798
2,493
2,305
-1
-1
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Y2017.M10.D04.Exercise where {-- Okay, so we've uploaded our data to a data store! Great! Yay! So. What're we gonna do with those data? Freeze it in Glacier? Yes, that's what companies do, but let's try something different: let's actually use those data and do...
geophf/1HaskellADay
exercises/HAD/Y2017/M10/D04/Exercise.hs
mit
3,721
0
8
621
396
241
155
39
1
module GHCJS.DOM.SVGTextPathElement ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/SVGTextPathElement.hs
mit
48
0
3
7
10
7
3
1
0