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
{-# LANGUAGE FlexibleInstances #-} {- | Module : Language.Egison.EvalState Licence : MIT This module defines the state during the evaluation. -} module Language.Egison.EvalState ( EvalState(..) , initialEvalState , MonadEval(..) , mLabelFuncName ) where import Control.Monad.Except impor...
egison/egison
hs-src/Language/Egison/EvalState.hs
Haskell
mit
1,515
{-# LANGUAGE CPP #-} module GHCJS.DOM.Element ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.Element #else module Graphics.UI.Gtk.WebKit.DOM.Element #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBK...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/Element.hs
Haskell
mit
420
module GHCJS.Utils where import GHCJS.Foreign import GHCJS.Types foreign import javascript unsafe "console.log($1)" consoleLog :: JSRef a -> IO () foreign import javascript unsafe "(function() { return this; })()" this :: IO (JSRef a)
CRogers/stack-ide-atom
haskell/src/GHCJS/Utils.hs
Haskell
mit
242
module Main where import Data.Monoid import Language.LambdaCalculus maybeFromEither :: Either x y -> Maybe y maybeFromEither (Left _) = Nothing maybeFromEither (Right x) = Just x -- | Read a lambda calclus example from file -- openExample :: String -> IO (Maybe Term) openExample ex = do conte...
owainlewis/lambda-calculus
src/Main.hs
Haskell
mit
413
{-# LANGUAGE MultiParamTypeClasses, DataKinds, KindSignatures, TypeOperators, FlexibleInstances, OverlappingInstances, TypeSynonymInstances, IncoherentInstances #-} module Math.Matrix where import Math.Vec hiding (r,g,b,a,x,y,z,w) import qualified Math.Vec as V (r,g,b,a,x,y,z,w) import GHC.TypeLits type Matrix n m a...
davidyu/Slowpoke
hs/src/Math/matrix.hs
Haskell
mit
9,345
{-# LANGUAGE LambdaCase #-} import Brainhack.Evaluator (emptyMachine, eval, runBrainState) import Brainhack.Parser (parse) import Control.Exception.Safe (SomeException) import Control.Monad (forM) import Data.Bifunctor (second) import Data.List (nub) import Data.Tuple.Extra ((&&&)) import NicoLang.Parser.Items (NicoTo...
aiya000/nico-lang
test/Spec.hs
Haskell
mit
2,199
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedLabels #-} {-# LANGUAGE TypeApplications #-} {-# OPTIONS_GHC -O0 #-} {-# OPTIONS_GHC -fomit-interface-pragmas #-} module ZoomHub.Storage.PostgreSQL.GetRecent ( getRecent, ) where import Data.Binary (Word64) import Squeal.PostgreSQ...
zoomhub/zoomhub
src/ZoomHub/Storage/PostgreSQL/GetRecent.hs
Haskell
mit
1,281
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SQLResultSetRowList (js_item, item, js_getLength, getLength, SQLResultSetRowList, castToSQLResultSetRowList, gTypeSQLResultSetRowList) where import Prelude ((.), (==), (>>=), return, IO, Int,...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SQLResultSetRowList.hs
Haskell
mit
1,715
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} import Prelude hiding (Functor, fmap, id) class (Category c, Category d) => Functor c d t where fmap :: c a b -> d (t a) (t b) type Hask = (->) instance Category Hask where id x = x (f . g) x = f (g x) instance Functor Hask Hask [] ...
riwsky/wiwinwlh
src/functors.hs
Haskell
mit
379
module TemplateGen.TemplateContext ( TemplateContext(..) , mkTemplateContext ) where import qualified TemplateGen.Master as M import qualified TemplateGen.PageContext as PC import qualified TemplateGen.Settings as S import qualified TemplateGen.Url as U data TemplateContext = TemplateContext { pageTitle :: ...
seahug/seattlehaskell-org-static
src/lib/TemplateGen/TemplateContext.hs
Haskell
mit
952
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Consensus.Log -- Copyright : (c) Phil Hargett 2014 ...
hargettp/raft
src/Data/Log.hs
Haskell
mit
6,658
-- ------------------------------------------------------------------------------------- -- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved. -- For email, run on linux (perl v5.8.5): -- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0...
cbrghostrider/Hacking
codeJam/2014/elf/greedyElf.hs
Haskell
mit
1,999
{-# LANGUAGE NoMonomorphismRestriction #-} import Diagrams.Prelude import Diagrams.Backend.SVG.CmdLine c1 = circle 0.5 # lw none # showOrigin c2 = circle 1 # fc orange c3 = circle 0.5 # fc steelblue # showOrigin diagram :: Diagram B diagram = (c1 ||| c2) === c3 main = mainWith $ frame 0.1 diagram
jeffreyrosenbluth/NYC-meetup
meetup/Atop5.hs
Haskell
mit
304
{-# LANGUAGE TypeOperators #-} module Language.LSP.Server ( module Language.LSP.Server.Control , VFSData(..) , ServerDefinition(..) -- * Handlers , Handlers(..) , Handler , transmuteHandlers , mapHandlers , notificationHandler , requestHandler , ClientMessageHandler(..) , Options(..) , defau...
alanz/haskell-lsp
lsp/src/Language/LSP/Server.hs
Haskell
mit
1,114
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Hecate.Backend.JSON ( JSON , run , initialize , finalize , AppState ) where import Control.Monad (when) import Control.Monad.Catch (MonadThrow (..)) import qualified Control.Monad.Except as Except import...
henrytill/hecate
src/Hecate/Backend/JSON.hs
Haskell
apache-2.0
3,297
{-# LANGUAGE OverloadedStrings #-} module IFind.UI ( runUI ) where import Control.Applicative import Data.Either import Data.IORef import Graphics.Vty hiding (pad) import Graphics.Vty.Widgets.All import System.Exit (exitSuccess) import Text.Printf import qualified Data.Text as T import qualified Data.Text.Encoding...
andreyk0/ifind
IFind/UI.hs
Haskell
apache-2.0
6,997
module Checker where import Data.Maybe import EdictDB type Conjugation = String conjugate :: Word -> Conjugation -> Maybe Word conjugate _ [] = Nothing conjugate ([],_) _ = Nothing conjugate w c | not (validC c) = Just w | c == "Te" = teForm $ Just w | c == "Imperitive" = imperitive $...
MarkMcCaskey/Refcon
Checker.hs
Haskell
apache-2.0
17,577
{-# LANGUAGE OverloadedStrings #-} import Text.HTML.SanitizeXSS import Text.HTML.SanitizeXSS.Css import Data.Text (Text) import Data.Text as T import Test.Hspec.Monadic import Test.Hspec.HUnit () import Test.HUnit (assert, (@?=), Assertion) test :: (Text -> Text) -> Text -> Text -> Assertion test f actual expected = ...
silkapp/haskell-xss-sanitize
test/main.hs
Haskell
bsd-2-clause
3,468
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QHttp_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:31 Warning : this file is machine generated - do not m...
keera-studios/hsQt
Qtc/Network/QHttp_h.hs
Haskell
bsd-2-clause
16,093
{-# LANGUAGE CPP #-} module CLaSH.GHC.Compat.Outputable ( showPpr, showSDoc, showPprDebug ) where #if __GLASGOW_HASKELL__ >= 707 import qualified DynFlags (unsafeGlobalDynFlags) #elif __GLASGOW_HASKELL__ >= 706 import qualified DynFlags (tracingDynFlags) #endif import qualified Outputable (Outputable (..), SDoc,...
christiaanb/clash-compiler
clash-ghc/src-ghc/CLaSH/GHC/Compat/Outputable.hs
Haskell
bsd-2-clause
908
import Intel.ArBB import Intel.ArBB.Util.Image import qualified Intel.ArbbVM as VM import qualified Data.Vector.Storable as V import qualified Prelude as P import Prelude as P hiding (map,zipWith) import Data.Word import System.IO import System.Time import Text.Printf import System.Environment import F...
svenssonjoel/EmbArBB
Samples/Bench/sobel.hs
Haskell
bsd-3-clause
4,578
module Text.Highlighter.Lexers.Vim (lexer) where import Text.Regex.PCRE.Light import Text.Highlighter.Types lexer :: Lexer lexer = Lexer { lName = "VimL" , lAliases = ["vim"] , lExtensions = [".vim", ".vimrc"] , lMimetypes = ["text/x-vim"] , lStart = root' , lFlags = [multiline] } root' :...
chemist/highlighter
src/Text/Highlighter/Lexers/Vim.hs
Haskell
bsd-3-clause
1,348
module NumberKata where import DeleteNth import HappyNumbers import LastDigitOfLargeNumber import PascalsTriangle import PerimeterOfSquaresInRectangle import ProductOfConsecutiveFibs import WeightForWeight testKata :: IO () testKata = print "Hey! Another super-useless function!"
Eugleo/Code-Wars
src/NumberKata.hs
Haskell
bsd-3-clause
282
{-# LANGUAGE TemplateHaskell #-} module Item ( Item(..) , itemSymbol , itemDescription ) where import Control.Lens import Misc data Item = Item { _itemSymbol :: Symbol , _itemDescription :: String } deriving (Read, Show, Eq) makeLenses ''Item
dagit/7drl2017
src/Item.hs
Haskell
bsd-3-clause
258
module Graphics.Vty.Widgets.Builder.Handlers.DirBrowser ( handlers ) where import Control.Applicative import Graphics.Vty.Widgets.Builder.Types import Graphics.Vty.Widgets.Builder.GenLib import qualified Graphics.Vty.Widgets.Builder.Validation as V import qualified Graphics.Vty.Widgets.Builder.SrcHelpers as S ...
jtdaugherty/vty-ui-builder
src/Graphics/Vty/Widgets/Builder/Handlers/DirBrowser.hs
Haskell
bsd-3-clause
1,325
{-# LANGUAGE OverloadedStrings #-} module Spell.LazyText where import qualified Data.Text.Lazy as TL import Data.Text.Lazy (Text) import Data.Monoid import Data.List.Ordered (nubSort) import Data.Ord import Data.List import Control.Monad type Dict = ( TL.Text -> Bool, TL.Text -> Int ) singles :: [ TL.Text ] singles...
erantapaa/test-spelling
src/Spell/LazyText.hs
Haskell
bsd-3-clause
1,820
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-} module Network.LambdaBridge.Bridge where import Data.Word as W import System.Random import Data.Default import Control.Concurrent import Control.Concurrent.MVar import Control.Concurrent.Chan import Numeric import Data.Word import Data.Binary import Data.Binary.Get as ...
andygill/lambda-bridge
Network/LambdaBridge/Bridge.hs
Haskell
bsd-3-clause
6,133
import qualified Network.HTTP.Types as HTTP import qualified Network.HTTP.Conduit as HTTP import Aws import qualified Aws.S3 as S3 import qualified Aws.SimpleDb as Sdb import qualified Aws.Sqs as Sqs import qualified Aws.Ses as Ses
jgm/aws
ghci.hs
Haskell
bsd-3-clause
292
------------------------------------------------------------------------ -- | -- Module : ALife.Creatur.Wain.UIVector.Cluster.GeneratePopulation -- Copyright : (c) Amy de Buitléir 2012-2016 -- License : BSD-style -- Maintainer : amy@nualeargais.ie -- Stability : experimental -- Portability : portabl...
mhwombat/exp-uivector-cluster-wains
src/ALife/Creatur/Wain/UIVector/Cluster/GeneratePopulation.hs
Haskell
bsd-3-clause
2,203
{-# LANGUAGE QuasiQuotes #-} module Cauterize.GHC7.Generate.GenStack ( generateOutput ) where import Cauterize.GHC7.Options import Cauterize.GHC7.Generate.Utils import qualified Cauterize.Specification as Spec import System.FilePath.Posix import Data.String.Interpolate.Util import Data.String.Interpolate...
cauterize-tools/caut-ghc7-ref
src/Cauterize/GHC7/Generate/GenStack.hs
Haskell
bsd-3-clause
1,274
{-# OPTIONS_GHC -fno-warn-unused-imports #-} module Singletons.BoxUnBox where import Data.Singletons.TH import Data.Singletons.SuppressUnusedWarnings $(singletons [d| data Box a = FBox a unBox :: Box a -> a unBox (FBox a) = a |])
int-index/singletons
tests/compile-and-dump/Singletons/BoxUnBox.hs
Haskell
bsd-3-clause
240
-- © 2001, 2002 Peter Thiemann module Main where import WASH.CGI.CGI hiding (head, map, span, div) main = run $ standardQuery "Upload File" $ do text "Enter file to upload " fileH <- checkedFileInputField refuseUnnamed empty submit fileH display (fieldVALUE "UPLOAD") refuseUnnamed mf = do FileRefe...
nh2/WashNGo
Examples/old/Upload.hs
Haskell
bsd-3-clause
667
module IptAdmin.Config where import Control.Monad.Error import Data.ConfigFile import IptAdmin.Types import System.FilePath.Posix cONFpATHd :: String cONFpATHd = "/etc/iptadmin" cONFIGURATIONf :: String cONFIGURATIONf = "iptadmin.conf" getConfig :: ErrorT String IO IptAdminConfig getConfig = do configE <- lift...
etarasov/iptadmin
src/IptAdmin/Config.hs
Haskell
bsd-3-clause
1,482
{-# LANGUAGE CPP, FlexibleInstances, OverloadedStrings, Rank2Types #-} #ifdef GENERICS {-# LANGUAGE DefaultSignatures, TypeOperators, KindSignatures, FlexibleContexts, MultiParamTypeClasses, UndecidableInstances, ScopedTypeVariables #-} #endif module Data.Csv.Conversion ( -- * Type conversion ...
sjoerdvisscher/cassava
Data/Csv/Conversion.hs
Haskell
bsd-3-clause
24,266
{-# OPTIONS_GHC -F -pgmF htfpp #-} module Ebitor.Rope.CursorTest (htf_thisModulesTests) where import Data.List (intercalate) import Data.Maybe (fromJust) import Test.Framework import Ebitor.Rope (Rope) import Ebitor.Rope.Cursor import Ebitor.RopeUtils import qualified Ebitor.Rope as R madWorld = "it's a mad mad mad...
benekastah/ebitor
test/Ebitor/Rope/CursorTest.hs
Haskell
bsd-3-clause
2,415
{-# LANGUAGE OverloadedStrings #-} module Themes ( InternalTheme(..) , defaultTheme , internalThemes , lookupTheme , themeDocs -- * Attribute names , timeAttr , channelHeaderAttr , channelListHeaderAttr , currentChannelNameAttr , unreadChannelAttr , mentionsChannelAttr , urlAttr , codeAttr...
aisamanra/matterhorn
src/Themes.hs
Haskell
bsd-3-clause
17,282
module Opaleye.Internal.NEList where data NEList a = NEList a [a] deriving Show singleton :: a -> NEList a singleton = flip NEList [] toList :: NEList a -> [a] toList (NEList a as) = a:as neCat :: NEList a -> NEList a -> NEList a neCat (NEList a as) bs = NEList a (as ++ toList bs) instance Functor NEList where f...
k0001/haskell-opaleye
Opaleye/Internal/NEList.hs
Haskell
bsd-3-clause
511
import Control.Monad import Codec.Compression.GZip import qualified Data.ByteString.Char8 as S import qualified Data.ByteString.Lazy as L import System.FilePath import System.FilePath.Find import System.FilePath.Glob import System.FilePath.Manip import Text.Regex.Posix ((=~)) -- Get a list of all symlinks. getDangl...
bos/filemanip
examples/Simple.hs
Haskell
bsd-3-clause
2,319
module Avg where {-@ measure sumD :: [Double] -> Double sumD([]) = 0.0 sumD(x:xs) = x + (sumD xs) @-} {-@ measure lenD :: [Double] -> Double lenD([]) = 0.0 lenD(x:xs) = (1.0) + (lenD xs) @-} {-@ expression Avg Xs = ((sumD Xs) / (lenD Xs)) @-} {-@ meansD :: xs:{v:[Double] | ((lenD v) > 0.0)} ...
ssaavedra/liquidhaskell
tests/pos/Avg.hs
Haskell
bsd-3-clause
673
{-# LANGUAGE EmptyDataDecls, TypeSynonymInstances #-} {-# OPTIONS_GHC -fcontext-stack42 #-} module Games.Chaos2010.Database.Database_constraints where import Games.Chaos2010.Database.Fields import Database.HaskellDB.DBLayout type Database_constraints = Record (HCons (LVPair Constraint_name (Expr String))...
JakeWheat/Chaos-2010
Games/Chaos2010/Database/Database_constraints.hs
Haskell
bsd-3-clause
487
module MapDeclM where import Recursive import IdM {-+ A class to apply a monadic function to all declarations in a structure. The type of the structure is #s#, the type of the declarations is #d#. The functional dependency ensures that we can determine the type of declarations from the type of the structure. -} cl...
forste/haReFork
tools/base/transforms/MapDeclM.hs
Haskell
bsd-3-clause
686
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 -} {-# LANGUAGE CPP, DeriveDataTypeable #-} -- | -- #name_types# -- GHC uses several kinds of name internally: -- -- * 'OccName.OccName': see "OccName#name_types" -- -- * 'RdrName.RdrName' is the type of names that come di...
green-haskell/ghc
compiler/basicTypes/RdrName.hs
Haskell
bsd-3-clause
36,400
module Board ( Board (..) , mkBoard , isEmptyCell , isValidUnit , lockUnit , clearFullRows ) where import Control.Arrow ((&&&)) import Data.Ix (inRange,range) import Data.List (foldl') import Data.Set (Set(..)) import qualified Data.Set as Set import Cell import Unit import Types data Board = Board { c...
msakai/icfpc2015
src/Board.hs
Haskell
bsd-3-clause
1,995
{-# LANGUAGE DoAndIfThenElse #-} module Term(Term(..), TermClass(..), Substitution(..), parse, act, makeUniqueVars, betaReduction) where import Text.Parsec hiding (parse) import qualified Text.Parsec as Parsec import Control.Applicative hiding ((<|>)) import Control.Monad import Data.List import VarEnvironment data ...
projedi/type-inference-rank2
src/Term.hs
Haskell
bsd-3-clause
4,308
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} module FreeAgentSpec (main, spec) where import FreeAgent.AgentPrelude import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = describe "FreeAgent" $ do it "goes out in the world and does a thing" $ True `s...
jeremyjh/free-agent
core/test/FreeAgentSpec.hs
Haskell
bsd-3-clause
334
-------------------------------------------------------------------------------- -- | -- Module : Graphics.UI.GLUT.Callbacks -- Copyright : (c) Sven Panne 2002-2005 -- License : BSD-style (see the file libraries/GLUT/LICENSE) -- -- Maintainer : sven.panne@aedion.de -- Stability : stable -- Portabili...
FranklinChen/hugs98-plus-Sep2006
packages/GLUT/Graphics/UI/GLUT/Callbacks.hs
Haskell
bsd-3-clause
2,245
{-# LANGUAGE OverloadedStrings #-} -- | XSD @dateTime@ data structure <http://www.w3.org/TR/xmlschema-2/#dateTime> module Text.XML.XSD.DateTime ( DateTime(..) , isZoned , isUnzoned , dateTime' , dateTime , toText , fromZonedTime , toUTCTime , fromUTCTime ...
skogsbaer/xsd
Text/XML/XSD/DateTime.hs
Haskell
bsd-3-clause
8,178
{-# LANGUAGE FlexibleContexts #-} module Data.Stack ( Stack , evalStack , push , pop ) where import Control.Applicative import Control.Monad.State.Strict type Stack a = State [a] pop :: (Applicative m, MonadState [a] m) => m a pop = gets head <* modify tail push :: (Applicative m, MonadState [a] m) => a -> m ...
kirbyfan64/sodium
src/Data/Stack.hs
Haskell
bsd-3-clause
367
-- !!! Testing Read (assuming that Eq, Show and Enum work!) module TestRead where import Ratio(Ratio,Rational,(%)) import List(zip4,zip5,zip6,zip7) import Char(isLatin1) -- test that expected equality holds tst :: (Read a, Show a, Eq a) => a -> Bool tst x = read (show x) == x -- measure degree of error diff :: (Rea...
FranklinChen/Hugs
tests/rts/read.hs
Haskell
bsd-3-clause
2,665
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 -} {-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types] ...
ezyang/ghc
compiler/hsSyn/HsExpr.hs
Haskell
bsd-3-clause
104,032
module J ( module J , module J.Store ) where import J.Store data J = J { key :: String , dst :: String }
KenetJervet/j
src/J.hs
Haskell
bsd-3-clause
147
module Diag.Util.RecursiveContents (getRecursiveContents) where import Control.Monad (forM) import System.Directory (doesDirectoryExist, getDirectoryContents) import System.FilePath ((</>)) getRecursiveContents :: FilePath -> IO [FilePath] getRecursiveContents topdir = do names <- getDirectoryContents topdir let...
marcmo/hsDiagnosis
src/Diag/Util/RecursiveContents.hs
Haskell
bsd-3-clause
593
{-# LANGUAGE RankNTypes, TypeOperators, DefaultSignatures #-} -- | No comparison that I'm aware of module MHask.Indexed.Layered where import MHask.Arrow import qualified MHask.Indexed.Join as MHask import qualified MHask.Indexed.Duplicate as MHask -- | IxLayered is its own dual. class (MHask.IxJoin t, MHask.Ix...
DanBurton/MHask
MHask/Indexed/Layered.hs
Haskell
bsd-3-clause
1,543
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Servant.FileUpload.Client.GHC where import Data.Proxy (Proxy (..)) import Data.Void (Void, absurd) import Servant.API ((:>)) import Servant.Client (HasClient (..)) import Servan...
rimmington/servant-file-upload
servant-file-upload-client/src/Servant/FileUpload/Client/GHC.hs
Haskell
bsd-3-clause
550
module Chapter9Exercises where import Data.Maybe import Data.Char -- exercise 2 str = "HbEfLrLxO" onlyUpperHello = filter isUpper str -- exercise 3 julie = "julie" capitalize :: [Char] -> [Char] capitalize [] = [] capitalize (a:as) = toUpper a : as -- exercise 4 toAllUpper :: [Char] -> [Char] toAllUpper [] = [...
brodyberg/Notes
ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/Chapter9.hs
Haskell
mit
1,403
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ParallelListComp #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE RecordWildCards #-} -- | A very simple Graphical User Interface (GUI) for user interaction with -- but...
alphalambda/codeworld
codeworld-base/src/Extras/Widget.hs
Haskell
apache-2.0
19,161
{- Teak synthesiser for the Balsa language Copyright (C) 2007-2010 The University of Manchester This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or...
Mahdi89/eTeak
src/Type.hs
Haskell
bsd-3-clause
21,407
module State.TreeSpec (treeSpec) where import State.Tree import Test.Hspec import Control.Monad.Identity testTree :: Integer -> Identity ([Integer], String) testTree 0 = return ([1, 2], "0") testTree 1 = return ([3], "1") testTree 2 = return ([], "2") testTree 3 = return ([], "3") testTree _ = error "No node" loopTr...
BakerSmithA/Turing
test/State/TreeSpec.hs
Haskell
bsd-3-clause
1,334
{-# LANGUAGE GeneralizedNewtypeDeriving, ScopedTypeVariables, BangPatterns #-} module Halfs.Inode ( InodeRef(..) , blockAddrToInodeRef , buildEmptyInodeEnc , decLinkCount , fileStat , incLinkCount , inodeKey , inodeRefToBlockAddr , isNilIR , nilIR , readStream , writeStream -- * for intern...
hackern/halfs
Halfs/Inode.hs
Haskell
bsd-3-clause
51,840
{-# LANGUAGE Rank2Types, RecordWildCards #-} module OS.Internal ( OS(..) , genericOS ) where import Data.Version (showVersion) import Development.Shake import Development.Shake.FilePath import Dirs import Paths import Types import Utils data OS = OS { -- These paths are all on the target m...
erantapaa/haskell-platform
hptool/src/OS/Internal.hs
Haskell
bsd-3-clause
4,934
module SDL.Raw.Basic ( -- * Initialization and Shutdown init, initSubSystem, quit, quitSubSystem, setMainReady, wasInit, -- * Configuration Variables addHintCallback, clearHints, delHintCallback, getHint, setHint, setHintWithPriority, -- * Log Handling log, logCritical, logDebug, ...
Velro/sdl2
src/SDL/Raw/Basic.hs
Haskell
bsd-3-clause
6,592
{-# LANGUAGE DeriveGeneric, DeriveDataTypeable #-} -- | Types used while planning how to build everything in a project. -- -- Primarily this is the 'ElaboratedInstallPlan'. -- module Distribution.Client.ProjectPlanning.Types ( SolverInstallPlan, -- * Elaborated install plan types ElaboratedInstallPlan, ...
bennofs/cabal
cabal-install/Distribution/Client/ProjectPlanning/Types.hs
Haskell
bsd-3-clause
14,755
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} -- Determine which packages are already installed module Stack.Build.Installed ( InstalledMap , Installed (..) , GetInstalledOpts (..) , getInstalle...
duplode/stack
src/Stack/Build/Installed.hs
Haskell
bsd-3-clause
8,898
main = drawingOf(thing(1) & thing(2)) thing(n) = if n > 1 rectangle(n, n) else circle(n)
venkat24/codeworld
codeworld-compiler/test/testcase/test_ifCondition/source.hs
Haskell
apache-2.0
89
-- | This module provides numerical routines for minimizing linear and nonlinear multidimensional functions. -- Multidimensional optimization is significantly harder than one dimensional optimization. -- In general, there are no black box routines that work well on every function, -- even if the function has only a sin...
arnabgho/HLearn
src/HLearn/Optimization/Multivariate.hs
Haskell
bsd-3-clause
18,644
<?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="hu-HU"> <title>Front-End Scanner | ZAP Extension</title> <maps> <homeID>top</homeID> <m...
kingthorin/zap-extensions
addOns/frontendscanner/src/main/javahelp/org/zaproxy/zap/extension/frontendscanner/resources/help_hu_HU/helpset_hu_HU.hs
Haskell
apache-2.0
978
module SDL.Raw.Platform ( -- * Platform Detection getPlatform ) where import Control.Monad.IO.Class import Foreign.C.String foreign import ccall "SDL.h SDL_GetPlatform" getPlatformFFI :: IO CString getPlatform :: MonadIO m => m CString getPlatform = liftIO getPlatformFFI {-# INLINE getPlatform #-}
dalaing/sdl2
src/SDL/Raw/Platform.hs
Haskell
bsd-3-clause
306
{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} #if __GLASGOW_HASKELL__ >= 707 {-# LA...
rpglover64/lens
src/Control/Lens/Internal/Magma.hs
Haskell
bsd-3-clause
9,589
{-# LANGUAGE UnboxedSums #-} module UbxSumLevPoly where -- this failed thinking that (# Any | True #) :: TYPE (SumRep [LiftedRep, b]) -- But of course that b should be Lifted! -- It was due to silliness in TysWiredIn using the same uniques for different -- things in mk_sum. p = True where (# _x | #) = (# | True #...
ezyang/ghc
testsuite/tests/unboxedsums/UbxSumLevPoly.hs
Haskell
bsd-3-clause
322
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances, TypeFamilies, GeneralizedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module T4809_IdentityT ( evalIdentityT , IdentityT(..) , XML(..) ) where import Control.Applicative (Applicative, Alternative) import Control....
philderbeast/ghcjs
test/ghc/typecheck/T4809_IdentityT.hs
Haskell
mit
1,601
module Vectorise.Generic.PADict ( buildPADict ) where import Vectorise.Monad import Vectorise.Builtins import Vectorise.Generic.Description import Vectorise.Generic.PAMethods ( buildPAScAndMethods ) import Vectorise.Utils import BasicTypes import CoreSyn import CoreUtils import CoreUnfold import Module import Ty...
urbanslug/ghc
compiler/vectorise/Vectorise/Generic/PADict.hs
Haskell
bsd-3-clause
4,973
{-# LANGUAGE Arrows #-} {-# OPTIONS -fno-warn-redundant-constraints #-} -- Test for Trac #1662 module Arrow where import Control.Arrow expr' :: Arrow a => a Int Int expr' = error "urk" term :: Arrow a => a () Int term = error "urk" expr1 :: Arrow a => a () Int expr1 = proc () -> do x <- term -< () ...
urbanslug/ghc
testsuite/tests/arrows/should_compile/arrowpat.hs
Haskell
bsd-3-clause
433
-- | This is a library which colourises Haskell code. -- It currently has six output formats: -- -- * ANSI terminal codes -- -- * LaTeX macros -- -- * HTML 3.2 with font tags -- -- * HTML 4.01 with external CSS. -- -- * XHTML 1.0 with internal CSS. -- -- * mIRC chat client colour codes. -- module Language.Haskell.HsC...
kyoungrok0517/linguist
samples/Haskell/HsColour.hs
Haskell
mit
4,949
-- Hugs failed this test Jan06 module Mod172 where import Mod172_B (f,g)
urbanslug/ghc
testsuite/tests/module/mod172.hs
Haskell
bsd-3-clause
75
module Ghci025C (f, g, h) where import Ghci025D g x = f x + 1 h x = x `div` 2 data C = C {x :: Int}
urbanslug/ghc
testsuite/tests/ghci/scripts/Ghci025C.hs
Haskell
bsd-3-clause
104
#!/usr/bin/env stack -- stack --install-ghc runghc --package turtle {-# LANGUAGE OverloadedStrings #-} import Turtle main = stdout $ input "README.md"
JoshuaGross/haskell-learning-log
Code/turtle/input.hs
Haskell
mit
164
----------------------------------------------------------------------------- -- | -- Module : TestQueue -- Copyright : (c) Phil Hargett 2014 -- License : MIT (see LICENSE file) -- -- Maintainer : phil@haphazardhouse.net -- Stability : experimental -- Portability : non-portable (requires STM) -- --...
hargettp/distributed-containers
test/TestQueue.hs
Haskell
mit
4,727
module ListyInstances where import Data.Monoid import Listy instance Monoid (Listy a) where mempty = Listy [] mappend (Listy l) (Listy l') = Listy $ mappend l l'
diminishedprime/.org
reading-list/haskell_programming_from_first_principles/orphan-instance/ListyInstances.hs
Haskell
mit
167
import Data.List import Data.List.Extra import Data.Maybe import qualified Data.Map as Map parseLine :: String -> [Int] parseLine s = let [name, _, _, speed, "km/s", _, endurance, "seconds,", _, _, _, _, _, rest, "seconds."] = words s in concat $ repeat $ replicate (read endurance) (read speed) ++ repl...
msullivan/advent-of-code
2015/A14b.hs
Haskell
mit
1,018
module Problem8 ( removeDuplicates ) where removeDuplicates :: (Eq a) => [a] -> [a] removeDuplicates [] = [] removeDuplicates [x] = [x] removeDuplicates (x:xs) = if x == head xs then removeDuplicates xs else x : removeDuplicates xs
chanind/haskell-99-problems
Problem8.hs
Haskell
mit
232
lastPart :: Int -> [a] -> [a] lastPart _ [] = [] lastPart _ [x] = [x] lastPart x l@(h:t) | x > 0 = lastPart nx t | otherwise = l where nx = x - 1 firstPart :: Int -> [a] -> [a] firstPart _ [] = [] firstPart _ [x] = [x] firstPart x l@(h:t) | x > 0 = h:(firstPart nx t) ...
andrewaguiar/s99-haskell
p19.hs
Haskell
mit
660
{-# OPTIONS_GHC -fno-warn-orphans #-} module Application ( getApplicationDev , appMain , develMain , makeFoundation -- * for DevelMain , getApplicationRepl , shutdownApp -- * for GHCI , handler , db ) where import Control.Monad.Logger (liftLoc, runLoggingT) i...
darthdeus/reedink
Application.hs
Haskell
mit
6,680
{-# LANGUAGE TypeFamilies, ScopedTypeVariables #-} import Data.Acid import Data.Acid.Centered import Control.Monad (when) import Control.Concurrent (threadDelay) import System.Exit (exitSuccess, exitFailure) import System.Directory (doesDirectoryExist, removeDirectoryRecursive) import Control.Exception (catch, SomeEx...
sdx23/acid-state-dist
test/SyncTimeout.hs
Haskell
mit
1,014
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TemplateHaskell #-} module Init ( (@/=), (@==), (==@) , assertNotEqual , assertNotEmpty , assertEmpty , isTravis , BackendMonad ...
greydot/persistent
persistent-test/Init.hs
Haskell
mit
9,069
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses #-} import Hate import Hate.Graphics import Vec2Lens (x,y) import Control.Applicative import Control.Lens import System.Random -- sample 4 data Sehe = Sehe { _pos :: Vec2, _vel :: Vec2 } makeLenses ''Sehe data SampleStat...
maque/Hate
samples/sample_sprite.hs
Haskell
mit
1,876
import System.Environment bmiTell :: (RealFloat a) => a -> a -> String bmiTell weight height | bmi <= 18.5 = "You're underweight, you emo, you!" | bmi <= 25.0 = "You're supposedly normal. Pffft, I bet you're ugly!" | bmi <= 30.0 = "You're fat! Lose some weight, fatty!" | otherwise ...
dmitrinesterenko/haskell_io_examples
bmiCalc.hs
Haskell
mit
503
-- Write a function that takes a list and returns the same list in reverse module Main (reverseList) where aux [] acc = acc aux (h:t) acc = aux t (h:acc) reverseList xs = aux xs []
ryanplusplus/seven-languages-in-seven-weeks
haskell/day1/reverse_list.hs
Haskell
mit
189
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html module Stratosphere.ResourceProperties.ElasticLoadBalancingLoadBalancerPolicies where im...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ElasticLoadBalancingLoadBalancerPolicies.hs
Haskell
mit
4,306
module Book ( Book, load, compile ) where import Control.Applicative import Control.Arrow import Control.Dangerous hiding ( Exit, Warning, execute ) import Control.Monad import Control.Monad.Trans import Data.List import Data.Focus import Data.Maybe import Data.Scope import System.FilePath import System.FilePath.Utils ...
Soares/Bookbuilder
src/Book.hs
Haskell
mit
4,473
{-# Language ParallelListComp #-} {-# Language ViewPatterns #-} {-# Language RecordWildCards #-} {-# Language ScopedTypeVariables #-} module Symmetry.IL.Model.HaskellSpec where import Data.Generics import Data.Foldable as Fold import Data.List import Data.Maybe import ...
gokhankici/symmetry
checker/src/Symmetry/IL/Model/HaskellSpec.hs
Haskell
mit
16,206
module Triangle (area) where area :: Float -> Float -> Float area b h = b * h
tonilopezmr/Learning-Haskell
Exercises/3/Exercise 1/Triangle.hs
Haskell
apache-2.0
80
module KeyBind ( Key (..) , Keyset , updateKeyset , keysetToXY ) where import Data.Complex import Data.Set import Graphics.UI.SDL import Graphics.UI.SDL.Keysym data Key = A | B | C | RB | LB | UB | DB | QUIT deriving (Eq, Ord, Show) type Keyset = Set Key eventToKey :: Event -> Keyset -> Keyset eventToKe...
c000/PaperPuppet
src/KeyBind.hs
Haskell
bsd-3-clause
1,216
{-# LANGUAGE CPP , DeriveDataTypeable , FlexibleInstances , FlexibleContexts , MultiParamTypeClasses , TypeFamilies , UndecidableInstances #-} {- | Copyright : (c) Andy Sonnenburg 2013 License : BSD3 Maintainer : andy22286@gmail.com -} module Data.Tuple.IO ( module Data.Tuple.MTuple ...
sonyandy/var
src/Data/Tuple/IO.hs
Haskell
bsd-3-clause
5,909
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Control.ConstraintClasses.Key ( -- * Key classes CKey ) where import Prelude hiding (lookup) import Data.Functor.Identity import Data.Functor.Product import Data.Func...
guaraqe/constraint-classes
src/Control/ConstraintClasses/Key.hs
Haskell
bsd-3-clause
1,028
module Khronos.AssignModules ( assignModules ) where import Algebra.Graph.AdjacencyIntMap hiding ( empty ) import qualified Data.IntMap.Strict as IntMap import qualified Data.IntSet as Set import qualified Data.List.Extra ...
expipiplus1/vulkan
generate-new/khronos-spec/Khronos/AssignModules.hs
Haskell
bsd-3-clause
19,322
{-# LANGUAGE DeriveFunctor, LambdaCase #-} module Data.Boombox.Head where import Data.Boombox.Player import Data.Boombox.Tape import Control.Comonad import Control.Applicative -- | 'Head' is a Store-like comonad which handles seeking. data Head i a = Head !i (Maybe i -> a) deriving Functor instance Comonad (Head i) w...
fumieval/boombox
src/Data/Boombox/Head.hs
Haskell
bsd-3-clause
1,274
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Configuration.Screen where import Lens.Simple ( makeLenses , (^.) ) import Data.Yaml ...
rumblesan/proviz
src/Configuration/Screen.hs
Haskell
bsd-3-clause
1,069
module Main where import Control.Applicative import Control.Concurrent import Control.Monad import Control.Monad.IO.Class import Data.Aeson import Data.DateTime (DateTime) import Data.Function import Data.Monoid import Data.Text (Text) import Network.API.Builder import Reddit import Reddit.Types.Subreddit import Reddi...
intolerable/year-beast
src/Main.hs
Haskell
bsd-3-clause
3,857
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Migrate.Internal.Types ( TransferMonad , TransferState(..) , TransactionError(..) , getInformation, get, write, append, modify, getPreviousError , runTransferMonad ) where import ClassyPrel...
JustusAdam/bitbucket-github-migrate
src/Migrate/Internal/Types.hs
Haskell
bsd-3-clause
2,765
{-# LANGUAGE MagicHash, UnboxedTuples #-} module CasIORef (casIORef) where import GHC.IORef import GHC.STRef import GHC.Exts import GHC.IO casIORef :: IORef a -> a -> a -> IO Bool casIORef (IORef (STRef r#)) old new = IO $ \s -> case casMutVar# r# old new s of (# s', did, val #) -> if did ==# 0# then ...
mono0926/ParallelConcurrentHaskell
CasIORef.hs
Haskell
bsd-3-clause
379