code
stringlengths
2
1.05M
repo_name
stringlengths
5
101
path
stringlengths
4
991
language
stringclasses
3 values
license
stringclasses
5 values
size
int64
2
1.05M
module Language.ContextSemantics.CallByNeedLambda where import Language.ContextSemantics.Expressions import Language.ContextSemantics.Utilities () import Language.ContextSemantics.Output import Control.Arrow (second) import Data.List (nub) import Data.List.Zipper import Data.Maybe import Data.Nthable import Prelude...
batterseapower/context-semantics
Language/ContextSemantics/CallByNeedLambda.hs
Haskell
bsd-3-clause
8,490
module Chp82 where {-- Derived instances --} {-- We explained that a typeclass is a sort of an interface that defines some behavior. A type can be made an instance of a typeclass if it supports that behavior. --} {-- We also mentioned that they're often confused with classes in languages like Java, Python, C++ a...
jamesyang124/haskell-playground
src/Chp82.hs
Haskell
bsd-3-clause
7,414
module Snap.Snaplet.Config.Tests where ------------------------------------------------------------------------------ import Control.Concurrent import Control.Concurrent.Async import Control.Monad import qualified Data.ByteString.Char8 as BS import qualified Data.Configurator.Types as C import Data.Function import qua...
snapframework/snap
test/suite/Snap/Snaplet/Config/Tests.hs
Haskell
bsd-3-clause
3,308
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module NumberSix.Handlers.TryRuby ( ruby , handler ) where -------------------------------------------------------------------------------- import Control.Applicative ((<$>)) impo...
itkovian/number-six
src/NumberSix/Handlers/TryRuby.hs
Haskell
bsd-3-clause
1,999
module Main where import Network import System.IO (hPutStrLn, hClose, Handle) import Control.Concurrent (forkIO) main :: IO () main = startServer >>= handleConnections qotdService startServer :: IO Socket startServer = listenOn $ PortNumber 17 handleConnections :: (Handle -> IO ()) -> Socket -> IO () handleConne...
anler/tcp-quotes
app/Main.hs
Haskell
bsd-3-clause
581
-- -- xmonad example config file. -- -- A template showing all available configuration hooks, -- and how to override the defaults in your own xmonad.hs conf file. -- -- Normally, you'd only override those defaults you care about. -- import XMonad import Data.Monoid import System.Exit import qualified XMonad.StackSet ...
markus1189/xmonad-710
man/xmonad.hs
Haskell
bsd-3-clause
9,677
import Distribution.Simple main = defaultMain
solidsnack/maccatcher
Setup.hs
Haskell
bsd-3-clause
74
{-| This module provides the /Remove Weak Suffixes/ processor. Let @Wl#@ be forward closed, then @ |- <S# / W# + W, Q, T#> :f ------------------------------------- |- <S# / W# + Wl# + W, Q, T#> :f @ -} module Tct.Trs.Processor.DP.DPGraph.RemoveWeakSuffixes ( removeWeakSuffixesDeclaration , removeWe...
ComputationWithBoundedResources/tct-trs
src/Tct/Trs/Processor/DP/DPGraph/RemoveWeakSuffixes.hs
Haskell
bsd-3-clause
4,815
{-# LANGUAGE UnicodeSyntax #-} import Prelude.Unicode data Tree a = Empty | Branch a (Tree a) (Tree a) deriving (Show, Eq) tree4 = Branch 1 (Branch 2 Empty (Branch 4 Empty Empty)) (Branch 2 Empty Empty) countLeaves ∷ Tree a → Int countLeaves Empty = 0 countLeaves (Branch _ Empty Empty) ...
m00nlight/99-problems
haskell/p-61.hs
Haskell
bsd-3-clause
514
{- ****************************************************************************** * I N V A D E R S * * * * Module: Command * *...
ivanperez-keera/SpaceInvaders
src/Command.hs
Haskell
bsd-3-clause
1,079
{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE TemplateHaskell #-} module Types.Posts ( ClientMessage , newClientMessage , cmDate , cmType , cmText , ClientMessageType(..) , Attachment , mkAttachment , attachmentName , attachmentFileId , attachmentURL , ClientPostType(..) , ClientPost , toClie...
aisamanra/matterhorn
src/Types/Posts.hs
Haskell
bsd-3-clause
6,677
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.HU.Corpus ( corpus ) where import Data.String impo...
facebookincubator/duckling
Duckling/Numeral/HU/Corpus.hs
Haskell
bsd-3-clause
2,236
module AI ( search , module AI.Types ) where import Types import AI.Types import Text.Printf import qualified AI.API.My as My import qualified AI.API.Tzaar as Tzaar import qualified AI.API.GameTree as GameTree search :: Board b => Algorithm -> Implementation -> Evaluation -> Position b -> Depth -> (PV, Score) sea...
sphynx/hamisado
AI.hs
Haskell
bsd-3-clause
795
{-# LANGUAGE BangPatterns #-} -- | -- Module: Data.Aeson.Encoding.Builder -- Copyright: (c) 2011 MailRank, Inc. -- (c) 2013 Simon Meier <iridcode@gmail.com> -- License: BSD3 -- Maintainer: Bryan O'Sullivan <bos@serpentine.com> -- Stability: experimental -- Portability: portable -- -- Efficie...
sol/aeson
Data/Aeson/Encoding/Builder.hs
Haskell
bsd-3-clause
8,539
module Expression.AST where data Variable = Variable String deriving Eq data Expression = Const Int | Var Variable | BinExpr Expression BinOp Expression | MultiExpr MultiOp [Expression] | TimeDerivative Variable | TimeDerivative2 Variable data BinOp = Plus | Minus | Mult | Quotient | Exp d...
Zomega/thesis
Wurm/CAS/Expression/AST.hs
Haskell
mit
354
module Main where --import Test.Framework (defaultMain, Test, testGroup) import qualified Data.ByteString.Lazy.Builder.BasicEncoding.Tests import qualified Data.ByteString.Lazy.Builder.Tests import TestFramework main :: IO () main = defaultMain tests tests :: [Test] tests = [ testGroup "Build...
meiersi/bytestring-builder
tests/builder/TestSuite.hs
Haskell
bsd-3-clause
470
{-# LANGUAGE ScopedTypeVariables #-} module Types where import Debug.Trace import Test.QuickCheck type Longitude = Double -- -180 .. 180 type Latitude = Double -- -90 .. 90 newtype Geographic = Geographic (Longitude,Latitude) deriving Show type ScreenX = Double -- -1 .. 1, + on right type ScreenY = Doubl...
andygill/willowbrae
projections/Types.hs
Haskell
bsd-3-clause
4,672
{-# LANGUAGE CPP, NoMonomorphismRestriction #-} #include "fusion-phases.h" module Data.Array.Parallel.Unlifted.Stream.Segments ( streamSegsFromNestedUSSegd , streamSegsFromVectorsUSSegd , streamSegsFromVectorsUVSegd , streamSegsFromVectorsUSSegdSegmap , streamSegsFromVectorsUSSeg...
mainland/dph
dph-prim-seq/Data/Array/Parallel/Unlifted/Stream/Segments.hs
Haskell
bsd-3-clause
13,609
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} -- | Resolving a build plan for...
AndrewRademacher/stack
src/Stack/BuildPlan.hs
Haskell
bsd-3-clause
47,672
{-# LANGUAGE CPP, OverloadedStrings, RecordWildCards, ScopedTypeVariables #-} import Control.Monad (forM) import Data.Aeson (eitherDecode) import Data.Aeson.Encode import Data.Aeson.Parser (value) import Data.Aeson.Types import Data.Char (toUpper) import Test.Framework (Test, defaultMain, testGroup) import Test.Framew...
maximkulkin/aeson
tests/Properties.hs
Haskell
bsd-3-clause
12,070
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} #ifndef MIN_VERSION_base #define MIN_VERSION_base(x,y,z) 1 #endif module Test.System.GPIO.TypesSpec (spec) where import Protolude import System.GPIO.Types import Data.Bits (unsafeShiftL, unsafeShiftR) import ...
dhess/gpio
test/Test/System/GPIO/TypesSpec.hs
Haskell
bsd-3-clause
4,438
{-| Module : System.GPIO.Linux.Sysfs.IO Description : Linux @sysfs@ GPIO operations in IO Copyright : (c) 2019, Drew Hess License : BSD3 Maintainer : Drew Hess <src@drewhess.com> Stability : experimental Portability : non-portable The actual Linux @sysfs@ implementation. This implementation will only fun...
dhess/gpio
src/System/GPIO/Linux/Sysfs/IO.hs
Haskell
bsd-3-clause
4,945
{-# LANGUAGE CPP #-} #ifndef MIN_VERSION_profunctors #define MIN_VERSION_profunctors(x,y,z) 0 #endif ----------------------------------------------------------------------------- -- | -- Module : Data.Machine.Mealy -- Copyright : (C) 2012 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- M...
fumieval/machines
src/Data/Machine/Mealy.hs
Haskell
bsd-3-clause
4,321
-- !!! make sure context of EQ is minimised in interface file. -- module ShouldSucceed where data NUM = ONE | TWO class (Num a) => ORD a class (ORD a, Show a) => EQ a where (===) :: a -> a -> Bool
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/typecheck/should_compile/tc077.hs
Haskell
bsd-3-clause
200
{-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | -- Module : Data.STRef.Lazy -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : ...
tolysz/prepare-ghcjs
spec-lts8/base/Data/STRef/Lazy.hs
Haskell
bsd-3-clause
1,132
{-# LANGUAGE DeriveGeneric, DatatypeContexts #-} module CannotDoRep1_1 where import GHC.Generics -- We do not support datatypes with context data (Show a) => Context a = Context a deriving Generic1
urbanslug/ghc
testsuite/tests/generics/GenCannotDoRep1_1.hs
Haskell
bsd-3-clause
201
module Rebase.GHC.Float ( module GHC.Float ) where import GHC.Float
nikita-volkov/rebase
library/Rebase/GHC/Float.hs
Haskell
mit
71
{-# LANGUAGE ScopedTypeVariables #-} module Model.Post where import Import import qualified Database.Esqueleto as E import Database.Esqueleto((^.)) getPosts :: Int -> Int -> DB [Entity Post] getPosts page postsPerPage | page > 0 && postsPerPage > 0 = selectList [] [ Desc PostCreated , LimitTo postsPer...
isankadn/yesod-testweb-full
Model/Post.hs
Haskell
mit
524
{-# OPTIONS -Wall -Werror #-} import Control.Applicative import Control.Exception import Control.Monad import Data.List import System.Directory import System.Environment import System.IO -- dist .lib include main :: IO () main = getArgs >>= write where write (dist : lib : inc : _) = readFile dist >>= writeIncludes ...
MichaeGon/pragma-maker-for-LLVM
pragma-maker-old.hs
Haskell
mit
1,604
doubleMe x = x + x doubleUs x y = doubleMe x + doubleMe y doubleSmallNumber x = if x > 100 then x else x*2 doubleSmallNumber' x = (if x > 100 then x else x*2) + 1 boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x]
Sgoettschkes/learning
haskell/LearnYouAHaskell/old/baby.hs
Haskell
mit
312
module Main where import Test.Tasty (defaultMain, testGroup, TestTree) import Utrecht.MasterMind.Test main :: IO () main = defaultMain tests tests :: TestTree tests = testGroup "All tests" [ masterMindSuite ]
kandersen/Utrecht
test/Test.hs
Haskell
mit
215
{-# LANGUAGE FlexibleContexts, FlexibleInstances, GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings, PatternSynonyms #-} {-# LANGUAGE RankNTypes, ScopedTypeVariables, StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell, TypeFamilies, ConstraintKinds #-} {-# OPTIONS_GHC...
sboosali/commands
commands-core/sources/Commands/RHS/Types.hs
Haskell
mit
7,485
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} ------------------------------------------- -- | -- Module : Web.Stripe.Dispute -- Copyright : (c) David Johnson, 2014 -- Maintainer : djohnson.m@gmail.com ...
dmjio/stripe
stripe-core/src/Web/Stripe/Dispute.hs
Haskell
mit
2,913
module Game.Poker.Cards ( Suit(..) , Card , allCards , cardSuit , cardNumber , cardStrength ) where -- | 4 types of card -- -- >>> Hearts -- Show -- Hearts -- -- >>> read "Hearts" :: Suit -- Read -- Hearts -- -- >>> Hearts == Hearts -- Eq -- True -...
tobynet/java-poker
src/Game/Poker/Cards.hs
Haskell
mit
2,264
{-# LANGUAGE RankNTypes, ImpredicativeTypes, LiberalTypeSynonyms #-} module Treb.Config (withTrebEnv) where import qualified Hasql as H import qualified Hasql.Postgres as HP import qualified Data.Map as M import qualified Data.ByteString.Lazy as B import qualified Data.ByteString.Char8 as BC import qualified Database....
MadSciGuys/trebuchet
src/Treb/Config.hs
Haskell
mit
11,175
module Main where import Codec.Picture import Codec.Picture.Types import Data.Maybe (fromJust) import Data.Word (Word8) import Data.List as L (transpose,foldl') import Text.Printf (printf) import Control.Arrow ((&&&)) import Options.Applicative import qualified Data.ByteString as B import System.IO (stdin) data Opti...
Drezil/img2ascii
src/Main.hs
Haskell
mit
5,308
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module Celtchar.Novel.Structure where import Data.Yaml import GHC.Generics data Language = French | English deriving (Generic) data Document = Document FilePath deriving (Ge...
ogma-project/celtchar
src/Celtchar/Novel/Structure.hs
Haskell
mit
2,311
module Handler.EditThread where import Authentification (isModeratorBySession, getThreadPermissions) import Captcha import CustomForms (threadMForm) import Import import Helper (spacesToMinus) import Widgets (threadWidget, postWidget, accountLinksW) getEditThreadR :: ThreadId -> Handler Html getEditThreadR tid = do ...
cirquit/HaskellPie
HaskellPie/Handler/EditThread.hs
Haskell
mit
3,045
module Lexer where import Text.Parsec.String (Parser) import Text.Parsec.Language (emptyDef) import qualified Text.Parsec.Token as Tok lexer :: Tok.TokenParser () lexer = Tok.makeTokenParser style where ops = ["+","*","-",";"] names = ["def","extern"] style = emptyDef { ...
raulfpl/kaleidoscope
src/chapter2/Lexer.hs
Haskell
mit
946
{-# LANGUAGE MultiParamTypeClasses #-} module Core ( NonUnitVector , UnitVector , Point(..) , Ray(..) , Transform(..) , RayPosition , VectorUnaryOps(..) , VectorBinaryOps(..) , RefractiveIndex , RayWithMedium(..) , vector , normal , unsafeForceUnitVector , origin , to , normalize , normalizeWithLength , at , toRayP...
stu-smith/rendering-in-haskell
src/experiment08/Core.hs
Haskell
mit
8,275
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html module Stratosphere.ResourceProperties.CloudFrontDistributionOrigin where...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/CloudFrontDistributionOrigin.hs
Haskell
mit
4,862
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-secrettargetattachment.html module Stratosphere.Resources.SecretsManagerSecretTargetAttachment w...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/SecretsManagerSecretTargetAttachment.hs
Haskell
mit
3,164
{- ****************************************************************************** * JSHOP * * * * Module: TestSuite * *...
nbrunt/JSHOP
src/TestSuite.hs
Haskell
mit
7,600
module Tables.A004489 (a004489) where import Helpers.BaseRepresentation (toBase, fromBase) import Helpers.ListHelpers (zipWithPadding) import Helpers.Table (tableByAntidiagonals) a004489 :: Int -> Int a004489 i = fromBase 3 $ map tertSum $ zipWithPadding 0 (base3 n) (base3 k) where (n, k) = tableByAntidiagonals i ...
peterokagey/haskellOEIS
src/Tables/A004489.hs
Haskell
apache-2.0
376
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1beta1.Scale where import GHC.Generics import Data.Text import Kubernetes.V1.ObjectMeta import Openshift.V1beta1.ScaleSpec import Op...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1beta1/Scale.hs
Haskell
apache-2.0
1,616
{-# LANGUAGE PackageImports, OverloadedStrings, TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module TlsIo ( TlsIo, evalTlsIo, liftIO, throwError, readCached, randomByteString, Partner(..), opponent, isCiphered, readContentType, writeContentType, readVersion, writeVersion, readLen, writeLen, setVersio...
YoshikuniJujo/forest
subprojects/tls-analysis/client/TlsIo.hs
Haskell
bsd-3-clause
18,760
----------------------------------------------------------------------------- -- | -- Module : Text.ParserCombinators.Parsec.Prim -- Copyright : (c) Daan Leijen 1999-2001 -- License : BSD-style (see the file libraries/parsec/LICENSE) -- -- Maintainer : daan@cs.uu.nl -- Stability : provisional -- Por...
OS2World/DEV-UTIL-HUGS
libraries/Text/ParserCombinators/Parsec/Prim.hs
Haskell
bsd-3-clause
17,579
--Basically a brute force attempt. For larger numbers, say where a+b+c=10000, this will take a long long time. At 1000 though, it takes a minute or so triplet n = [(x,y,z) | x <- [1..(n-1)], y <- [1..(n-x)], z <- [1..(n-x-y)], x+y+z == n, z>y, z>x, y>x, x^2+y^2==z^2] problem9 = triplet 1000
thomas-oo/projectEulerHaskell
src/Problem9.hs
Haskell
bsd-3-clause
293
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveGeneric #-} module MidiRhythm.NotePress ( Duration(..), Press(..), NotePress(..), Velocity(..), Pitch(..), ElapsedTime(..), PressCount(..), ) where import qualified Numeric.NonNegative.Wrapper as NonNeg import GHC.Generics newtype ElapsedTime ...
a10nik/midiRhythm
src/MidiRhythm/NotePress.hs
Haskell
bsd-3-clause
979
{-# LANGUAGE StandaloneDeriving #-} import Data.List (concatMap, nub) import Data.Ratio import Data.ByteString.Char8 (pack) import Test.QuickCheck import Data.Trie import qualified Data.ByteString.UTF8 as UTF8 import qualified Text.JSONb as JSONb prop_structures_parse = samples structure_tests sam...
solidsnack/JSONb
test/SimpleUnits.hs
Haskell
bsd-3-clause
5,575
{- (c) The AQUA Project, Glasgow University, 1993-1998 \section[Simplify]{The main module of the simplifier} -} {-# LANGUAGE CPP #-} module Simplify ( simplTopBinds, simplExpr ) where #include "HsVersions.h" import DynFlags import SimplMonad import Type hiding ( substTy, extendTvSubst, substTyVar ) import Sim...
gcampax/ghc
compiler/simplCore/Simplify.hs
Haskell
bsd-3-clause
118,609
#!/usr/bin/env runhaskell import Distribution.PackageDescription import Distribution.Simple import Distribution.Simple.LocalBuildInfo main :: IO () main = defaultMain
jeffwheeler/pointedlist
Setup.hs
Haskell
bsd-3-clause
168
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} module Data.StreamLike where import Data.ListLike as LL import Data.Word import Data.Bits import Data.Functor import Data.ByteString as B import Control.Comonad -- | Stream type. s is a stream like list...
ierton/yteratee
src/Data/StreamLike.hs
Haskell
bsd-3-clause
1,841
{-# LANGUAGE MultiParamTypeClasses #-} -- | The Scale module implements scales. module Music.Diatonic.Scale ( Scale, Scl(..), majorScale, minorScale, majorPentatonicScale, minorPentatonicScale, minorHarmonicScale, minorMelodicScale, tetrachord ) where import Music.Diatonic data Scale = Diatonic Quali...
xpika/music-diatonic
Music/Diatonic/Scale.hs
Haskell
bsd-3-clause
3,559
----------------------------------------------------------------------------- -- | -- Module : Network.HTTP.HandleStream -- Copyright : (c) 2008- Sigbjorn Finne -- License : BSD -- -- Maintainer : Sigbjorn Finne <sigbjorn.finne@gmail.com> -- Stability : experimental -- Portability : non-portable (n...
astro/HTTPbis
Network/HTTP/HandleStream.hs
Haskell
bsd-3-clause
10,063
module Sexy.Instances.Plus.Double where import Sexy.Classes (Plus(..)) import Sexy.Data (Double) import qualified Prelude as P instance Plus Double where (+) = (P.+)
DanBurton/sexy
src/Sexy/Instances/Plus/Double.hs
Haskell
bsd-3-clause
169
----------------------------------------------------------------------------- -- -- Module : GameOfLife.Ui.Text -- Copyright : 2016 Author name here -- License : BSD3 -- -- Maintainer : bnazariy@gmail.com -- Stability : -- Portability : -- -- | -- ------------------------------------------------------...
AM636E/HaskellGameOfLife
src/GameOfLife/Ui/Text.hs
Haskell
bsd-3-clause
2,502
import NLP.DictParser main :: IO () main = getContents >>= \c -> print (parseString c)
mwotton/dictparser
src/main.hs
Haskell
bsd-3-clause
99
module Main where import Data.Graph.Inductive.Graph import Data.Graph.Inductive.Tree (Gr) import System.Exit import Flow source = 1 sink = 2 node = 3 graph :: Gr String Int graph = insEdge (node, sink, 1) . insEdge (source, node, 3) . insEdge (source, sink, 10) $ insNodes [(source, "source"), (sink, "sink"), (no...
thsutton/mf
src/Main.hs
Haskell
bsd-3-clause
911
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE Strict #-} module Layers.Pool where import Network import Util import Static import Data.Singletons.TypeLits import Data.Array.Repa ...
jonascarpay/convoluted
src/Layers/Pool.hs
Haskell
bsd-3-clause
1,383
-- | Quick, hacky sendmail wrapper module Sihemo.Sendmail ( sendmail ) where import System.Process (readProcess) sendmail :: String -- ^ Recipient -> String -- ^ Subject -> [String] -- ^ Content (lines) -> IO () -- ^ Blocks until mail is sent sendmail recipient subject bo...
jaspervdj/sihemo
src/Sihemo/Sendmail.hs
Haskell
bsd-3-clause
497
module Derivative where import qualified Data.Map as M import Control.Monad (sequence) data Expr = Con String | Num Double | Fun String Int | Add [Expr] | Mul [Expr] | Div Expr Expr | Neg Expr | Cos Expr | Sin Expr |...
GintMist/double-pendulum
src/derivative.hs
Haskell
bsd-3-clause
3,964
module Main where import System.Environment import Data.Tree import Data.Char data Op = Plus | Minus | Times | Div deriving Show data Elem = Op Op | Int Int deriving Show type Expr = Tree Elem lexer :: String -> [ Elem ] lexer "" = [ ] lexer ( ' ' : cs ) = lexer cs lexer ( '+' : cs ) = Op Plus : lexer cs lexer ( '...
YoshikuniJujo/toyhaskell_haskell
tests/testOp.hs
Haskell
bsd-3-clause
1,089
-- | -- Module: WildBind.X11.KeySym -- Description: Re-export KeySyms -- Maintainer: Toshio Ito <debug.ito@gmail.com> -- -- This module re-exports X11 'KeySym's. -- -- @since 0.2.0.0 module WildBind.X11.KeySym ( -- * The type KeySym, -- * Alphabet xK_a, xK_b, xK_c, ...
debug-ito/wild-bind
wild-bind-x11/src/WildBind/X11/KeySym.hs
Haskell
bsd-3-clause
7,315
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} -- | -- Module : Data.Array.Accelerate.Math.DFT -- Copyright : [2012] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonell -- License : BSD3 -- -- Maintainer : Manuel M T Chakravarty <chak@cse.unsw.edu.au> -- Stability : expe...
thielema/accelerate-fft
Data/Array/Accelerate/Math/DFT.hs
Haskell
bsd-3-clause
4,284
{-# LANGUAGE CPP #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE JavaScriptFFI #-} {-# OPTIONS_HADDOCK hide #-} module JavaScript.Blob ( Blob , readBlob , isBlob ) where import Control.Exception (mask_) import Data.ByteString (ByteString) #ifdef ghcjs_HOST_OS import GHCJS.Foreign (bufferBy...
mstksg/ghcjs-websockets
src/JavaScript/Blob.hs
Haskell
mit
1,311
{-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- Various orphan instances and functions that we don't want to appear in client module Unison.ABT.Extra where import Control.Applicative import Data.Bytes.Serial (Serial(..), Serial1(..)) import Data.Bytes.VarInt (VarInt(..)) import Data.List...
CGenie/platform
node/src/Unison/ABT/Extra.hs
Haskell
mit
3,610
{-# Language TemplateHaskell #-} {-# Language OverloadedStrings #-} module BitcoinCore.Keys ( PublicKeyRep(..) , Address(..) , WIFPrivateKey(..) , genKeys , getAddress , getWIFPrivateKey , getPrivateKeyFromWIF , getPubKey , btcCurve , serializePrivateKey , deserializePrivateKey , serializePublic...
clample/lamdabtc
backend/src/BitcoinCore/Keys.hs
Haskell
bsd-3-clause
5,582
module NestedImporting2 where import NestedImporting2.A main :: Fay () main = print r
fpco/fay
tests/NestedImporting2.hs
Haskell
bsd-3-clause
88
module Root.Src.Main where main = do putStrLn "Hello Haskell World!"
codeboardio/kali
test/src_examples/haskell/several_files3/Root/Src/Main.hs
Haskell
mit
68
-- {-# LANGUAGE NoImplicitPrelude #-} -- {-# LANGUAGE QuasiQuotes #-} -- {-# LANGUAGE TemplateHaskell #-} -- | Test suite for GHCi like applications including both GHCi and Intero. module Stack.GhciSpec where import Test.Hspec spec :: Spec spec = return () {- Commented out as part of the fix for https://github.com/...
MichielDerhaeg/stack
src/test/Stack/GhciSpec.hs
Haskell
bsd-3-clause
9,341
{-# LANGUAGE TypeFamilies, QuasiQuotes, TemplateHaskell, MultiParamTypeClasses, OverloadedStrings #-} module YesodCoreTest.Csrf (csrfSpec, Widget, resourcesApp) where import Yesod.Core import Test.Hspec import Network.Wai import Network.Wai.Test import Web.Cookie import qualified Data.Map as Map import Data.ByteStri...
MaxGabriel/yesod
yesod-core/test/YesodCoreTest/Csrf.hs
Haskell
mit
3,256
{-# LANGUAGE OverloadedStrings #-} module TestImport ( module Yesod.Test , module Model , module Foundation , module Database.Persist , runDB , Spec , Example ) where import Yesod.Test import Database.Persist hiding (get) import Database.Persist.Sql (SqlPersistM, runSqlPersistMPool) imp...
zhy0216/haskell-learning
yosog/tests/TestImport.hs
Haskell
mit
583
{-# LANGUAGE OverloadedStrings #-} module SymBoilerPlate where import SymMap import Control.Monad import Data.Aeson import Data.HashMap.Strict as H import System.IO.Unsafe import System.Random {-@ nonDet :: a -> x:Int -> {v:Int | 0 <= v && v < x } @-} nonDet :: a -> Int -> Int nonDet _ x = nonDetRange 0 x {-@ nonD...
abakst/symmetry
checker/include/SymBoilerPlateQC.hs
Haskell
mit
3,533
-- Get the lowest common multiple of all integers between 1 and 20, that is, the lowest number that is divisible by all numbers from 1 to 20 main = print getProblem5Value getProblem5Value :: Integer getProblem5Value = getLeastCommonMultiple [1..20] -- Lowest Common Multiple: takes a list of numbers and returns the l...
jchitel/ProjectEuler.hs
Problems/Problem0005.hs
Haskell
mit
1,334
{-# Language BangPatterns #-} {-# Language GeneralizedNewtypeDeriving #-} {-# Language Rank2Types #-} module Unison.Runtime.Bits where import Data.Tuple (swap) import Data.List import Unison.Runtime.Unfold (Unfold) import qualified Unison.Runtime.Unfold as U newtype Bits = Bits { bitstream :: Unfold Bit } deriving (...
nightscape/platform
node/src/Unison/Runtime/Bits.hs
Haskell
mit
3,275
{-# LANGUAGE MultiParamTypeClasses #-} -- module module RCL.Error where -- imports import Control.Monad.Error -- exported functions withError :: MonadError a m => Either a b -> m b withError = either throwError return testError :: MonadError e m => m a -> m Bool testError e = (e >> return False) ...
nicuveo/RCL
src/RCL/Error.hs
Haskell
mit
353
{-# LANGUAGE OverloadedStrings #-} module DarkSky.Response.DataBlock where import DarkSky.Response.Icon import DarkSky.Response.DataPoint (DataPoint) import Data.Aeson import Data.Text (Text) data DataBlock = DataBlock { data' :: [DataPoint] , summary :: Maybe Text , icon :: Maybe Icon } deriving (Eq, Show) ...
peterstuart/dark-sky
src/DarkSky/Response/DataBlock.hs
Haskell
mit
737
import Chorale.Test.Common as ChoraleTestCommon import Test.Framework main :: IO () main = defaultMainWithArgs testsToRun ["--maximum-generated-tests=1000"] testsToRun :: [Test] testsToRun = ChoraleTestCommon.tests
mocnik-science/chorale
tests/Test.hs
Haskell
mit
218
-- 54 - 60 -- https://wiki.haskell.org/99_questions/54A_to_60 module NinetyNine.P5X where import Data.List (findIndex, genericIndex) import Data.Maybe (fromJust) data BTree a = Empty | Branch a (BTree a) (BTree a) deriving (Eq, Ord, Show) {- 54A. Check whether a given term represents a binary tree. In Prolog or ...
airt/Haskell-99
src/NinetyNine/P5X.hs
Haskell
mit
8,529
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings, TupleSections, LambdaCase #-} module PrevNextPost where import Control.Applicative (Alternative (..)) import Data.Char import Data.Maybe import Data.Monoid import qualifi...
holdenlee/philosophocle
src/PrevNextPost.hs
Haskell
mit
2,716
module Api.Controllers.User ( authenticate , create , unverifiedEdit , verifyEdit ) where import Api.Types.Fields (UserToken (..)) import Api.Types.Server (ApiActionM, ApiException (..), mailer) import Control.Monad.Reader (asks, lift) import Control.Applicative ((<$>), (<|>)) import Control.Monad.IO.Class (liftIO) im...
bendyworks/api-server
lib/Api/Controllers/User.hs
Haskell
mit
2,392
{-# LANGUAGE OverloadedStrings #-} import Control.Monad (foldM) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Forth (ForthError(..), emptyState, evalText, toList) main :: IO () main = hspecWith defaultConfig {configFastFail = Tr...
exercism/xhaskell
exercises/practice/forth/test/Tests.hs
Haskell
mit
6,377
{-# LANGUAGE DataKinds, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings, ScopedTypeVariables, TypeOperators #-} module Hevents.Eff.Demo where -- * Imports, stuff to make the compiler happy import Control.Category import Control.Concurrent.Async import Control.Concurrent.STM i...
abailly/hevents
test/Hevents/Eff/Demo.hs
Haskell
mit
7,032
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ScopedTypeVariable...
gibiansky/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Layout/Types.hs
Haskell
mit
7,299
module Wyas.Types ( LispVal(..) , LispError(..) , ThrowsError , trapError , extractValue ) where import Control.Monad.Except import Text.ParserCombinators.Parsec (ParseError) data LispVal = Atom String | Bool Bool | Character Char | Do...
saclark/wyas
src/Wyas/Types.hs
Haskell
mit
2,120
{-# LANGUAGE ScopedTypeVariables #-} module Jabara.Util.MonthSpec (spec) where import Data.Time.Calendar import Jabara.Util.Month import Test.Hspec import Test.Hspec.QuickCheck (prop) import Text.Read spec :: Spec spec = do describe "read month" $ do it "r...
jabaraster/jabara-util
test/Jabara/Util/MonthSpec.hs
Haskell
mit
701
module Y2018.M07.D03.Exercise where {-- Yesterday, we translated JSON that was a mapping of String -> String to a Codex that was a mapping Vertex -> Relations where Relations was Map Vertex (Vertex, Strength) and we learned that the keys of the relations were really just indices of the arrayed (Vertex,Strength) pairi...
geophf/1HaskellADay
exercises/HAD/Y2018/M07/D03/Exercise.hs
Haskell
mit
1,543
module Tools.BlankChopperSpec (main, spec) where import Test.Hspec import Tools.BlankChopper main :: IO () main = hspec spec spec :: Spec spec = do describe "chop" $ do context "breaks on spaces" $ do itChopsAsSpecSamples [ ("x y", ["x", "y"]) , ("a b", ["a", "b"]) , (" m n ...
DominikJaniec/LearnHaskell
problems/calculator/test/Tools/BlankChopperSpec.hs
Haskell
mit
1,578
module Handler.CacheSpec (spec) where import TestImport spec :: Spec spec = withApp $ do describe "getCacheR" $ do error "Spec not implemented: getCacheR"
swamp-agr/carbuyer-advisor
test/Handler/CacheSpec.hs
Haskell
mit
171
{-# LANGUAGE TypeFamilies, KindSignatures, ConstraintKinds, ExplicitNamespaces, GADTs, TypeOperators, DataKinds, RankNTypes, AllowAmbiguousTypes, RecordWildCards #-} module ConstraintWitness.Internal ( (:~:)(..), Witness, canonicalWitness, expose, useWitness ...
Solonarv/constraint-witness
plugin/ConstraintWitness/Internal.hs
Haskell
mit
2,684
-- Project Euler Problem 22 - names scores -- -- Sum of letter values in names weighted by position in list -- -- import Data.String import Data.List alph = zip ['A'..'Z'] [1..26] elim_just :: Maybe a -> a elim_just (Just a) = a wordscore x = sum [ elim_just (lookup a alph) | a <- x] -- str = "\"MARY\",\"PATRICIA\"...
yunwilliamyu/programming-exercises
project_euler/p022_names_scores.hs
Haskell
cc0-1.0
978
{- Copyrights (c) 2016. Samsung Electronics Ltd. All right 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 l...
ryzhyk/cocoon
cocoon/MiniNet/MiniNet.hs
Haskell
apache-2.0
5,845
----------------------------------------------------------------------------- -- Copyright 2019, Ideas project team. This file is distributed under the -- terms of the Apache License 2.0. For more information, see the files -- "LICENSE.txt" and "NOTICE.txt", which are included in the distribution. -----------------...
ideas-edu/ideas
src/Ideas/Service/FeedbackScript/Run.hs
Haskell
apache-2.0
7,515
------------------------------------------------------------------------------- -- Experimental test for evaluating Queues performance -- -- Data Structures. Grado en Informática. UMA. -- Pepe Gallardo, 2012 ------------------------------------------------------------------------------- module Demos.Queue.Queue...
Saeron/haskell
data.structures/haskell/Demos/Queue/QueuesPerformance.hs
Haskell
apache-2.0
1,417
----------------------------------------------------------------------------- -- | -- Module : Text.PrettyPrint.HughesPJ -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : provisional ...
lwchkg/sunlight-x
test/code-snippets/haskell.hs
Haskell
apache-2.0
34,428
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1.SecurityContext where import GHC.Generics import Openshift.V1.Capabilities import Openshift.V1.SELinuxOptions import qualified Dat...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1/SecurityContext.hs
Haskell
apache-2.0
2,184
module Ticket75 where data a :- b = Q -- | A reference to ':-' f :: Int f = undefined
nominolo/haddock2
tests/golden-tests/tests/Ticket75.hs
Haskell
bsd-2-clause
88
{-Joseph Eremondi UU# 4229924 Utrecht University, APA 2015 Project one: dataflow analysis March 17, 2015 -} {-# LANGUAGE RecordWildCards #-} {-| General framework for constructing lattices and finding fixpoints of monotone functions. |-} module Optimize.MonotoneFramework ( AnalysisDirection(..), ProgramInfo...
JoeyEremondi/utrecht-apa-p1
src/Optimize/MonotoneFramework.hs
Haskell
bsd-3-clause
4,433
{-# LANGUAGE NoMonomorphismRestriction, ScopedTypeVariables#-} module Scan where import Obsidian import Data.Word import Data.Bits import Control.Monad import Prelude hiding (map,zipWith,zip,sum,replicate,take,drop,iterate,last) import qualified Prelude as P -----------------------------------------...
svenssonjoel/ObsidianGFX
Examples/ScanBench/Scan.hs
Haskell
bsd-3-clause
4,464