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 |
|---|---|---|---|---|---|
{-|
Copyright : (c) Dave Laing, 2017
License : BSD3
Maintainer : dave.laing.80@gmail.com
Stability : experimental
Portability : non-portable
-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSi... | dalaing/type-systems | src/Fragment/Tuple/Ast/Error.hs | Haskell | bsd-3-clause | 2,653 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Setup
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
-- Maintainer : lemmih@gmail.com
-- Stability : provisional
-- Portability : portable
--
--
--------------------... | alphaHeavy/cabal | cabal-install/Distribution/Client/Setup.hs | Haskell | bsd-3-clause | 45,137 |
-- #hide
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.BlendingFactor
-- Copyright : (c) Sven Panne 2002-2005
-- License : BSD-style (see the file libraries/OpenGL/LICENSE)
--
-- Maintainer : sven.panne@aedion.de
-- Stabil... | FranklinChen/hugs98-plus-Sep2006 | packages/OpenGL/Graphics/Rendering/OpenGL/GL/BlendingFactor.hs | Haskell | bsd-3-clause | 2,227 |
{-# LANGUAGE NamedFieldPuns, RecordWildCards #-}
module Graphics.BarChart.Parser.Progression where
import Text.CSV
import System.FilePath
import Graphics.BarChart.Types
import Graphics.BarChart.Parser
import Graphics.BarChart.Rendering
-- | Used by 'writeProgressionChart' to generate a bar chart from
-- progress... | sebfisch/haskell-barchart | src/Graphics/BarChart/Parser/Progression.hs | Haskell | bsd-3-clause | 1,021 |
{-# LANGUAGE
ConstraintKinds
, FlexibleContexts
, FlexibleInstances
, MultiParamTypeClasses
, ScopedTypeVariables
, TypeFamilies
, TypeSynonymInstances
#-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
--------------------------------------------------------------------------------
-- |
-- Module : Grap... | mgsloan/toy-gtk-diagrams | src/Graphics/UI/Toy/Gtk/Diagrams.hs | Haskell | bsd-3-clause | 3,832 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Spring13.Week7.Scrabble where
import Data.Char
newtype Score = Score Int
deriving (Eq, Read, Show, Ord, Num)
instance Monoid Score where
mempty = Score 0
mappend = (+)
score :: Char -> Score
score c
| c' `elem` "aeilnorstu" = Score 1
| c' `elem` "dg" = S... | bibaijin/cis194 | src/Spring13/Week7/Scrabble.hs | Haskell | bsd-3-clause | 657 |
{-#LANGUAGE OverloadedStrings, NoMonomorphismRestriction, TupleSections#-}
import Control.Applicative
import Control.Monad
import System.Directory
import System.FilePath
import Data.String
import Data.Conduit
import qualified Data.Conduit.List as CL
import Data.Conduit.Filesystem
import qualified Filesystem.Path ... | philopon/cabal-src-recache | Main.hs | Haskell | bsd-3-clause | 2,611 |
--
--
--
----------------
-- Exercise 9.2.
----------------
--
--
--
module E'9''2 where
mult :: Integer -> Integer -> Integer
mult 0 _ = 0
mult left right
= right + mult ( left - 1 ) right
{- GHCi>
mult 1 2
mult 2 2
-}
-- 2
-- 4
-- GHCi> mult 0 ( fact ( -2 ) )
-- 0
-- Explanation: the "right" arg... | pascal-knodel/haskell-craft | _/links/E'9''2.hs | Haskell | mit | 667 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Control.Concurrent.Utils
( Lock()
, Exclusive(..)
, Synchronised(..)
, withLock
) where
import Control.Distributed.Process
( Process
)
import qualified Control.Distributed.Process as Process (catch)
import Control.Excep... | qnikst/distributed-process-extras | src/Control/Concurrent/Utils.hs | Haskell | bsd-3-clause | 1,855 |
module Main where
import Control.Monad (void)
import Graphics.Vty
main :: IO ()
main = do
cfg <- standardIOConfig
vty <- mkVty cfg
let line1 = charFill (defAttr `withBackColor` blue) ' ' 10 1
line2 = charFill (defAttr `withBackColor` green) ' ' 10 1
img = translate 10 5 (line1 `vertJoin` line2)
... | jtdaugherty/vty | test/Issue76.hs | Haskell | bsd-3-clause | 400 |
module IRTS.CodegenC (codegenC) where
import Idris.AbsSyntax
import IRTS.Bytecode
import IRTS.Lang
import IRTS.Simplified
import IRTS.Defunctionalise
import IRTS.System
import IRTS.CodegenCommon
import Idris.Core.TT
import Util.System
import Numeric
import Data.Char
import Data.Bits
import Data.List (intercalate)
imp... | mrmonday/Idris-dev | src/IRTS/CodegenC.hs | Haskell | bsd-3-clause | 32,663 |
module Case1 where
fib n
| n <= 1 = 1
| otherwise = case (fib (n-1), fib (n-2)) of
(n1, n2) -> n1 + n2 + 1
| RefactoringTools/HaRe | old/testing/evalMonad/Case1.hs | Haskell | bsd-3-clause | 152 |
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
skipUnless =<< ghcVersionIs (>= mkVersion [8,1])
withPackageDb $ do
withDirectory "mylib" $ setup_install_with_docs ["--ipid", "mylib-0.1.0.0"]
withDirectory "mysql" $ setup_install_with_docs ["--ipid", "mysql-0.1.0.0"]
withDirectory "pos... | mydaum/cabal | cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs | Haskell | bsd-3-clause | 948 |
euclideanDistance :: [Double] -> [Double] -> Double
euclideanDistance p q = sqrt . sum $ zipWith (\ u v -> (u-v)^2) p q
| imanmafi/Algorithm-Implementations | Euclidean_distance/Haskell/jcla1/euclidean_distance.hs | Haskell | mit | 120 |
{-# LANGUAGE PolyKinds, GADTs, KindSignatures, DataKinds, FlexibleInstances #-}
module T7438a where
data Thrist :: k -> k -> * where
Nil :: Thrist a a
| urbanslug/ghc | testsuite/tests/polykinds/T7438a.hs | Haskell | bsd-3-clause | 157 |
{-# htermination fmToList_GE :: (Ord a, Ord k) => FiniteMap (Either a k) b -> (Either a k) -> [((Either a k),b)] #-}
import FiniteMap
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/FiniteMap_fmToList_GE_10.hs | Haskell | mit | 135 |
module Main(main) where
import System.Directory (Permissions)
import System.IO (FilePath)
data Info = Info {
infoPath :: FilePath
, infoPerms :: Maybe Permissions
, infoSize :: Maybe Integer
, infoModTime :: Maybe ClockTime
} deriving (Eq, Ord, Show)
| rockdragon/julia-programming | code/haskell/ControlVisit.hs | Haskell | mit | 310 |
{-# htermination (/=) :: Float -> Float -> Bool #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_SLASHEQ_8.hs | Haskell | mit | 52 |
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable, NamedFieldPuns #-}
-- | Just re-exports a few of the types from
-- "Service.Twilio.Types". There are a number of helper functions
-- which are currently exposed by "Service.Twilio.Types" that aren't
-- exposed here.
module Service.Twilio (
-- * Base Twilio types
... | reifyhealth/twill | src/Service/Twilio.hs | Haskell | mit | 1,748 |
module Control.Concurrent.ForkOrDoPool where
import Control.Concurrent
import Control.Concurrent.MVar as MVar
import Data.List as List
import Data.Maybe as Maybe
import Prelude.Extensions as PreludeExt
type ForkOrDoPool = [(ThreadId, MVar (IO ()))]
createPool :: Int -> IO ForkOrDoPool
createPool = \number_of_threads ... | stevedonnelly/haskell | code/Control/Concurrent/ForkOrDoPool.hs | Haskell | mit | 1,282 |
module Language.PCPL.Syntax
( Program(..)
, Domino(..)
, Symbol
, syms
, unsyms
) where
import Language.UTM.Syntax
-- | PCPL program
data Program = Program
{ startDomino :: Input -> Domino
, dominos :: [Domino]
, separator :: Symbol
}
data Domino = Domino [Symbol] [Symbo... | davidlazar/PCPL | src/Language/PCPL/Syntax.hs | Haskell | mit | 347 |
module PostgREST.Parsers where
import Protolude hiding (try, intercalate)
import Control.Monad ((>>))
import Data.Text (intercalate)
import Data.List (init, last)
import Data.Tree
import ... | NotBrianZach/postgrest | src/PostgREST/Parsers.hs | Haskell | mit | 5,173 |
module System.Flannel.ParamsSpec
( spec
) where
import System.Flannel.Params
import Test.Hspec
spec :: Spec
spec = do
describe "defaultParams" $ do
it "sets every field as empty" $ do
isSet "test" defaultParams `shouldBe` False
getOption "test" defaultParams `shouldBe` Noth... | nahiluhmot/flannel | spec/System/Flannel/ParamsSpec.hs | Haskell | mit | 1,178 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
module Network.RestClientSpec (main, spec) where
import Helper
import Network.RestClient
main :: IO ()
main = hspec spec
withServer :: (IO Req -> IO a) -> IO a
withServer = withHttpServer status200 [("Content-Type", ... | sol/rest-client | test/Network/RestClientSpec.hs | Haskell | mit | 1,063 |
module Y2017.M04.D19.Exercise where
import Data.Aeson
-- below imports available from 1HaskellADay git repository
import Wikidata.Query.Aeson
import Wikidata.Query.Endpoint
import Y2017.M04.D18.Exercise
{--
Okay, today we're going to do the same thing as yesterday, but with a different
SPARQL query. Recall that we... | geophf/1HaskellADay | exercises/HAD/Y2017/M04/D19/Exercise.hs | Haskell | mit | 987 |
module Spear.Math.Vector.Vector3
(
Vector3(..)
, Right3
, Up3
, Forward3
, Position3
-- * Construction
, unitx3
, unity3
, unitz3
, zero3
, vec3
, orbit
-- * Operations
, cross
)
where
import Spear.Math.Vector.Class
import Foreign.C.Types (CFloat)
import Forei... | jeannekamikaze/Spear | Spear/Math/Vector/Vector3.hs | Haskell | mit | 4,913 |
import Control.Monad (forM_)
import Data.Array
import qualified Data.Char as Char
import qualified Data.List as List
data Light = On | Off
deriving (Eq, Show)
type Lights = Array Coordinates Light
type Coordinates = (Int, Int)
main = do
lightsList <- List.transpose <$> map (map parseInput) <$> lines <$> getCont... | SamirTalwar/advent-of-code | 2015/AOC_18_2.hs | Haskell | mit | 2,075 |
{-# LANGUAGE MultiParamTypeClasses #-}
module Database.EventSafe.ConcSpec
( spec
) where
import Control.Concurrent
import Control.Monad
import Database.EventSafe.Conc
import Database.EventSafe.Types
import Test.Hspec
data EventExample = EventExample deriving (Show, Eq, Ord)
data ResourceRefExample ... | thoferon/eventsafe | tests/Database/EventSafe/ConcSpec.hs | Haskell | mit | 1,492 |
{-# LANGUAGE Safe, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.GroupWiths
-- Copyright : (c) Uli Köhler 2014
-- License : Apache License v2.0
-- Maintainer : ukoehler@techoverflow.net
-- Stability : provisional
-- Port... | kyclark/group-with | Control/GroupWith.hs | Haskell | apache-2.0 | 5,997 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GADTs #-}
module Startups.GameTypes where
import Startups.Base
impor... | bitemyapp/7startups | Startups/GameTypes.hs | Haskell | bsd-3-clause | 4,991 |
-- 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. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
------------------... | facebookincubator/duckling | Duckling/Ranking/Classifiers/EN_TT.hs | Haskell | bsd-3-clause | 264,531 |
module Dxedrine.Hlists where
import Control.Monad (forM_, replicateM_)
import Dxedrine.Words
import Data.Binary
import Data.Binary.Get
import Data.Binary.Put
import qualified Data.ByteString.Lazy as BL
import Data.Maybe (fromMaybe)
import Data.Word (Word8(..), Word16(..))
data Range =
IgnoreR Int
| OneR Word8 W... | ejconlon/dxedrine | src/Dxedrine/Hlists.hs | Haskell | bsd-3-clause | 4,539 |
module Tct.Trs.Data.Precedence
( Order (..)
, Precedence (..)
, precedence
, empty
, insert
, eclasses
, recursionDepth
, ranks
) where
import qualified Control.Monad.State.Strict as St
import Data.List (find)
import qualified Data.Map as M
import ... | ComputationWithBoundedResources/tct-trs | src/Tct/Trs/Data/Precedence.hs | Haskell | bsd-3-clause | 2,563 |
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, DeriveFunctor, OverloadedStrings, PatternGuards #-}
-- | Types used to generate the input.
module Input.Item(
Sig(..), Ctx(..), Ty(..),
Item(..), itemName,
Target(..), TargetId(..),
splitIPackage, splitIModule,
hseToSig, hseToItem
) w... | BartAdv/hoogle | src/Input/Item.hs | Haskell | bsd-3-clause | 5,430 |
{-# LANGUAGE
TemplateHaskell
, QuasiQuotes
#-}
module Language.Haskell.TH.HDBI
(
deriveToRow
, deriveFromRow
) where
-- import Control.Applicative
import Control.Monad
import Control.Applicative
import Database.HDBI.SqlValue (ToRow(..),
FromRow(..),
... | s9gf4ult/hdbi | Language/Haskell/TH/HDBI.hs | Haskell | bsd-3-clause | 3,428 |
{-# LANGUAGE TypeFamilies #-}
{-| This is a dummy backend that doesn't offer any formalism to specify models or verify contracts.
It is only used to provide a backend for testing purporses (Or if you are too lazy to write components). -}
module Language.GTL.Backend.None where
import Language.GTL.Backend
import Dat... | hguenther/gtl | lib/Language/GTL/Backend/None.hs | Haskell | bsd-3-clause | 1,009 |
{-|
Module : Idris.Core.Evaluate
Description : Evaluate Idris expressions.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE BangPatterns, DeriveGeneric, FlexibleInstances,
MultiParamTypeClasses, PatternGuards #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
module... | jmitchell/Idris-dev | src/Idris/Core/Evaluate.hs | Haskell | bsd-3-clause | 56,761 |
{-# LANGUAGE TemplateHaskell #-}
module Main (
main
) where
import Test.Tasty
import Test.Tasty.QuickCheck
import System.Exit
import qualified Data.Schema.Sql.ScriptParseTest as SPT (testGroup)
main = defaultMain tests
tests :: TestTree
tests =
testGroup "All Tests" [
SPT.testGroup... | proegssilb/git-sql | test/MainTestSuite.hs | Haskell | bsd-3-clause | 329 |
-- |
module X12.Tokens where
import Data.Text
data ElementToken = SimpleElementToken Text
| ComponentElementToken Text
| CompositeElementToken [ElementToken]
| RepeatedElementToken [ElementToken]
deriving (Eq, Show)
data SegmentToken = SegmentT... | alexkyllo/xtwelve | src/X12/Tokens.hs | Haskell | bsd-3-clause | 490 |
{-# LANGUAGE ScopedTypeVariables #-}
module GhcUtilsSpec (main, spec) where
import Test.Hspec
import TestUtils
import qualified GHC as GHC
import qualified Data.Generics as SYB
import qualified GHC.SYB.Utils as SYB
import Language.Haskell.GHC.ExactPrint.Utils
import Language.Haskell.Refact... | mpickering/HaRe | test/GhcUtilsSpec.hs | Haskell | bsd-3-clause | 3,442 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.INTEL.ParallelArrays
-- Copyright : (c) Sven Panne 2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portabl... | phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/INTEL/ParallelArrays.hs | Haskell | bsd-3-clause | 1,012 |
module Board.MoveGen where
import Data.Bits
import Data.Char
import Data.Word
import Numeric
import Utils
import Text.Printf
import qualified Data.Vector.Unboxed as V
{-
noWe nort noEa
+7 +8 +9
\ | /
west -1 <- 0 -> +1 east
/ | \
-... | sphynx/hamisado | Board/MoveGen.hs | Haskell | bsd-3-clause | 6,543 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{- |
Module : Kiosk.Backend.Data.ReportTemplate
Description : Render a Report Template from a Form and a list of DataTemplates
Copyright : Plow Technologies LLC
License : MIT License
Maintainer : Scott Murphy
Stability : experi... | plow-technologies/cobalt-kiosk-data-template | src/Kiosk/Backend/Data/ReportTemplate.hs | Haskell | bsd-3-clause | 7,767 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import CNC.FanucMacro
import CNC.HCode
import CNC.GInterpreter
import CNC.GParser
import CNC.AwePrelude
--import Prelude(Num(..), Fractional(..), Floating(..), Int, ($), id, putStrLn, (++), Just)
import System.Environment
evaluateIsoFile :: FilePath -> IO ProgramS... | akamaus/gcodec | src/CNC/GEmulator.hs | Haskell | bsd-3-clause | 680 |
{-# LANGUAGE OverloadedStrings, DoAndIfThenElse #-}
-- |
-- Command line utility, this is not meant to be used as a library.
--
-- To use as a library see the README or use this as an example of how
-- to combine the caching backend, request system, and parser/rule
-- checker.
module Main where
import Con... | ixmatus/grob | src/Grob.hs | Haskell | bsd-3-clause | 8,593 |
{-# LANGUAGE DeriveDataTypeable #-}
{- |
Module : $Header$
Description : Shrimp error types and pretty-printing
Copyright : (c) Galois, Inc.
Shrimp error types and pretty-printing
-}
module SCD.M4.Errors(Error(..), nubError, occurrences, flatten, distribute,
errorsByType) where
import SCD.M4.Syntax(IfdefId... | GaloisInc/sk-dev-platform | libs/SCD/src/SCD/M4/Errors.hs | Haskell | bsd-3-clause | 8,929 |
import Control.Concurrent
import Control.Concurrent.STM.TVar
import Control.Monad
import Control.Monad.STM
import Data.IORef
import Data.Map
import Foreign.C.Types
import Foreign.Ptr
import Foreign.Storable
import Graphics.Rendering.OpenGL
import Graphics.UI.GLFW as GLFW
import System.Exit (exitWith, ExitCode (..))
imp... | imalsogreg/flycap | tests/multCameras.hs | Haskell | bsd-3-clause | 6,866 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANG... | leptonyu/mint | corn-server/src/Service/User.hs | Haskell | bsd-3-clause | 5,253 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.TypeLits.Singletons.Internal
-- Copyright : (C) 20... | goldfirere/singletons | singletons-base/src/GHC/TypeLits/Singletons/Internal.hs | Haskell | bsd-3-clause | 10,075 |
{-# LANGUAGE DeriveDataTypeable,OverloadedStrings #-}
module XMonad.Actions.XHints.Translate where
import Data.Typeable
import XMonad.Actions.XHints.State
import qualified Language.Bing as B
import Language.Bing (BingLanguage,BingContext,ClientId,ClientSecret,getAccessToken,execBing)
import Control.Monad.IO.Class (Mon... | netogallo/XHints | src/XMonad/Actions/XHints/Translate.hs | Haskell | bsd-3-clause | 1,214 |
{-# LANGUAGE OverloadedStrings #-}
module Air.Cli.Parser where
import Control.Applicative ((<$>), (<*>), (<*))
import Data.Char (chr)
import Data.ByteString hiding (map, elem)
import Data.Attoparsec hiding (satisfy)
import Data.Attoparsec.Combinator
import Data.Attoparsec.ByteString.Char8
import Air.Cli (Command(..)... | andorp/air | src/Air/Cli/Parser.hs | Haskell | bsd-3-clause | 4,974 |
module ReplaceExperiment where
replaceWithP :: b -> Char
replaceWithP = const 'p'
lms :: [Maybe [Char]]
lms = [Just "Ave", Nothing, Just "woohoo"]
replaceWithP' :: [Maybe [Char]] -> Char
replaceWithP' = replaceWithP
liftedReplace :: Functor f => f a -> f Char
liftedReplace = fmap replaceWithP
liftedReplace' :: [M... | chengzh2008/hpffp | src/ch16-Functor/oneMoreList.hs | Haskell | bsd-3-clause | 1,231 |
{-# language CPP #-}
-- | = Name
--
-- VK_AMD_shader_explicit_vertex_parameter - device extension
--
-- == VK_AMD_shader_explicit_vertex_parameter
--
-- [__Name String__]
-- @VK_AMD_shader_explicit_vertex_parameter@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
-- 22... | expipiplus1/vulkan | src/Vulkan/Extensions/VK_AMD_shader_explicit_vertex_parameter.hs | Haskell | bsd-3-clause | 3,769 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1999
Analysis functions over data types. Specficially, detecting recursive types.
This stuff is only used for source-code decls; it's recorded in interface
files for imported data types.
-}
{-# LANGUAGE CPP #-}
module TcTyD... | nushio3/ghc | compiler/typecheck/TcTyDecls.hs | Haskell | bsd-3-clause | 45,303 |
{-# LANGUAGE ViewPatterns, TemplateHaskell #-}
module Data.TrieMap.Representation.TH.ReprMonad (
ReprMonad,
liftQuasi,
recurse,
getInstance,
outputInstance,
mustBreak,
execReprMonad,
forceDefaultListRep) where
import Data.TrieMap.Representation.Class
import Data.TrieMap.Representation.TH.Utils
import ... | lowasser/TrieMap | Data/TrieMap/Representation/TH/ReprMonad.hs | Haskell | bsd-3-clause | 3,101 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[StgSyn]{Shared term graph (STG) syntax for spineless-tagless code generation}
This data type represents programs just before code generation (conversion to
@Cmm@): basically, what we have is a stylised form of @CoreSyntax@, the style
being one that... | vTurbine/ghc | compiler/stgSyn/StgSyn.hs | Haskell | bsd-3-clause | 27,004 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GADTs #-}
module Oracle.DiffOracleOld where
import qualified Data.IntMap as M
import Data.Maybe
import Data.List
import Debug.Trace
import Oracle.Internal
import Language.Clojure.Lang
import Language.Clojure.AST
import Util.UnixD... | nazrhom/vcs-clojure | src/Oracle/DiffOracleOld.hs | Haskell | bsd-3-clause | 3,890 |
-- mathsprimitives.hs
module Math.MathsPrimitives where
-- primitive operations on sequences (lists) of numbers
-- used in implementation of vectors, matrices, polynomials, cyclotomic fields, etc
import List (transpose)
infixr 8 */, *//
infixl 7 $*, $., $$*
infixl 6 $+, $-, $$+, $$-
-- addition o... | nfjinjing/bench-euler | src/Math/MathsPrimitives.hs | Haskell | bsd-3-clause | 2,012 |
{-# LANGUAGE TypeSynonymInstances,GeneralizedNewtypeDeriving,MultiParamTypeClasses,FlexibleInstances #-}
module MigrationsTest
( tests
)
where
import Test.HUnit
import Control.Monad.Identity ( runIdentity, Identity )
import qualified Data.Map as Map
import Data.Time.Clock ( UTCTime )
import Database.Schema.Mi... | creswick/dbmigrations | test/MigrationsTest.hs | Haskell | bsd-3-clause | 2,438 |
module ParsecExpr
{-# DEPRECATED "This module has moved to Text.ParserCombinators.Parsec.Expr" #-}
(module Text.ParserCombinators.Parsec.Expr) where
import Text.ParserCombinators.Parsec.Expr
| FranklinChen/hugs98-plus-Sep2006 | fptools/hslibs/text/parsec/ParsecExpr.hs | Haskell | bsd-3-clause | 191 |
-- Copyright 2004-present Facebook. All Rights Reserved.
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
module Haxl.Core.CallGraph where
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
#if __GLASGOW_HASKELL__ < 804
import Data.Monoid
#endif
import Data.Text (Text)
import qualified Data.T... | facebook/Haxl | Haxl/Core/CallGraph.hs | Haskell | bsd-3-clause | 1,071 |
{-
(c) The University of Glasgow 2006
(c) The AQUA Project, Glasgow University, 1996-1998
TcTyClsDecls: Typecheck type and class declarations
-}
{-# LANGUAGE TupleSections, CPP #-}
module ETA.TypeCheck.TcTyClsDecls (
tcTyAndClassDecls, tcAddImplicits,
-- Functions used by TcInstDcls to check
... | pparkkin/eta | compiler/ETA/TypeCheck/TcTyClsDecls.hs | Haskell | bsd-3-clause | 100,831 |
{-# 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/StackMap.hs | Haskell | bsd-3-clause | 2,719 |
-- | Basic operations on graphs.
--
module GraphOps (
addNode, delNode, getNode, lookupNode, modNode,
size,
union,
addConflict, delConflict, addConflicts,
addCoalesce, delCoalesce,
addExclusion, addExclusions,
addPreference,
... | olsner/ghc | compiler/utils/GraphOps.hs | Haskell | bsd-3-clause | 23,303 |
{-# LANGUAGE RankNTypes, PolyKinds #-}
-- NB: -fprint-explicit-runtime-reps enabled in all.T
module TypeSkolEscape where
import GHC.Types
import GHC.Exts
type Bad = forall (v :: RuntimeRep) (a :: TYPE v). a
| sdiehl/ghc | testsuite/tests/dependent/should_fail/TypeSkolEscape.hs | Haskell | bsd-3-clause | 210 |
module Time {-(
ClockTime,
Month(January,February,March,April,May,June,
July,August,September,October,November,December),
Day(Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday),
CalendarTime(CalendarTime, ctYear, ctMonth, ctDay, ctHour, ctMin,
ctPicosec, ctWDay, ctYDa... | forste/haReFork | tools/base/tests/HaskellLibraries/Time.hs | Haskell | bsd-3-clause | 5,602 |
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# LANGUAGE RankNTypes, ExistentialQuantification #-}
-- An interesting interaction of universals and existentials, prompted by
-- http://www.haskell.org/pipermail/haskell-cafe/2004-October/007160.html
--
-- Note the nested pattern-match in runProg; tc183 checks th... | urbanslug/ghc | testsuite/tests/typecheck/should_fail/tcfail126.hs | Haskell | bsd-3-clause | 1,007 |
-- | Check universe constraints.
module Idris.Core.Constraints ( ucheck ) where
import Idris.Core.TT ( TC(..), UExp(..), UConstraint(..), FC(..),
ConstraintFC(..), Err'(..) )
import Control.Applicative
import Control.Monad.State.Strict
import Data.List ( partition )
import qualified Data.Map.S... | osa1/Idris-dev | src/Idris/Core/Constraints.hs | Haskell | bsd-3-clause | 9,942 |
module Rhodium.Context where
import Control.Exception.Base (assert)
type Label = String
data UpTerm var
= UpVar var
| UpPred Label [DnTerm var]
-- ^ variables and atoms
| UpPi (UpTerm var) (UpTerm var)
-- ^ dependant product
| UpSigma (UpTerm var) (UpTerm var)
-- ^ dependant sum
| UpWType (UpTerm va... | DrNico/rhodium | tools/rhc-strap/Rhodium/Context.hs | Haskell | mit | 8,149 |
{-
{-
Nested comment
-}
-- Note: still commented
fibs :: [Int]
fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
-}
main :: IO ()
main = print [1..]
| cgag/loc | tests/data/nested-comments.hs | Haskell | mit | 147 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
module Ringo.ArgParser (ProgArgs(..), parseArgs) where
import qualified Data.Text as Text
import qualified Distribution.Package as P
import qualified Distribution.PackageDescription as P
import qualified Distribution.C... | quintype/ringo | app/Ringo/ArgParser.hs | Haskell | mit | 5,122 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.MediaKeySystemAccess
(getConfiguration, getConfiguration_, createMediaKeys,
createMediaKeys_, getKeySyste... | ghcjs/jsaddle-dom | src/JSDOM/Generated/MediaKeySystemAccess.hs | Haskell | mit | 2,815 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.RTCDataChannel (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.RTCDataChannel
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS.DOM.JSFFI.Gen... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/RTCDataChannel.hs | Haskell | mit | 355 |
module Str where
import qualified Data.Text as DT
-- type Str = BS.ByteString
type Str = DT.Text
| dancor/melang | src/Str.hs | Haskell | mit | 99 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE MultiWayIf #-}
module RWPAS.Level.Type
( Level()
... | Noeda/rwpas | src/RWPAS/Level/Type.hs | Haskell | mit | 18,371 |
{-# LANGUAGE FlexibleContexts #-}
module Ch27.SyslogUDPClient
where
import Data.Bits
import Network.Socket hiding (sendTo)
import Network.Socket.ByteString (sendTo)
import Ch27.SyslogTypes
import qualified Data.ByteString.Char8 as Strict
import qualified Data.ByteString.Lazy.Char8 as Lazy (toStrict)
import Data.ByteS... | futtetennista/IntroductionToFunctionalProgramming | RWH/src/Ch27/SyslogUDPClient.hs | Haskell | mit | 4,975 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
module Apollo.Reflection
( Demote'
, Demote
, ReflectS(..)
, Proxiable(..)
, Proxy(..)
, KProxy(..)
) where
import Data.Proxy
-- | Type level function that selects a canonical type constructor for a given
-- kind. Generally, the sele... | tsani/apollo | src/Apollo/Reflection.hs | Haskell | mit | 1,071 |
module Util.GL where
import qualified Graphics.Rendering.OpenGL as GL
float2gl :: Float -> GL.GLfloat
float2gl = realToFrac :: Float -> GL.GLfloat
| kaisellgren/ankka | src/Util/GL.hs | Haskell | mit | 149 |
{-# LANGUAGE DeriveDataTypeable #-}
{-
Copyright (C) 2012-2017 Jimmy Liang, Michal Antkiewicz <http://gsd.uwaterloo.ca>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, in... | gsdlab/claferIG | src-cmd/Main.hs | Haskell | mit | 8,717 |
module Y2016.M07.D21.Solution where
import Data.Graph
import Data.Tree (subForest, rootLabel)
import Data.Maybe (maybeToList, mapMaybe)
import Y2016.M07.D20.Solution
import Y2016.M07.D19.Exercise (figure2)
{--
you can get a Graph-Figure of figure from:
*Y2016.M07.D21.Solution> let (gr,fnPt,fnVertM) = graphit figure... | geophf/1HaskellADay | exercises/HAD/Y2016/M07/D21/Solution.hs | Haskell | mit | 1,574 |
import Data.List.Split
main = getContents >>= putStr . main'
main' :: String -> String
main' cs = unlines $ map getShell (lines cs)
getShell :: String -> String
getShell ln = last $ splitOn ":" ln
| ryuichiueda/UspMagazineHaskell | Study1_Q2/q1_2_1.hs | Haskell | mit | 200 |
{- |
== Getting Started
To get started with golden testing and this library, see
<https://ro-che.info/articles/2017-12-04-golden-tests Introduction to golden testing>.
This module provides a simplified interface. If you want more, see
"Test.Tasty.Golden.Advanced".
== Filenames
Filenames are looked up in the usual wa... | feuerbach/tasty-golden | Test/Tasty/Golden.hs | Haskell | mit | 11,066 |
{-# htermination sin :: Float -> Float #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_sin_1.hs | Haskell | mit | 43 |
-- Benchmark.hs
-- A set of (micro-) benchmarks for the Haskell
-- programming language
--
-- vim: ft=haskell sw=2 ts=2 et
--
{-# LANGUAGE OverloadedStrings #-}
module Main where
import System.CPUTime
import Fibonacci as Fib
import PerfectNumber as Pn
import qualified Mandelbrot as M
-- a helper fun for timing mea... | kkirstein/proglang-playground | Haskell/src/Benchmark/Benchmark.hs | Haskell | mit | 2,251 |
{-# LANGUAGE NoImplicitPrelude, TypeSynonymInstances, FlexibleInstances #-}
module IHaskell.Display.Diagrams (diagram) where
import ClassyPrelude
import System.Directory
import qualified Data.ByteString.Char8 as Char
import System.IO.Unsafe
import Diagrams.Prelude
import Diagrams.Backend.Cairo
import IHaskell.Disp... | aostiles/LiveHaskell | ihaskell-display/ihaskell-diagrams/IHaskell/Display/Diagrams.hs | Haskell | mit | 1,295 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.SVGTransformList
(js_clear, clear, js_initialize, initialize, js_getItem, getItem,
js_insertItemBefore, insertItemBefore, js_replaceItem, replaceItem,
js_removeItem, removeItem, js_appendIte... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGTransformList.hs | Haskell | mit | 6,358 |
import Control.Applicative
main :: IO ()
main = show . sum . map read . words <$> getLine >>= putStrLn | fabianm/olympiad | 2015-2016/round-1/a0.hs | Haskell | apache-2.0 | 104 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Kubernetes.V1.NamespaceList where
import GHC.Generics
import Data.Text
import Kubernetes.Unversioned.ListMeta
import Kubernetes.V1.Namespace
im... | minhdoboi/deprecated-openshift-haskell-api | kubernetes/lib/Kubernetes/V1/NamespaceList.hs | Haskell | apache-2.0 | 1,441 |
module HelperSequences.A000005Spec (main, spec) where
import Test.Hspec
import HelperSequences.A000005 (a000005)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A000005" $
it "correctly computes the first 20 elements" $
take 20 (map a000005 [1..]) `shouldBe` expectedValue where
expectedValue... | peterokagey/haskellOEIS | test/HelperSequences/A000005Spec.hs | Haskell | apache-2.0 | 365 |
-- |This module exports functions for testing the compiler on Flapjax source
-- files.
module Test.FileTests(compileFlapjaxFile,compileFlapjaxFilesIn) where
import System.IO
import System.Directory
import Text.ParserCombinators.Parsec(ParseError,parseFromFile)
import Html.Parser(parse)
import Flapjax.Compiler(compileP... | brownplt/ovid | src/Test/FileTests.hs | Haskell | bsd-2-clause | 1,531 |
-- 1258
import Data.Function(on)
import Data.List(group, permutations, sort, sortBy)
import Data.Ratio(denominator, numerator)
invnum = -101010101
myadd a b
| a == invnum || b == invnum = invnum
| otherwise = a + b
mysub a b
| a == invnum || b == invnum = invnum
| otherwise = a - b
mymul a b
| a ==... | higgsd/euler | hs/93.hs | Haskell | bsd-2-clause | 1,601 |
{-# OPTIONS_GHC -fwarn-unused-imports #-}
module Instances () where
import Control.Monad.IO.Control
import Data.Enumerator
import Control.Monad.IO.Class
import Control.Exception.Control
instance MonadIO m => MonadControlIO (Iteratee a m) where
liftControlIO f = liftIO $ f run'
where
run' iter = return $ It... | konn/konnfav | Instances.hs | Haskell | bsd-2-clause | 451 |
-- vim: sw=2: ts=2: set expandtab:
{-# LANGUAGE TemplateHaskell,
ScopedTypeVariables,
FlexibleInstances,
MultiParamTypeClasses,
FlexibleContexts,
UndecidableInstances,
OverloadedStrings,
CPP #-}
----------------------------------... | kyagrd/micronax | src/Syntax.hs | Haskell | bsd-2-clause | 1,567 |
-- | This module implements various functions that return a probabilistic result,
-- defined as unitary operators, and quantum computations.
module QIO.QIORandom where
import Data.Monoid as Monoid
import QIO.QioSyn
import QIO.Qdata
import QIO.Qio
import Data.Complex
-- | The exponentiated Pauli-X rotation
rX :: RR ... | alexandersgreen/qio-haskell | QIO/QIORandom.hs | Haskell | bsd-2-clause | 4,890 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS -Wall #-}
module Main (
main
) where
import Control.Monad (foldM)
import Control.Monad.Trans (liftIO)
import qualified Data.ByteString.Char8 as C
import Data.Default
import qualified Data.IntMap as IM... | kfish/zoom-cache | tools/zoom-cache.hs | Haskell | bsd-2-clause | 8,530 |
{-# LANGUAGE FlexibleContexts #-}
module CubicleMaze (solve) where
import Data.Bits (popCount)
import Data.Maybe (fromJust)
import Data.List (foldl')
import qualified Data.OrdPSQ as PSQ
import qualified Data.Set as Set
import Text.Parsec.Prim (Stream, ParsecT, parse)
import Text.Parsec.Char (digit, endOfLine)
import ... | cjlarose/advent-2016 | src/CubicleMaze.hs | Haskell | bsd-3-clause | 2,012 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module Hassistant.Header where
import qualified GHC
import qualified Exception
import qualified DynFlags
import qualified Util
import qualified Outputable
import qualified GHC.Paths
import Control.Applicative
import qualified Data.Text as T
imp... | philopon/hassistant.vim | src/Hassistant/Header.hs | Haskell | bsd-3-clause | 1,841 |
-- Copyright (c) 2014-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is distributed under the terms of a BSD license,
-- found in the LICENSE file.
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiP... | simonmar/Haxl | Haxl/DataSource/ConcurrentIO.hs | Haskell | bsd-3-clause | 2,689 |
-- | 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... | ezyang/ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | Haskell | bsd-3-clause | 31,558 |
module Main where
import System.Environment (getArgs)
import Network.Factual.API
import Data.Factual.Query.DiffsQuery
import Data.Factual.Response
main :: IO()
main = do
args <- getArgs
let oauthKey = head args
let oauthSecret = last args
let options = Options { token = generateToken oauthKey oauthSecret, tim... | rudyl313/factual-haskell-driver | examples/DiffsExample.hs | Haskell | bsd-3-clause | 619 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.