code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
module Main where data Suit = Spades | Hearts deriving (Show) data Rank = Ten | Jack | Queen | King | Ace deriving (Show) type Card = (Rank, Suit) type Hand = [Card] value :: Rank -> Integer value Ten = 1 value Jack = 2 value Queen = 3 value King = 4 value Ace = 5 cardValue :: Card -> Integer ...
mtraina/seven-languages-seven-weeks
week-7-haskell/day3/cards_with_show.hs
mit
357
0
6
97
143
82
61
13
1
module PPL2.VM.ALU.Types where import PPL2.Prelude import PPL2.VM.Types import PPL2.VM.Control.Types (MicroInstr) import Data.IntMap (IntMap) import qualified Data.IntMap as I import Data.Map (Map) import qualified Data.Map as M import qualified Data.List as L -- -------------------------...
UweSchmidt/ppl2
src/PPL2/VM/ALU/Types.hs
mit
1,989
0
13
397
636
344
292
44
1
import System.IO import System.Random import Control.Monad main = do gen <- getStdGen askForNumber gen askForNumber :: StdGen -> IO () askForNumber gen = do let (randNumber, newGen) = randomR (1, 10) gen :: (Int, StdGen) putStr "What is the secret number (1-10)? " hFlush stdout numberStrin...
feliposz/learning-stuff
haskell/guess2.hs
mit
587
0
13
168
182
87
95
18
2
{-| Module : Control.Monad.Bayes.Traced.Common Description : Numeric code for Trace MCMC Copyright : (c) Adam Scibior, 2015-2020 License : MIT Maintainer : leonhard.markert@tweag.io Stability : experimental Portability : GHC -} module Control.Monad.Bayes.Traced.Common ( Trace, singleton, output, ...
adscib/monad-bayes
src/Control/Monad/Bayes/Traced/Common.hs
mit
2,461
0
18
532
942
492
450
54
2
-- | Controls and helpers for changing slides in a deck. module Haste.Deck.Control ( forward, back, goto, skip, present, present_, enableDeck, disableDeck ) where import Control.Monad import Control.Monad.IO.Class import Data.IORef import Haste import Haste.Concurrent import Haste.DOM import Haste.Events impo...
valderman/haste-deck
Haste/Deck/Control.hs
mit
5,211
0
24
1,510
1,440
714
726
98
9
{-# LANGUAGE DataKinds #-} {-# OPTIONS_GHC -fdefer-type-errors -Wwarn #-} module Servant.Server.Internal.ContextSpec (spec) where import Data.Proxy (Proxy (..)) import Test.Hspec (Spec, context, describe, it, shouldBe) import Test.ShouldNotTypecheck ...
zoomhub/zoomhub
vendor/servant/servant-server/test/Servant/Server/Internal/ContextSpec.hs
mit
2,432
0
27
688
642
318
324
53
1
module Mockups.Elements.Txt where import qualified Data.ByteString.Char8 as BS import Mockups.Elements.Common data TxtAttr = TxtContent BS.ByteString | TxtColor Color deriving (Eq, Show)
ostapneko/tiny-mockups
src/main/Mockups/Elements/Txt.hs
mit
211
0
7
45
49
31
18
7
0
-- Модуль для тестирования библиотеки import Text.Parsec import qualified Address.Number as N import qualified Address.String as S import Address.Main import Address.Types main = do -- TODO: Тут хорошо было бы сделать модульное тестирование print $ parseAddr "строение 1-A/2" print $ parseAddr "стр 1-A/2...
kahless/russian-address-parser
src/Address/_Test.hs
mit
2,988
1
8
475
438
188
250
45
1
module Plumbing ( hashObject , writeTree , setRef ) where import qualified App import qualified Data.ByteString as B import Control.Monad.Trans.State (evalStateT) import System.Directory ( doesDirectoryExist, getDirectoryContents ) import System.FilePath ( (</>) ) import System.Log.Logger import Control.Exc...
danstiner/clod
src/Plumbing.hs
mit
2,747
0
19
661
901
453
448
73
3
----------------------------------------------------------------------------- -- | -- Module : DSP.Basic -- Copyright : (c) Matthew Donadio 1998 -- License : GPL -- -- Maintainer : m.p.donadio@ieee.org -- Stability : experimental -- Portability : portable -- -- Basic functions for manipulating signa...
tolysz/dsp
DSP/Basic.hs
gpl-2.0
3,650
0
11
824
1,021
572
449
44
2
-- #hide -------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GL.Domain -- Copyright : (c) Sven Panne 2002-2009 -- License : BSD-style (see the file libraries/OpenGL/LICENSE) -- -- Maintainer : sven.panne@aedion.de -- Stability : ...
ducis/haAni
hs/common/Graphics/Rendering/OpenGL/GL/Domain.hs
gpl-2.0
2,503
0
18
538
574
324
250
47
0
-- | Highlights Haskell code with ANSI terminal codes. module Language.Haskell.HsColour.TTY (hscolour,hscolourG) where {-@ LIQUID "--totality" @-} import Language.Haskell.HsColour.ANSI as ANSI import Language.Haskell.HsColour.Classify import Language.Haskell.HsColour.Colourise import Language.Haskell.HsColour.Output(...
nikivazou/hscolour
Language/Haskell/HsColour/TTY.hs
gpl-2.0
906
0
8
134
170
102
68
13
1
-- grid is a game written in Haskell -- Copyright (C) 2018 karamellpelle@hotmail.com -- -- This file is part of grid. -- -- grid is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the Lice...
karamellpelle/grid
source/Game/Run/RunData/Plain/ShadeSceneKonami.hs
gpl-3.0
5,267
0
13
1,330
1,148
590
558
104
1
{-# LANGUAGE OverloadedLists #-} module Nirum.Constructs.DeclarationSetSpec (SampleDecl (..), spec) where import Control.Exception.Base (evaluate) import Data.String (IsString (..)) import Test.Hspec.Meta import Nirum.Constructs (Construct (..)) import qualified Nirum.Constructs.Annotation as A import Nirum.Construc...
dahlia/nirum
test/Nirum/Constructs/DeclarationSetSpec.hs
gpl-3.0
5,054
0
18
1,880
1,213
632
581
96
1
{- ============================================================================ | Copyright 2011 Matthew D. Steele <mdsteele@alum.mit.edu> | | | | This file is part of Fallback. | ...
mdsteele/fallback
src/Fallback/View/Abilities.hs
gpl-3.0
13,251
0
28
3,572
3,328
1,705
1,623
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Blogger.Types.Sum -- Copyright : (c) 2015-2016 Brendan...
rueshyna/gogol
gogol-blogger/gen/Network/Google/Blogger/Types/Sum.hs
mpl-2.0
22,302
0
11
5,534
3,983
2,114
1,869
461
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.FirebaseRules.Types.Sum -- Copyright : (c) 2015-2016 B...
brendanhay/gogol
gogol-firebase-rules/gen/Network/Google/FirebaseRules/Types/Sum.hs
mpl-2.0
11,913
0
11
2,458
1,698
909
789
200
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-tpu/gen/Network/Google/Resource/TPU/Projects/Locations/Operations/Cancel.hs
mpl-2.0
6,102
0
15
1,233
714
424
290
103
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-urlshortener/gen/Network/Google/Resource/URLShortener/URL/List.hs
mpl-2.0
2,916
0
14
645
390
233
157
56
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/ManagedConfigurationsforUser/List.hs
mpl-2.0
5,908
0
20
1,390
787
458
329
123
1
module Data.Multimap.Tests ( runTests ) where import qualified Data.Multimap as Multimap import qualified Data.Set as Set import Test.Dwergaz testKey1 :: String testKey1 = "one" testKey2 :: String testKey2 = "two" empty :: Multimap.Multimap String Int empty = Multimap.empty inserter :: (Ord k, ...
henrytill/hecate
tests/Data/Multimap/Tests.hs
apache-2.0
2,477
0
10
616
709
407
302
76
1
module Graham.A328045 (a328045, a328045_list) where import Data.List (genericIndex, subsequences) import Graham.A006255 (a006255_list) import Graham.A300518 (a300518) import Math.NumberTheory.Powers.Squares (isSquare') import Math.NumberTheory.Powers.Fourth (isFourthPower') a328045 :: Integer -> Integer a328045 n | ...
peterokagey/haskellOEIS
src/Graham/A328045.hs
apache-2.0
1,146
0
13
197
439
235
204
25
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QGroupBox_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:26 Warning : this file is machine generated - do n...
keera-studios/hsQt
Qtc/Gui/QGroupBox_h.hs
bsd-2-clause
56,487
0
18
12,271
18,825
9,082
9,743
-1
-1
----------------------------------------------------------------------------- -- | -- Module : XMonad.Actions.Eval -- Copyright : (c) 2009 Daniel Schoepe -- License : BSD3-style (see LICENSE) -- -- Maintainer : Daniel Schoepe <daniel.schoepe@gmail.com> -- Stability : unstable -- Portability : unport...
eb-gh-cr/XMonadContrib1
XMonad/Actions/MyEval.hs
bsd-3-clause
4,233
0
12
1,299
581
332
249
35
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} module Web.Bugzilla.Search ( -- * Search operators (.==.) , (./=.) , (.<.) , (.<=.) , (.>.) , (.>=.) , (.=~.) , (./=~.) , equalsAny , contains , containsCase , containsAny , containsAll , changedBefore , changedAfter , changedFrom , changedTo , changedBy ,...
sethfowler/hsbugzilla
src/Web/Bugzilla/Search.hs
bsd-3-clause
3,132
0
8
556
1,138
644
494
90
1
{-# LANGUAGE TemplateHaskell, DeriveGeneric, RankNTypes #-} module MinIR.OrderedIndex ( OrderedIndex , fromTerms , termsScore ) where import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as HM import qualified...
bgamari/minir
MinIR/OrderedIndex.hs
bsd-3-clause
3,422
0
15
915
1,316
679
637
-1
-1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Web.Tumblr.Types where import Control.Applicative (empty) import Data.Aeson import Data.Time (UTCTime) import Data.Time.Format (parseTimeM, defaultTimeLocale) import Data.Time.LocalTime (zonedTimeToUTC) impor...
Taneb/humblr
src/Web/Tumblr/Types.hs
bsd-3-clause
7,462
0
39
2,039
2,149
1,181
968
225
0
{-# LANGUAGE OverloadedStrings #-} module Commands ( Command(..) , commands ) where import Data.Aeson import qualified Data.Text as T import qualified Data.Map as M import HQStatus (getHQStatusString) data Command = Command { help :: T.Text , reply :: [T.Text] -> IO T.Text , inGroupChat ::...
astro/l-bot
src/Commands.hs
bsd-3-clause
1,042
0
12
238
360
200
160
25
2
-- Advent of Code ---- Day 25: Let It Snow module AOC2015.Day25 where import Math.NumberTheory.Powers {- Right-to-left binary method https://en.wikipedia.org/wiki/Modular_exponentiation#Right-to-left_binary_method -} coord :: Int -> Int -> Int coord n m = div (k*(k+1)) 2 + m where k = n + m answers :: IO () ...
bitrauser/aoc
src/AOC2015/Day25.hs
bsd-3-clause
629
0
16
175
179
93
86
13
1
module Web.Dash.Fetch ( fetch , fetch' ) where import Data.Maybe import Network.URL import Network.Curl import Text.JSON type PeriodOptions = [(String, String)] -- | @fetch'@ fetches the data for the given API Token, @token@, -- and metric name, @metric@, in the time window, @opts@ fe...
bruce/dash-haskell
Web/Dash/Fetch.hs
bsd-3-clause
1,748
0
12
390
377
196
181
29
2
module TestDirScanner (tests) where import Definitions import DirScanner import Fixtures import System.FilePath import Test.Hspec.HUnit() import Test.Hspec.Monadic import Test.HUnit tests = describe "dir scanner:" $ do it "finds html files recursively" $ withTmpDir $ \tmpDir -> do createEmptyFile $ tmpDi...
rickardlindberg/alldoc
tests/TestDirScanner.hs
bsd-3-clause
898
0
16
227
244
124
120
22
1
{-# LANGUAGE MultiParamTypeClasses #-} -- | -- Module : Simulation.Aivika.Experiment.Chart.DeviationChartView -- Copyright : Copyright (c) 2012-2017, David Sorokin <david.sorokin@gmail.com> -- License : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability : experimental -- Tested with: G...
dsorokin/aivika-experiment-chart
Simulation/Aivika/Experiment/Chart/DeviationChartView.hs
bsd-3-clause
17,560
0
27
6,554
3,086
1,612
1,474
273
6
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -fno-warn...
cdornan/idiot
Text/RE/TDFA/Text/Lazy.hs
bsd-3-clause
2,471
0
8
659
486
289
197
50
1
module Arhelk.Russian.Lemma.Data.Substantive where import Arhelk.Russian.Lemma.Data.Common import Lens.Simple import Data.Monoid import TextShow -- | Склонение. Describes declension of substantives data Declension = FirstDeclension | SecondDeclension | ThirdDeclension deriving (Eq, Ord, Enum, Show, Bound...
Teaspot-Studio/arhelk-russian
src/Arhelk/Russian/Lemma/Data/Substantive.hs
bsd-3-clause
3,365
0
12
602
776
419
357
-1
-1
-- The Timber compiler <timber-lang.org> -- -- Copyright 2008-2009 Johan Nordlander <nordland@csee.ltu.se> -- 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 sour...
mattias-lundell/timber-llvm
src/Lambdalift.hs
bsd-3-clause
11,061
0
17
5,250
2,843
1,457
1,386
105
3
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} {-# LANGUAGE ConstraintKinds #-} module Fragment.Annotation.Rules.Type.Infer.SyntaxDirected ( AnnotationInferTypeContext , annotationInferTypeRules ) where im...
dalaing/type-systems
src/Fragment/Annotation/Rules/Type/Infer/SyntaxDirected.hs
bsd-3-clause
777
0
9
150
143
86
57
14
1
{-# LANGUAGE OverloadedStrings #-} -- | Find paths given the root directory of deployment. module Paths ( RootDir , incoming , angelConf , nginxConf , postgresConf ) where import Prelude () import Filesystem.Path.CurrentOS (FilePath, (</>)) type RootDir = FilePath incoming :: RootDir -> FileP...
yesodweb/deploy
src/Paths.hs
bsd-3-clause
595
0
6
110
129
78
51
18
1
{-# language TemplateHaskell, GADTs #-} import Data.Function.Memoize import Control.Monad (forM_, when) import Test3Helper -- NonstandardParams is defined by: -- -- data NonstandardParams a b -- = NonstandardParams (a -> Bool) b -- -- This won’t compile because it needs addition typeclass constraints in -- the ...
tov/memoize
test/test3.hs
bsd-3-clause
1,093
0
19
235
293
156
137
20
1
{-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -fno-warn-missing-methods #-} module HW06.HW06 where -- Exercise 1 ----------------------------------------- fib :: Integer -> Integer fib 0 = 0 fib 1 = 1 fib n = fib (n - 1) + fib (n - 2) fibs1 :: [Integer] fibs1 = fib `map` [0..] -- Exe...
kemskems/cis194-spring13
src/HW06/HW06.hs
bsd-3-clause
2,524
0
12
610
1,041
567
474
55
1
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} -------------------------------------------------------------------------------- {-| Module : Media Copyright : (c) Daan Leijen 2003 (c) shelarcy 2007 License : wxWindows Maintainer : wxhaskell-devel@lists.sourceforge.net Stability...
jacekszymanski/wxHaskell
wx/src/Graphics/UI/WX/Media.hs
lgpl-2.1
3,779
0
9
679
453
254
199
40
1
{-# language DataKinds #-} {-# language FlexibleInstances #-} import Control.Monad ( unless ) import qualified OpenCV as CV import OpenCV.TypeLevel import OpenCV.VideoIO.Types main :: IO () main = do cap <- CV.newVideoCapture -- Open the first available video capture device. Usually the -- webcam if run o...
lukexi/haskell-opencv
examples/src/videoio.hs
bsd-3-clause
1,376
0
19
401
360
172
188
30
3
-- ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow, 2011 -- -- Generate code to initialise cost centres -- -- ----------------------------------------------------------------------------- module Eta.Profiling.ProfInit (profilingInitCode) where import E...
rahulmutt/ghcvm
compiler/Eta/Profiling/ProfInit.hs
bsd-3-clause
1,654
0
6
329
102
74
28
7
1
module Tests.TestSuiteTasty where import System.Exit (exitFailure) import System.Environment (lookupEnv) import qualified Tests.Parser as P import qualified Tests.TypeCheck as TC import qualified Tests.Simplify as S import qualified Tests.Disintegrate as D import qualified Tests.Sample as E import ...
zachsully/hakaru
haskell/Tests/TestSuiteTasty.hs
bsd-3-clause
1,465
0
11
284
350
201
149
36
2
{-| Instance status data collector. -} {- Copyright (C) 2013 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 source code must retain the above copyright notice, this...
apyrgio/ganeti
src/Ganeti/DataCollectors/InstStatus.hs
bsd-2-clause
7,407
0
20
1,540
1,276
665
611
139
4
<?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="sq-AL"> <title>Active Scan Rules - Alpha | ZAP Extension</title> <maps> <homeID>top</homeID>...
thc202/zap-extensions
addOns/ascanrulesAlpha/src/main/javahelp/org/zaproxy/zap/extension/ascanrulesAlpha/resources/help_sq_AL/helpset_sq_AL.hs
apache-2.0
986
83
53
162
403
212
191
-1
-1
-- This example demonstrates the peril of trying to benchmark a -- function that performs lazy I/O. import Criterion.Main main :: IO () main = defaultMain [ -- By using whnfIO, when the benchmark loop goes through an -- iteration, we inspect only the first constructor returned after -- the file is opened....
paulolieuthier/criterion
examples/BadReadFile.hs
bsd-2-clause
653
0
10
147
53
31
22
4
1
module SchemeParse ( parseAtom {-, parseString-} , parseNumber , parseExpr , readExpr) where import Control.Monad import Text.ParserCombinators.Parsec hiding (spaces) import SchemeDef {-spaces :: Parser () spaces = skipMany1 space-} symbol :: Parser Char symbol = oneOf "!$%&|*+-/:<=>?@^_~" pars...
phlip9/scheme-interpreter
SchemeParse.hs
mit
1,242
0
11
400
265
136
129
27
3
{- Counting Sundays Problem 19 You are given the following information, but you may prefer to do some research for yourself. 1 Jan 1900 was a Monday. Thirty days has September, April, June and November. All the rest have thirty-one, Saving February alone, Which has twenty-eight, rain or shine. And on leap years, twent...
feliposz/project-euler-solutions
haskell/euler19.hs
mit
2,405
2
12
504
682
378
304
29
2
module Main where {- pwr :: Integral a => a -> a -> a pwr b e = pwr' b b e pwr' :: Integral a => a -> a -> a -> a pwr' acc b 1 = acc pwr' acc b e = pwr' (acc*b) b (e-1) x % y | x < y = x | x == y = 0 | otherwise = (x - y) % y -} result :: (Enum a, RealFloat a) => a result = head [ a * b * sqrt (a * ...
ron-wolf/haskeuler
src/09.hs
mit
450
0
14
151
152
80
72
5
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Data.List.NonEmpty import Language.SAL main :: IO () main = putStrLn (renderSAL ctx) ctx :: Context ctx = Context "salctx" Nothing body where body = ContextBody (ModuleDecl salmod :| []) salmod :: ModuleDeclaration salmod = let ins = InputDecl ...
GaloisInc/language-sal
examples/salmod.hs
mit
769
0
15
224
257
133
124
23
1
module KMC.Syntax.ParserCombinators ( repetitions , delims , parens , brackets , braces , suppressDelims , parseTable , nonGroupParens , genParseTable ) where import Control.Applicative hiding (many) import Text.ParserCombinators.Parsec (choice, count, many, many1, ...
diku-kmc/regexps-syntax
KMC/Syntax/ParserCombinators.hs
mit
3,169
0
12
747
793
415
378
54
4
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Y2018.M04.D09.Exercise where import Data.Aeson import Database.PostgreSQL.Simple import Database.PostgreSQL.Simple.SqlQQ {-- Okay, fam. We're going to wrap up our preparation for the data load by parsing tags into a tags lookup table. --} -- below imports avail...
geophf/1HaskellADay
exercises/HAD/Y2018/M04/D09/Exercise.hs
mit
804
0
8
116
135
84
51
18
1
{-# LANGUAGE FlexibleContexts , UndecidableSuperClasses #-} module MiniSequel.Mapper where import MiniSequel import MiniSequel.Expression ((=.), SequelExpression) import Database.HDBC import Data.Data import Data.Char (toUpper, toLower, isUpper) import Data.Maybe (fromJust) import qualified ...
TachoMex/MiniSequel
src/MiniSequel/Mapper.hs
mit
2,283
0
16
814
786
420
366
52
6
{-| Module: Y2015.D06 Description: Advent of Code Day 06 Solutions. License: MIT Maintainer: @tylerjl Solutions to the day 06 set of problems for <adventofcode.com>. -} module Y2015.D06 ( testA , testB , Instruction(..) , Range(..) , parseInstructions , configureGridA , configureGridB , light...
tylerjl/adventofcode
src/Y2015/D06.hs
mit
4,087
0
12
835
1,233
669
564
93
1
-- | In this module, we model an /elementary topos/ with Haskell types -- (see <https://en.wikipedia.org/wiki/Topos>). -- To be more precise, we model the "smallest elementary topos with a -- natural number object". Without such a natural number object, -- the resulting topos would be boring, consisting merely of the f...
brunjlar/protop
src/Protop/Core.hs
mit
1,649
0
5
247
225
158
67
33
0
module Solidran.Hamm.DetailSpec (spec) where import Test.Hspec import Solidran.Hamm.Detail spec :: Spec spec = do describe "Solidran.Hamm.Detail" $ do describe "hammingDist" $ do it "should work in the given sample" $ do hammingDist "GAGCCTACTAACGGGAT" "CATCGTAATGACGGCCT" ...
Jefffrey/Solidran
test/Solidran/Hamm/DetailSpec.hs
mit
726
0
17
261
139
69
70
18
1
{-| Module : Optimization.TAC.UnneededLabels Description : Remove labels which are never jumped to. Copyright : 2014, Jonas Cleve License : GPL-3 -} module Optimization.TAC.UnneededLabels ( removeUnneededLabels ) where import Interface.TAC ( TAC, Command (..), Label, isGoto, getLabelFromGo...
Potregon/while
src/Optimization/TAC/UnneededLabels.hs
gpl-3.0
1,062
0
10
235
205
118
87
21
3
fact1 0 = 1 fact1 n = fact1 (n-1) * n fact2 n | n == 0 = 1 | otherwise = fact2 (n-1) * n fact3 n = case n == 0 of True -> 1 False -> fact3 (n-1) * n fact4 n = case n of 0 -> 1 _ -> fact4 (n-1) * n fact5 n = product [1..n] fact6 n = if n == 0 then 1 ...
graninas/Haskell-Algorithms
Tests/Fact.hs
gpl-3.0
341
4
9
148
206
100
106
14
2
module Level.Task where import Control.Lens.Operators import Level import qualified Level.Command as Command import StaticElement(StaticElement) import Task import Counter import Actor (TaskType(Mine)) import Unfold import Level.Transformation mine :: StaticElement -> Level -> Identifier Task -> Task mine s lvl i = ...
svenkeidel/gnome-citadel
src/Level/Task.hs
gpl-3.0
801
0
12
208
251
141
110
20
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-route53/gen/Network/AWS/Route53/UpdateHealthCheck.hs
mpl-2.0
10,652
0
14
2,210
1,427
852
575
162
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-games/gen/Network/Google/Resource/Games/Players/Get.hs
mpl-2.0
3,666
0
14
869
487
288
199
72
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-storage/gen/Network/Google/Resource/Storage/Objects/Patch.hs
mpl-2.0
7,369
0
22
1,852
1,125
643
482
153
1
{-# LANGUAGE CPP #-} import qualified Control.Exception as E import Control.Monad (filterM, join, liftM2, mapM_, unless, when) import qualified Data.ByteString.Lazy as B import Data.Char ( ord ) import Data.Functor ( (<$>) ) import Data.List (foldl', foldr, intersperse, intercalate, nub, lookup, isPrefix...
jacekszymanski/wxHaskell
wxc/Setup.hs
lgpl-2.1
29,164
13
20
9,044
5,731
3,006
2,725
-1
-1
module System.Monitoring.Nrpe ( checkNRPE , liftNRPE , IONRPE , NRPE -- re-exports lower-level modules , module System.Monitoring.Nrpe.Protocol , module System.Monitoring.Nrpe.Nagios ) where import Data.ByteString (ByteString) import Control.Applicative ((<$>)) import System.Monitoring.Nrpe.Protoco...
lucasdicioccio/nrpe
src/System/Monitoring/Nrpe.hs
apache-2.0
752
0
7
129
210
125
85
17
1
{-# LANGUAGE ViewPatterns #-} module Language.K3.Codegen.CPP.Materialization.Common where import Control.Arrow import Data.Hashable import Language.K3.Core.Annotation import Language.K3.Core.Common import Language.K3.Core.Expression import Language.K3.Core.Type rollLambdaChain :: K3 Expression -> ([(Identifier, K3 ...
DaMSL/K3
src/Language/K3/Codegen/CPP/Materialization/Common.hs
apache-2.0
1,095
0
11
174
435
244
191
27
5
{- Copyright 2015 Tristan Aubrey-Jones 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 writing, sof...
flocc-net/flocc
v0.1/Compiler/Back/TypeNames.hs
apache-2.0
8,904
0
24
2,350
2,062
1,105
957
74
16
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QGraphicsItemGroup_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:25 Warning : this file is machine generat...
keera-studios/hsQt
Qtc/Gui/QGraphicsItemGroup_h.hs
bsd-2-clause
98,747
0
18
20,812
30,664
14,671
15,993
-1
-1
module Handler.View where import Import import Handler.Markdown (renderMarkdown) getViewR :: NoteId -> Handler RepHtml getViewR noteId = do note <- runDB $ get404 noteId defaultLayout $ do setTitle (toHtml $ noteTitle note) let markdown = renderMarkdown (unTextarea $ noteText note) $(widgetFile "view"...
MasseR/introitu
Handler/View.hs
bsd-2-clause
322
0
16
60
108
52
56
-1
-1
module Permutations where import Data.List (delete, nub) -- | List all permutations of a list (4 kyu) -- | Link: https://biturl.io/Permutations -- | My original solution permutations :: Eq a => [a] -> [[a]] permutations [] = [[]] permutations xs = nub [x : ys | x <- xs, ys <- permutations (delete x xs)]
Eugleo/Code-Wars
src/combinatorics-kata/Permutations.hs
bsd-3-clause
308
0
11
58
105
58
47
5
1
{-# LANGUAGE OverloadedStrings #-} module Main ( main ) where import Control.Applicative ((<$>)) import Control.Monad (forever, mzero) import Control.Monad.Trans (liftIO) import Control.Monad.IO.Class (MonadIO) import Control.Concurrent (forkIO, ThreadId) im...
rvion/chrome-reloader
src/Main.hs
bsd-3-clause
2,454
0
20
742
651
354
297
58
1
{- Copyright (c) 2014-2015, Johan Nordlander, Jonas Duregård, Michał Pałka, Patrik Jansson and Josef Svenningsson All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistribu...
josefs/autosar
oldARSim/Main.hs
bsd-3-clause
2,812
0
9
724
317
154
163
19
1
module HaskellCI.Config.Jobs where import HaskellCI.Prelude import qualified Distribution.Compat.CharParsing as C import qualified Distribution.Parsec as C import qualified Distribution.Pretty as C import qualified Text.PrettyPrint as PP -- | Jobs -- -- * @N:M@ - @N@ ghcs (caba...
hvr/multi-ghc-travis
src/HaskellCI/Config/Jobs.hs
bsd-3-clause
1,460
0
15
400
428
229
199
32
1
-- {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE ExplicitForAll #-} --{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} -- {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} --{-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE RankNTypes #-} --{-# LANGUAGE RebindableSyntax...
LATBauerdick/fv.hs
src/FV/Fit.hs
bsd-3-clause
7,151
38
20
2,667
2,488
1,330
1,158
142
3
{-# OPTIONS -fno-warn-tabs #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and -- detab the module (please do the detabbing in a separate patch). See -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces -- fo...
nomeata/ghc
compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs
bsd-3-clause
2,590
0
10
560
404
238
166
44
7
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} {-@ LIQUID "--no-termination "@-} import LiquidHaskell import Language.Haskell.Liquid.Prelude import Prelude hiding (sum, length, (!!), Functor(..)) import qualified Prelude as P [lq| qualif Size(v:int, xs:a): v = (size xs) |] [lq| data List a = N...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/Class.hs
bsd-3-clause
2,007
4
9
577
679
366
313
-1
-1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} -- | Provides operations for BitFields that are used in the protocol. module Network.BitTorrent.BitField ( BitField(..) , newBitField , get , set , completed , toPWP ) where import Control.DeepSeq import Data.Bits impo...
farnoy/torrent
src/Network/BitTorrent/BitField.hs
bsd-3-clause
2,400
0
12
471
536
302
234
49
2
-- | contains a prettyprinter for the -- Template Haskell datatypes module Language.Haskell.TH.Ppr where -- All of the exports from this module should -- be "public" functions. The main module TH -- re-exports them all. import Text.PrettyPrint (render) import Language.Haskell.TH.PprLib import Language.Ha...
GaloisInc/halvm-ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
28,065
0
14
8,235
9,832
4,812
5,020
569
8
{-# LANGUAGE CPP, BangPatterns #-} {-# OPTIONS -Wall #-} ----------------------------------------------------------------------------- -- | -- Module : Language.CFamily.Data.InputStream -- Copyright : (c) 2008,2011 Benedikt Huber -- License : BSD-style -- Maintainer : benedikt.huber@gmail.com -- Stabili...
micknelso/language-c
src/Language/CFamily/Data/InputStream.hs
bsd-3-clause
2,994
0
8
493
345
216
129
32
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE FlexibleInstances, ViewPatterns #-} ----------------------------------------------------------------------------- -- | -- Module : Data.HyperDex.Client -- Copyright : (c) Aaron Friel 2013 -- License : BSD-style -- Maintainer : mayreply@aaronfriel.com -...
AaronFriel/hyhac
src/Database/HyperDex/Utf8.hs
bsd-3-clause
2,349
0
9
330
397
232
165
33
1
module Automata where import Sets -- Estrutura de um automato finito nao deterministico data Nfa a = NFA (Set a) (Set (Move a)) a (Set a) deriving (Eq, Show) -- data Move a = Move a Char a |Emove a a deriving (Eq, Ord...
arthurmgo/regex-ftc
src/Automata.hs
bsd-3-clause
2,764
0
18
853
1,221
611
610
60
2
module DropNth where --(Problem 16) Drop every N'th element from a list. dropNth :: [a] -> Int -> [a] dropNth [] _ = [] dropNth y@(x:xs) n = (take (n - 1) y) ++ dropNth (drop 2 xs) n
michael-j-clark/hjs99
src/11to20/DropNth.hs
bsd-3-clause
188
0
9
44
90
49
41
4
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ScopedTypeVariables #-} -- | See "Control.Monad.Ether.Reader". module Control.Monad.Ether.Implicit.Reader ( -- * MonadReader class MonadReader , local , ask , reader , asks -- * The Reader monad , Reader , runReader -- * The R...
bitemyapp/ether
src/Control/Monad/Ether/Implicit/Reader.hs
bsd-3-clause
1,690
0
9
333
422
239
183
33
1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Data.MessagePack.Types.Instances () where import Data.Void (Void) import Data.MessagePack.Types.Class (MessagePack) import Data.MessagePack.Types.Generic () instance MessagePack a => MessagePack (Maybe a) instance (Me...
SX91/hs-msgpack-types
src/Data/MessagePack/Types/Instances.hs
bsd-3-clause
403
0
7
96
101
57
44
8
0
{-# LANGUAGE DoRec #-} module LazyRec where import Control.Monad.Trans.Writer import Data.Maybe type Symbol = String type Line = Int type SymData = (Symbol, Line) type Stmt = (SymData, [String]) type Prog = [Stmt] prog :: Prog prog = [ (("alma", 1), ["korte", "alma"]) , (("korte", 2), ["szilva"]) , (("szilva",...
robinp/haskell-toys
src/Toys/LazyRec.hs
bsd-3-clause
1,248
0
13
258
500
277
223
39
1
module Win32Font {- ( CharSet , PitchAndFamily , OutPrecision , ClipPrecision , FontQuality , FontWeight , createFont, deleteFont , StockFont, getStockFont , oEM_FIXED_FONT, aNSI_FIXED_FONT, aNSI_VAR_FONT, sYSTEM_FONT , dEVICE_DEFAULT_FONT, sYSTEM_FIXED_FONT ) where -} where import StdDIS import Win32Typ...
OS2World/DEV-UTIL-HUGS
libraries/win32/Win32Font.hs
bsd-3-clause
14,409
143
31
2,242
3,506
1,906
1,600
-1
-1
module Simplify where import Prelude hiding (pi, abs) import Lang.LF import Terms import qualified Debug.Trace as Debug data BindData (γ :: Ctx *) where BindEmpty :: BindData E BindLetcont :: BindData γ -> LF γ TERM {- :: v ==> term -} -> BindData (γ ::> b) Bin...
robdockins/canonical-lf
toyml/Simplify.hs
bsd-3-clause
13,373
0
26
5,522
4,399
2,123
2,276
-1
-1
{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Test.AWS.Gen.SWF -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay...
fmapfmapfmap/amazonka
amazonka-swf/test/Test/AWS/Gen/SWF.hs
mpl-2.0
20,077
0
7
3,449
1,834
1,076
758
319
1
module B1.Program.Chart.TaskManager ( TaskManager , newTaskManager ) where data TaskManager = TaskManager (IORef [IO ()]) newTaskManager :: IO TaskManager newTaskManager = do workQueue <- newIORef [] return $ TaskManager workQueue
madjestic/b1
src/B1/Program/Chart/ThreadManager.hs
bsd-3-clause
244
0
11
43
74
39
35
8
1
{-# LANGUAGE FlexibleInstances,FlexibleContexts,MultiWayIf,CPP #-} module Herbie.MathInfo where import Class import DsBinds import DsMonad import ErrUtils import GhcPlugins hiding (trace) import Unique import MkId import PrelNames import UniqSupply import TcRnMonad import TcSimplify import Type import Control.Mon...
mikeizbicki/HerbiePlugin
src/Herbie/MathInfo.hs
bsd-3-clause
11,357
0
21
4,332
3,018
1,557
1,461
203
15
module Term.CLS where -- $Id$ -- untersuche, ob CL(S) rückwärts change-bounded ist -- falls ja, dann wäre das ein argument für REG-erhaltung import Term.Type import Term.Dot import Term.Match import Term.Change import ToDoc import Data.FiniteMap import Control.Monad ( when ) type STerm = Term Char instance ToDo...
Erdwolf/autotool-bonn
src/Term/CLS.hs
gpl-2.0
2,342
8
15
721
1,144
598
546
75
2
-- ==========================================================-- -- === Raw lexical analysis (tokenisation) of source ===-- -- === Lexer.hs ===-- -- ==========================================================-- module Main where -- import Char -- 1.3 ----------------------...
roberth/uu-helium
test/simple/benchmarks/Main.hs
gpl-3.0
39,140
0
19
14,963
11,121
6,009
5,112
905
26
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module Hakyll.Core.Rules.Tests ( tests ) where -------------------------------------------------------------------------------- import Data.IORef (IORef, newIORef, ...
Minoru/hakyll
tests/Hakyll/Core/Rules/Tests.hs
bsd-3-clause
3,836
0
14
1,163
780
390
390
76
1
{-# LANGUAGE TypeInType, ScopedTypeVariables, TypeOperators, GADTs #-} {-# OPTIONS_GHC -Wno-overlapping-patterns #-} -- don't want erroneous warning in test output -- if removing this doesn't change output, then -- remove it!...
ezyang/ghc
testsuite/tests/typecheck/should_compile/T13337.hs
bsd-3-clause
602
0
11
196
133
73
60
-1
-1
{-# LANGUAGE MagicHash, UnboxedTuples #-} module Main ( main ) where import GHC.Exts import GHC.Prim import GHC.ST main = putStr (test_sizeofArray ++ "\n" ++ test_sizeofMutableArray ++ "\n" ) test_sizeofArray :: String test_sizeofArray = flip shows "\n" $ runST $ ST $ \ s# -> go 0 [] s...
hferreiro/replay
testsuite/tests/codeGen/should_run/cgrun065.hs
bsd-3-clause
982
0
21
320
374
190
184
24
1
add a b = a + b
pauldoo/scratch
RealWorldHaskell/ch02/add.hs
isc
17
0
5
8
16
7
9
1
1
module Parse (parse, parseExpr, lexSynonym) where import Text.Parsec hiding (parse) import qualified Text.Parsec as P import Text.Parsec.String (Parser) import LambdaWithSynonyms (Expr'(..)) import Data.Functor ((<$>)) import Control.Arrow (left) import Control.Applicative ((<*)) parse :: String -> Either String Expr...
hughfdjackson/abattoir
src/Parse.hs
mit
1,234
0
8
191
405
219
186
36
1
{-# OPTIONS -Wall #-} {-# LANGUAGE TupleSections #-} import qualified Data.List as List import qualified Data.Map.Strict as Map import qualified Data.Maybe as Maybe import Data.Set (Set) import qualified Data.Set as Set import Helpers.Function import Helpers.Grid (Grid, Point) import qualified Helpers.Grid as Grid ma...
SamirTalwar/advent-of-code
2021/AOC_11_2.hs
mit
1,308
0
19
355
429
231
198
30
2
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE DeriveGeneric #-} -- | simple haskell interface for freetype2 -- -- for error codes: https://hackage.haskell.org/package/freetype2-0.1.1/src/include/freetype/fterrdef.h module Graphics.Font ( module Gr...
MaxDaten/typography-ft2
Graphics/Font.hs
mit
2,801
0
12
755
720
390
330
68
2
-- A Gift Well Spent -- http://www.codewars.com/kata/54554846126a002d5b000854/ module Gift where buy :: (Num a, Eq a) => a -> [a] -> Maybe (Int, Int) buy c is = if null cs then Nothing else Just (head cs) where cs = [(i, j) | i<-[0..length is - 1], j <- drop i [1..length is - 1], is!!i + is!!j == c]
gafiatulin/codewars
src/7 kyu/Gift.hs
mit
308
0
13
67
157
84
73
4
2
module Y2017.M07.D26.Exercise where import Control.Monad.State import Data.Map (Map) -- below import available via 1HaskellADay git repository import Relational.Scheme.Types {-- Unification and freshness for today. So, yesterday, we saw how to unify two atoms and how that reduced to lifting their equivalence into ...
geophf/1HaskellADay
exercises/HAD/Y2017/M07/D26/Exercise.hs
mit
3,957
0
9
746
280
162
118
20
1