code
stringlengths
2
1.05M
repo_name
stringlengths
5
101
path
stringlengths
4
991
language
stringclasses
3 values
license
stringclasses
5 values
size
int64
2
1.05M
module Data.Binary.Strict.BitUtil ( topNBits , bottomNBits , leftShift , rightShift , leftTruncateBits , rightTruncateBits ) where import Data.Word (Word8) import qualified Data.ByteString as B import Data.Bits (shiftL, shiftR, (.|.), (.&.)) -- | This is used for masking the last byte of a ByteString so...
KrzyStar/binary-low-level
src/Data/Binary/Strict/BitUtil.hs
Haskell
bsd-3-clause
2,221
{-# LANGUAGE OverloadedStrings #-} module Server.Protocol where import Data.Aeson import Language.Parser.Errors ( ImprovizCodeError(..) ) data ImprovizResponse = ImprovizOKResponse String | ImprovizErrorResponse String | ImprovizCodeErrorResponse [ImprovizCodeError] deriving (Sho...
rumblesan/improviz
src/Server/Protocol.hs
Haskell
bsd-3-clause
666
{-# LANGUAGE CPP, LambdaCase, BangPatterns, MagicHash, TupleSections, ScopedTypeVariables #-} {-# OPTIONS_GHC -w #-} -- Suppress warnings for unimplemented methods ------------- WARNING --------------------- -- -- This program is utterly bogus. It takes a value of type () -- and unsafe-coerces it to a function, and a...
mcschroeder/ghc
testsuite/tests/stranal/should_compile/T9208.hs
Haskell
bsd-3-clause
3,414
module HList ( H , repH , absH ) where type H a = [a] -> [a] -- {-# INLINE repH #-} repH :: [a] -> H a repH xs = (xs ++) -- {-# INLINE absH #-} absH :: H a -> [a] absH f = f [] -- -- Should be in a "List" module -- {-# RULES "++ []" forall xs . xs ++ [] = xs #-} -- {-# RULES "++ strict...
ku-fpg/hermit
examples/reverse/HList.hs
Haskell
bsd-2-clause
633
{-# LANGUAGE PatternSynonyms #-} {- | Copyright : Copyright (C) 2006-2018 Bjorn Buckwalter License : BSD3 Maintainer : bjorn@buckwalter.se Stability : Stable Portability: GHC only This module provides types and functions for manipulating unit names. Please note that the details of the name repre...
bjornbm/dimensional
src/Numeric/Units/Dimensional/UnitNames.hs
Haskell
bsd-3-clause
1,146
{-# LANGUAGE Rank2Types #-} module Main where -- order of imports analogous to cabal build-depends -- base import System.Environment(getArgs) import Data.IORef import Control.Monad ((=<<)) -- gtk import Graphics.UI.Gtk hiding (get) -- hint import Language.Haskell.Interpreter hiding ((:=),set,get) -- astview-util...
RefactoringTools/HaRe
hareview/src/Main.hs
Haskell
bsd-3-clause
1,281
----------------------------------------------------------------------------- -- | -- Module : RefacUnfoldAsPatterns -- Copyright : (c) Christopher Brown 2007 -- -- Maintainer : cmb21@kent.ac.uk -- Stability : provisional -- Portability : portable -- -- This module contains a transformation for HaRe. -- ...
kmate/HaRe
old/refactorer/RefacUnfoldAsPatterns.hs
Haskell
bsd-3-clause
17,830
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} import Control.Distributed.Process hiding (Message, mask, finally, handleMessage, proxy) import Control.Distributed.Process.Closure import Control.Concurrent.Async import Control.Monad.IO.Class import Control.Monad im...
prt2121/haskell-practice
parconc/distrib-chat/chat.hs
Haskell
apache-2.0
10,981
module Data.Foo where foo :: Int foo = undefined fibonacci :: Int -> Integer fibonacci n = fib 1 0 1 where fib m x y | n == m = y | otherwise = fib (m+1) y (x + y)
yuga/ghc-mod
test/data/ghc-mod-check/Data/Foo.hs
Haskell
bsd-3-clause
187
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, GADTs #-} module FDsFromGivens where class C a b | a -> b where cop :: a -> b -> () data KCC where KCC :: C Char Char => () -> KCC {- Failing, as it righteously should! g1 :: (C Char [a], C Char Bool) => a -> () g1 x = () -} ...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/typecheck/should_fail/FDsFromGivens.hs
Haskell
bsd-3-clause
385
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-} -- Tests the special case of -- non-recursive, function binding, -- with no type signature module ShouldCompile where f = \ (x :: forall a. a->a) -> (x True, x 'c') g (x :: forall a. a->a) = x
wxwxwwxxx/ghc
testsuite/tests/typecheck/should_compile/tc194.hs
Haskell
bsd-3-clause
247
{-source: http://overtond.blogspot.sg/2008/07/pre.html-} runTest = runFD test test = do x <- newVar [0..3] y <- newVar [0..3] ((x .<. y) `mplus` (x `same` y)) x `hasValue` 2 labelling [x, y]
calvinchengx/learnhaskell
constraints/constraint.hs
Haskell
mit
214
{-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE OverloadedStrings #-} module View where import Lucid index :: Html () -> Html () index bd = head_ $ do head_ hd body_ bd hd :: Html () hd = do meta_ [charset_ "utf-8"] meta_ [name_ "viewport", content_ "width=device-width, initial-scale=1"] t...
muhbaasu/pfennig-server
src/Pfennig/View.hs
Haskell
mit
4,510
module Glob (namesMatching) where import System.Directory (doesDirectoryExist, doesFileExist, getCurrentDirectory, getDirectoryContents) import System.FilePath (dropTrailingPathSeparator, splitFileName, (</>)) import Control.Exception (handle) import Control.Monad (forM) import GlobRegex (matchesGlob, matchesGlobCs) ...
cirquit/Personal-Repository
Haskell/RWH/Regex/Glob.hs
Haskell
mit
3,249
module Lib ( helloWorld ) where helloWorld :: IO () helloWorld = putStrLn "Hello world!"
stackbuilders/hapistrano
example/src/Lib.hs
Haskell
mit
98
--map takes a function and a list and applies that function to all elements map' :: (a -> b) -> [a] -> [b] map' _ [] = [] map' f (x:xs) = f x : map' f xs map1 = map' (replicate 3) [3..6] map2 = map (map (^2)) [[1,2],[3,4,5,6],[7,8]] --filter takes a predicate and returns a list filter' :: (a -> Bool) -> [a] -> [a...
luisgepeto/HaskellLearning
06 Higher Order Functions/03_maps_and_filters.hs
Haskell
mit
1,688
module Main where import System (getArgs) import System.Console.GetOpt import System.IO import System.Directory import System.FS.RDFS data Options = Options { optVerbose :: Bool , optShowVersion :: Bool , optFiles :: [FilePath] } deriving Show defaultOptions = Options { optV...
realdesktop/rdfs
exec/Main.hs
Haskell
mit
1,348
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.SVGForeignObjectElement (getX, getY, getWidth, getHeight, SVGForeignObjectElement(..), gTypeSVGForeignObj...
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGForeignObjectElement.hs
Haskell
mit
2,220
{-# LANGUAGE GADTs, DataKinds, TypeFamilies, TypeOperators, PolyKinds #-} module ListProofs where import Data.Singletons.Prelude import Data.Type.Equality import FunctionProofs {- data MapP f l r where MapNil :: MapP f '[] '[] MapCons :: MapP f as bs -> MapP f (a ': as) (Apply f a ': bs) mapP :: SList l -> MapP...
vladfi1/hs-misc
ListProofs.hs
Haskell
mit
2,062
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} module Tinc.Sandbox ( PackageConfig , Sandbox , findPackageDb , initSandbox , recache , cabalSandboxDirectory , cabalSandboxBinDirectory , listPackages #ifdef TEST , packageFromPackageConf...
robbinch/tinc
src/Tinc/Sandbox.hs
Haskell
mit
3,362
module Day08 where import Debug.Trace import Data.Char part1 :: IO () part1 = do text <- readFile "lib/day08-input.txt" let f l = length l - go l (print . sum . map f . words) text where go :: String -> Int go [] = 0 go ('\"' :xs) = go xs go ('\\':'x':_:_:xs...
cirquit/Personal-Repository
Haskell/Playground/AdventOfCode/advent-coding/src/Day08.hs
Haskell
mit
602
module Sound.Morse ( encodeString , encodeMorse , morseTable , fromChar , morseToBool , Morse(..) ) where import Data.List (intersperse) import Data.Char (toLower) import Data.Maybe (fromMaybe) import Control.Arrow (first) import qualified Data.Map as Map data Morse = Dit | Dah | Pause deriving (Show,...
fritz0705/morse
Sound/Morse.hs
Haskell
mit
4,126
-- | First-order logic constants. ----------------------------------------------------------------------------- {-# LANGUAGE CPP #-} {-# LANGUAGE UnicodeSyntax #-} -- Adapted from AgdaLight (Plugins.FOL.Constants). module Apia.FOL.Constants ( lTrue , lFalse , lNot , lAnd , lOr , lCond , lBic...
asr/apia
src/Apia/FOL/Constants.hs
Haskell
mit
1,100
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE DeriveGeneric #-} import GHC.Generics import Test.SmallCheck import Test.SmallCheck.Series data NList1 a = Empty | ConsElem a (NList1 a) | ConsList (NList1 a) (NList1 a) deriving (Show, Eq, Generic) data NList2 a = Elem ...
mihaimaruseac/blog-demos
lists/list.hs
Haskell
mit
1,554
{-# LANGUAGE OverloadedStrings #-} -- | -- Module: Database.Neo4j -- Copyright: (c) 2014, Antoni Silvestre -- License: MIT -- Maintainer: Antoni Silvestre <antoni.silvestre@gmail.com> -- Stability: experimental -- Portability: portable -- -- Library to interact with the Neo4j REST API. -- module Databa...
asilvestre/haskell-neo4j-rest-client
src/Database/Neo4j.hs
Haskell
mit
6,370
import Data.List (sort) main = do let test = [[2],[3,4],[6,5,7],[4,1,8,3]] print $ minimumTotal 0 test print $ minimumTotal 0 [[2]] minimumTotal :: Integer -> [[Integer]] -> Integer minimumTotal = foldl (\a b -> (head.sort) $ map (+ a) b)
ccqpein/Arithmetic-Exercises
Triangle/Triangle2.hs
Haskell
apache-2.0
258
rank (m:e:j:_) | (m==100) || (e==100) || (j==100) = 'A' | m+e >= 180 = 'A' | m+e+j >= 240 = 'A' | m+e+j >= 210 = 'B' |(m+e+j >= 150) &&((m>=80) || (e>=80)) = 'B' | otherwise = 'C' ans ([0]:_) = [] ans (n:x) = let n'= (n!!0) o = map rank ...
a143753/AOJ
0218.hs
Haskell
apache-2.0
512
-- | The 'MakeReflections' module takes the 'FileDescriptorProto' -- output from 'Resolve' and produces a 'ProtoInfo' from -- 'Reflections'. This also takes a Haskell module prefix and the -- proto's package namespace as input. The output is suitable -- for passing to the 'Gen' module to produce the files. -- -- This...
alphaHeavy/protocol-buffers
hprotoc/Text/ProtocolBuffers/ProtoCompile/MakeReflections.hs
Haskell
apache-2.0
17,414
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} module Network.Eureka.Application ( lookupByAppName , lookupByAppNameAll , lookupAllApplications ) where import Control.Monad (mzero) import Control.Monad.Logger (MonadLoggerIO) import Data.A...
SumAll/haskell-eureka-client
src/Network/Eureka/Application.hs
Haskell
apache-2.0
4,451
module Main where import TAEval import TAType import TACheck import TAParser import TAPretty import CalcSyntax import Data.Maybe import Control.Monad.Trans import System.Console.Haskeline eval' :: Expr -> Expr eval' = fromJust . eval process :: String -> IO () process line = do let res = parseExpr line case re...
toonn/wyah
src/TA.hs
Haskell
bsd-2-clause
749
-- | Tests for substring functions (@take@, @split@, @isInfixOf@, etc.) {-# OPTIONS_GHC -fno-enable-rewrite-rules -fno-warn-missing-signatures #-} module Tests.Properties.Substrings ( testSubstrings ) where import Data.Char (isSpace) import Test.QuickCheck import Test.Tasty (TestTree, testGroup) import Test.T...
bos/text
tests/Tests/Properties/Substrings.hs
Haskell
bsd-2-clause
15,864
{-# LANGUAGE PackageImports #-} import "mini-scilab-site" Application (getApplicationDev) import Network.Wai.Handler.Warp (runSettings, defaultSettings, settingsPort) import Control.Concurrent (forkIO) import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (th...
marcotmarcot/mini-scilab-site
devel.hs
Haskell
bsd-2-clause
710
{-# LANGUAGE CPP, OverloadedStrings #-} module Demo.JS ( readInputState , writeInputState , mkRandomInput , sDrawButton , printHighError , sCellsDiv , sNumCells , printLowError , cullErrors ...
RoboNickBot/linked-list-web-demo
src/Demo/JS.hs
Haskell
bsd-2-clause
14,296
{-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables #-} {-# LANGUAGE BangPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.InterfaceFile -- Copyright : (c) David Waern 2006-2009, -- Ma...
haskell/haddock
haddock-api/src/Haddock/InterfaceFile.hs
Haskell
bsd-2-clause
22,415
-- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. -- In addition, you can configure a number of different aspects of Yesod -- by overriding methods in the Yesod typeclass. That instance is -- declared in the Foundation.hs file....
thlorenz/WebToInk
webtoink/Settings.hs
Haskell
bsd-2-clause
2,518
{-# LANGUAGE OverloadedStrings #-} --{-# LANGUAGE QuasiQuotes #-} module Main where import MyLib (app) import Control.Monad (mzero) import Data.Aeson import Test.Hspec import Test.Hspec.Wai import Network.HTTP.Types (methodPost, hCont...
sagarsachdeva/database-service
test/Main.hs
Haskell
bsd-3-clause
7,843
-- 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/PL_XX.hs
Haskell
bsd-3-clause
152,584
{-# language CPP #-} -- No documentation found for Chapter "Fence" module Vulkan.Core10.Fence ( createFence , withFence , destroyFence , resetFences , getFenceStatus , waitForFenc...
expipiplus1/vulkan
src/Vulkan/Core10/Fence.hs
Haskell
bsd-3-clause
31,350
module Cpp where import FixPrime cpp (x, y) = [(a, b) | a <- x, b <- y] cpr (a, y) = [(a, b) | b <- y] cpl (x, b) = [(a, b) | a <- x] cpp' (x, y) = do a <- x b <- y return (a, b) cpr' (a, y) = do b <- y return (a, b) cpl' (x, b) = do a <- x return (a, b)
cutsea110/aop
src/Cpp.hs
Haskell
bsd-3-clause
274
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} module Test.ZM.ADT.TypedBLOB.K614edd84c8bd (TypedBLOB(..)) where import qualified Prelude(Eq,Ord,Show) import qualified GHC.Generics import qualified Flat import qualified Data.Model import qualified Test.ZM.ADT.Type.K7028aa556ebc import qualified Test.ZM....
tittoassini/typed
test/Test/ZM/ADT/TypedBLOB/K614edd84c8bd.hs
Haskell
bsd-3-clause
796
{- In the game of darts a player throws three darts at a target board which is split into twenty equal sized sections numbered one to twenty. The score of a dart is determined by the number of the region that the dart lands in. A dart landing outside the red/green outer ring darts zero. The black and cream regions in...
bgwines/project-euler
src/solved/problem109.hs
Haskell
bsd-3-clause
2,741
module Language.Haskell.GhcMod.Lint where import Control.Applicative ((<$>)) import Control.Exception (handle, SomeException(..)) import Language.Haskell.GhcMod.Logger (checkErrorPrefix) import Language.Haskell.GhcMod.Types import Language.Haskell.HLint (hlint) -- | Checking syntax of a target file using hlint. -- ...
carlohamalainen/ghc-mod
Language/Haskell/GhcMod/Lint.hs
Haskell
bsd-3-clause
705
module DobadoBots.Interpreter.Data ( ActionToken ( ..) , SensorToken ( ..) , Cond ( ..) , LogicExpr ( ..) , CmpInteger ( ..) , Collider ( ..) ) where import Data.HashMap.Strict (HashMap) data ActionToken = MoveForward | TurnLeft | TurnRight ...
NinjaTrappeur/DobadoBots
src/DobadoBots/Interpreter/Data.hs
Haskell
bsd-3-clause
1,113
import Test.QuickCheck -- Our QC instances and properties: import Instances import Properties.Delete import Properties.Failure import Properties.Floating import Properties.Focus import Properties.GreedyView import Properties.Insert import Properties.Screen import Properties.Shift import Properties.Stack import Propert...
xmonad/xmonad
tests/Properties.hs
Haskell
bsd-3-clause
8,250
module Main where ---------------------------------------------------------------------------------------- -- Specification: -- -- 1. Input format is displayed UTF-8 encoded text. -- -- 2. All punctuation...
dmjio/wordfreq
Main.hs
Haskell
bsd-3-clause
3,868
{-# LANGUAGE TypeApplications #-} module Streaming.BinarySpec where import Control.Monad (replicateM_, void) import Data.Binary (put) import Data.Binary.Put (runPut) import Data.Function ((&)) import qualified Data.ByteString.Streaming as Q import Streaming.Binary import qualified Streaming.Prelude as S import Test.H...
mboes/streaming-binary
test/Streaming/BinarySpec.hs
Haskell
bsd-3-clause
2,030
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE ExplicitForAll #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGU...
taruti/diagrams-cairo-raster
example/Benchmarks.hs
Haskell
bsd-3-clause
2,332
{-# LANGUAGE BangPatterns #-} module Tactics.Util ( allLockablePlaces , randomWalkTillLocked , randomWalkTillLockedWithPPs ) where import Control.Monad import Data.Map (Map) import qualified Data.Map as Map import Data.Set (Set) import qualified Data.Set as Set import qualified System.Random as Rand im...
msakai/icfpc2015
src/Tactics/Util.hs
Haskell
bsd-3-clause
4,435
----------------------------------------------------------------------------- {- | This module defines the monad of sampling functions. See Park, Pfenning and Thrun: A probabilistic language based upon sampling functions, Principles of programming languages 2005 Sampling functions allow the composition of both discre...
glutamate/probably
Math/Probably/Sampler.hs
Haskell
bsd-3-clause
12,708
-- 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. {-# LANGUAGE GADT...
rfranek/duckling
Duckling/Time/ES/Rules.hs
Haskell
bsd-3-clause
38,523
{-# LINE 1 "Control.Monad.ST.Lazy.Imp.hs" #-} {-# LANGUAGE Unsafe #-} {-# LANGUAGE MagicHash, UnboxedTuples, RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Monad.ST.Lazy.Imp -- Copyright : (c) The University of...
phischu/fragnix
builtins/base/Control.Monad.ST.Lazy.Imp.hs
Haskell
bsd-3-clause
4,607
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} module Language.Why3.PP (ppTh, ppD, ppE, ppT, ppL, ppP, isOpWhy3) where import Language.Why3.AST import Text.PrettyPrint import Data.Text (Text) import qualified Data.Text as Text ppTh :: Theory -> Doc ppTh (Theory x ds) = text "theory" <+> p...
GaloisInc/why3
src/Language/Why3/PP.hs
Haskell
bsd-3-clause
7,013
{-# LANGUAGE OverloadedStrings #-} module Network.XMPP.TCPConnection ( TCPConnection , openStream , getStreamStart , openComponent , tagXMPPConn ) where import Network.XMPP.XMLParse import...
drpowell/XMPP
Network/XMPP/TCPConnection.hs
Haskell
bsd-3-clause
5,945
-- | Simulates the @isUnicodeIdentifierStart@ Java method. <http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html#isUnicodeIdentifierStart%28int%29> module Language.Java.Character.IsUnicodeIdentifierStart ( IsUnicodeIdentifierStart(..) ) where import Data.Char import Data.Word import Data.Set.Diet(Diet) ...
tonymorris/java-character
src/Language/Java/Character/IsUnicodeIdentifierStart.hs
Haskell
bsd-3-clause
9,723
module ControllerService ( controller , PacketIn ) where import Prelude hiding (catch) import Base import Data.Map (Map) import MacLearning (PacketOutChan) import qualified NIB import qualified NIB2 import qualified Nettle.OpenFlow as OF import Nettle.OpenFlow.Switch (showSwID) import qualified Nettle.Servers.Se...
brownsys/pane
src/ControllerService.hs
Haskell
bsd-3-clause
14,376
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE FlexibleInstances #-} module Language.Nano.Errors where import Debug.Trace import Text.Printf import Text.PrettyPrint.HughesPJ import Language.ECMAScript3.PrettyPrint bugBadPhi l t1s t2s = printf "BUG: Unbalanced Phi at %s \n %s \n %s" (ppshow l) (...
UCSD-PL/nano-js
Language/Nano/Errors.hs
Haskell
bsd-3-clause
2,435
module Paths_language_c_quote_utils ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName ) where import Data.Version (Version(..)) import System.Environment (getEnv) version :: Version version = Version {versionBranch = [0,0,0,1], versionTags = []} bindir, libdir, datadir, libexe...
jfischoff/language-c-quote-utils
dist/build/autogen/Paths_language_c_quote_utils.hs
Haskell
bsd-3-clause
1,119
import Network import Control.Concurrent import System.IO main = withSocketsDo $ do sock <- listenOn $ PortNumber 5002 loop sock loop sock = do (h,_,_) <- accept sock forkIO $ body h loop sock where body h = do hPutStr h msg hFlush h hClose h msg = "HTTP/1.1 200 OK\r\nCon...
aycanirican/hlibev
Examples/BasicConcurrent.hs
Haskell
bsd-3-clause
358
-- just fire up ghci, :load Smt.hs and run `go file.smt2` module Smt where import qualified Data.Text.Lazy.IO as T import Language.Fixpoint.Config (SMTSolver (..)) import Language.Fixpoint.Parse import Language.Fixpoint.SmtLib2 import System.Environment main = do f:_ <- getArgs _ <- go f ...
rolph-recto/liquid-fixpoint
tests/smt2/Smt.hs
Haskell
bsd-3-clause
558
{-# LANGUAGE BangPatterns, FlexibleInstances, OverloadedStrings, TypeSynonymInstances #-} module Main ( main ) where import Control.Applicative import Criterion.Main import Data.ByteString (ByteString) import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import qualified Data....
solidsnack/cassava
benchmarks/Benchmarks.hs
Haskell
bsd-3-clause
2,992
{-# LANGUAGE DeriveDataTypeable, PatternGuards, FlexibleInstances, MultiParamTypeClasses, CPP #-} -- deriving Typeable for ghc-6.6 compatibility, which is retained in the core ----------------------------------------------------------------------------- -- | -- Module : XMonad.Hooks.ManageDocks -- Copyright : ...
markus1189/xmonad-contrib-710
XMonad/Hooks/ManageDocks.hs
Haskell
bsd-3-clause
10,132
<?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="pt-BR"> <title>Revisitar | Extensão ZAP</title> <maps> <homeID>top</homeID> <mapref loc...
kingthorin/zap-extensions
addOns/revisit/src/main/javahelp/org/zaproxy/zap/extension/revisit/resources/help_pt_BR/helpset_pt_BR.hs
Haskell
apache-2.0
972
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Lazyfoo.Lesson07 (main) where import Control.Monad import Foreign.C.Types import Linear import SDL (($=)) import qualified SDL import Paths_sdl2 (getDataFileName) #if !MIN_VERSION_base(4,8,0) import Control.Applicative #endif screenWidth, screenHeight :...
tejon/sdl2
examples/lazyfoo/Lesson07.hs
Haskell
bsd-3-clause
1,760
module Foo () where import Data.Set (Set(..)) {-@ include <selfList.hquals> @-} {-@ invariant {v0:[{v: a | (Set_mem v (listElts v0))}] | true } @-} {-@ type IList a = {v0: [{v:a | (Set_mem v (listElts v0))}] | true } @-} {-@ moo :: [a] -> IList a @-} moo [] = [] moo (_:xs) = xs goo [] = [] goo (_:xs) ...
abakst/liquidhaskell
tests/pos/selfList.hs
Haskell
bsd-3-clause
410
----------------------------------------------------------------------------- -- | -- Module : XMonad.Prompt.Theme -- Copyright : (C) 2007 Andrea Rossato -- License : BSD3 -- -- Maintainer : andrea.rossato@unibz.it -- Stability : unstable -- Portability : unportable -- -- A prompt for changing the t...
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Prompt/Theme.hs
Haskell
bsd-2-clause
1,628
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Makefile Dependency Generation -- -- (c) The University of Glasgow 2005 -- ----------------------------------------------------------------------------- module DriverMkDepend ( doMkDependHS ) where #inc...
forked-upstream-packages-for-ghcjs/ghc
compiler/main/DriverMkDepend.hs
Haskell
bsd-3-clause
14,693
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} module Shexkell.Data.ShapeMap where import qualified Data.Map as Map import Data.RDF import Data.List import Data.Maybe (fromJust) import Shexkell.Data.ShEx hiding (shapes) import Shexkel...
weso/shexkell
src/Shexkell/Data/ShapeMap.hs
Haskell
mit
2,610
isPrime :: Integer -> Bool isPrime n | n == 1 = False | n > 1 = and [ mod n i /= 0 | i <- [2..n], i*i <= n] | otherwise = False factorize :: Integer -> [Integer] factorize n = factorize_worker n 2 factorize_worker :: Integer -> Integer -> [Integer] factorize_worker n factor | n == 1 = [] | mod n factor ...
mino2357/Hello_Haskell
src/test.hs
Haskell
mit
860
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volumes-host.html module Stratosphere.ResourceProperties.ECSTaskDefinitionHostVolumeProper...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ECSTaskDefinitionHostVolumeProperties.hs
Haskell
mit
1,676
{-# LANGUAGE OverloadedStrings #-} module VDOM.Adapter.Types where import Data.Int import Data.Word import Data.Text data Property = Property { propertyName :: String , propertyValue :: JSProp } deriving (Show) data VNodeAdapter = VNodeAdapter { vNodeAdapterTagName :: String , vNodeAdapterInnerText :: String...
smurphy8/shakespeare-dynamic
vdom-adapter/src/VDOM/Adapter/Types.hs
Haskell
mit
1,146
module Main(main) where import Snap.Snaplet import Snap import Site main :: IO () main = do (_, site, _) <- runSnaplet Nothing haskitterInit quickHttpServe site -- Start the Snap server
lkania/Haskitter
src/Main.hs
Haskell
mit
204
{-# htermination show :: (Show a) => (Maybe a) -> String #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_show_10.hs
Haskell
mit
61
module Y2017.M08.D04.Exercise where -- below import available via 1HaskellADay git repository import Y2017.M08.D01.Exercise {-- Yesterday we looked at a rot13 cypher, but that was unsatifactory for a couple of reasons: 1. it rotted down low on the 13 only. What if you want to rot 12? Would you have to write a whole...
geophf/1HaskellADay
exercises/HAD/Y2017/M08/D04/Exercise.hs
Haskell
mit
1,756
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternSynonyms #-} module Unison.TypePrinter where import Unison.Prelude import qualified Data.Map as Map import Unison.HashQualified (HashQualified) import Unison.Name ( Name ) import Unison.NamePrinter (...
unisonweb/platform
parser-typechecker/src/Unison/TypePrinter.hs
Haskell
mit
7,559
{-# LANGUAGE ExistentialQuantification #-} module Jakway.Blackjack.Util where import Data.List (elemIndex) import System.IO import System.Exit hiding (die) import System.Console.GetOpt import Data.Maybe (catMaybes) innerMapTuple4 :: forall t t1. (t -> t1) -> (t, t, t, t) -> (t1, t1, t1, t1) innerMapTuple4 f (a,b,c,d)...
tjakway/blackjack-simulator
src/Jakway/Blackjack/Util.hs
Haskell
mit
2,422
import Control.Monad import Data.Set (Set) import qualified Data.Set as Set data Pos = Pos { x :: Int, y :: Int } deriving (Eq, Ord) data Node = Node { pos :: Pos , size :: Int , used :: Int } deriving (Eq, Ord) type State = (Pos, Pos) data Grid = Grid { wall :: Pos ...
seishun/aoc2016
day22.hs
Haskell
mit
2,020
module Main where import Network.Hubbub.Queue.Test import Network.Hubbub.SubscriptionDb.Test import Network.Hubbub.Http.Test import Network.Hubbub.Hmac.Test import Network.Hubbub.Internal.Test import Network.Hubbub.Test import Prelude (IO) import Test.Tasty (defaultMain,testGroup,TestTree) main :: IO () main = defa...
benkolera/haskell-hubbub
test/Test.hs
Haskell
mit
489
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html module Stratosphere.Resources.EC2VPCCidrBlock where import Stratosphere.ResourceImports ...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/EC2VPCCidrBlock.hs
Haskell
mit
2,426
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appstream-fleet-domainjoininfo.html module Stratosphere.ResourceProperties.AppStreamFleetDomainJoinInfo where...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/AppStreamFleetDomainJoinInfo.hs
Haskell
mit
2,315
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} module Control.Monad.Shmonad.CommandSpec (main, spec) where import Test.Hspec import GHC.TypeLits import Control.Monad.Shmonad.Expression import Control.Monad.Shmonad.Command main :: IO () main = hspec spec spec :: Spec spec = do describe "A C...
corajr/shmonad
test/Control/Monad/Shmonad/CommandSpec.hs
Haskell
bsd-2-clause
1,744
{- | Module : Cantor.Project Copyright : Copyright (C) 2014 Krzysztof Langner License : BSD3 Maintainer : Krzysztof Langner <klangner@gmail.com> Stability : alpha Portability : portable Data Types and functions for procesing project -} module Cantor.Project ( Project , projectBuildSystem ...
klangner/cantor
src/Cantor/Project.hs
Haskell
bsd-2-clause
2,960
module Rede.MainLoop.Framer( readNextChunk ,readLength ,Framer ,LengthCallback ) where import Control.Monad.Trans.Class (lift) import Control.Monad.IO.Class (MonadIO -- , liftIO ) import qualifi...
loadimpact/http2-test
hs-src/Rede/MainLoop/Framer.hs
Haskell
bsd-3-clause
2,730
{-# language PackageImports #-} -- | This module re-exports <https://hackage.haskell.org/package/indentation-parsec/docs/Text-Parsec-Indentation.html Text.Parsec.Indentation> from <https://hackage.haskell.org/package/indentation-parsec indentation-parsec>. module Text.Parsec.Indentation (module Impl) where import "ind...
lambdageek/indentation
indentation/src/Text/Parsec/Indentation.hs
Haskell
bsd-3-clause
369
{-# LANGUAGE EmptyDataDecls , OverloadedStrings , GeneralizedNewtypeDeriving , FlexibleInstances #-} module Clay.Size ( -- * Size type. Size , Abs , Rel -- * Size constructors. , px , pt , em , ex , pct -- * Shorthands for mutli size-valued properties. , sym , sym2 , sym3 -- * Angle type. , Angle ,...
bergmark/clay
src/Clay/Size.hs
Haskell
bsd-3-clause
3,373
{-# LANGUAGE ScopedTypeVariables #-} -- | This module provides convenience functions for interfacing @tls@. -- -- This module is intended to be imported @qualified@, e.g.: -- -- @ -- import "Data.Connection" -- import qualified "System.IO.Streams.TLS" as TLS -- @ -- module System.IO.Streams.TLS ( TLSConnec...
didi-FP/tcp-streams
System/IO/Streams/TLS.hs
Haskell
bsd-3-clause
3,903
-- For Scotty {-# LANGUAGE OverloadedStrings #-} import Web.Scotty import Network.Wai.Handler.Warp (defaultSettings, settingsPort, settingsHost, HostPreference (HostIPv4)) -- For Me import Control.Monad.Trans (liftIO) import Data.Text.Lazy (pack, unpack) -- Project-Internal -- TODO: Hookup internal modules listenPort ...
clockfort/mobile-webnews
webnews.hs
Haskell
bsd-3-clause
1,142
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables #-} -- | -- This package provides a function to generate a choice operator -- in lifted IO monad by specifying exceptions to be caught. module Control.Exception.IOChoice.Lifted.TH (newIOChoice) where import Control.Exception.Lifted import Language.Haskell.TH import ...
kazu-yamamoto/io-choice
Control/Exception/IOChoice/Lifted/TH.hs
Haskell
bsd-3-clause
905
{-# OPTIONS_GHC -F -pgmF tasty-discover -optF --modules="*Test.hs" -optF --debug #-}
tittoassini/typed
test/Driver.hs
Haskell
bsd-3-clause
86
import Control.Concurrent (threadDelay) import Control.Distributed.Process import Control.Distributed.Process.Node import Control.Monad (forever) import Network.Transport.TCP (createTransport, ...
igniting/cloud-haskell-example
src/SingleNode.hs
Haskell
bsd-3-clause
1,716
{-# LANGUAGE OverloadedStrings #-} module Configuration where import Data.Aeson import Control.Applicative ((<$>),(<*>)) import Control.Monad (mzero) import System.Directory (doesFileExist) import qualified Data.ByteString.Lazy as B (readFile) import System.Exit (exitFailure) -- | Contains the configuratio values da...
froozen/simple-wiki
src/Configuration.hs
Haskell
bsd-3-clause
1,510
module NaiveLensExamples where -- http://blog.jakubarnold.cz/2014/07/14/lens-tutorial-introduction-part-1.html data User = User { name :: String, age :: Int } deriving Show data Project = Project { owner :: User, value :: Int } deriving Show bob = User { name = "Bob", age = 30 } project1 = Project { owner = bob, val...
peterbecich/haskell-programming-first-principles
src/NaiveLensExamples.hs
Haskell
bsd-3-clause
1,163
{-# LANGUAGE OverloadedStrings #-} module Network.HPACK.Table.Entry ( -- * Type Size , Entry(..) , Header -- re-exporting , HeaderName -- re-exporting , HeaderValue -- re-exporting , Index -- re-exporting -- * Header and Entry , toEntry , toEntryToken -- * Getters , entrySize , ...
kazu-yamamoto/http2
Network/HPACK/Table/Entry.hs
Haskell
bsd-3-clause
2,406
{-# LANGUAGE OverloadedStrings #-} module YaLedger.Output.ASCII where import Data.List import Data.String import YaLedger.Output.Formatted import YaLedger.Output.Tables data ASCII = ASCII deriving (Eq, Show) align :: Int -> Align -> FormattedText -> FormattedText align w ALeft str | textLength str >= w = takeTe...
portnov/yaledger
YaLedger/Output/ASCII.hs
Haskell
bsd-3-clause
4,421
{-# LANGUAGE MultiWayIf, RecordWildCards, ScopedTypeVariables, TemplateHaskell, NoImplicitPrelude #-} module Schedule ( Schedule, PartialSchedule(..), schPastGames, schPlayerCount, schCurrent, schBest, schIterationsTotal, schIterationsLeft, randomSchedule, advancePartialSchedule, p...
neongreen/hat
src/Schedule.hs
Haskell
bsd-3-clause
11,878
{-# LANGUAGE TemplateHaskell #-} {- | Module : Verifier.SAW.Cryptol.Prelude Copyright : Galois, Inc. 2012-2015 License : BSD3 Maintainer : huffman@galois.com Stability : experimental Portability : non-portable (language extensions) -} module Verifier.SAW.Cryptol.PreludeM ( Module , module Verifier.S...
GaloisInc/saw-script
cryptol-saw-core/src/Verifier/SAW/Cryptol/PreludeM.hs
Haskell
bsd-3-clause
532
module QueryArrow.ElasticSearch.Record where import Data.Aeson (parseJSON, toJSON, FromJSON, ToJSON, Value) import Data.Map.Strict (Map, union, delete) import Data.Text (Text) import Control.Applicative ((<$>)) newtype ESRecord = ESRecord (Map Text Value) deriving Show instance FromJSON ESRecord where parseJSON ...
xu-hao/QueryArrow
QueryArrow-db-elastic/src/QueryArrow/ElasticSearch/Record.hs
Haskell
bsd-3-clause
656
module Matterhorn.Draw.ReactionEmojiListOverlay ( drawReactionEmojiListOverlay ) where import Prelude () import Matterhorn.Prelude import Brick import Brick.Widgets.List ( listSelectedFocusedAttr ) import qualified Data.Text as T import Matterhorn.Draw.ListOverla...
matterhorn-chat/matterhorn
src/Matterhorn/Draw/ReactionEmojiListOverlay.hs
Haskell
bsd-3-clause
1,436
module SimpleModule.EvaluatorSuite ( tests ) where import Data.List (stripPrefix) import SimpleModule.Data import SimpleModule.Evaluator import SimpleModule.Parser (expression) import Test.HUnit tests :: Test tests = TestList [ testEq "Eval const" (E...
li-zhirui/EoplLangs
test/SimpleModule/EvaluatorSuite.hs
Haskell
bsd-3-clause
4,254
{-# OPTIONS_GHC -w #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-} -- | A module where tuple classes and instances are created up to 16-tuple using 'makeTupleRefs'. -- The number of classes and instances can be changed by hiding import from this m...
nboldi/references
Control/Reference/TupleInstances.hs
Haskell
bsd-3-clause
492
module Main (main) where import Prelude () import Prelude.Compat import Criterion.Main import qualified Typed.Generic as Generic import qualified Typed.Manual as Manual import qualified Typed.TH as TH main :: IO () main = defaultMain [ Generic.benchmarks , Manual.benchmarks , TH.benchmarks , Generic.decode...
sol/aeson
benchmarks/Typed.hs
Haskell
bsd-3-clause
387