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 |
|---|---|---|---|---|---|
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
import Data.List (sort)
import Test.Hspec (Spec, describe, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import Prelude hiding (null)
import CustomSet
( delete
, difference
, fromList
, insert
, isDisjointFrom
... | exercism/xhaskell | exercises/practice/custom-set/test/Tests.hs | Haskell | mit | 7,179 |
main = do cs <- getContents
putStr $ numbering cs
numbering :: String -> String
numbering cs = unlines $ map format $ zipLineNumber $ lines cs
zipLineNumber :: [String] -> [(String, String)]
zipLineNumber xs = zip (map show [1..]) xs
format (s1, s2) = s1++" "++s2
| kazuya030/haskell-test | old/catn.hs | Haskell | mit | 280 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.HTMLHeadingElement
(js_setAlign, setAlign, js_getAlign, getAlign, HTMLHeadingElement,
castToHTMLHeadingElement, gTypeHTMLHeadingElement)
where
import Prelude ((.), (==), (>>=), return, IO, In... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/HTMLHeadingElement.hs | Haskell | mit | 1,809 |
module GHCJS.DOM.OESStandardDerivatives (
) where
| manyoo/ghcjs-dom | ghcjs-dom-webkit/src/GHCJS/DOM/OESStandardDerivatives.hs | Haskell | mit | 52 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies, FlexibleContexts, ConstraintKinds #-}
module Database.Persist.Class.PersistUnique
(PersistUniqueRead(..)
,PersistUniqueWrite(..)
,getByValue
,insertBy
,insertUniqueEntity
,replaceUnique
,checkUnique
,onlyUnique)
where
import Database.Persist.Types
impo... | psibi/persistent | persistent/Database/Persist/Class/PersistUnique.hs | Haskell | mit | 9,836 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
module Config (
asks
, ConfigHandler(..)
, Config(..)
, readConfigFromEnv
, convertServer
) where
import System.Environment
import qualified Data.Map as M
import Data.Maybe
import Control.Monad.R... | lierdakil/markco | server/src/Config.hs | Haskell | mit | 1,820 |
module Graphics.Urho3D.UI.Internal.Menu(
Menu
, menuCntx
, sharedMenuPtrCntx
, SharedMenu
) where
import qualified Language.C.Inline as C
import qualified Language.C.Inline.Context as C
import qualified Language.C.Types as C
import Graphics.Urho3D.Container.Ptr
import qualified Data.Map as Map
data Menu
... | Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/UI/Internal/Menu.hs | Haskell | mit | 471 |
{-# Language BangPatterns #-}
module Main where
import System.IO
import System.Environment
import System.Console.Haskeline
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as C
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Error
import Control.Monad.State
import Cont... | mhlakhani/hlisp | src/Main.hs | Haskell | mit | 2,229 |
module Hasql.Postgres.Session.Execution where
import Hasql.Postgres.Prelude
import qualified Data.HashTable.IO as Hashtables
import qualified Database.PostgreSQL.LibPQ as PQ
import qualified Hasql.Postgres.Statement as Statement
import qualified Hasql.Postgres.TemplateConverter as TemplateConverter
import qualified Ha... | begriffs/hasql-postgres | library/Hasql/Postgres/Session/Execution.hs | Haskell | mit | 3,467 |
module PureScript.Ide.Watcher where
import Control.Concurrent (threadDelay)
import Control.Concurrent.STM
import Control.Monad (forever, when)
import qualified Data.Map as M
import Data.Maybe (isJust)
import PureScript.Ide.Externs... | nwolverson/psc-ide | src/PureScript/Ide/Watcher.hs | Haskell | mit | 1,218 |
import qualified Problem01 as P01
import qualified Problem02 as P02
import qualified Problem03 as P03
import qualified Problem04 as P04
import qualified Problem05 as P05
import qualified Problem06 as P06
import qualified Problem07 as P07
import qualified Problem08 as P08
import qualified Problem14 as P14
cine = False ... | edwardwas/adventOfCodeTwo | src/Main.hs | Haskell | mit | 1,278 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Brainfuck.Cell
( Cell
, Math (..)
, stepCell
) where
import ClassyPrelude
import Data.Monoid (Sum)
type Cell = Sum Word8
data Math = Inc | Dec
deriving Show
stepCell :: Math -> (Cell -> Cell)
stepCell Inc =... | expede/brainfucker | src/Brainfuck/Cell.hs | Haskell | apache-2.0 | 412 |
cnt' n ('O':'I':xs) = cnt' (n+1) xs
cnt' n x = n
cnt [] = []
cnt ('I':xs) =
let n = cnt' 0 xs
r = drop (2*n) xs
in
n:(cnt r)
cnt ('O':xs) = cnt xs
ans ("0":_) = []
ans (n:_:s:xs) =
let n' = read n :: Int
r = cnt s
a = sum $ map (\x -> if x >= n' then (x-n'+1) else 0) r
in
a:(ans ... | a143753/AOJ | 0538.hs | Haskell | apache-2.0 | 405 |
{-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Messages.Type (Type(..)) where
import Prelude ((+), (/), (.))
import qualified Prelude as Prelude'
import qualified Data.Typeable as Prelude'
import qualified Data.Data as Prel... | JDrit/MemDB | client.hs/src/Messages/Type.hs | Haskell | apache-2.0 | 2,139 |
module Tables.A268057Spec (main, spec) where
import Test.Hspec
import Tables.A268057 (a268057)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A268057" $
it "correctly computes the first 20 elements" $
take 20 (map a268057 [1..]) `shouldBe` expectedValue where
expectedValue = [1,1,1,1,2,1,1,... | peterokagey/haskellOEIS | test/Tables/A268057Spec.hs | Haskell | apache-2.0 | 347 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QResizeEvent.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:20
Warning : this file is machine generated - do ... | keera-studios/hsQt | Qtc/Gui/QResizeEvent.hs | Haskell | bsd-2-clause | 4,324 |
{-| Implementation of the Ganeti Query2 export queries.
-}
{-
Copyright (C) 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above c... | apyrgio/snf-ganeti | src/Ganeti/Query/Export.hs | Haskell | bsd-2-clause | 3,309 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
-- | A module collecting the toy grammars used for testing and
-- unit test examples themselves.
module NLP.TAG.Vanilla.Tests
( Test (..)
, TestRes (..)
, mkGram1
, gram1Tests
, mkGram2
, gram2Tests
, mkGram3
, gram3T... | kawu/tag-vanilla | src/NLP/TAG/Vanilla/Tests.hs | Haskell | bsd-2-clause | 18,182 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleInstances #-}
module NLP.Albemarle.Cooccur
( -- * Sliding Window
geometricSkips,
harmonicSkips,
packIDs,
unpackIDs,
cooccurify,
wordSlice,
frequency,
wordFreque... | SeanTater/albemarle | src/NLP/Albemarle/Cooccur.hs | Haskell | bsd-3-clause | 3,483 |
module TriangleKata.Day1 (triangle, TriangleType(..)) where
data TriangleType = Illegal | Equilateral | Isosceles | Scalene
deriving (Show, Eq)
type Triangle = (Int, Int, Int)
triangle :: Triangle -> TriangleType
triangle (0, 0, 0) = Illegal
triangle (a, b, c)
| a + b < c
... | Alex-Diez/haskell-tdd-kata | old-katas/src/TriangleKata/Day1.hs | Haskell | bsd-3-clause | 552 |
module Config
( scPre
) where
import Data.Monoid
import Common
genDefaultNav galNav = N { navTitle = "Home"
, navPath = Just ""
, subs =
[ galNav
, N { navTitle = "Webdesign"
... | maximilianhuber/maximilian-huber.de | src/Config.hs | Haskell | bsd-3-clause | 1,929 |
#!/usr/bin/env runhaskell
import Distribution.Simple (defaultMainWithHooks, simpleUserHooks,
UserHooks(..), Args)
{-
-- The test-related options have been disabled due to incompitibilities
-- in various Cabal release versions. In particular, the type expected for
-- runTests has changed, ... | kfish/hogg | Setup.hs | Haskell | bsd-3-clause | 1,463 |
-- Copyright (c) 2011, Mark Wright. All rights reserved.
{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
module Main (main) where
import Control.Exception as E
import qualified Data.List as L
import Data.Char (toLower)
import Distribution.Compiler
import Distribution.ModuleName (components, ModuleName)
impor... | markwright/cquery | Main.hs | Haskell | bsd-3-clause | 10,420 |
{-# LANGUAGE OverloadedStrings #-}
module Language.Brainfuck.Internals.CCodeGen where
import Data.Int
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as TIO
import qualified Data.Text.Lazy.Builder as TB
import Data.Text.Format
import Control.Monad.State
import Language.Brainfuck.Internals.Inst... | remusao/Hodor | src/Language/Brainfuck/Internals/CCodeGen.hs | Haskell | bsd-3-clause | 2,368 |
{-# LANGUAGE GeneralizedNewtypeDeriving
, MultiParamTypeClasses
, TypeSynonymInstances
, FlexibleContexts
, FlexibleInstances
, StandaloneDeriving
#-}
-----------------------------------------------------------------------------
-- |
-- Module : Diagrams.Tw... | fryguybob/diagrams-spiro | src/Diagrams/TwoD/Spiro.hs | Haskell | bsd-3-clause | 2,294 |
-- SG library
-- Copyright (c) 2009, Neil Brown.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are
-- met:
--
-- * Redistributions of source code must retain the above copyright
-- notice, this ... | eigengrau/haskell-sg | Data/SG/Vector/Basic.hs | Haskell | bsd-3-clause | 6,065 |
-- To run, package aivika-experiment-cairo must be installed.
import Simulation.Aivika.Experiment
import Simulation.Aivika.Experiment.Chart
import Simulation.Aivika.Experiment.Chart.Backend.Cairo
import Graphics.Rendering.Chart.Backend.Cairo
import Model
import Experiment
main = do
-- run the ordinary simulat... | dsorokin/aivika-experiment-chart | examples/Financial/MainUsingCairo.hs | Haskell | bsd-3-clause | 774 |
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable, BangPatterns #-}
module Valkyria.Type where
import Air.Data.Default
import Air.TH
import Air.Env
import Prelude ()
import Air.Data.Record.SimpleLabel
import Control.Concurrent.STM
import Data.ByteString.Char8 (ByteString)
import Data.Map (Map)
import Data.StateVar
im... | nfjinjing/source-code-server | src/Valkyria/Type.hs | Haskell | bsd-3-clause | 4,315 |
-- | Refreshes the shared simulation state. The new state will be calculated:
--
-- * Regularly, according to the speed selected by the user
--
-- * Every time there's a change in the status (running, paused, stopped, etc).
module Controller.Conditions.ShowState
( installHandlers )
where
-- External imports
impor... | ivanperez-keera/SoOSiM-ui | src/Controller/Conditions/ShowState.hs | Haskell | bsd-3-clause | 1,289 |
{-# LANGUAGE ScopedTypeVariables #-}
module Spec.ExecuteF where
import Spec.Decode
import Spec.Machine
import Utility.Utility
import Spec.VirtualMemory
import qualified Spec.CSRField as Field
import Data.Bits
import Data.Word
import Data.Int
import SoftFloat
import Prelude hiding (isNaN)
canonicalNaN = 0x7fc00000 :: I... | mit-plv/riscv-semantics | src/Spec/ExecuteF.hs | Haskell | bsd-3-clause | 8,803 |
{-
(c) The University of Glasgow 2006
(c) The AQUA Project, Glasgow University, 1996-1998
TcTyClsDecls: Typecheck type and class declarations
-}
{-# LANGUAGE TupleSections #-}
module ETA.TypeCheck.TcTyClsDecls (
tcTyAndClassDecls, tcAddImplicits,
-- Functions used by TcInstDcls to check
-- ... | alexander-at-github/eta | compiler/ETA/TypeCheck/TcTyClsDecls.hs | Haskell | bsd-3-clause | 100,819 |
{-
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.0
Kubernetes API version: v1.9.12
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
-}
{-|
Module : Kubernetes.OpenAPI.API.Storage... | denibertovic/haskell | kubernetes/lib/Kubernetes/OpenAPI/API/Storage.hs | Haskell | bsd-3-clause | 2,717 |
module ScrapYourImports where
data Exports = Exports
{ greet :: IO ()
}
makeExports :: String -> Exports
makeExports str = Exports
{ greet = putStrLn str
}
| sleexyz/haskell-fun | ScrapYourImports.hs | Haskell | bsd-3-clause | 168 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Text.Syntax.Parser.Attoparsec.Text (
runAsAttoparsec', runAsAttoparsec,
runAsIAttoparsec'
) where
import Data.Attoparsec.Types (Parser)
import Text.Syntax... | schernichkin/haskell-invertible-syntax-attoparsec | Text/Syntax/Parser/Attoparsec/Text.hs | Haskell | bsd-3-clause | 1,550 |
{- Data/Singletons/Syntax.hs
(c) Richard Eisenberg 2014
eir@cis.upenn.edu
Converts a list of DLetDecs into a LetDecEnv for easier processing,
and contains various other AST definitions.
-}
{-# LANGUAGE DataKinds, TypeFamilies, PolyKinds, DeriveDataTypeable,
StandaloneDeriving, FlexibleInstances #-}
mod... | int-index/singletons | src/Data/Singletons/Syntax.hs | Haskell | bsd-3-clause | 5,063 |
module Arion.Utilities (
associate,
dependencies,
findHaskellFiles
) where
import Arion.Types
import Control.Applicative ((<*>))
import Data.List (nub, sort, union, isInfixOf)
import Data.Map (Map, fromList)
import System.FilePath.Find (always, ex... | saturday06/arion | src/Arion/Utilities.hs | Haskell | mit | 2,916 |
--main = do
-- contents <- getContents
-- putStr (shortLinesOnly contents)
main = interact shortLinesOnly
shortLinesOnly :: String -> String
shortLinesOnly input =
let allLines = lines input
shortLines = filter (\line -> length line < 10) allLines
result = unlines shortLines
in result
... | leichunfeng/learnyouahaskell | shortlinesonly.hs | Haskell | mit | 382 |
-- Body of the HTML page for a package
{-# LANGUAGE PatternGuards, RecordWildCards #-}
module Distribution.Server.Pages.Package (
packagePage,
renderDependencies,
renderVersion,
renderFields,
renderDownloads
) where
import Distribution.Server.Features.PreferredVersions
import Distribution.Server... | haskell-infra/hackage-server | Distribution/Server/Pages/Package.hs | Haskell | bsd-3-clause | 17,668 |
{-# LANGUAGE OverloadedStrings #-}
module NumberSix.Handlers.Reddit
( handler
) where
--------------------------------------------------------------------------------
import Control.Applicative ((<$>), (<*>))
import Control.Monad (mzero)
import Control.Monad.Trans (liftI... | itkovian/number-six | src/NumberSix/Handlers/Reddit.hs | Haskell | bsd-3-clause | 2,660 |
-- Copyright (c) 1998 Chris Okasaki.
-- See COPYRIGHT file for terms and conditions.
module CollectionUtils
{-# DEPRECATED "This module is unmaintained, and will disappear soon" #-}
where
import Prelude hiding (map,null,foldr,foldl,foldr1,foldl1,lookup,filter)
import Collection
map :: (Coll cin a, CollX cout b) =... | alekar/hugs | fptools/hslibs/data/edison/Coll/CollectionUtils.hs | Haskell | bsd-3-clause | 959 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
module Ros.Std_msgs.UInt16 where
import qualified Prelude as P
import Prelude ((.), (+), (*))
import qualified Data.Typeable as T
import Control.Applicative
import Ros.Internal.RosBinar... | acowley/roshask | msgs/Std_msgs/Ros/Std_msgs/UInt16.hs | Haskell | bsd-3-clause | 1,237 |
{-# LANGUAGE Haskell98 #-}
{-# LINE 1 "Data/Attoparsec/Text.hs" #-}
{-# LANGUAGE BangPatterns, CPP, FlexibleInstances, TypeSynonymInstances #-}
{-# LANGUAGE Trustworthy #-} -- Imports internal modules
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
... | phischu/fragnix | tests/packages/scotty/Data.Attoparsec.Text.hs | Haskell | bsd-3-clause | 16,149 |
{-# LANGUAGE PolyKinds #-}
module T16326_Fail7 where
import Data.Kind
-- Make sure that this doesn't parse as something goofy like
-- forall (forall :: Type -> Type) (k :: Type). forall k -> k -> Type
data Foo :: forall k -> k -> Type
| sdiehl/ghc | testsuite/tests/dependent/should_fail/T16326_Fail7.hs | Haskell | bsd-3-clause | 238 |
{-# LANGUAGE CPP #-}
#if !defined(TESTING) && __GLASGOW_HASKELL__ >= 703
{-# LANGUAGE Trustworthy #-}
#endif
#include "containers.h"
-----------------------------------------------------------------------------
-- |
-- Module : Data.Map.Strict
-- Copyright : (c) Daan Leijen 2002
-- (c) Andriy ... | shockkolate/containers | Data/Map/Strict.hs | Haskell | bsd-3-clause | 45,518 |
-- Stacks: using restricted type synonyms
module Stack where
type Stack a = [a] in emptyStack, push, pop, topOf, isEmpty
emptyStack :: Stack a
emptyStack = []
push :: a -> Stack a -> Stack a
push = (:)
pop :: Stack a -> Stack a
pop [] = error "pop: empty stack"
pop (_:xs) = xs
topOf ... | FranklinChen/Hugs | demos/Stack.hs | Haskell | bsd-3-clause | 1,249 |
{-# LANGUAGE LambdaCase, MultiWayIf #-}
module Unification
( Equality
, Bindings
, Unifiable
, unifyLiberally
, applyBinding
, applyBinding'
, applyBindingM
, UnificationResult(..)
) where
import qualified Data.Map as M
import Control.Monad
import Control.Applicative
import Control.... | psibi/incredible | logic/Unification.hs | Haskell | mit | 10,729 |
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE PolyKinds, DataKinds, RankNTypes, TypeFamilies,
TypeApplications, TypeOperators, GADTs #-}
module SAKS_030 where
import Data.Kind
import Data.Type.Equality
type T1 :: forall k (a :: k). Bool
type T2 :: k -> Bool
type family T1 where
T1 @Bool @Tru... | sdiehl/ghc | testsuite/tests/saks/should_compile/saks030.hs | Haskell | bsd-3-clause | 619 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="ar-SA">
<title>دليل البدء</title>
<maps>
<homeID>top</homeID>
<mapref location="map.jhm... | thc202/zap-extensions | addOns/gettingStarted/src/main/javahelp/org/zaproxy/zap/extension/gettingStarted/resources/help_ar_SA/helpset_ar_SA.hs | Haskell | apache-2.0 | 978 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="ur-PK">
<title>Passive Scan Rules | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<... | thc202/zap-extensions | addOns/pscanrules/src/main/javahelp/org/zaproxy/zap/extension/pscanrules/resources/help_ur_PK/helpset_ur_PK.hs | Haskell | apache-2.0 | 979 |
{-# LANGUAGE RankNTypes, NamedWildCards #-}
-- See #11098
module NamedWildcardExplicitForall where
foo :: forall _a . _a -> _a -- _a is a type variable
foo = not
bar :: _a -> _a -- _a is a named wildcard
bar = not
baz :: forall _a . _a -> _b -> (_a, _b) -- _a is a varia... | sdiehl/ghc | testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.hs | Haskell | bsd-3-clause | 521 |
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-}
module Ros.Internal.Log where
import qualified Prelude as P
import Prelude ((.))
import qualified Data.Typeable as T
import Control.Applicative
import Ros.Internal.RosBinary
import Ros.Internal.Msg.MsgInfo
import Ros.Internal.Msg.HeaderSupport
import qualified Data... | bitemyapp/roshask | src/Ros/Internal/Log.hs | Haskell | bsd-3-clause | 1,547 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Provide ability to upload tarballs to Hackage.
module Stack.Upload
( -- * Upload
nopUploader
, mkUploader
, Uploader
, upload
, uploadBytes
, UploadSettings
, defaultUplo... | phadej/stack | src/Stack/Upload.hs | Haskell | bsd-3-clause | 11,305 |
-- | a module for caching a monadic action based on its return type
--
-- The cache is a HashMap where the key uses the TypeReP from Typeable.
-- The value stored is toDyn from Dynamic to support arbitrary value types in the same Map.
--
-- un-exported newtype wrappers should be used to maintain unique keys in the cach... | ygale/yesod | yesod-core/Yesod/Core/TypeCache.hs | Haskell | mit | 3,896 |
{-# LANGUAGE OverloadedLists, TypeFamilies #-}
import qualified Data.Set as S
import GHC.Exts
main = do print ([] :: (S.Set Int))
print (['a','b','c'] :: (S.Set Char))
print (['a','c'..'g'] :: (S.Set Char))
instance Ord a => IsList (S.Set a) where
type (Item (S.Set a)) = a
fromList = ... | lukexi/ghc-7.8-arm64 | testsuite/tests/overloadedlists/should_run/overloadedlistsrun02.hs | Haskell | bsd-3-clause | 350 |
{-# LANGUAGE TemplateHaskell #-}
-- Test for sane reporting on TH code giving up.
module ShouldCompile where
$( fail "Code not written yet..." )
| urbanslug/ghc | testsuite/tests/th/TH_fail.hs | Haskell | bsd-3-clause | 148 |
{-# LANGUAGE DeriveGeneric, RecordWildCards, TypeSynonymInstances, FlexibleInstances #-}
module Game.World(
World(..)
, WorldId(..)
, worldInfoMsg
, WorldFindPlayer(..)
) where
import Control.DeepSeq
import Data.Hashable
import Data.HashMap.Strict (HashMap)
import Data.Text (Text)
import Game.Player
impor... | NCrashed/sinister | src/shared/Game/World.hs | Haskell | mit | 1,296 |
{-# LANGUAGE TemplateHaskell #-}
import TemplateHaskell
data MyData = MyData
{ foo :: String
, bar :: Int
}
listFields ''MyData
main = print $ MyData { foo = "what", bar = 1 }
| limdauto/learning-haskell | snippets/TemplateHaskellTests.hs | Haskell | mit | 192 |
module System.AtomicWrite.Writer.ByteStringSpec (spec) where
import Test.Hspec (it, describe, shouldBe, Spec)
import System.AtomicWrite.Writer.ByteString (atomicWriteFile)
import System.IO.Temp (withSystemTempDirectory)
import System.FilePath.Posix (joinPath)
import Data.ByteString.Char8 (pack)
spec :: Spec
spec =... | bitemyapp/atomic-write | spec/System/AtomicWrite/Writer/ByteStringSpec.hs | Haskell | mit | 625 |
{-# LANGUAGE OverloadedStrings #-}
-- | Parser for what seems to be DCPU16 assembly.
--
-- There is some ambiguity between sources: the specification uses uppercase a
-- lot (which I'd rather put in as an option later, with the strict
-- implementation being default).
--
-- A screenshot also shows indirect mode being d... | amtal/soyuz | DCPU16/Assembly/Parser.hs | Haskell | mit | 5,788 |
{-# OPTIONS_GHC -Wall #-}
module Todo.Predicates ( minDate
, maxDate
, minPriority
, maxPriority
, isComplete
) where
import Todo.Data
minDate :: Date -> Task -> Bool
minDate d = maybe False (d >=) . may... | nadirs/todohs | src/lib/Todo/Predicates.hs | Haskell | mit | 669 |
-- https://projecteuler.net/problem=29
-- Consider all integer combinations of a^b for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
-- 22=4, 23=8, 24=16, 25=32
-- 32=9, 33=27, 34=81, 35=243
-- 42=16, 43=64, 44=256, 45=1024
-- 52=25, 53=125, 54=625, 55=3125
-- If they are then placed in numerical order, with any repeats removed, we get th... | kirhgoff/haskell-sandbox | euler29/countPowers.hs | Haskell | mit | 774 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module HsPredictor.LoadCSV where
-- standard
import Control.Exception (bracket, catch, throwIO)
import Control.Monad (when)
import Control.Monad.Error (liftIO)
impor... | Taketrung/HsPredictor | library/HsPredictor/LoadCSV.hs | Haskell | mit | 4,364 |
module ECL.ClassicChecker where
import ECL.DataTypes
-- | Type Synonyms for pattern
-- * representation
-- *
-- * Basic representations of cases
type Case = [Binder]
type Cases = [Case]
-- * Result
type Result = Cases
-- * Pattern Matching definition
type DefPm = Cases
-- | unmatched: returns the list
... | nicodelpiano/stlcnat-exhaustivity-checker | src/ECL/ClassicChecker.hs | Haskell | mit | 2,949 |
module Routes.TH
( module Routes.TH.Types
-- * Functions
, module Routes.TH.RenderRoute
, module Routes.TH.ParseRoute
, module Routes.TH.RouteAttrs
-- ** Dispatch
, module Routes.TH.Dispatch
) where
import Routes.TH.Types
import Routes.TH.RenderRoute
import Routes.TH.ParseRoute
impo... | ajnsit/wai-routes | src/Routes/TH.hs | Haskell | mit | 370 |
{-# LANGUAGE RecordWildCards #-}
module Main where
--import Data.ByteString.Char8 (ByteString)
import HlAdif
import HlLog
import HlOptions
import Options.Applicative
import qualified Data.ByteString.Char8 as B
import Data.Semigroup ((<>))
import System.IO
import Text.Regex.TDFA.ByteString
data Options = Options
{ f... | netom/hamloghs | app/hl-filter.hs | Haskell | mit | 2,313 |
-- Problems/Problem063Spec.hs
module Problems.Problem063Spec (main, spec) where
import Test.Hspec
import Problems.Problem063
main :: IO()
main = hspec spec
spec :: Spec
spec = describe "Problem 63" $
it "Should evaluate to 49" $
p63 `shouldBe` 49
| Sgoettschkes/learning | haskell/ProjectEuler/tests/Problems/Problem063Spec.hs | Haskell | mit | 262 |
data Quantum =
Yes
| No
| Both deriving (Eq, Show)
convert :: Quantum -> Bool
convert Yes = False
convert No = False
convert Both = False
convert2 Yes = False
convert2 No = False
convert2 Both = True
convert3 Yes = False
convert3 No = True
convert3 Both = True
convert4 Yes = True
convert4 No = True
conver... | JustinUnger/haskell-book | ch11/exp.hs | Haskell | mit | 946 |
{- |
- Implementation of the IDA* search algorithm
-}
{-# LANGUAGE ScopedTypeVariables, MultiParamTypeClasses,
FunctionalDependencies, FlexibleInstances, UndecidableInstances #-}
module Rubik.IDA where
import qualified Data.Set as S
-- | Type of outgoing edges, labelled and weighted.
data Succ label le... | Lysxia/twentyseven | src/Rubik/IDA.hs | Haskell | mit | 2,548 |
import Control.Monad.Writer
import Control.Monad ((<=<), (>=>))
deeldoorTwee :: (Integral a, Show a) => a -> Maybe String
deeldoorTwee x = if even x
then Just (show x++" is deelbaar door 2." )
else Just (show x++" is niet deelbaar door 2!" )
half :: (Integral a) => a -> Maybe a
h... | iambernie/tryhaskell | useful.hs | Haskell | mit | 1,399 |
module Assembler(assemble) where
import Datatypes
import Opcodes
import Text.Printf
assemble :: [IR] -> [String]
assemble instructions =
map (printf "0x%08x") hex
where hex = map assembleInstruction instructions
assembleInstruction :: IR -> Int
assembleInstruction LoadIR = (hexOpcode Lw)
assembleInstruction S... | aleksanb/hdc | src/Assembler.hs | Haskell | mit | 1,524 |
module AlecSequences.A280172Spec (main, spec) where
import Test.Hspec
import AlecSequences.A280172 (a280172)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A280172" $
it "correctly computes the first 20 elements" $
take 20 (map a280172 [1..]) `shouldBe` expectedValue where
expectedValue = [... | peterokagey/haskellOEIS | test/AlecSequences/A280172Spec.hs | Haskell | apache-2.0 | 361 |
{- |
Module : Data.Time.Zones.Internal
Copyright : (C) 2014 Mihaly Barasz
License : Apache-2.0, see LICENSE
Maintainer : Mihaly Barasz <klao@nilcons.com>
Stability : experimental
-}
{-# LANGUAGE CPP #-}
#ifdef TZ_TH
{-# LANGUAGE TemplateHaskell #-}
#endif
module Data.Time.Zones.Internal (
-- * Time co... | nilcons/haskell-tz | Data/Time/Zones/Internal.hs | Haskell | apache-2.0 | 3,989 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
module Spark.Core.Internal.DatasetStructures where
import Data.Vector(Vector)
import qualified Data.Vector as V
import qualified Data.Text as T
imp... | tjhunter/karps | haskell/src/Spark/Core/Internal/DatasetStructures.hs | Haskell | apache-2.0 | 8,561 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE... | SKA-ScienceDataProcessor/RC | MS6/dna/core/DNA/Interpreter/Run.hs | Haskell | apache-2.0 | 8,035 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
#if __GLASGOW_HASKELL__ >= 786
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
#endif
module Data.Complex.Polar (
#if __GLASGOW_HASKELL__ >= 800
Polar((:<)),
#elif __GLASGOW_HASKELL >= 786
Polar,
pattern (:<),
#else
Polar,
#endif
... | kaoskorobase/polar | Data/Complex/Polar.hs | Haskell | bsd-2-clause | 8,785 |
{-# LANGUAGE TemplateHaskell, QuasiQuotes, DeriveDataTypeable,
MultiParamTypeClasses, TypeFamilies, FlexibleContexts,
FlexibleInstances, OverloadedStrings #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Application.WebLogger.Server.Yesod where
import ... | wavewave/weblogger-server | lib/Application/WebLogger/Server/Yesod.hs | Haskell | bsd-2-clause | 3,032 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE UnboxedTuples #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Codec.Compression.Zlib.OutputWindow (
OutputWindow,
emptyWindow,
emitExcess,
finalizeWindow,
addByte,
addCh... | GaloisInc/pure-zlib | src/Codec/Compression/Zlib/OutputWindow.hs | Haskell | bsd-3-clause | 4,249 |
{-# LANGUAGE TupleSections #-}
module Main where
import Data.Vector.Unboxed as V hiding ((++))
import qualified Data.Vector.Unboxed.Mutable as VM
import Data.Word
import Data.Bits
import qualified Data.List as L
import qualified Data.ByteString as B
import qualified Control.Monad.State.Strict as S
import Control.Mona... | dan-t/dcpu16 | Emulator.hs | Haskell | bsd-3-clause | 9,008 |
-- UUAGC 0.9.38.6 (./src/SistemaL.ag)
module SistemaL where
{-# LINE 3 "./src/SistemaL.ag" #-}
import Data.List
{-# LINE 9 "./src/SistemaL.hs" #-}
{-# LINE 69 "./src/SistemaL.ag" #-}
addIdentProds prods alfa
= let prods' = map (\(Simbolo e,_) -> e) prods
resto = alfa \\ prods'
iprods = ma... | carliros/lsystem | src/SistemaL.hs | Haskell | bsd-3-clause | 19,601 |
{-# LANGUAGE ScopedTypeVariables #-}
-- © 2006 Peter Thiemann
{- | Transactional, type-indexed implementation of server-side state.
Glossary
A transactional entity (TE) is a named multi-versioned global variable.
-}
module WASH.CGI.Transaction (
T (), init, create, remove, get, set,
with, Control (..),
TCGI ()... | nh2/WashNGo | WASH/CGI/Transaction.hs | Haskell | bsd-3-clause | 13,274 |
{-# LANGUAGE TemplateHaskell #-}
module Snap.StarterTH where
------------------------------------------------------------------------------
import qualified Data.Foldable as F
import Data.List
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
import System.Directory.T... | janrain/snap | src/Snap/StarterTH.hs | Haskell | bsd-3-clause | 2,006 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.GHC
-- Copyright : Isaac Jones 2003-2007
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This is a fairly large module. It contains most of the GHC-specific code for
... | IreneKnapp/Faction | libfaction/Distribution/Simple/GHC.hs | Haskell | bsd-3-clause | 53,821 |
-- | == Single URI Authorization
--
-- There are cases in which limited and short-term access to a
-- protected resource is granted to a third party which does not have
-- access to the shared credentials. For example, displaying a
-- protected image on a web page accessed by anyone. __Hawk__ provides
-- limited suppor... | rvl/hsoz | src/Network/Hawk/URI.hs | Haskell | bsd-3-clause | 2,098 |
{-# LANGUAGE RecordWildCards, TypeFamilies, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings, TupleSections #-}
module Aws.SimpleDb.Commands.GetAttributes
where
import Aws.Response
import Aws.Signature
import Aws.SimpleDb.Info
import Aws.SimpleDb.Metadata
import ... | jgm/aws | Aws/SimpleDb/Commands/GetAttributes.hs | Haskell | bsd-3-clause | 2,206 |
module HaskQuery (
module HaskQuery.AutoIndex,
Relation,
Cont,
empty,
emptyWithIndex,
reindex,
runQuery,
select,
runQueryM,
executeM,
selectM,
filterM,
selectWithIndex,
selectDynamic,
selectDynamicWithTypeM,
insert,
insertRows,
insertInto,
update,
delete
) where
import qualified Data.IntMap.Lazy
import qualified Data... | stevechy/haskellEditor | ext-src/HaskQueryPackage/HaskQuery.hs | Haskell | bsd-3-clause | 5,788 |
{- *** MOCS-COPYRIGHT-NOTICE-BEGIN ***
-
- This copyright notice is auto-generated by ./add-copyright-notice.
- Additional copyright notices must be added below the last line of this notice.
-
- MoCS (https://lewis.cs.uni-saarland.de/tools/mocs/): "haskell-frontend/Temporal.hs".
- The content of this file is copy... | larskuhtz/MoCS | haskell-frontend/Temporal.hs | Haskell | bsd-3-clause | 21,085 |
-- | Physical constants.
module DSMC.Util.Constants
( amu
, avogadro
, boltzmann
, unigas
)
where
-- | Atomic mass unit 1.660538921(73)e-27, inverse to Avogadro's
-- constant.
amu :: Double
amu = 1.6605389217373737e-27
-- | Avogadro constant 6.02214129(27)e23
avogadro :: Double
avogadro = 6.02... | dzhus/dsmc | src/DSMC/Util/Constants.hs | Haskell | bsd-3-clause | 515 |
{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-matches -fno-warn-name-shadowing -fno-warn-missing-signatures #-}
{-# LANGUAGE FlexibleInstances, DeriveFunctor, MultiParamTypeClasses, UndecidableInstances, FlexibleContexts, TypeSynonymInstances #-}
------------------------------------------------------------... | lingxiao/CIS700 | depricated/Play1129.hs | Haskell | bsd-3-clause | 12,496 |
module Backend.Generic123 (
mpg321Backend
, ogg123Backend
) where
import Backend
import Control.Concurrent
import Control.Monad
import System.IO
import System.Process
(shell,CreateProcess(..),StdStream(..),createProcess,waitForProcess)
-- | A backend for controlling mpg321.
mpg321Backend :: IO Backend
mp... | elliottt/din | src/Backend/Generic123.hs | Haskell | bsd-3-clause | 1,842 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DataKinds #-}
import Test.Tasty.HUnit ((@?=), Assertion, testCase)
import Test.Tasty.TH (defaultMainGenerator)
import Language.Cypher
case_simpleMatchExample :: Assertion
case_simpleMatchExample =
show (simpleMatch (PNode (Just n) [] ... | HaskellDC/neo4j-cypher | tests/Language/cypher-test-suite.hs | Haskell | bsd-3-clause | 939 |
module Main where
import Data.Ord (comparing)
import qualified Data.Vector.Algorithms.Intro as Intro
import qualified Data.Vector.Storable as VS
import Data.Vector.Storable.Mutable (IOVector)
import Numeric.LinearAlgebra hiding (eig, vector)
import Numeric.LinearAlgebra.Arnoldi
import Test.Hspec
import Test.QuickCheck... | ttuegel/arpack | tests/tests.hs | Haskell | bsd-3-clause | 2,306 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Recursi... | tomberek/rulestesting | Auto.hs | Haskell | bsd-3-clause | 9,312 |
{-
Copyright 2019 The CodeWorld Authors. 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 applicab... | alphalambda/codeworld | codeworld-auth/src/CodeWorld/Auth/Secret.hs | Haskell | apache-2.0 | 1,714 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="pl-PL">
<title>Authentication Statistics | ZAP Extension</title>
<maps>
<homeID>top</homeID... | veggiespam/zap-extensions | addOns/authstats/src/main/javahelp/org/zaproxy/zap/extension/authstats/resources/help_pl_PL/helpset_pl_PL.hs | Haskell | apache-2.0 | 987 |
--------------------------------------------------------------------------------
-- |
-- Module : HEP.Kinematics.Vector.LorentzTVector
-- Copyright : (c) 2014-2017 Chan Beom Park
-- License : BSD-style
-- Maintainer : Chan Beom Park <cbpark@gmail.com>
-- Stability : experimental
-- Portability : GHC... | cbpark/hep-kinematics | src/HEP/Kinematics/Vector/LorentzTVector.hs | Haskell | bsd-3-clause | 2,612 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE UndecidableInstances #-}
module Language.Embedded.Concurrent.Backend.C where
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative
#endif
import Control.Monad.Operational.Higher
import Data.Typeable
import Language.Embedded.Expression
import Language... | kmate/imperative-edsl | src/Language/Embedded/Concurrent/Backend/C.hs | Haskell | bsd-3-clause | 3,765 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 2000
FunDeps - functional dependencies
It's better to read it as: "if we know these, then we're going to know these"
-}
{-# LANGUAGE CPP #-}
module Eta.TypeCheck.FunDeps (
FDEq (..),
Equation(..), pprEquation,
... | rahulmutt/ghcvm | compiler/Eta/TypeCheck/FunDeps.hs | Haskell | bsd-3-clause | 25,305 |
module Settings.Packages.Haddock (haddockPackageArgs) where
import Expression
haddockPackageArgs :: Args
haddockPackageArgs = package haddock ?
builder GhcCabal ? pure ["--flag", "in-ghc-tree"]
| bgamari/shaking-up-ghc | src/Settings/Packages/Haddock.hs | Haskell | bsd-3-clause | 200 |
-- | Basic types used by this library.
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Brick.Types
( Location(..)
, locL
, TerminalLocation(..)
, CursorLocation(..)
, cursorLocationL
, cursorLocationNameL
, HandleEvent(..)
, Name(..)
, suffixLenses
)
where
import Cont... | FranklinChen/brick | src/Brick/Types.hs | Haskell | bsd-3-clause | 2,308 |
module Manual where
import System.IO(openFile,hClose,IOMode(..),hPutStr,stdout)
import Data.Char(isAlpha,isDigit)
-- Parts of the manual are generated automatically from the
-- sources, by generating LaTex files by observing the
-- data structures of the Omega sources
import LangEval(vals)
import Syntax(metaHaskellO... | cartazio/omega | src/Manual.hs | Haskell | bsd-3-clause | 4,733 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.