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 Main where
import Lib
main :: IO ()
main = putStrLn "Hello, Main here."
| epost/psc-query | psc-query/Main.hs | Haskell | bsd-3-clause | 81 |
{-# OPTIONS_GHC -fno-warn-tabs #-}
import Common
import Hex
import Xor
main = do
putStrLn "=== Challange5 ==="
putStrLn $ hexEncode $ xorBytes message key
where
key = strToVec "ICE"
message = strToVec "Burning 'em, if you ain't quick and nimble\nI go crazy when I hear a cymbal"
| andrewcchen/matasano-cryptopals-solutions | set1/Challange5.hs | Haskell | bsd-3-clause | 286 |
module Trainer where
import System.Random
import Trainer.Internal
randomListIndex :: Double -> IO Int
randomListIndex hi = do r1 <- randomRIO (0,1)
r2 <- randomRIO (0,1)
return (floor $ positiveStdNormal hi r1 r2)
| epsilonhalbe/VocabuLambda | Trainer.hs | Haskell | bsd-3-clause | 264 |
-- polyacounting.hs
module Math.PolyaCounting where
-- Cameron, Combinatorics, p247-253
import Math.PermutationGroups
import Math.SchreierSims
import Math.QQ
import Math.MPoly
import Math.CombinatoricsCounting (factorial, choose)
-- ROTATION GROUP OF CUBE (AS PERMUTATION OF FACES)
-- 1
-- 2 3 4 5
... | nfjinjing/bench-euler | src/Math/PolyaCounting.hs | Haskell | bsd-3-clause | 5,948 |
module Scurry.Comm.Message(
ScurryMsg(..),
) where
import Control.Monad
import Data.Binary
import qualified Data.ByteString as BSS
import Data.Word
import Scurry.Types.Network
import Scurry.Peer
type PingID = Word32
-- |These are the messages we get across the network.
-- They are the management and data protoc... | dmagyar/scurry | src/Scurry/Comm/Message.hs | Haskell | bsd-3-clause | 3,581 |
{-# LANGUAGE RankNTypes #-}
{-
Copyright (C) 2012-2017 Kacper Bak, Jimmy Liang, Michal Antkiewicz <http://gsd.uwaterloo.ca>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction,... | gsdlab/clafer | src/Language/ClaferT.hs | Haskell | mit | 11,024 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
-- | High-level scenarios which can be launched.
module Pos.Launcher.Scenario
( runNode
, runNode'
, nodeStartMsg
) where
import Universum
import qualified Data.HashMap.Strict as ... | input-output-hk/cardano-sl | lib/src/Pos/Launcher/Scenario.hs | Haskell | apache-2.0 | 5,177 |
{-
Copyright 2012 Google Inc. 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 applicable law or agreed to in ... | mzero/plush | src/Plush/Server/Utilities.hs | Haskell | apache-2.0 | 3,631 |
{-# LANGUAGE BangPatterns #-}
-- This is a non-exposed internal module
--
-- The code in this module has been ripped from containers-0.5.5.1:Data.Map.Base [1] almost
-- verbatimely to avoid a dependency of 'template-haskell' on the containers package.
--
-- [1] see https://hackage.haskell.org/package/containers-0.5.5.... | rahulmutt/ghcvm | libraries/eta-meta/Language/Eta/Meta/Lib/Map.hs | Haskell | bsd-3-clause | 549 |
{-# LANGUAGE Haskell98 #-}
{-# LINE 1 "Data/ByteString/Lazy/Builder/Extras.hs" #-}
-- | We decided to rename the Builder modules. Sorry about that.
--
-- The old names will hang about for at least once release cycle before we
-- deprecate them and then later remove them.
--
module Data.ByteString.Lazy.Builder.Extras (... | phischu/fragnix | tests/packages/scotty/Data.ByteString.Lazy.Builder.Extras.hs | Haskell | bsd-3-clause | 406 |
{-# LANGUAGE RecordWildCards #-}
-- | Build configuration
module Stack.Config.Build where
import Data.Maybe
import Data.Monoid.Extra
import Stack.Types.Config
-- | Interprets BuildOptsMonoid options.
buildOptsFromMonoid :: BuildOptsMonoid -> BuildOpts
buildOptsFromMonoid BuildOptsMonoid... | mrkkrp/stack | src/Stack/Config/Build.hs | Haskell | bsd-3-clause | 4,419 |
module Comment00004 where
dropBitMask xs
| t = 1
-- | otherwise = go
| charleso/intellij-haskforce | tests/gold/parser/Comment00004.hs | Haskell | apache-2.0 | 80 |
{-# LANGUAGE RecordWildCards #-}
module Test.Haddock
( module Test.Haddock.Config
, runAndCheck, runHaddock, checkFiles
) where
import Control.Monad
import Data.Maybe
import System.Directory
import System.Exit
import System.FilePath
import System.IO
import System.Process
import qualified Data.ByteStri... | Helkafen/haddock | haddock-test/src/Test/Haddock.hs | Haskell | bsd-2-clause | 5,180 |
{-# LANGUAGE FlexibleInstances #-}
module SafeInfered05_A where
class C a where
f :: a -> String
instance C [Int] where
f _ = "[Int]"
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/safeHaskell/safeInfered/SafeInfered05_A.hs | Haskell | bsd-3-clause | 141 |
module T8603 where
import Control.Monad
import Data.Functor
import Control.Monad.Trans.Class( lift )
import Control.Monad.Trans.State( StateT )
newtype RV a = RV { getPDF :: [(Rational,a)] } deriving (Show, Eq)
instance Functor RV where
fmap f = RV . map (\(x,y) -> (x, f y)) . getPDF
instance Monad RV where
ret... | urbanslug/ghc | testsuite/tests/typecheck/should_fail/T8603.hs | Haskell | bsd-3-clause | 745 |
-- list comprehensions
-- Applying an expression to each value in a list
ghci> [x*2 | x <- [1..10]]
[2,4,6,8,10,12,14,16,18,20]
-- And also filtering out some of the values
ghci> [x*2 | x <- [1..10], x*2 > 12 ]
[14,16,18,20]
-- Using a function to filter out some of the vaalues
ghci> [x | x <- [50..100], x `mod` 7 =... | claremacrae/haskell_snippets | list_comprehensions.hs | Haskell | mit | 1,470 |
module RandomExample where
import Control.Applicative (liftA3)
import Control.Monad (replicateM)
import Control.Monad.Trans.State
import System.Random
-- newtype State s a =
-- State { runState :: s -> (a, s) }
-- Six-sided die
data Die =
DieOne
| DieTwo
| DieThree
| DieFour
| DieFive
| DieSix
der... | mitochon/hexercise | src/haskellbook/ch23/ch23.hs | Haskell | mit | 2,290 |
import Network.SimpleServe (listen, makeStore)
main :: IO ()
main = do
store <- makeStore
listen store
| ngasull/hs-simple-serve | src/Main.hs | Haskell | mit | 108 |
{-
Parser.hs: Parser for the Flounder interface definition language
Part of Flounder: a strawman device definition DSL for Barrelfish
Copyright (c) 2009, ETH Zurich.
All rights reserved.
This file is distributed under the terms in the attached LICENSE file.
If you do not ... | modeswitch/barrelfish | tools/fugu/Parser.hs | Haskell | mit | 2,938 |
-- String array joining in Haskell
-- http://www.codewars.com/kata/5436bb1df0c10d280900131f
module JoinedWords where
joinS :: [String] -> String -> String
joinS l s = drop (length s) (foldl (\str w -> str ++ s ++ w) "" l)
| gafiatulin/codewars | src/7 kyu/JoinedWords.hs | Haskell | mit | 224 |
module Main where
import Marc
import Data.List
import System.Environment
import Options.Applicative
data MarcDumpOptions = MarcDumpOptions
{
file :: String
,recordNumbersAndOffsets :: Bool
}
runWithOptions :: MarcDumpOptions -> IO ()
runWithOptions opts = do
s <- readFile $ file opts
let records = readBa... | ccatalfo/marc | src/Main.hs | Haskell | mit | 714 |
import Text.ParserCombinators.Parsec hiding (spaces)
import System.Environment
import Control.Monad
data LispVal = Atom String
| List [LispVal]
| DottedList [LispVal] LispVal
| Number Integer
| String String
| Bool Bool
parseString :: Parser LispVal
parseString = do
char '"'
x <- many (non... | mmwtsn/write-yourself-a-scheme | 02-parsing/exercises/01-with-do.hs | Haskell | mit | 1,145 |
module Bassbull where
import qualified Data.ByteString.Lazy as BL
import qualified Data.Foldable as F
import Data.Csv.Streaming
-- a simple type alias for data
type BaseballStats = (BL.ByteString, Int, BL.ByteString, Int)
getAtBatsSum :: FilePath -> IO Int
getAtBatsSum battingCsv = do
csvData <- BL.readFile batt... | Sgoettschkes/learning | haskell/HowIStart/bassbull/src/Bassbull.hs | Haskell | mit | 583 |
{-# LANGUAGE BangPatterns #-}
-- Copyright © 2012 Bart Massey
-- [This program is licensed under the "MIT License"]
-- Please see the file COPYING in the source
-- distribution of this software for license terms.
import Control.Exception
import Control.Monad
import Data.Array.IO
import qualified Data.Bits as B
import ... | BartMassey/ciphersaber | ciphersaber.hs | Haskell | mit | 4,381 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Lucid.Server where
import Control.Monad
import qualified Data.ByteString.Char8 as SC
import Happstack.Server
import Lucid
-- | happstack server utils
serve :: ServerPart Response -> ... | tonyday567/hdcharts | src/Lucid/Server.hs | Haskell | mit | 753 |
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module Hydrazine.Server.Boxen where
import Servant
import Control.Monad.Trans.Either
import Data.Functor.Identity
import Data.Time.LocalTime
import Control.Monad
import Data.Maybe
import Control.Monad.Trans.Class
impo... | dgonyeo/hydrazine | src/Hydrazine/Server/Boxen.hs | Haskell | mit | 10,840 |
-- mood.hs
module MoodIsBlahOrWoot where
data Mood = Blah | Woot deriving Show
changeMood Blah = Woot
changeMood _ = Blah
| Lyapunov/haskell-programming-from-first-principles | chapter_4/mood.hs | Haskell | mit | 127 |
module Problem17 where
import Data.Char (isSpace)
main = print $ sum $ map (length . filter (not . isSpace) . spellIt) [1..1000]
spellIt :: Int -> String
spellIt 1000 = "one thousand"
spellIt n | n >= 100 = spellIt (n `div` 100) ++ " hundred" ++ sep " and " (spellIt (n `rem` 100))
| n >= 90 = "ninety" ++... | DevJac/haskell-project-euler | src/Problem17.hs | Haskell | mit | 1,304 |
{-# LANGUAGE NoImplicitPrelude #-}
-- |
-- Module: TestCase
-- Description: All test cases aggregated and exported as tests :: [Test].
-- Copyright: Copyright (c) 2015-2016 Jan Sipr
-- License: MIT
--
-- Stability: stable
-- Portability: NoImplicitPrelude
--
-- All test cases aggregated and exported ... | Siprj/ragnarok | test/TestCase.hs | Haskell | mit | 2,111 |
{-# language NoImplicitPrelude, DoAndIfThenElse, OverloadedStrings, ExtendedDefaultRules #-}
{-# LANGUAGE CPP, ScopedTypeVariables #-}
-- | Description : Argument parsing and basic messaging loop, using Haskell
-- Chans to communicate with the ZeroMQ sockets.
module Main (main) where
import ... | sumitsahrawat/IHaskell | main/Main.hs | Haskell | mit | 18,868 |
{-
- Whidgle.Rules
-
- A mixture of game rules and heuristics.
-}
-- export everything
module Whidgle.Rules where
import Control.Lens
import Data.Function
import Whidgle.Types
-- How many steps away an opponent can be before we consider the possibility of attack behavior.
reasonablyClose :: Int
reasonablyClose ... | Zekka/whidgle | src/Whidgle/Rules.hs | Haskell | mit | 2,374 |
module Hecate.Error (module Hecate.Error) where
import Control.Exception (Exception)
import Data.Typeable (Typeable)
import TOML (TOMLError)
-- | 'AppError' represents application errors
data AppError
= CsvDecoding String
| TOML TOMLError
| Configuration String
... | henrytill/hecate | src/Hecate/Error.hs | Haskell | apache-2.0 | 1,021 |
module Redigo where
| aloiscochard/redigo | src/Redigo.hs | Haskell | apache-2.0 | 20 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE JavaScriptFFI #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PackageImports #-}
{-
Copyright 2015 Google Inc. All rights reserved.
Licensed un... | d191562687/codeworld | codeworld-base/src/Internal/DeepEq.hs | Haskell | apache-2.0 | 2,323 |
module Segments.Common.Time where
import Data.Time (formatTime, defaultTimeLocale)
import Data.Time.LocalTime (getZonedTime)
import Segments.Base
-- powerline.segments.common.time.date
timeDateSegment :: SegmentHandler
timeDateSegment args _ = do
let isTime = argLookup args "istime" False
let fmt = argLook... | rdnetto/powerline-hs | src/Segments/Common/Time.hs | Haskell | apache-2.0 | 583 |
module HEP.Util.Parsing where
import Control.Monad.Identity
import Control.Exception (bracket)
import Text.Parsec
import System.IO
readConfig :: (Show a) => FilePath -> (ParsecT String () Identity a) -> IO a
readConfig fp parser = do
putStrLn fp
bracket (openFile fp ReadMode) hClose $ \fh -> do
str <- hGe... | wavewave/HEPUtil | src/HEP/Util/Parsing.hs | Haskell | bsd-2-clause | 512 |
{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-}
module Handler.Forening where
import Import
getForeningR :: Forening -> Handler Html
getForeningR forening = standardLayout $(widgetFile "forening")
| dtekcth/DtekPortalen | src/Handler/Forening.hs | Haskell | bsd-2-clause | 216 |
{-# LANGUAGE OverloadedLists #-}
module FnReps.Polynomial.UnaryChebSparse where
import FnReps.Polynomial.UnaryChebSparse.DCTMultiplication
--import Numeric.AERN.MPFRBasis.Interval
import Numeric.AERN.DoubleBasis.Interval ()
import qualified Data.HashMap.Strict as HM
{-|
Unary polynomials over the domain [-1,1]... | michalkonecny/aern | aern-fnreps/src/FnReps/Polynomial/UnaryChebSparse.hs | Haskell | bsd-3-clause | 1,628 |
{-# LANGUAGE TemplateHaskell, TypeFamilies #-}
module Linear.NURBS.Types (
Weight(..), weightPoint, weightValue, ofWeight, weight, wpoint,
Span(..), spanStart, spanEnd,
KnotData(..), knotData, knotDataAt, knotDataSpan,
NURBS(..), nurbsPoints, nurbsKnot, nurbsKnoti, nurbsDegree
) where
import Prelude.Unicode
imp... | mvoidex/nurbs | src/Linear/NURBS/Types.hs | Haskell | bsd-3-clause | 3,622 |
import Data.List (findIndex, sortBy)
import Data.Function (on)
import Data.Maybe (fromJust)
import Data.Array
import Data.Array.ST
import Control.Monad (forM_)
import Control.Monad.ST
import Text.Printf
squares = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1"... | foreverbell/project-euler-solutions | src/84.hs | Haskell | bsd-3-clause | 2,834 |
-- !!! Testing Refs
import Data.IORef
a1 =
newIORef 'a' >>= \ v ->
readIORef v >>= \ x ->
print x
a2 =
newIORef 'a' >>= \ v ->
writeIORef v 'b' >>
readIORef v >>= \ x ->
print x
a3 =
newIORef 'a' >>= \ v1 ->
newIORef 'a' >>= \ v2 ->
print (v1 == v1, v1 == v2, v2 == v2)
| FranklinChen/Hugs | tests/rts/refs.hs | Haskell | bsd-3-clause | 293 |
module EmbedTest where
import Syntax
import Driving
import Util.Miscellaneous
checkStep = Invoke "cS"
step = Invoke "s"
getAnswer = Invoke "gA"
getTime = Invoke "gT"
add = Invoke "a"
checkPerson = Invoke "cP"
movePerson = Invoke "mP"
moveLight = Invoke "mL"
times = Invoke "t"
ololo = Invoke "ololo"
g1 = [checkSte... | kajigor/uKanren_transformations | test/EmbedTest.hs | Haskell | bsd-3-clause | 1,502 |
{-# Language TypeFamilies #-}
module Data.Source.ByteString.Lazy.Char8.Offset where
import Data.Char
import Data.Source.Class
import qualified Data.ByteString.Lazy as B
data Src
= Src
{ loc :: Int
, str :: B.ByteString
} deriving (Eq,Ord,Show,Read)
mkSrc :: B.ByteString -> Src
mkSrc = Src 0
instance Source Src w... | permeakra/source | Data/Source/ByteString/Lazy/Char8/Offset.hs | Haskell | bsd-3-clause | 932 |
{-# LANGUAGE BangPatterns, CPP, Rank2Types, ScopedTypeVariables,
TypeOperators #-}
-- |
-- Module: Data.BloomFilter
-- Copyright: Bryan O'Sullivan
-- License: BSD3
--
-- Maintainer: Bryan O'Sullivan <bos@serpentine.com>
-- Stability: unstable
-- Portability: portable
--
-- A fast, space efficient Bloom filter impl... | brinchj/bloomfilter | Data/BloomFilter.hs | Haskell | bsd-3-clause | 15,366 |
-- | Facilities for composing SOAC functions. Mostly intended for use
-- by the fusion module, but factored into a separate module for ease
-- of testing, debugging and development. Of course, there is nothing
-- preventing you from using the exported functions whereever you
-- want.
--
-- Important: this module is \... | mrakgr/futhark | src/Futhark/Optimise/Fusion/Composing.hs | Haskell | bsd-3-clause | 9,930 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE UnicodeSyntax #-}
import Shake
import Foreign.Storable (sizeOf)
import System.Console.GetOpt
import ... | Heather/Shake.it.off | src/Main.hs | Haskell | bsd-3-clause | 2,343 |
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE DataKinds #-}
module Control.Eff.Internal.Eff (Eff(..),run,runM,runTCQ,send) where
import Control.Eff.Internal.Union
import Control.Eff.Internal.TCQ
data Eff r a = ... | Lazersmoke/reee-monads | src/Control/Eff/Internal/Eff.hs | Haskell | bsd-3-clause | 1,522 |
{-# LANGUAGE PackageImports #-}
import "hitweb" 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 (threadDelay)... | NicolasDP/hitweb | devel.hs | Haskell | bsd-3-clause | 707 |
{-# language CPP #-}
{-# language QuasiQuotes #-}
{-# language TemplateHaskell #-}
#ifndef ENABLE_INTERNAL_DOCUMENTATION
{-# OPTIONS_HADDOCK hide #-}
#endif
module OpenCV.Internal.Core.Types.Point.TH
( mkPointType
) where
import "base" Data.List ( intercalate )
import "base" Data.Monoid ( (<>) )
import "base" Fo... | lukexi/haskell-opencv | src/OpenCV/Internal/Core/Types/Point/TH.hs | Haskell | bsd-3-clause | 6,656 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
module ZM.Type.Float64(IEEE_754_binary64(..)) where
import Data.Model
import ZM.Type.Bits11
import ZM.Type.Bits52
import ZM.Type.Words
-- |An IEEE-754 Big Endian 64 bits Float
data IEEE_754_binary64 =
IEEE_7... | tittoassini/typed | src/ZM/Type/Float64.hs | Haskell | bsd-3-clause | 513 |
{-# LANGUAGE OverloadedStrings #-}
import qualified Graphics.UI.Threepenny as UI
import Graphics.UI.Threepenny.Core
import Foundation.Common
import Examples.Blog
import Control.Applicative
import Control.Monad
import Data.List (intersperse)
main :: IO ()
main = do
startGUI Config
{ tpPort = 10000
, t... | kylcarte/threepenny-extras | src/Examples/BlogTest.hs | Haskell | bsd-3-clause | 2,566 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.CSL.Eval.Date
-- Copyright : (c) Andrea Rossato
-- License : BSD-style (see LICENSE)
--
-- Maintainer : ... | jgm/pandoc-citeproc | src/Text/CSL/Eval/Date.hs | Haskell | bsd-3-clause | 10,495 |
{-| The API part of @feed-gipeda@. The console client is just a thin wrapper
around this.
-}
module FeedGipeda
( Endpoint (..)
, feedGipeda
, module FeedGipeda.Types
) where
import Control.Arrow (second)
import Control.Concurrent (forkIO)
import ... | sgraf812/feed-gipeda | src/FeedGipeda.hs | Haskell | bsd-3-clause | 4,308 |
module Main where
import System.Environment
import Language.Sheo.Parser
import Language.Sheo.Printer
compile :: String -> IO ()
compile fileName = do prgm <- parse fileName
case prgm of
Just p' -> print $ prettyPrint p'
Nothing -> return ()
u... | forestbelton/sheo | app/Main.hs | Haskell | bsd-3-clause | 519 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE DataKinds #-}
module Main where
import Data.Default
import Text.Haiji
import qualified Data.Text as T
import qualified Data.Text.Lazy as LT
import qualified Data.Text.Lazy.IO as LT
main :: IO ()
main = LT.put... | notogawa/haiji | example.hs | Haskell | bsd-3-clause | 828 |
-- | UI of inventory management.
module Game.LambdaHack.Client.UI.InventoryM
( Suitability(..), ResultItemDialogMode(..)
, getFull, getGroupItem, getStoreItem
, skillCloseUp, placeCloseUp, factionCloseUp
#ifdef EXPOSE_INTERNAL
-- * Internal operations
, ItemDialogState(..), accessModeBag, storeItemPrompt, g... | LambdaHack/LambdaHack | engine-src/Game/LambdaHack/Client/UI/InventoryM.hs | Haskell | bsd-3-clause | 35,792 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
module CommonRe... | Garygunn94/DFS | CommonResources/src/CommonResources.hs | Haskell | bsd-3-clause | 5,480 |
module Main where
import Data.Maybe (isNothing, isJust)
import System.IO
import Network.Socket
import qualified System.Process as SysProc
import qualified System.Process.Internals as SysProcInt (withProcessHandle, ProcessHandle__(..))
import Control.Concurrent.MVar
import qualified System.Posix.Signals as Sig
main ::... | diekmann/tinyrsh | rsh-impls/hs-idiomatic/tinyrsh/app/Main.hs | Haskell | bsd-3-clause | 2,836 |
{-# LANGUAGE RecursiveDo #-}
-- Example: Analysis of a PERT-type Network
--
-- It is described in different sources [1, 2]. So, this is chapter 14 of [2] and section 7.11 of [1].
--
-- PERT is a technique for evaluating and reviewing a project consisting of
-- interdependent activities. A number of books have been w... | dsorokin/aivika-experiment-chart | examples/PERT/Model.hs | Haskell | bsd-3-clause | 5,728 |
{-# LANGUAGE OverloadedStrings #-}
module KAT_PubKey.DSA (dsaTests) where
import qualified Crypto.PubKey.DSA as DSA
import Crypto.Hash
import Imports
data VectorDSA = VectorDSA
{ pgq :: DSA.Params
, msg :: ByteString
, x :: Integer
, y :: Integer
, k :: Integer
, r :: Integer
, s :: Integ... | vincenthz/cryptonite | tests/KAT_PubKey/DSA.hs | Haskell | bsd-3-clause | 31,104 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.C.String
-- Copyright : (c) The FFI task force 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : ... | rahulmutt/ghcvm | libraries/base/Foreign/C/String.hs | Haskell | bsd-3-clause | 14,674 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
module HERMIT.Dictionary.Unfold
( externals
, betaReducePlusR
, unfoldR
, unfoldPredR
, unfoldNameR
, unfoldNamesR
, unfoldSaturatedR
, specializeR
) whe... | conal/hermit | src/HERMIT/Dictionary/Unfold.hs | Haskell | bsd-2-clause | 4,084 |
module IOFullyQualifiedUsed where
import qualified System.IO (putStrLn)
main :: IO ()
main = System.IO.putStrLn "test"
| serokell/importify | test/test-data/base@basic/24-IOFullyQualifiedUsed.hs | Haskell | mit | 121 |
{-|
Module : Idris.Completion
Description : Support for command-line completion at the REPL and in the prover.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
module Idris.Completion (replCompletion, proverCompletion) where
import Idris.AbsSyntax (runIO)
import Idris.AbsSyntaxTree
import Id... | markuspf/Idris-dev | src/Idris/Completion.hs | Haskell | bsd-3-clause | 9,713 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
module TcCustomSolverSuper where
import GHC.TypeLits
import Data.Typeable
{-
When solving super-class instances, GHC solves the evidence without
using the solver (see `tcSuperClasses` in `TcInstDecls`).
However, some classes need to be excepted from this... | sdiehl/ghc | testsuite/tests/typecheck/should_compile/TcCustomSolverSuper.hs | Haskell | bsd-3-clause | 726 |
<?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="sr-SP">
<title>AJAX Spider | ZAP Extensions</title>
<maps>
<homeID>top</homeID>
<mapref... | kingthorin/zap-extensions | addOns/spiderAjax/src/main/javahelp/org/zaproxy/zap/extension/spiderAjax/resources/help_sr_SP/helpset_sr_SP.hs | Haskell | apache-2.0 | 973 |
{-# LANGUAGE CPP #-}
module Distribution.Simple.GHCJS (
configure, getInstalledPackages, getPackageDBContents,
buildLib, buildExe,
replLib, replExe,
startInterpreter,
installLib, installExe,
libAbiHash,
hcPkgInfo,
registerPackage,
componentGhcOptio... | Helkafen/cabal | Cabal/Distribution/Simple/GHCJS.hs | Haskell | bsd-3-clause | 41,352 |
{-# LANGUAGE OverloadedStrings #-}
module Clay.Attributes where
import Clay.Selector
-- From: http://www.whatwg.org/specs/web-apps/current-work/multipage/section-index.html#index
accept, acceptCharset, accesskey, action, alt, async, autocomplete, autofocus,
autoplay, challenge, charset, checked, class_, cols, cols... | Heather/clay | src/Clay/Attributes.hs | Haskell | bsd-3-clause | 3,332 |
{-# LANGUAGE DataKinds, TypeOperators, TypeFamilies #-}
{-# LANGUAGE UndecidableInstances, ScopedTypeVariables, FlexibleContexts #-}
module T11990b where
import GHC.TypeLits
import Data.Proxy
type family PartialTF t :: Symbol where
PartialTF Int = "Int"
PartialTF Bool = "Bool"
PartialTF a = TypeError (Text... | ezyang/ghc | testsuite/tests/typecheck/should_fail/T11990b.hs | Haskell | bsd-3-clause | 981 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, RoleAnnotations #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Ptr
-- Copyright : (c) The FFI Task Force, 2000-2002
-- License : see libraries/base/... | tolysz/prepare-ghcjs | spec-lts8/base/GHC/Ptr.hs | Haskell | bsd-3-clause | 6,465 |
{-# OPTIONS_GHC -O -funbox-strict-fields #-}
-- The combination of unboxing and a recursive newtype crashed GHC 6.6.1
-- Trac #1255
-- Use -O to force the unboxing to happen
module Foo where
newtype Bar = Bar Bar -- Recursive
data Gah = Gah { baaz :: !Bar }
| urbanslug/ghc | testsuite/tests/typecheck/should_compile/tc226.hs | Haskell | bsd-3-clause | 265 |
module HAD.Y2014.M03.D21.Exercise where
-- $setup
-- >>> import Test.QuickCheck
-- >>> import Data.Maybe (fromJust)
-- | minmax
-- get apair of the min and max element of a list (in one pass)
-- returns Nothing on empty list
--
-- Point-free: checked
--
-- The function signature follows the idea of the methods in the... | geophf/1HaskellADay | exercises/HAD/Y2014/M03/D21/Exercise.hs | Haskell | mit | 722 |
{-# LANGUAGE Arrows, FlexibleContexts #-}
module QNDA.ImageReader where
import Text.XML.HXT.Core hiding (xshow)
import System.Directory (copyFile, doesFileExist, getCurrentDirectory)
import qualified System.FilePath.Posix as FP
import qualified System.Process as Prc (readProcess)
import Network.HTTP.Base (urlEnco... | k16shikano/wikipepub | QNDA/ImageReader.hs | Haskell | mit | 2,938 |
{-# LANGUAGE PatternGuards #-}
-----------------------------------------------------------------------------
-- |
-- Module : Game.Tournament
-- Copyright : (c) Eirik Albrigtsen 2012
-- License : MIT
-- Maintainer : Eirik <clux> Albrigtsen
-- Stability : unstable
--
-- Tournament construction and mai... | clux/tournament.hs | Game/Tournament.hs | Haskell | mit | 29,171 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE QuasiQuotes #-}
module AoC201607
( runDay,
) where
import Data.List (tails)
import Str
import Text.Parsec
import Text.Parsec.String
runDay :: IO ()
runDay = do
let tlsCount = execute addressesParser fullInput
let sslCount = execute2 addressesParser fullInput
p... | rickerbh/AoC | AoC2016/src/AoC201607.hs | Haskell | mit | 183,702 |
{-# LANGUAGE DeriveFunctor #-}
module Compiler.PreAST.Type.Statement where
import Compiler.Serializable
import Compiler.PreAST.Type.Symbol
import Compiler.PreAST.Type.Expression
--------------------------------------------------------------------------------
-- Statement
data Statement a = Assignment a (Expression ... | banacorn/mini-pascal | src/Compiler/PreAST/Type/Statement.hs | Haskell | mit | 1,334 |
-- | This module provides utilities for rendering the 'Ann' type of the
-- API. 'Ann' gives extra structure to textual information provided by
-- the backend, by adding nested annotations atop the text.
--
-- In the current School of Haskell code, 'Ann' is used for source
-- errors and type info. This allows things lik... | fpco/schoolofhaskell | soh-client/src/View/Annotation.hs | Haskell | mit | 5,613 |
{-# htermination elemIndex :: (Eq a, Eq k) => (a, k) -> [(a, k)] -> Maybe Int #-}
import List
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/List_elemIndex_12.hs | Haskell | mit | 94 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RecordWildCards #-}
module Main where
import qualified Data.ByteString.Char8 as B8
import Data.Char (toLower)
import Data.Monoid
import qualified Data.Text as T
import Myracloud
import Myracloud.Types hiding (value)
import Opti... | zalora/myrapi | src/Main.hs | Haskell | mit | 4,358 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
module Betfair.APING.Types.InstructionReportStatus
... | joe9/betfair-api | src/Betfair/APING/Types/InstructionReportStatus.hs | Haskell | mit | 739 |
module Main where
import Base
import Simple
import Infeasible
import Clustering
import Stupid
main :: IO ()
main
= do putStrLn "Simple"
simple
putStrLn "Infeasible"
infeasible
putStrLn "Clustering"
clustering
putStrLn "Stupid"
stupid
| amosr/limp-cbc | examples/Test.hs | Haskell | mit | 296 |
module Handler.Github where
import Import
import Blaze.ByteString.Builder (copyByteString, toByteString)
getGithubR :: Handler ()
getGithubR = do
_ <- requireProfile
mdest <- lookupGetParam "dest"
dest <-
case mdest of
Nothing -> fmap ($ ProfileR) getUrlRender
Just dest -> ... | fpco/schoolofhaskell.com | src/Handler/Github.hs | Haskell | mit | 1,365 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module SyntheticWeb.Observer
( service
) where
import Control.Applicative ((<|>))
import Control.Monad (forM_)
import Control.Monad.IO.Class (liftIO)
import qualified Data.ByteString.Char8 as BS
import Data.Time (NominalDiffTime)
import ... | kosmoskatten/synthetic-web | src/SyntheticWeb/Observer.hs | Haskell | mit | 5,709 |
module Carbon.DataStructures.Trees.SelfBalancingBinarySearchTree (Tree (..), create, from_list, to_list, remove, removeall, count, find, size, height, add, prettyprint, rotate_cw, rotate_ccw) where
import qualified Carbon.DataStructures.Trees.GenericBinaryTree as GenericBinaryTree
import Data.List (foldl')
import Deb... | Raekye/Carbon | haskell/src/Carbon/DataStructures/Trees/SelfBalancingBinarySearchTree.hs | Haskell | mit | 5,693 |
module Main where
import Serve
import Handler.Scim.Portal
main = serve "13573" scimPortalHandler | stnma7e/scim_serv | portal/Main.hs | Haskell | mit | 98 |
--------------------------------------------------------------------------------
-- |
-- Module : System.Socket.Unsafe
-- Copyright : (c) Lars Petersen 2015
-- License : MIT
--
-- Maintainer : info@lars-petersen.net
-- Stability : experimental
---------------------------------------------------------... | lpeterse/haskell-socket | src/System/Socket/Unsafe.hs | Haskell | mit | 3,952 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Solver where
import Control.Monad
import Control.Monad.Loops
import Data.Bifunctor
import Data.List
import Data.List.HT
import Data.Monoid
import Data.Ratio
import qualified Gaussian as G
{-
Notes about this module:
for the purpose o... | Javran/misc | gaussian-elim/src/Solver.hs | Haskell | mit | 6,510 |
-- | Data.TSTP.V module.
-- Adapted from https://github.com/agomezl/tstp2agda.
module Data.TSTP.V
( V
( V )
) where
------------------------------------------------------------------------------
import Athena.Utils.PrettyPrint ( Pretty ( pretty ) )
import Athena.Translation.Utils ( stdName )
-------------... | jonaprieto/athena | src/Data/TSTP/V.hs | Haskell | mit | 696 |
{-# language NoImplicitPrelude, DoAndIfThenElse, OverloadedStrings, ExtendedDefaultRules #-}
{-# LANGUAGE CPP #-}
-- | Description : Shell scripting wrapper using @Shelly@ for the @notebook@, and
-- @console@ commands.
module IHaskell.IPython (
replaceIPythonKernelspec,
defaultConfFile,
get... | sumitsahrawat/IHaskell | src/IHaskell/IPython.hs | Haskell | mit | 10,974 |
module Monoid3 where
import Data.Semigroup
import Test.QuickCheck
import SemiGroupAssociativeLaw
import MonoidLaws
import ArbitrarySum
data Two a b = Two a b deriving (Eq, Show)
instance (Semigroup a, Semigroup b) => Semigroup (Two a b) where
(Two x1 y1) <> (Two x2 y2) = Two (x1 <> x2) (y1 <> y2)
instance... | NickAger/LearningHaskell | HaskellProgrammingFromFirstPrinciples/Chapter15.hsproj/Monoid3.hs | Haskell | mit | 869 |
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, OverloadedStrings #-}
{-
compatibility with older GHC
-}
module Compiler.Compat ( PackageKey
, packageKeyString
, modulePackageKey
, stringToPackageKey
, primPackageKey
... | ghcjs/ghcjs | src/Compiler/Compat.hs | Haskell | mit | 3,659 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{- |
This is where all the real code for the cartographer lives.
-}
module Network.Eureka.Cartographer.HTTP (
Config(..),
withEureka,
website
) where
import Prelude hiding (lookup)... | SumAll/haskell-cartographer-server | src/Network/Eureka/Cartographer/HTTP.hs | Haskell | apache-2.0 | 7,188 |
module FFMpegCommandSpec where
import Test.HUnit
import FFMpegCommand
runFFMpegCommandTests = runTestTT tests
tests = TestList [ TestLabel "Test Single Time" testSingleTime
, TestLabel "Test Two Times" testTwoTimes ]
testSingleTime = TestCase (
assertEqual "test.mkv 00:00:01" (Just "ffmpeg -i tes... | connrs/ffsplitgen | test/FFMpegCommandSpec.hs | Haskell | apache-2.0 | 1,087 |
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANG... | coursestitch/coursestitch-api | lib/CourseStitch/Models/Tables.hs | Haskell | apache-2.0 | 1,841 |
-- http://www.codewars.com/kata/5467e4d82edf8bbf40000155
module DescendingOrder where
import Data.List
descendingOrder :: Integer -> Integer
descendingOrder = foldl (\acc n -> acc * 10 + n) 0 . sortBy (flip compare) . map (`mod`10) . takeWhile (>0) . iterate (`div`10)
| Bodigrim/katas | src/haskell/7-Descending-Order.hs | Haskell | bsd-2-clause | 271 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QSystemTrayIcon_h.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:18
Warning : this file is machine generated ... | keera-studios/hsQt | Qtc/Gui/QSystemTrayIcon_h.hs | Haskell | bsd-2-clause | 13,411 |
module Spring13.Week4.Week4Spec where
import Test.Hspec
import Test.QuickCheck
import Spring13.Week4.Week4
main :: IO ()
main = hspec spec
spec :: Spec
spec =
do describe "fun1'" $
do it "property" $
do property $ \xs -> fun1' xs == fun1 (xs :: [Integer])
describe "fun2'" $
do it "c... | bibaijin/cis194 | test/Spring13/Week4/Week4Spec.hs | Haskell | bsd-3-clause | 2,272 |
{-# LANGUAGE DataKinds #-}
module Data.SoftHeap.SHselect(shSelect) where
import Data.SoftHeap
import Control.Monad.ST
import Data.Natural
sOne=SSucc SZero
sTwo=SSucc sOne
sThree=SSucc sTwo
--returns
partition :: (Ord k) => [k] -> k -> Int
partition l x = undefined
slice :: Int -> Int -> [k] -> [k]
slice from to xs... | formrre/soft-heap-haskell | soft-heap/src/Data/SoftHeap/SHselect.hs | Haskell | bsd-3-clause | 1,213 |
{-# LANGUAGE LambdaCase, RankNTypes #-}
module Sloch
( LangToSloc
, PathToLangToSloc
, sloch
, summarize
, summarize'
) where
import Data.Map (Map)
import qualified Data.Map as M
import Data.Map.Extras (adjustWithDefault)
import Dirent (makeDirent, direntsAtDepth)
import Language ... | mitchellwrosen/Sloch | src/sloch/Sloch.hs | Haskell | bsd-3-clause | 1,888 |
module Traduisons.Client where
import Control.Monad.Except
import Control.Monad.State
import qualified Data.Map as M
import Data.List
import Data.List.Split
import Traduisons.API
import Traduisons.Types
import Traduisons.Util
helpMsg :: String
helpMsg = "Help yourself."
runTest :: String -> ExceptT TraduisonsError... | bitemyapp/traduisons-hs | src/Traduisons/Client.hs | Haskell | bsd-3-clause | 3,789 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.