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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE... | qmuli/qmuli | library/Qi/Program/Config/Ipret/State.hs | mit | 7,342 | 0 | 22 | 2,235 | 1,081 | 575 | 506 | -1 | -1 |
module Main where
import Test.Hspec
import qualified Spec
main :: IO ()
main = do
putStrLn "before spec"
hspec Spec.spec
putStrLn "after spec"
| beni55/hspec | hspec-discover/integration-test/with-module-name/Main.hs | mit | 161 | 0 | 8 | 41 | 48 | 24 | 24 | 8 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Control.Functor.End
-- Copyright : (C) 2008 Edward Kmett
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability : experimental
-- Portability : non-po... | urska19/MFP---Samodejno-racunanje-dvosmernih-preslikav | Control/Functor/End.hs | apache-2.0 | 568 | 0 | 9 | 95 | 68 | 46 | 22 | -1 | -1 |
-- |
-- Module: Network.Riak.CRDT.Types
-- Copyright: (c) 2016 Sentenai
-- Author: Antonio Nikishaev <me@lelf.lu>
-- License: Apache
-- Maintainer: Tim McGilchrist <timmcgil@gmail.com>, Mark Hibberd <mark@hibberd.id.au>
-- Stability: experimental
-- Portability: portable
--
-- Haskell-side view of CR... | tmcgilchrist/riak-haskell-client | riak/src/Network/Riak/CRDT/Types.hs | apache-2.0 | 7,791 | 0 | 11 | 1,963 | 1,787 | 1,006 | 781 | 169 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : Network.HTTP.Base
-- Copyright : See LICENSE file
-- License : BSD
--
-- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>
-- Stability : experimental
-- Port... | beni55/HTTP | Network/HTTP/Base.hs | bsd-3-clause | 33,862 | 777 | 18 | 8,894 | 7,066 | 4,112 | 2,954 | 557 | 13 |
{-# LANGUAGE OverloadedStrings #-}
module Formalize.Internal.Util
( saveAsPdf
, createFormData
, createEmptyFormData
, emptyFlash
) where
import qualified Data.ByteString as BS
import qualified Data.Text as T
import Data.Time.Format
import Data.Time.LocalTime
impor... | thevangelist/Crystallize | src/Formalize/Internal/Util.hs | bsd-3-clause | 1,402 | 0 | 10 | 305 | 342 | 179 | 163 | 34 | 1 |
{-
(c) The GRASP Project, Glasgow University, 1994-1998
\section[TysWiredIn]{Wired-in knowledge about {\em non-primitive} types}
-}
{-# LANGUAGE CPP #-}
-- | This module is about types that can be defined in Haskell, but which
-- must be wired into the compiler nonetheless. C.f module TysPrim
module TysWiredIn (
... | fmthoma/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | 34,170 | 0 | 14 | 8,985 | 5,385 | 2,942 | 2,443 | 474 | 10 |
{-# LANGUAGE OverloadedStrings #-}
module Css.Post
(postStyles) where
import Clay
import Prelude hiding ((**))
import Css.Constants
-- Post Styles
postStyles :: Css
postStyles = do
body ?
do color grey1
fontWeight $ normal
tabsCSS
postCSS
tabsCSS :: Css
tabsCSS = do
"#posts" &... | alexbaluta/courseography | app/Css/Post.hs | gpl-3.0 | 5,033 | 0 | 24 | 2,003 | 1,248 | 535 | 713 | 154 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE GADTs #-}
-- This module is full of orphans, unfortunately
module GHCi.TH.Binary () where
import Data.Binary
import qualified Data.ByteString as B
... | ezyang/ghc | libraries/ghci/GHCi/TH/Binary.hs | bsd-3-clause | 2,651 | 0 | 10 | 377 | 723 | 352 | 371 | 76 | 0 |
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Program.Ar
-- Copyright : Duncan Coutts 2009
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This module provides an library inter... | fugyk/cabal | Cabal/Distribution/Simple/Program/Ar.hs | bsd-3-clause | 6,773 | 0 | 21 | 1,884 | 1,381 | 732 | 649 | -1 | -1 |
-- Test newtype derived instances
newtype Age = MkAge Int deriving (Eq, Show)
instance Num Age where
(+) (MkAge a) (MkAge b) = MkAge (a+b)
(*) = undefined
negate = undefined
abs = undefined
signum = undefined
fromInteger = undefined
main = print (MkAge 3 + MkAge 5)
| ghc-android/ghc | testsuite/tests/deriving/should_run/drvrun001.hs | bsd-3-clause | 307 | 0 | 8 | 89 | 111 | 61 | 50 | 9 | 1 |
{-# LANGUAGE TypeFamilies #-}
module J2S.Game.Mock where
import Control.Applicative
import Control.Monad.Except
import Control.Monad.Identity
import Control.Monad.Trans.Except
import qualified Data.List.NonEmpty as NE
import Numeric.Natural
import ... | berewt/J2S | test/J2S/Game/Mock.hs | mit | 1,699 | 0 | 13 | 438 | 490 | 267 | 223 | 43 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Handler.Repo where
import Data.ElmPackage
import Data.PersistSemVer
import Data.SemVer (toText)
import Dat... | rgrempel/frelm.org | src/Handler/Repo.hs | mit | 8,192 | 0 | 20 | 3,881 | 795 | 407 | 388 | 86 | 3 |
{-# htermination toInteger :: Int -> Integer #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_toInteger_1.hs | mit | 49 | 0 | 2 | 8 | 3 | 2 | 1 | 1 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module CountdownGame.Spiel.Phasen
( SpielParameter (..)
, Phasen (..)
, Versuche
, Ergebnisse, Ergebnis (..)
, startGameLoop
, versuchHinzufuegen
)where
import GHC.Generics (Generic)
import Control.Con... | CarstenKoenig/Countdown | src/web/CountdownGame/Spiel/Phasen.hs | mit | 4,728 | 0 | 16 | 969 | 1,325 | 702 | 623 | 109 | 2 |
module LogicProblem.Solver.SDef (
SolveResult(..)
, SolveInnerResult(..)
, solveResult
, hasFinished
) where
import LogicProblem.Solver.Def
import LogicProblem.Solver.Hypotheses
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
data SolveInnerResult r e = NewHypoth... | fehu/h-logic-einstein | src/LogicProblem/Solver/SDef.hs | mit | 1,006 | 0 | 10 | 319 | 189 | 109 | 80 | 18 | 1 |
{-# LANGUAGE FlexibleContexts, GADTs, TypeFamilies, ViewPatterns, RankNTypes #-}
module BiFlux.Trans.Translation where
import Lang.AST as BiGUL
import Lang.MonadBiGULError
import Control.Monad
import Control.Monad.Except
import GHC.InOut
import BiFlux.Lang.AST as BiFlux
import BiFlux.DTD.Type as BType
import Text.Pret... | prl-tokyo/bigul-configuration-adaptation | Transformations/src/BiFlux/Trans/Translation.hs | mit | 23,236 | 0 | 22 | 5,811 | 7,186 | 3,546 | 3,640 | 305 | 9 |
-- Type where we specify the shape of each of the elements
-- Algebraic operations
-- "sum" is alternation (A | B, meaning A or B but not both)
-- "product" is combination (A B, meaning A and B together)
data Pair = P Int Double -- Pair of numbers, an Int and a Double
data Pair = I Int | D Double -- Either an Int or ... | domenicosolazzo/practice-haskell | basics/algebraic_datatype.hs | mit | 332 | 2 | 5 | 75 | 36 | 20 | 16 | 2 | 0 |
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
module Y2018.M01.D08.Exercise where
{--
Okay, one more, then a thought on generalization.
Friday, we looked at sections classifying newspaper articles as a graph, but
now we want to store unique sections in a table and relate those sections back
to the articles they cl... | geophf/1HaskellADay | exercises/HAD/Y2018/M01/D08/Exercise.hs | mit | 3,600 | 0 | 13 | 562 | 459 | 278 | 181 | 42 | 1 |
{-# LANGUAGE OverlappingInstances, IncoherentInstances, UndecidableInstances,
PatternGuards, TupleSections #-}
module HeredNormal where
import Prelude hiding (pi,abs,mapM)
import Control.Applicative
import Control.Monad ((<=<))
import Control.Monad.Except hiding (mapM)
import Control.Monad.Reader hiding (mapM)
... | andreasabel/helf | src/HeredNormal.hs | mit | 4,403 | 116 | 17 | 988 | 1,696 | 900 | 796 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad
import Data.Attoparsec
import Data.Attoparsec.Char8 as A
import Data.ByteString.Char8
data Action
= Success
| KeepAlive
| NoResource
| Hangup
| NewLeader
| Election
deriving Show
type Sender = ByteString
type Payload = ByteString
data Message = ... | riwsky/wiwinwlh | src/attoparsec.hs | mit | 1,001 | 11 | 10 | 228 | 316 | 154 | 162 | 43 | 7 |
import Data.List
layout :: [String] -> IO ()
layout = putStr
. unlines
. zipWith (\n l -> show n ++ ") " ++ l) [1..]
appString :: String -> String -> String
appString l r = "(" ++ l ++ "++" ++ r ++ ")"
split :: [a] -> [([a],[a])]
split [] = []
split [_] = []
split (x:xs) = ([x],xs) : [(x:ls,rs) | (ls,rs) <- sp... | craynafinal/cs557_functional_languages | hw3/q2.hs | mit | 1,049 | 3 | 14 | 210 | 590 | 312 | 278 | 27 | 2 |
{- Copyright © 2012, Vincent Elisha Lee Frey. All rights reserved.
- This is open source software distributed under a MIT license.
- See the file 'LICENSE' for further information.
-}
module System.Console.CmdTheLine.Common where
import Data.Function ( on )
import Text.PrettyPrint ( Doc, text )
import Control.A... | glutamate/cmdtheline | src/System/Console/CmdTheLine/Common.hs | mit | 6,129 | 1 | 12 | 1,828 | 1,328 | 747 | 581 | 109 | 2 |
{-|
Module : TestPrint.Problen.ProblemExpr
Description : The ProblemExpr type Printer tests
Copyright : (c) Andrew Burnett 2014-2015
Maintainer : andyburnett88@gmail.com
Stability : experimental
Portability : Unknown
The Test Tree Node for the ProblemExpr type's Printer Tests
-}
module TestPrint.Problem.Pro... | aburnett88/HSat | tests-src/TestPrint/Problem/ProblemExpr.hs | mit | 738 | 0 | 6 | 145 | 86 | 53 | 33 | 16 | 1 |
{-# LANGUAGE TupleSections #-}
------------------------------------------------------------------------------
module Snap.Snaplet.Rest.Resource.Builder
( addMedia
, setCreate
, setRead
, setUpdate
, setDelete
, setToDiff
, setFromParams
, setPutAction
) where
----------------------... | zmthy/snaplet-rest | src/Snap/Snaplet/Rest/Resource/Builder.hs | mit | 4,249 | 0 | 16 | 777 | 922 | 489 | 433 | 58 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Views.Components.MainFooter (mainFooterView) where
import BasicPrelude
import Text.Blaze.Html5 (Html, (!))
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as A
mainFooterView :: Html
mainFooterView =
H... | nicolashery/example-marvel-haskell | Views/Components/MainFooter.hs | mit | 722 | 0 | 14 | 156 | 182 | 99 | 83 | 20 | 1 |
import System.Environment (getArgs)
import qualified Data.ByteString.Lazy as B
copyFile :: FilePath -> FilePath -> IO ()
copyFile source dest = do
contents <- B.readFile source
B.writeFile dest contents
main = do
(fileName1:fileName2:_) <- getArgs
copyFile fileName1 fileName2
| topliceanu/learn | haskell/bytestr.hs | mit | 296 | 0 | 10 | 56 | 101 | 51 | 50 | 9 | 1 |
{-# LANGUAGE BangPatterns, RankNTypes #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
{-# OPTIONS_GHC -fspec-constr #-}
{-# OPTIONS_GHC -fdicts-cheap #-}
module Main where
import Criterion.Main as C
import HERMIT.Optimization.StreamFusion.List
f :: Int -> Int
f n = foldl (+) 0 (concatMap (\x -> enumFromTo... | ku-fpg/hermit-streamfusion | Intuition.hs | mit | 905 | 0 | 12 | 282 | 296 | 155 | 141 | 29 | 1 |
str = "sinus aestuum"
ns = [7,6..1]
chunks n xs
| n <= length xs = fst (splitAt n xs) : chunks n (tail xs)
| otherwise = []
chks = [chunks x str | x <- ns]
main = do
putStrLn "str = "
print str
putStrLn "chks = "
mapM_ (putStrLn . show) chks
| jsavatgy/dit-doo | code/chunks.hs | gpl-2.0 | 265 | 0 | 9 | 79 | 138 | 65 | 73 | 11 | 1 |
import Functions
import Data.Bool
import SearchMonad
import Data.Maybe
type N = Integer
type Baire = N -> N
data T = Fork [(N,T)]
-- Programming exercises.
cantorTree :: T
cantorTree = Fork [(0, cantorTree), (1, cantorTree)]
unboundedBreadthTree :: N -> T
unboundedBreadthTree n = Fork [(i, unboundedBreadthTree(n+1)... | KukovecJ/Nemogoci_Funkcionali | Exercises.hs | gpl-2.0 | 2,812 | 1 | 20 | 835 | 1,448 | 773 | 675 | 60 | 3 |
module Controllers.Game.Model.ServerGame (ServerGame,
makeServerGame,
gameId,
game,
playing,
broadcastChannel,... | Happy0/liscrabble | src/Controllers/Game/Model/ServerGame.hs | gpl-2.0 | 1,951 | 0 | 10 | 776 | 352 | 196 | 156 | 36 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
module ADC.Types.Locale ( Locale(..) )
where
import Prelude hiding (Applicative(..), print)
import Text.Syntax
import Text.Syntax.Parser.Naive
import Text.Syntax.Printer.Naive
import qualified Data.Aeson.Types as AT ( Pars... | gore-v/AuctionParser | src/ADC/Types/Locale.hs | gpl-3.0 | 1,640 | 0 | 28 | 469 | 510 | 271 | 239 | 47 | 1 |
module Utils
( module Utils.Debug
, module Utils
)
where
import Text.Parsec (choice, try)
import Text.Parsec.String (GenParser)
import Text.Regex.TDFA ((=~))
import Import
import Utils.Debug
-- strings
trim :: String -> String
trim s | l <= limit = s
| otherwise = take limit s ++ suffix
where
... | simonmichael/shelltestrunner | src/Utils.hs | gpl-3.0 | 1,864 | 0 | 11 | 455 | 517 | 283 | 234 | 39 | 3 |
module RenderToHtml where
import System.IO
import Control.Monad.Trans (liftIO)
import CursesWrap
import Interface
import Data.Array
import BasicTypes
import CommonTypes
prelude = "<html><head><style>td {border: none; width: 1em; min-width: 1em; max-width: 1em}</style><title>htmlshot</title></head><body><table border=... | arirahikkala/straylight-divergence | src/RenderToHtml.hs | gpl-3.0 | 1,790 | 0 | 16 | 412 | 468 | 237 | 231 | 49 | 15 |
{-# LANGUAGE NoImplicitPrelude #-}
module TickerApp (main) where
import Prelude
import FFI
import JSAPI
import Ticker
main :: Fay ()
main =
addWindowEventListener "load" handleLoad
handleLoad :: Event -> Fay Bool
handleLoad _ = do
tickerInit "canvas"
return False
| SneakingCat/fay-ticker | examples/TickerApp.hs | gpl-3.0 | 276 | 0 | 7 | 51 | 74 | 39 | 35 | 13 | 1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module UseGHCTypeLitsNats where
import GHC.TypeLi... | ntc2/haskell-call-trace | experiments/composition/type-lits.hs | mpl-2.0 | 2,032 | 3 | 13 | 442 | 307 | 172 | 135 | 20 | 1 |
-- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft }
record :: Record
record = Record
{ rProperties =
[ "foo" .= "bar"
, "foo" .= "bar"
, "foo" .= "bar"
, "foo" .= "bar"
, "foo" .= "bar"
, "foo" .= "bar"
, "foo" .= "bar"
, "f... | lspitzner/brittany | data/Test540.hs | agpl-3.0 | 343 | 0 | 8 | 94 | 76 | 44 | 32 | 11 | 1 |
module P9x.Util(
doExpectEqual, expectEqual, expectEqual_, testList
) where
import Test.HUnit
doExpectEqual :: (Eq a, Show a) => String -> a -> a -> IO Counts
doExpectEqual desc expected actual = runTestTT (expectEqual desc expected actual)
expectEqual_ :: (Eq a, Show a) => a -> a -> Test
expectEqual_ = expectEqu... | dkandalov/katas | haskell/p99/src/p9x/Util.hs | unlicense | 570 | 0 | 9 | 98 | 215 | 113 | 102 | 11 | 1 |
{-# OPTIONS_GHC -Wall -Werror #-}
module FAst (
FExpr(..),
FStmt(..),
frender
) where
-- The functional AST
import Text.PrettyPrint
type Ident = String
data FExpr = FInt Int
| FIdent Ident
| FCall Ident [FExpr]
| FFilter FExpr Ident FExpr
data FStmt = FAssign Ident FExpr
... | hyPiRion/hs-playground | fun-to-imp/src/FAst.hs | unlicense | 1,109 | 0 | 12 | 332 | 439 | 226 | 213 | 29 | 1 |
import AdventOfCode (readInputFile)
import Data.List (isInfixOf, tails)
nice1 :: String -> Bool
nice1 s = count (`elem` "aeiou") s >= 3 && not (any bad pairs) && any (uncurry (==)) pairs
where bad ('a', 'b') = True
bad ('c', 'd') = True
bad ('p', 'q') = True
bad ('x', 'y') = True
bad... | petertseng/adventofcode-hs | bin/05_nice_strings.hs | apache-2.0 | 752 | 0 | 11 | 220 | 377 | 198 | 179 | 23 | 5 |
data Offer a = Present a
| PercentDiscount Float
| AbsoluteDiscount Float
| Restrict [a] (Offer a)
| From Integer (Offer a)
| Until Integer (Offer a)
| Extend Integer (Offer a)
| Both (Offer a) (Offer a)
| BetterOf... | egaburov/funstuff | Haskell/dsl_fold/offer.hs | apache-2.0 | 1,625 | 0 | 13 | 618 | 599 | 316 | 283 | -1 | -1 |
-- Copyright (C) 2013-2014 Fraser Tweedale
--
-- 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 o... | frasertweedale/hs-jose | test/Types.hs | apache-2.0 | 8,097 | 0 | 16 | 931 | 774 | 414 | 360 | 59 | 1 |
module Database.VCache.PVar
( PVar
, newPVar
, newPVars
, newPVarIO
, newPVarsIO
, loadRootPVar
, loadRootPVarIO
, readPVar
, readPVarIO
, writePVar
, modifyPVar
, modifyPVar'
, swapPVar
, pvar_space
, unsafePVarAddr
, unsafePVarRefct
) where
import C... | dmbarbour/haskell-vcache | hsrc_lib/Database/VCache/PVar.hs | bsd-2-clause | 3,417 | 0 | 13 | 744 | 619 | 337 | 282 | -1 | -1 |
module Bankotrav.Compression where
import Data.List (foldl', elemIndex)
import Data.Maybe (fromMaybe)
import Bankotrav.Types
import Bankotrav.Base
import Bankotrav.Counting
compressBoard :: Board -> Int
compressBoard board = fst $ foldl' step (0, emptyBoard) boardIndices
where step (acc, bi) i =
let cel... | Athas/banko | bankotrav/src/Bankotrav/Compression.hs | bsd-2-clause | 1,298 | 0 | 17 | 442 | 407 | 214 | 193 | 30 | 3 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Controller
( withYwitter
) where
import Ywitter
import Settings
import Yesod.Helpers.Static
import Yesod.Helpers.Auth
import Database.Persist.GenericSql
import... | tanakh/Ywitter | Controller.hs | bsd-2-clause | 1,493 | 0 | 12 | 236 | 226 | 126 | 100 | 27 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module MainTest where
import Data.Text (Text)
import qualified Data.Text as T
import qualified FastTags
import FastTags hiding (process)
import qualified Lexer
import Token
import Test.Tasty
import Test.Tasty.HUnit
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests ... | osa1/fast-tags | tests/MainTest.hs | bsd-3-clause | 28,118 | 0 | 16 | 9,268 | 5,865 | 3,434 | 2,431 | 533 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Document where
import Control.Applicative
import Data.Attoparsec.Text
import Data.Monoid
import Data.Text
import qualified Data.Text as Text
import Test.Tasty
import Test.Tasty.HUnit
import Data.OrgMode.Parse.Types
import Data.OrgMode.Parse.Attoparsec.Document
import Util
p... | imalsogreg/orgmode-parse | test/Document.hs | bsd-3-clause | 2,248 | 0 | 13 | 707 | 490 | 282 | 208 | 49 | 1 |
module LiquidHaskell.Plugin (
module Language.Haskell.Liquid.Plugin
) where
import Language.Haskell.Liquid.Plugin
| spinda/liquidhaskell | src/LiquidHaskell/Plugin.hs | bsd-3-clause | 122 | 0 | 5 | 17 | 23 | 16 | 7 | 3 | 0 |
{-# LANGUAGE OverloadedStrings, TupleSections #-}
module Shell where
import System.Posix.Types
import System.Posix.ByteString.FilePath
import System.Posix.Process.ByteString
import System.Posix.Directory.ByteString
import System.Posix.IO
import System.IO
import qualified Data.Text as T
import qualified Data.Text.Encod... | firefrorefiddle/hssh | src/Shell.hs | bsd-3-clause | 695 | 0 | 8 | 110 | 147 | 98 | 49 | 23 | 0 |
{-# LANGUAGE QuasiQuotes #-}
module Test12 () where
import LiquidHaskell
data L a = N | C a (L a)
[lq| measure len :: L a -> Int |]
len N = 0
len (C x xs) = 1 + len xs
[lq| three :: { v:(L Int) | len v = 3 } |]
three = C 1 (C 2 (C 3 N))
| spinda/liquidhaskell | benchmarks/gsoc15/pos/test12.hs | bsd-3-clause | 250 | 0 | 9 | 77 | 103 | 58 | 45 | 9 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module Hexploration.Emulator.Internal where
import Hexploration.Byte
import Control.Applicative
import Control.Lens
import Control.Monad.Read... | chaosmasttter/hexploration | source/Hexploration/Emulator/Internal.hs | bsd-3-clause | 9,429 | 0 | 13 | 1,876 | 1,928 | 1,015 | 913 | 111 | 2 |
-----------------------------------------------------------------------------
-- |
-- Copyright : (C) 2015 Dimitri Sabadie
-- License : BSD3
--
-- Maintainer : Dimitri Sabadie <dimitri.sabadie@gmail.com>
-- Stability : experimental
-- Portability : portable
-----------------------------------------------------... | phaazon/agui | src/Graphics/UI/AGUI/Core/Renderer.hs | bsd-3-clause | 457 | 0 | 7 | 68 | 40 | 29 | 11 | 3 | 0 |
module RW.Chap6.TCs (
BasicEq
) where
class BasicEq a where
isEqual :: a -> a -> Bool
unEqual :: a -> a -> Bool
a `unEqual` b = not (isEqual a b)
instance BasicEq Bool where
isEqual True True = True
isEqual False False = True
isEqual _ _ = False
data Color =
Red
| Blue
| Green
| Yell... | ChrisCoffey/rwh | src/RW/Chap6/Typeclasses.hs | bsd-3-clause | 985 | 0 | 14 | 322 | 368 | 194 | 174 | 33 | 0 |
{-# LANGUAGE ScopedTypeVariables #-}
module Database.Sqroll.Table.Field.Unique
( Unique (..)
) where
import Control.Applicative ((<$>))
import Database.Sqroll.Table.Field
newtype Unique a = Unique {unUnique :: a}
deriving (Eq, Ord, Show)
instance forall a. Field a => Field (Unique a) where
fieldType... | pacak/sqroll | src/Database/Sqroll/Table/Field/Unique.hs | bsd-3-clause | 578 | 0 | 8 | 129 | 183 | 103 | 80 | 13 | 0 |
{-# LANGUAGE ScopedTypeVariables #-}
-- |An efficient implementation of 'Data.Graph.Inductive.Graph.Graph'
-- using big-endian patricia tree (i.e. "Data.IntMap").
--
-- This module provides the following specialised functions to gain
-- more performance, using GHC's RULES pragma:
--
-- * 'Data.Graph.Inductive.Graph.in... | jsa/fgl | Data/Graph/Inductive/PatriciaTree.hs | bsd-3-clause | 5,774 | 0 | 15 | 1,812 | 2,284 | 1,212 | 1,072 | -1 | -1 |
-----------------------------------------------------------------------------
-- |
-- Module : System.Taffybar.Hooks.PagerHints
-- Copyright : (c) José A. Romero L.
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : José A. Romero L. <escherdragon@gmail.com>
-- Stability : unstable
-- Portability : ... | Undeterminant/taffybar | src/System/Taffybar/Hooks/PagerHints.hs | bsd-3-clause | 4,010 | 0 | 17 | 736 | 685 | 372 | 313 | 51 | 3 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Program.Db
-- Copyright : Isaac Jones 2006, Duncan Coutts 2007-2009
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This provides a 'ProgramDb' type which holds confi... | sopvop/cabal | Cabal/Distribution/Simple/Program/Db.hs | bsd-3-clause | 17,744 | 4 | 21 | 4,119 | 2,915 | 1,591 | 1,324 | 254 | 4 |
{-# LANGUAGE UnicodeSyntax #-}
module Main where
import Arith.Parser (parseString)
import Arith.Semantics (eval)
import Control.Monad.Loops (whileM_)
import System.IO (getLine, hFlush, hIsEOF, putStr, stdin,
stdout)
ma... | ayberkt/TAPL | src/Arith/Main.hs | bsd-3-clause | 625 | 0 | 15 | 225 | 190 | 94 | 96 | 20 | 2 |
module Main(main) where
import PolyPaver.Invocation
import Data.Ratio ((%))
main =
defaultMain Problem
{
box = [(0,(24083420467200 % 34059099853079,9007199254749184 % 6369051672525773)),(1,(1 % 2,2 % 1))]
,theorem = thm
}
thm =
Implies (Geq (Var 0) (Over (Over (Lit (1099511... | michalkonecny/polypaver | examples/old/their_sqrt/their_sqrt_27.hs | bsd-3-clause | 998 | 0 | 27 | 180 | 552 | 293 | 259 | 9 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Actions.PerWindowKeys
-- Description : Define key-bindings on a per-window basis.
-- Copyright : (c) Wilson Sales, 2019
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Wilson Sales <spoonm@spo... | xmonad/xmonad-contrib | XMonad/Actions/PerWindowKeys.hs | bsd-3-clause | 2,201 | 0 | 11 | 528 | 277 | 164 | 113 | 15 | 2 |
module Expression
( Expr
, ExprBase(..)
, printExpr
, eval
, variables
, genExprList
) where
import Data.Bits as Bit
import Data.ByteString.Builder
import Data.Word
import Numeric
import qualified Data.ByteString.Lazy.Char8 as L
import qualified Data.Set as Set
import Test.QuickCheck
-- |Base types for... | m-schmidt/fuzzer | src/Expression.hs | bsd-3-clause | 7,854 | 0 | 18 | 2,511 | 2,941 | 1,533 | 1,408 | 176 | 10 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.ARB.ShadowAmbient
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portabilit... | haskell-opengl/OpenGLRaw | src/Graphics/GL/ARB/ShadowAmbient.hs | bsd-3-clause | 664 | 0 | 5 | 91 | 47 | 36 | 11 | 7 | 0 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -Wall -Werror #-}
{- |
Module : $Header$
Description : Compiling Lobster policies to information flow graphs
Copyright : (c) Galois, Inc.
License : see the file LICENSE
Maintainer : Joe Hurd
Stability : provisional
Portability : portable
... | GaloisInc/sk-dev-platform | libs/lobster-selinux/src/Lobster/SELinux/SELinux.hs | bsd-3-clause | 11,246 | 1 | 25 | 3,401 | 2,714 | 1,397 | 1,317 | 223 | 12 |
module QuoteUtilsTests
( main
) where
import Control.Concurrent
import Bridgewalker
import CommonTypes
import Config
import FormatUtils
import QuoteUtils
main :: IO ()
main = do
bwHandles <- initBridgewalker
threadDelay $ 5 * 1000 * 1000
testQuote bwHandles $ AmountBasedOnBTC 1000000
testQuot... | javgh/bridgewalker | src/QuoteUtilsTests.hs | bsd-3-clause | 1,360 | 0 | 15 | 322 | 346 | 157 | 189 | 33 | 2 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MonadComprehensions #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANG... | ulricha/dsh-example-queries | Queries/TPCH/Standard/Q11.hs | bsd-3-clause | 1,962 | 0 | 11 | 580 | 564 | 299 | 265 | 48 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Turtle
import Prelude hiding (FilePath, log, putStrLn)
import Filesystem.Path.CurrentOS (fromText)
import Data.Text (pack)
import Data.Maybe
import qualified System.IO as SysIO (hFlush, stdout)
defaultSleepSeconds = 120
main :: IO ()
main = do
(repoPath,... | apauley/git-fetch-daemon | app/Main.hs | bsd-3-clause | 1,630 | 0 | 13 | 321 | 559 | 277 | 282 | 44 | 1 |
module Plunge.Types.PreprocessorOutput
( Section(..)
, LineRange(..)
, LineAssociation(..)
, LineNumber
, FromLine
, ToLine
, CLine
, CppLine
, CppDirective(..)
, DirectiveFlag(..)
) where
type LineNumber = Int
type FromLine = Int
type ToLine = Int
type CLine = String
type CppLine = String
da... | sw17ch/plunge | src/Plunge/Types/PreprocessorOutput.hs | bsd-3-clause | 1,290 | 0 | 9 | 428 | 297 | 187 | 110 | 41 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Network.Anonymous.I2PSpec where
import Control.Concurrent.MVar
import Control.Concurrent (forkIO,
threadDelay,
killThre... | bitemyapp/haskell-network-anonymous-i2p | test/Network/Anonymous/I2PSpec.hs | mit | 4,839 | 0 | 26 | 1,779 | 1,007 | 485 | 522 | 86 | 2 |
{-# LANGUAGE RecordWildCards #-}
module Pos.Chain.Update.BlockVersionData
( BlockVersionData (..)
, isBootstrapEraBVD
, ObftConsensusStrictness (..)
, ConsensusEra (..)
, consensusEraBVD
, obftEraFlagValue
) where
import Universum
import Control.Mo... | input-output-hk/pos-haskell-prototype | chain/src/Pos/Chain/Update/BlockVersionData.hs | mit | 7,189 | 0 | 37 | 1,968 | 1,344 | 752 | 592 | -1 | -1 |
{-# LANGUAGE NPlusKPatterns #-}
module Ch6examp where
-- ghci -XNPlusKPatterns
-- : set expandtab ts=4 ruler number spell
-- U case over N+K ?
-- ? Bart's Blog Post on Pattern Matching over enumerables
import qualified Data.List as D
-- 6.1 -- 02:00
factorial :: Int -> Int
factorial n = ... | HaskellForCats/HaskellForCats | MenaBeginning/Ch006/ch6ex2+.hs | mit | 8,041 | 110 | 11 | 2,865 | 2,041 | 1,109 | 932 | 93 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/SetLoadBasedAutoScaling.hs | mpl-2.0 | 5,533 | 0 | 9 | 1,037 | 576 | 351 | 225 | 66 | 1 |
{-
Copyright 2013 Google Inc. All Rights Reserved.
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 ... | mzero/plush | src/Plush/Run/Script.hs | apache-2.0 | 2,907 | 0 | 14 | 584 | 646 | 344 | 302 | 45 | 2 |
--
-- 6.DateAndTime.hs
-- R_Functional_Programming
--
-- Created by RocKK on 2/13/14.
-- Copyright (c) 2014 RocKK.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and ... | RocKK-MD/R_Functional_Programming | Sources/6.DateAndTime.hs | bsd-2-clause | 903 | 0 | 7 | 160 | 37 | 28 | 9 | 3 | 1 |
{- ------------------------------------------------------------------------
(c) The GHC Team, 1992-2012
DeriveConstants is a program that extracts information from the C
declarations in the header files (primarily struct field offsets)
and generates various files, such as a header file that can be #included
into non-... | olsner/ghc | utils/deriveConstants/Main.hs | bsd-3-clause | 46,059 | 203 | 19 | 14,963 | 10,343 | 5,358 | 4,985 | 757 | 35 |
module BrownPLT.JavaScript.Contracts.Template
( JavaScriptTemplate
, exprTemplate
, stmtTemplate
, substVar
, substVarList
, substIdList
, substFieldList
, expandCall
, templateExpression
, noPos
, thunkExpr
, renderTemplate
, renameVar
, templateStatements
) where
import Data.Data
impor... | brownplt/javascript-contracts | src/BrownPLT/JavaScript/Contracts/Template.hs | bsd-3-clause | 5,018 | 0 | 15 | 1,123 | 1,338 | 693 | 645 | 114 | 4 |
{-# LANGUAGE Haskell98, BangPatterns #-}
{-# LINE 1 "Data/ByteString/Search/Substitution.hs" #-}
-- |
-- Module : Data.ByteString.Search.Substitution
-- Copyright : Daniel Fischer
-- Licence : BSD3
-- Maintainer : Daniel Fischer <daniel.is.fischer@googlemail.com>
-- Stability : Provisional
... | phischu/fragnix | tests/packages/scotty/Data.ByteString.Search.Substitution.hs | bsd-3-clause | 2,043 | 0 | 12 | 452 | 327 | 189 | 138 | 24 | 0 |
{- |
Module : $Header$
Description : Utilities for CspCASLProver related to Isabelle
Copyright : (c) Liam O'Reilly and Markus Roggenbach,
Swansea University 2009
License : GPLv2 or higher, see LICENSE.txt
Maintainer : csliam@swansea.ac.uk
Stability : provisional
Portability : portab... | keithodulaigh/Hets | CspCASLProver/IsabelleUtils.hs | gpl-2.0 | 6,924 | 0 | 14 | 1,731 | 1,359 | 740 | 619 | 107 | 2 |
{- |
Module : $Id$
Description : various encodings
Copyright : (c) Uni Bremen 2005-2007
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : non-portable (existential types)
This folder contains various comorphisms (implemented usi... | mariefarrell/Hets | Comorphisms.hs | gpl-2.0 | 1,663 | 0 | 2 | 227 | 5 | 4 | 1 | 1 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Clay.Color where
import Data.Char (isHexDigit)
import Data.Monoid
import Data.String
import Data.Text (Text)
import Text.Printf
import qualified Data.Text as Text
import Data.Text.Read as Text
import Clay.Property
import Clay.Common
-- * Color datatype.
data Color
= Rgba... | damianfral/clay | src/Clay/Color.hs | bsd-3-clause | 10,938 | 0 | 14 | 3,931 | 3,658 | 2,017 | 1,641 | 253 | 6 |
pass :: [Inst] -> [Inst]
pass = peep1 . peep2 . peep3 . removeUnused
peep3 (x1:x2:x3:xs) = case (x1, x2, x3) of
(InstMove a b, InstMove c d, InstMove _ f) | (b == c) && (b == f) -> peep3 $ (InstMove a d):x3:xs
(InstMove a b, InstMove c d, InstUn _ _ f) | (b == c) && (b == f) ... | akrzemi1/Mach7 | code/msvc/Versity/test/peep-v2.hs | bsd-3-clause | 4,399 | 0 | 18 | 1,830 | 2,637 | 1,327 | 1,310 | 53 | 21 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
module T15549b where
import Data.Kind (Type)
newtype Identity a = Identity a
newtype Par1 a = Par1 a
data family Sing :: forall k. k -> Type
data instance Sing :: forall k.... | sdiehl/ghc | testsuite/tests/typecheck/should_compile/T15549b.hs | bsd-3-clause | 703 | 0 | 11 | 164 | 260 | 155 | 105 | -1 | -1 |
{-# LANGUAGE PartialTypeSignatures #-}
module AddAndOr6 where
addAndOr6 :: (Int, _) -> (Bool, _) -> (_ Int Bool)
addAndOr6 (a, b) (c, d) = (a `plus` d, b || c)
where plus :: Int -> Int -> Int
x `plus` y = x + y
| urbanslug/ghc | testsuite/tests/partial-sigs/should_compile/AddAndOr6.hs | bsd-3-clause | 222 | 0 | 8 | 56 | 108 | 63 | 45 | 6 | 1 |
{-# LANGUAGE CPP #-}
#include "stack001.hs"
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/rts/stack002.hs | bsd-3-clause | 44 | 0 | 2 | 6 | 4 | 3 | 1 | 1 | 0 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Type inference of @loop@. This is complicated because of the
-- uniqueness and size inference, so the implementation is separate
-- from the main type checker.
module Language.Futhark.TypeChecker.Terms.DoLoop
... | diku-dk/futhark | src/Language/Futhark/TypeChecker/Terms/DoLoop.hs | isc | 16,043 | 0 | 28 | 4,956 | 3,782 | 1,897 | 1,885 | 291 | 13 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.ByteLengthQueuingStrategy
(newByteLengthQueuingStrategy, size, size_,
ByteLengthQueuingStrategy(..), gTyp... | ghcjs/jsaddle-dom | src/JSDOM/Generated/ByteLengthQueuingStrategy.hs | mit | 1,983 | 0 | 11 | 251 | 456 | 282 | 174 | 29 | 1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.SVGTextPathElement
(pattern TEXTPATH_METHODTYPE_UNKNOWN,
pattern TEXTPATH_METHODTYPE_ALIGN,
pattern TEXTPATH_METHODTYPE_STRETCH,
pattern TEXTPATH_SPACINGTYPE_UNKNOWN,
pattern... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/SVGTextPathElement.hs | mit | 2,990 | 18 | 11 | 437 | 643 | 378 | 265 | 54 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ < 710
{-# LANGUAGE OverlappingInstances #-}
#endif
module Text.Blaze.JSON.Class where
import Prelude hiding(null)
import Text.Blaze.JSON.Internal
import qualified Data.Text as T
import qualified Data.... | philopon/blaze-json | src/Text/Blaze/JSON/Class.hs | mit | 4,790 | 0 | 10 | 1,122 | 1,463 | 809 | 654 | 136 | 0 |
{-# LANGUAGE RecordWildCards #-}
import Data.Foldable (for_)
import Test.Hspec (Spec, describe, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import ArmstrongNumbers (armstrong)
main :: IO ()
main = hspecWith defaultConfig {configFastFail = True} specs
specs :: Spec
sp... | exercism/xhaskell | exercises/practice/armstrong-numbers/test/Tests.hs | mit | 2,199 | 0 | 10 | 936 | 391 | 241 | 150 | 42 | 1 |
module Q41 where
import Q39
import Q40
import AvlSet
goldbachList :: Int -> Int -> [(Int, Int)]
goldbachList x y = case (tryGoldbachList x y) of Left result -> result
Right message -> error message
tryGoldbachList :: In... | cshung/MiscLab | Haskell99/q41.hs | mit | 1,043 | 0 | 17 | 403 | 378 | 193 | 185 | 27 | 2 |
import Graphics.UI.GLUT hiding (Point)
import Data.IORef
import Game.DeltaClock
import Game.Game (game)
import Game.Callbacks
import Game.Keyboard (initKeyboard)
main :: IO ()
main = do
_ <- getArgsAndInitialize
_ <- createWindow "Hello, World!"
clockRef <- initClock >>= newIORef
gameRef <- newIORef game
k... | sgrif/haskell-game | Main.hs | mit | 492 | 0 | 10 | 84 | 158 | 79 | 79 | 17 | 1 |
-- Problems/Problem022Spec.hs
module Problems.Problem022Spec (main, spec) where
import Test.Hspec
import Problems.Problem022
main :: IO()
main = hspec spec
spec :: Spec
spec = describe "Problem 22" $
it "Should evaluate to 871198282" $
p22 `shouldBe` 871198282
| Sgoettschkes/learning | haskell/ProjectEuler/tests/Problems/Problem022Spec.hs | mit | 276 | 0 | 8 | 51 | 73 | 41 | 32 | 9 | 1 |
module Game.Mahjong.Test.Static.Examples ( tests ) where
import Game.Mahjong.Meld
import Game.Mahjong.Static.Tiles
import Game.Mahjong.Static.Melds
import Game.Mahjong.Static.Examples
import Test.Tasty
import Test.Tasty.HUnit
tests :: TestTree
tests = testGroup "Game.Mahjong.Static.Examples Tests" [constr... | gspindles/mj-score-eval | test/Game/Mahjong/Test/Static/Examples.hs | mit | 2,314 | 0 | 9 | 523 | 488 | 248 | 240 | 55 | 1 |
import System.Environment
import System.IO
import System.Exit
import Control.Exception
import Assembler
main :: IO ()
main = do
args <- getArgs
catch ( if length args /= 1
then error "number of arguments must be 1\nUsage: hass-assembler <program>"
else createMifFile $ head args
) err
... | yu-i9/HaSS | src-assembler/Main.hs | mit | 433 | 0 | 13 | 120 | 119 | 60 | 59 | 15 | 2 |
module GraphDB.Util.TH where
import GraphDB.Util.Prelude
import Language.Haskell.TH
import qualified GraphDB.Util.TH.Parsers as P
caseLambda :: [Match] -> Exp
caseLambda matches = LamE [VarP argName] (CaseE (VarE argName) matches)
where
argName = mkName "_0"
caseFunDec :: Name -> [Match] -> Dec
caseFunDec na... | nikita-volkov/graph-db | library/GraphDB/Util/TH.hs | mit | 610 | 0 | 13 | 108 | 225 | 120 | 105 | 16 | 1 |
-- | Stability: provisional
module Test.Hspec.Core.Hooks (
before
, before_
, beforeWith
, beforeAll
, beforeAll_
, after
, after_
, afterAll
, afterAll_
, around
, around_
, aroundWith
) where
import Control.Exception (SomeException, finally, throwIO, try)
import Control.Concurrent.MVar
import ... | beni55/hspec | hspec-core/src/Test/Hspec/Core/Hooks.hs | mit | 3,048 | 0 | 17 | 656 | 1,058 | 534 | 524 | 61 | 3 |
-- file Spec.hs
import Test.Hspec
import Test.QuickCheck
import Addition
main :: IO ()
main = hspec $ do
describe "Addition.add" $ do
it "returns the sum of two Integers" $ do
add 10 20 `shouldBe` (30 :: Integer)
| laser/haste-experiment | demos/testing/AdditionSpec.hs | mit | 226 | 0 | 15 | 51 | 74 | 38 | 36 | 8 | 1 |
{-# LANGUAGE RecordWildCards #-}
module OpenGLApp
(
openGLMain
, GLApp(..)
) where
import Graphics.UI.GLUT
data GLApp =
GLApp
{ title :: String
, display :: DisplayCallback
, special :: SpecialCallback
, keyboard :: KeyboardCallback
}
openGLMain :: GLApp -> IO ()
openGLMain GLApp{.... | j-rock/tutte-your-stuff | src/OpenGLApp.hs | mit | 1,281 | 0 | 10 | 296 | 370 | 179 | 191 | 43 | 1 |
import Control.Applicative
import qualified Data.ByteString.Char8 as BS
import Data.Maybe
solve :: (Ord a1, Ord a, Num a) => [a1] -> [(a1, a)] -> a -> a
solve [] _ ans = ans
solve (x:xs) [] ans = solve xs [(x,0)] ans
solve (x:xs) ((p,q):ss) ans
| x > p = solve xs ((x, 1):(p,q):ss) (max ans 1)... | m00nlight/hackerrank | algorithm/contests/Counter-Code-2015/D.hs | gpl-2.0 | 836 | 0 | 16 | 254 | 471 | 253 | 218 | 23 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Module.Scheme.Env
( current
, removeLastScope
, consNewScope
, genScope
, newFunction
, newSymbol
, pop, pop'
, push
, withEnv
, withGlobal
, withScope
, withNScope
, findSymbol
, findFunc
) where
import Control.Monad.State
import Control.Monad.... | felixsch/ircbot | src/Module/Scheme/Env.hs | gpl-2.0 | 3,471 | 0 | 13 | 866 | 1,439 | 734 | 705 | 85 | 2 |
{-
Haskell implementation of sort tool.
http://linux.die.net/man/1/sort
-}
module Main where
import Data.List(sort)
main:: IO ()
main = getContents >>= putStrLn.unlines.sort.lines
| huseyinyilmaz/hs-gnu-core-utils | src/sort.hs | gpl-2.0 | 185 | 0 | 8 | 26 | 40 | 23 | 17 | 4 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.