code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
module Main where
import Options.Applicative
import ConduitWordCount
main :: IO ()
main = do
opts <- execParser optionsWithHelp
runWordCount opts
where
optionsWithHelp = info (helper <*> options)
( fullDesc
<> header "Example wc clone written using Conduit" )
options :: Parser Options
options =... | cschneid/wc-conduits | src/Main.hs | bsd-3-clause | 4,225 | 0 | 11 | 1,132 | 316 | 193 | 123 | 34 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
module App.Pages.HomePageService (getHomePageText) where
import Text.Hastache
import Text.Hastache.Context
import qualified Data.Text.Lazy.IO as TL
import Data.Text.Lazy
import App.TeamDetails.Types as Team(TeamDetails(..), Person(..))
import App.Roster.Types (TeamRoster(..), curr... | afcastano/cafe-duty | src/App/Pages/HomePageService.hs | bsd-3-clause | 2,400 | 0 | 17 | 781 | 590 | 318 | 272 | 39 | 8 |
--------------------------------------------------------------------------------
{-# LANGUAGE ForeignFunctionInterface #-}
module Firefly.Audio.Sound
( Sound
, soundFromFile
, soundFilePath
) where
--------------------------------------------------------------------------------
import Cont... | jaspervdj/firefly | src/Firefly/Audio/Sound.hs | bsd-3-clause | 1,790 | 0 | 10 | 316 | 278 | 153 | 125 | 28 | 2 |
{-#LANGUAGE MultiParamTypeClasses #-}
{-#LANGUAGE OverloadedStrings #-}
module Twilio.Recordings
( -- * Resource
Recordings(..)
, Twilio.Recordings.get
) where
import Control.Applicative
import Control.Monad.Catch
import Data.Aeson
import Data.Maybe
import Control.Monad.Twilio
import Twilio.Internal.Reques... | seagreen/twilio-haskell | src/Twilio/Recordings.hs | bsd-3-clause | 983 | 0 | 9 | 145 | 210 | 123 | 87 | 30 | 1 |
module CalculatorKata.Day3Spec (spec) where
import Test.Hspec
import CalculatorKata.Day3 (calculate)
spec :: Spec
spec = do
it "calculates one digit"
(calculate "5" == 5.0)
it "calculates many digits"
(calculate "435" == 435.0)
-- it "calculates additi... | Alex-Diez/haskell-tdd-kata | old-katas/test/CalculatorKata/Day3Spec.hs | bsd-3-clause | 620 | 0 | 11 | 204 | 120 | 62 | 58 | 13 | 1 |
module Control.OpenRTB.Auction where
{-
whats our query vocab?
maybe ands a ords
-}
data BQuery = AND [BQuery] | OR [BQuery]
| Simple AtomicQuery
data AtomicQuery = HasIPPrefix | DeviceInfo | GeoTimeZone
data Query = DaQuery {has :: BQuery,
butExcept:: RejectionRules }
{-
-}
{-
... | cartazio/hopenRTB | src/Control/OpenRTB/Auction.hs | bsd-3-clause | 427 | 1 | 9 | 103 | 92 | 58 | 34 | -1 | -1 |
{-Joseph Eremondi UU# 4229924
Utrecht University, APA 2015
Project one: dataflow analysis
March 17, 2015 -}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
module Optimize.Types where
-- |A central place to put types and definitions
-- | to avoid ... | JoeyEremondi/utrecht-apa-p1 | src/Optimize/Types.hs | bsd-3-clause | 3,559 | 0 | 13 | 790 | 518 | 310 | 208 | 43 | 1 |
module Physics.Falling.Shape.CSO
(
CSO
, AnnotatedCSO
, mkCSO
, mkCSOWithTransforms
, mkAnnotatedCSO
, mkAnnotatedCSOWithTransforms
)
where
import Physics.Falling.Math.Transform
import Physics.Falling.Shape.ImplicitShape
import Physics.Falling.Shape.TransformedShape
import Physics.Falling.Shape.MinkowskiSum
import Phy... | sebcrozet/falling | Physics/Falling/Shape/CSO.hs | bsd-3-clause | 1,489 | 0 | 10 | 291 | 481 | 264 | 217 | 27 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- | Checking for missing cases in a match expression. Based on
-- "Warnings for pattern matching" by Luc Maranget. We only detect
-- inexhaustiveness here - ideally, we would also like to check for
-- redundant cases.
module Language.Futhark.TypeChecker.Match
( unmatched,
Ma... | HIPERFIT/futhark | src/Language/Futhark/TypeChecker/Match.hs | isc | 5,410 | 0 | 19 | 1,435 | 1,981 | 1,005 | 976 | 134 | 6 |
-- |
-- Copyright : (c) 2015 Egor Tensin <Egor.Tensin@gmail.com>
-- License : MIT
-- Maintainer : Egor.Tensin@gmail.com
-- Stability : experimental
-- Portability : Windows-only
module Main (main) where
import Control.Monad (void)
import Control.Monad.Trans.Except (runExceptT)
import Data.Monoid ((<>))... | egor-tensin/windows-env | app/SetEnv.hs | mit | 2,353 | 0 | 14 | 619 | 564 | 292 | 272 | 64 | 2 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Qi.Test.Config.Identifier where
import Control.Lens
import Control.Monad.Freer
import Control.Monad.Freer.State
import Data.Default (def)
import qualified Data.HashMap.Strict ... | qmuli/qmuli | tests/Qi/Test/Config/Identifier.hs | mit | 1,214 | 0 | 12 | 371 | 280 | 162 | 118 | -1 | -1 |
{-# LANGUAGE FlexibleInstances, OverloadedStrings, FlexibleContexts #-}
{-|
Module : VizHaskell.RawRepresentation
Description : Special representation of raw JSON data
This module defines the 'RawRepresentation' class, with allows one to use
a data type that already is representable with a valid JSON contract
-}... | robarago/vizhaskell | hs/CoreRepresentacion/VizHaskell/RawRepresentation.hs | gpl-2.0 | 874 | 0 | 8 | 123 | 112 | 65 | 47 | 12 | 0 |
{-# LANGUAGE TypeApplications #-}
module Test.Pos.Chain.Txp.Gen
( genTxpConfiguration
, genPkWitness
, genRedeemWitness
, genScriptWitness
, genTx
, genTxAttributes
, genTxAux
, genTxHash
, genTxId
, genTxIn
, genTxInList
, genTxInWitn... | input-output-hk/cardano-sl | chain/test/Test/Pos/Chain/Txp/Gen.hs | apache-2.0 | 5,001 | 0 | 13 | 1,248 | 1,275 | 699 | 576 | 118 | 1 |
-- | Examples of how to use @cryptonite@.
module Crypto.Tutorial
( -- * API design
-- $api_design
-- * Hash algorithms
-- $hash_algorithms
-- * Symmetric block ciphers
-- $symmetric_block_ciphers
-- * Combining primitives
-- $combining_primitives
) where
-- $api_des... | vincenthz/cryptonite | Crypto/Tutorial.hs | bsd-3-clause | 7,954 | 0 | 3 | 1,845 | 195 | 192 | 3 | 2 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK hide #-}
module Text.Markdown.Inline
( Inline (..)
, inlineParser
, toInline
) where
import Prelude hiding (takeWhile)
import Data.Text (Text)
import qualified Data.Text as T
import Data.Attoparsec.Text
import Control.Applicative
import Data.Monoid... | beni55/markdown | Text/Markdown/Inline.hs | bsd-3-clause | 7,262 | 0 | 19 | 2,598 | 2,641 | 1,314 | 1,327 | 191 | 10 |
{-# LANGUAGE TypeOperators #-}
module Math.Probably.PlotR where
import System.Cmd
import System.Directory
import Data.List
import Data.Unique
import TNUtils
import Control.Monad.Trans
import System.IO
import Control.Monad
import Data.Maybe
data RPlotCmd = RPlCmd {
-- plotData :: String,
prePlot :: [String... | glutamate/probably | Math/Probably/PlotR.hs | bsd-3-clause | 4,665 | 0 | 21 | 1,599 | 1,414 | 726 | 688 | 98 | 1 |
-- |
-- Module : Foundation.Random
-- License : BSD-style
-- Stability : experimental
-- Portability : Good
--
-- This module deals with the random subsystem abstractions.
--
-- It provide 2 different set of abstractions:
--
-- * The first abstraction that allow a monad to generate random
-- through the 'M... | vincenthz/hs-foundation | foundation/Foundation/Random.hs | bsd-3-clause | 1,243 | 0 | 5 | 251 | 97 | 74 | 23 | 14 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{- |
Module : Network.MPD.Applicative.Mount
Copyright : (c) Joachim Fasting 2014
License : MIT
Maintainer : joachifm@fastmail.fm
Stability : stable
Portability : unportable
Mounting remote storage.
-}
module Network.MPD.Applicative.Mount
( mount
, unmount
, lis... | bens/libmpd-haskell | src/Network/MPD/Applicative/Mount.hs | lgpl-2.1 | 1,672 | 0 | 10 | 332 | 443 | 251 | 192 | 30 | 2 |
-- FIXME See how much of this module can be deleted.
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# OPTIONS -fno-warn-unused-do-bind #-}
-- | Functions for the GHC... | akhileshs/stack | src/Stack/GhcPkg.hs | bsd-3-clause | 10,591 | 0 | 19 | 3,201 | 2,723 | 1,380 | 1,343 | 230 | 3 |
module LiftToToplevel.PatBindIn1 where
--A definition can be lifted from a where or let into the surrounding binding group.
--Lifting a definition widens the scope of the definition.
--In this example, lift 'tup' defined in 'foo'
--This example aims to test renaming and the lifting of type signatures.
main :: Int
ma... | kmate/HaRe | test/testdata/LiftToToplevel/PatBindIn1.hs | bsd-3-clause | 486 | 0 | 9 | 119 | 111 | 64 | 47 | 9 | 1 |
{-|
A WAI adapter to the HTML5 Server-Sent Events API.
-}
module Network.Wai.EventSource (
ServerEvent(..),
eventSourceAppChan,
eventSourceAppIO
) where
import Data.Function (fix)
import Control.Concurrent.Chan (Chan, dupChan, readChan)
import Control.Monad.IO.Class (l... | dylex/wai | wai-extra/Network/Wai/EventSource.hs | mit | 1,245 | 0 | 16 | 307 | 264 | 146 | 118 | 24 | 2 |
{-# LANGUAGE OverloadedStrings, LambdaCase, ScopedTypeVariables, TupleSections #-}
{- |
Simple persistent cache. Cache file is deleted if the modification time
of any of the dependencies has changed.
-}
module Gen2.Cache (getCached, putCached) where
import Control.Applicative
import qualified Control.E... | danse/ghcjs | src/Gen2/Cache.hs | mit | 3,590 | 0 | 22 | 981 | 1,002 | 540 | 462 | 77 | 3 |
import Control.Concurrent
import Control.Exception
import Control.Monad
import System.IO
import System.Environment
-- test for deadlocks
main = do
hSetBuffering stdout NoBuffering
[n] <- getArgs
replicateM_ (read n) $ do
chan <- newChan
wid <- forkIO $ forever $ writeChan chan (5::Int)
... | beni55/ghcjs | test/pkg/base/Concurrent/chan002.hs | mit | 507 | 1 | 13 | 141 | 158 | 72 | 86 | 17 | 1 |
{-# LANGUAGE BangPatterns, OverloadedStrings #-}
{- The Computer Language Benchmarks Game
http://benchmarkgame.alioth.debian.org/
contributed by Bryan O'Sullivan
-}
import Control.Monad
import Data.ByteString.Unsafe
import Foreign.Ptr
import Foreign.Storable
import System.Environment
import qualified Data.... | beni55/ghcjs | test/nofib/shootout/fasta/Main.hs | mit | 2,149 | 9 | 25 | 407 | 852 | 455 | 397 | 42 | 3 |
{-# LANGUAGE TemplateHaskell #-}
module T2685a (th) where
import Language.Haskell.TH
newtype NT = C (() -> ())
th :: Q [Dec]
th = [d| foo = C undefined |]
| urbanslug/ghc | testsuite/tests/th/T2685a.hs | bsd-3-clause | 158 | 0 | 8 | 32 | 55 | 35 | 20 | 6 | 1 |
{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleContexts,OverloadedStrings,
GeneralizedNewtypeDeriving, MultiParamTypeClasses
, TemplateHaskell, TypeFamilies, RecordWildCards, DeriveGeneric, DeriveDataTypeable #-}
module Tach.Migration.Acidic.Types where
import Tach.Impulse.Types.TimeValue
-- import Tach.Impulse.T... | smurphy8/tach | core-types/tach-migration-acidic/src/Tach/Migration/Acidic/Types.hs | mit | 1,642 | 0 | 13 | 212 | 252 | 151 | 101 | 19 | 0 |
-- @Author: Zeyuan Shang
-- @Date: 2016-06-07 12:57:23
-- @Last Modified by: Zeyuan Shang
-- @Last Modified time: 2016-06-14 13:47:56
paths :: (Eq a) => a -> a -> [(a, a)] -> [[a]]
paths src dst edges
| src == dst = [[dst]]
| otherwise = [
src : path | edge <- edges, (fst edge) == src,
... | zeyuanxy/haskell-playground | ninety-nine-haskell-problems/vol9/82.hs | mit | 753 | 2 | 13 | 213 | 437 | 240 | 197 | 15 | 1 |
module Player where
data Player = O | X | None
deriving (Show, Enum, Eq)
getOther :: Player -> Player
getOther O = X
getOther X = O
readPlayerString :: String -> Player
readPlayerString "Player O" = O
readPlayerString "Player X" = X
readPlayerString "Player None" = None
readPlayerString "O" = O
read... | prydonius/Oxo | Player.hs | mit | 499 | 0 | 6 | 126 | 147 | 78 | 69 | 17 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE TypeOperators, DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
module Control.Eff.Test (testGroups) where
import Test.HUnit hiding (State)
import Test.QuickCheck
import Control.Eff
import Control... | suhailshergill/extensible-effects | test/Control/Eff/Test.hs | mit | 6,989 | 0 | 16 | 1,676 | 1,873 | 967 | 906 | -1 | -1 |
module Network.Yandex.Translate (
-- types
APIKey,
Language,
LanguagesDescr,
Direction(..),
YandexApiT,
YandexApiConfig(..),
TranslateParams(..),
-- api funcs
directions,
detect,
translate,
-- lens
apikey,
httpOptions,
format,
options,
_config,
... | bacher09/yandex-translate | src/Network/Yandex/Translate.hs | mit | 3,087 | 12 | 17 | 720 | 998 | 531 | 467 | -1 | -1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.HTMLImageElement
(js_setName, setName, js_getName, getName, js_setAlign, setAlign,
js_getAlign, getAlign, js_setAlt, setAlt, js_getAlt, getAlt,
js_setBorder, setBorder, js_getBorder, getBord... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/HTMLImageElement.hs | mit | 17,283 | 260 | 11 | 2,607 | 3,677 | 1,949 | 1,728 | 248 | 1 |
module Main where
import Options.Applicative
import qualified Data.ByteString.Char8 as BS
import Jenkins.Client (handleCmd, showError)
import Jenkins.Client.Types
import Network.HTTP.Client
import System.IO (stderr)
import System.Exit
import Options
main :: IO ()
main = do
opts <- execParser handleOpts
wi... | afiore/jenkins-tty.hs | src/Main.hs | mit | 841 | 0 | 17 | 231 | 220 | 118 | 102 | 23 | 2 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.WebGLContextAttributes (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.WebGLContextAttributes
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHC... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/WebGLContextAttributes.hs | mit | 379 | 0 | 5 | 33 | 33 | 26 | 7 | 4 | 0 |
module Main (main) where
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import Data.Char (isSpace, toUpper)
import Data.List (nub, sort, sortBy)
import System.Environment (getArgs)
import System.FilePath (takeDirectory)
import HsSearch.FileUtil (getParentPath, pathExists)
import Hs... | clarkcb/xsearch | haskell/hssearch/app/Main.hs | mit | 5,337 | 0 | 24 | 1,427 | 1,453 | 745 | 708 | 115 | 10 |
-- A palindromic number reads the same both ways. The largest
-- palindrome made from the product of two 2-digit numbers is 9009 =
-- 91 × 99.
-- Find the largest palindrome made from the product of two 3-digit numbers.
module Euler.Problem004
( solution
, palindrome
) where
solution :: Integer ... | whittle/euler | src/Euler/Problem004.hs | mit | 1,031 | 0 | 9 | 220 | 362 | 194 | 168 | 20 | 1 |
-- In ghci, you can just type simple expressions, e.g.
2 + 15
5 / 2
-- Need to put parens around negative numbers:
5 * (-3)
-- The following works if typed into ghci - but gives error when loaded, via :l arithmetic.hs
let x = 5 * 7
div 92 10 -- 9
92 `div` 10 -- backticks make it infix, so purpose is clearer
| claremacrae/haskell_snippets | arithmetic.hs | mit | 314 | 8 | 6 | 72 | 62 | 31 | 31 | -1 | -1 |
applyLog :: (a, String) -> (a -> (b,String)) -> (b, String)
applyLog (x,log) f = let (y, newLog) = f x in (y, log ++ newLog)
| rglew/lyah | applylog.hs | mit | 127 | 0 | 9 | 28 | 86 | 48 | 38 | 2 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticache-replicationgroup-nodegroupconfiguration.html
module Stratosphere.ResourceProperties.ElastiCacheRe... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/ElastiCacheReplicationGroupNodeGroupConfiguration.hs | mit | 5,108 | 0 | 12 | 351 | 539 | 306 | 233 | 42 | 1 |
-----------------------------------------------------------
---- |
---- Module: DNA
---- Description: Calculate hamming distance between DNA strands
---- Copyright: (c) 2015 Alex Dzyoba <alex.dzyoba@gmail.com>
---- License: MIT
-------------------------------------------------------------
module DNA where
dnaEquals :... | dzeban/haskell-exercism | point-mutations/haskell/point-mutations/DNA.hs | mit | 529 | 0 | 9 | 66 | 87 | 51 | 36 | 6 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-mongodbsettings.html
module Stratosphere.ResourceProperties.DMSEndpointMongoDbSettings where
im... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/DMSEndpointMongoDbSettings.hs | mit | 6,956 | 0 | 12 | 637 | 1,083 | 610 | 473 | 72 | 1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
module Control.Biegunka.Biegunka
( -- * Wrap/unwrap biegunka interpreters
biegunka
-- * Auxiliary
, expandHome
) where
import Control.Lens
import Data.Bool (boo... | biegunka/biegunka | src/Control/Biegunka/Biegunka.hs | mit | 2,821 | 0 | 19 | 743 | 654 | 369 | 285 | 61 | 1 |
import Data.List
-- yeah... just to simplify things
div' a b = (0 == rem a b)
-- it returns a list of primes less than lim
sieve lim = takeWhile (< lim) (2 : sieves [3,5..])
-- the helper for sieve
sieves (x:xs) = x : deleteBy (\x n -> div' n x) x (sieves xs)
primes' = 2 : filter (null . tail . primeFactors') [3,5.... | zeniuseducation/poly-euler | haskell/opt1.hs | epl-1.0 | 837 | 3 | 13 | 235 | 437 | 222 | 215 | 19 | 1 |
module GL.Bindings
( display, idle, reshape )
where
import Control.Applicative ( (<$>) )
import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT ( swapBuffers, postRedisplay )
import GL.Aliases ( glfloat, zerof, onef, setColor4 )
import qualified Program.State as P
-- |Callback to draw on screen... | szbokhar/genetic-boxes | GL/Bindings.hs | gpl-2.0 | 1,189 | 0 | 12 | 289 | 388 | 198 | 190 | 29 | 1 |
{- |
Module : $Header$
Description : print the abstract syntax so that it can be re-parsed
Copyright : (c) Christian Maeder and Uni Bremen 2003
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : experimental
Portability : portable
printing data types of t... | nevrenato/Hets_Fork | HasCASL/PrintAs.hs | gpl-2.0 | 23,634 | 33 | 27 | 8,208 | 8,858 | 4,431 | 4,427 | 553 | 24 |
-- P16 Drop every N'th element from a list.
-- Recursion with a counter
f1 :: Int -> [a] -> [a]
f1 n = f n
where f _ [] = []
f 1 (_:xs) = f n xs
f k (x:xs) = x : f (pred k) xs
-- Tail recursion
f2 :: Int -> [a] -> [a]
f2 n = f n []
where f _ acc [] = reverse acc
f 1 acc (_:xs) = ... | pavelfatin/ninety-nine | haskell/p16.hs | gpl-3.0 | 728 | 4 | 11 | 235 | 451 | 231 | 220 | 17 | 3 |
{-# LANGUAGE TupleSections, OverloadedStrings #-}
module Handler.Home where
import Yesod.Auth
import Import
import Handler.DB
import Data.Time
import Handler.Utils
getHomeR :: Handler Value
getHomeR = do
(Entity _ u) <- requireAuth
mug <- runDB $ get $ userDefaultUserGroupId u
today <- liftIO $ fmap utctDay... | tlaitinen/receipts | backend/Handler/Home.hs | gpl-3.0 | 847 | 0 | 17 | 268 | 209 | 108 | 101 | 22 | 1 |
module Main (main) where
import Control.Arrow
import Data.List
f :: [Int] -> [[Int]] -> [[Int]]
f _ [] = []
f [] rem = [[]]
f (x:s) rem = concatMap (concatMap (\ (y,t) -> map (y:) $ f s [t]) . g x) rem where
g :: Int -> [Int] -> [(Int,[Int])]
g _ [] = []
g n (y:t) = if other `elem` t then (y,other `delete` t) : rec ... | xkollar/handy-haskell | other/pt-2017-05/main.hs | gpl-3.0 | 964 | 0 | 14 | 229 | 628 | 344 | 284 | 25 | 2 |
module BarTender.Options
( module System.Console.GetOpt
, FilePath
, Bound (..)
, inBound
, outOfBound
, completeOption
, getConfigOpt
, getEnvironOpt
, handleOpt
) where
import Control.Monad
import Data.Char
import Data.Maybe
import System.Console.GetOpt
import System.Environ... | chrisbouchard/bartender | src/BarTender/Options.hs | gpl-3.0 | 5,805 | 0 | 20 | 1,994 | 1,742 | 902 | 840 | 120 | 8 |
{-# LANGUAGE TemplateHaskell, TypeApplications, PolyKinds, UndecidableInstances #-}
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
module Lamdu.Sugar.Annotations
( ShowAnnotation(..), showTypeAlways, showInTypeMode, showInEvalMode
, MarkAnnotations(..), alwaysShowAnnotations
) where
import qual... | lamdu/lamdu | src/Lamdu/Sugar/Annotations.hs | gpl-3.0 | 9,023 | 0 | 18 | 2,262 | 2,355 | 1,236 | 1,119 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
-- | new BLT : a more modular approach
module Main where
import Options.Applicative
import System.FilePath
data Input = FileInput FilePath | StdIn
fileInput :: Parser Input
fileInput = FileInput <$> strOption
( long "file"
<> short 'f'
<> metavar "FILENAME"
<> help... | emptylambda/BLT | src/NewBLT.hs | gpl-3.0 | 478 | 0 | 11 | 106 | 115 | 60 | 55 | 16 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-androidmanagement/gen/Network/Google/Resource/AndroidManagement/Enterprises/List.hs | mpl-2.0 | 5,759 | 0 | 19 | 1,402 | 963 | 555 | 408 | 131 | 1 |
func =
fooooooooooooooooooooooooooooooooo
+ foooooooooooooooooooooooooooooooo foooooooooooooooooooooooooooooooo
foooooooooooooooooooooooooooooooo
| lspitzner/brittany | data/Test300.hs | agpl-3.0 | 192 | 2 | 5 | 53 | 16 | 7 | 9 | 4 | 1 |
module QuantLib.Math
( module QuantLib.Math.InverseNormal
, module QuantLib.Math.Copulas
) where
import QuantLib.Math.InverseNormal
import QuantLib.Math.Copulas
| paulrzcz/hquantlib | src/QuantLib/Math.hs | lgpl-3.0 | 186 | 0 | 5 | 39 | 34 | 23 | 11 | 5 | 0 |
module Network.Haskoin.Node.Checkpoints
( checkpointMap
, checkpointList
, verifyCheckpoint
) where
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as M (fromList, lookup)
import Data.Word (Word32)
import Network.Haskoin.Block
import Network.Haskoin.Constants
-- | Checkpoints from bitcoind reference im... | plaprade/haskoin | haskoin-node/src/Network/Haskoin/Node/Checkpoints.hs | unlicense | 919 | 0 | 8 | 133 | 167 | 100 | 67 | 17 | 2 |
-- Copyright (c) 2013-2015 PivotCloud, Inc.
--
-- Aws.Kinesis.Commands.PutRecords
--
-- Please feel free to contact us at licensing@pivotmail.com with any
-- contributions, additions, or other feedback; we would love to hear from
-- you.
--
-- Licensed under the Apache License, Version 2.0 (the "License"); you may
-- n... | alephcloud/hs-aws-kinesis | src/Aws/Kinesis/Commands/PutRecords.hs | apache-2.0 | 9,186 | 0 | 12 | 1,584 | 871 | 525 | 346 | 102 | 0 |
{-# Language TypeFamilies #-}
module Language.Drasil.Chunk.Concept
( ConceptChunk, dcc, dcc', dccWDS, dccWDS', cc, cc', ccs, cic, cw
, CommonConcept, ConceptInstance
) where
import Language.Drasil.Classes.Core (HasUID(uid))
import Language.Drasil.Classes (Idea, Definition(defn), ConceptDomain(cdom), Concept)
im... | JacquesCarette/literate-scientific-software | code/drasil-lang/Language/Drasil/Chunk/Concept.hs | bsd-2-clause | 2,384 | 0 | 11 | 408 | 730 | 407 | 323 | 32 | 1 |
instance Functor Maybe where
fmap f (Just x) = Just (f x)
fmap f Nothing = Nothing
| sharkspeed/dororis | languages/haskell/LYHGG/8-making-our-own-types-and-typeclasses/8-the-functor-typeclass.hs | bsd-2-clause | 91 | 0 | 7 | 25 | 44 | 21 | 23 | 3 | 0 |
module YesodDsl.Simplify (simplify) where
import YesodDsl.AST
import Data.Generics
import Data.Either
import Data.Generics.Uniplate.Data
import qualified Data.List as L
import Data.Maybe
import qualified Data.Map as Map
simplify :: Module -> Module
simplify m = everywhere ((mkT sHandler) . (mkT sExpr)
... | tlaitinen/yesod-dsl | YesodDsl/Simplify.hs | bsd-2-clause | 3,114 | 0 | 21 | 1,051 | 1,258 | 640 | 618 | 56 | 9 |
{-|
Copyright : (C) 2012-2016, University of Twente
License : BSD2 (see the file LICENSE)
Maintainer : Christiaan Baaij <christiaan.baaij@gmail.com>
Create Netlists out of normalized CoreHW Terms
-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
module CLaSH.Netlist where
import... | ggreif/clash-compiler | clash-lib/src/CLaSH/Netlist.hs | bsd-2-clause | 22,136 | 0 | 33 | 7,207 | 6,436 | 3,300 | 3,136 | 346 | 20 |
{-# LANGUAGE TypeFamilies, FlexibleInstances, PostfixOperators #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : ForSyDe.MoC.SDF
-- Copyright : (c) George Ungureanu, KTH/ICT/E 2015;
-- SAM Group, KTH/ICT/ECS 2007-... | forsyde/forsyde-atom | src/ForSyDe/Atom/MoC/SDF/Core.hs | bsd-3-clause | 4,963 | 0 | 14 | 1,304 | 1,768 | 960 | 808 | 88 | 1 |
module Signal.Wavelet.Repa2Bench where
import Data.Array.Repa
import Signal.Wavelet.Repa2
import Signal.Wavelet.Repa.Common (forceS, forceP)
{-# INLINE benchDwtS #-}
benchDwtS :: (Array U DIM1 Double, Array U DIM1 Double) -> Array U DIM1 Double
benchDwtS = uncurry dwtS
{-# INLINE benchDwtP #-}
benchDwtP :: (Array... | jstolarek/lattice-structure-hs | bench/Signal/Wavelet/Repa2Bench.hs | bsd-3-clause | 2,186 | 0 | 8 | 421 | 685 | 371 | 314 | 48 | 1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude, ScopedTypeVariables, MagicHash #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.List
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/ba... | spacekitteh/smcghc | libraries/base/Data/OldList.hs | bsd-3-clause | 40,237 | 0 | 16 | 12,088 | 7,229 | 4,173 | 3,056 | 426 | 8 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Site where
import qualified Data.Text as T
import Data.Typeable
import Data.Data
import Data.ConfigFile
import Data.Either.Utils
import Config
data Site = Site { title :: T.Text
, style :: T.Text
, author :... | kaashif/muon | src/Site.hs | bsd-3-clause | 1,123 | 0 | 11 | 443 | 276 | 154 | 122 | 32 | 1 |
module Graphics.UI.SDL.Audio (
-- * Audio Device Management, Playing and Recording
audioInit,
audioQuit,
buildAudioCVT,
closeAudio,
closeAudioDevice,
convertAudio,
freeWAV,
getAudioDeviceName,
getAudioDeviceStatus,
getAudioDriver,
getAudioStatus,
getCurrentAudioDriver,
getNumAudioDevices,
getNumAudioDriv... | ekmett/sdl2 | Graphics/UI/SDL/Audio.hs | bsd-3-clause | 3,262 | 52 | 13 | 449 | 898 | 473 | 425 | 63 | 1 |
-- | Diff- and merge-related things.
module Guide.Diff
(
-- * Diffing
Diff(..),
DiffChunk(..),
diff,
-- * Merging
merge,
-- * Tokenizing
tokenize,
)
where
import Imports
import Guide.Diff.Merge (merge)
import Guide.Diff.Tokenize (tokenize)
import Guide.Utils (makeClassWithLenses)
import qualified D... | aelve/guide | back/src/Guide/Diff.hs | bsd-3-clause | 5,333 | 0 | 15 | 1,260 | 1,468 | 817 | 651 | -1 | -1 |
module Three where
import Data.List (nub)
import Data.List.Split (chunksOf)
type Coord = (Int, Int)
numDistinctLocations :: [Coord] -> Int
numDistinctLocations = length . nub
locationsVisited :: String -> [Coord]
locationsVisited = scanl followArrow (0,0)
followArrow :: Coord -> Char -> ... | purcell/adventofcodeteam | app/Three.hs | bsd-3-clause | 996 | 0 | 11 | 261 | 320 | 175 | 145 | 27 | 5 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
module API.Bitbucket where
import ClassyPrelude
import Control.Exception (SomeException)
import... | JustusAdam/bitbucket-github-migrate | src/API/Bitbucket.hs | bsd-3-clause | 7,461 | 0 | 14 | 1,826 | 1,791 | 984 | 807 | -1 | -1 |
{-|
The main box module.
-}
module Acme.Box
( box
) where
-- | The main box function, actually empty!
box :: IO ()
box = do
return ()
-- inspected by #42
| drwebb/acme-box | src/Acme/Box.hs | bsd-3-clause | 167 | 0 | 8 | 46 | 37 | 21 | 16 | 5 | 1 |
{-# LANGUAGE CPP, RecordWildCards, NamedFieldPuns, RankNTypes #-}
-- | Planning how to build everything in a project.
--
module Distribution.Client.ProjectPlanning (
-- * elaborated install plan types
ElaboratedInstallPlan,
ElaboratedConfiguredPackage(..),
ElaboratedPlanPackage,
ElaboratedSharedCon... | thomie/cabal | cabal-install/Distribution/Client/ProjectPlanning.hs | bsd-3-clause | 101,157 | 0 | 28 | 29,052 | 12,880 | 7,037 | 5,843 | 1,358 | 7 |
import System.Environment (getArgs)
import Data.List (elemIndices)
readMore :: String -> String
readMore s | length s < 56 = s
| otherwise = take (last e) s ++ "... <Read More>"
where e = 40 : [x | x <- elemIndices ' ' s, x < 40]
main :: IO ()
main = do
[inpFile] <- getArgs
input <-... | nikai3d/ce-challenges | easy/read_more.hs | bsd-3-clause | 388 | 0 | 11 | 111 | 166 | 81 | 85 | 11 | 1 |
module Mark where
data Mark = None | One | Two | Three
deriving (Show,Eq,Ord)
instance Num Mark where
(+) None x = x
(+) x None = x
(+) One One = Two
(+) Three _ = Three
(+) _ Three = Three
(+) One Two = Three
(+) Two One = Three
(+) Two Two = Three
fromInteger 0 = None
from... | Raynes/Hricket | src/Mark.hs | bsd-3-clause | 755 | 0 | 13 | 272 | 309 | 174 | 135 | 24 | 0 |
{-# LANGUAGE PatternSynonyms #-}
{-# OPTIONS_HADDOCK not-home #-}
-- | Description: How we encode GraphQL responses
module GraphQL.Internal.Output
( Response(..)
, Errors
, Error(..)
, GraphQLError(..)
, singleError
) where
import Protolude hiding (Location, Map)
import Data.Aeson (ToJSON(..))
import Dat... | jml/graphql-api | src/GraphQL/Internal/Output.hs | bsd-3-clause | 4,204 | 0 | 9 | 1,078 | 765 | 440 | 325 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
module Zero.Bittrex.Handlers
(
getMarketSummary
) where
import Control.Monad.IO.Class (liftIO)
import Data.Text (Text)
import Network.HTTP.Client (newManager)
import Network.HTT... | et4te/zero | server/src/Zero/Bittrex/Handlers.hs | bsd-3-clause | 1,101 | 0 | 13 | 223 | 246 | 134 | 112 | 25 | 2 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE FlexibleContexts, FlexibleInstances, TypeSynonymInstances #-}
{-# LANGUAGE OverlappingInstances, UndecidableInstances #-}
module Narradar.Processor... | pepeiborra/narradar | src/Narradar/Processor/InfinitaryProblem.hs | bsd-3-clause | 3,649 | 0 | 19 | 821 | 793 | 420 | 373 | 64 | 1 |
--
--
--
-----------------
-- Exercise 8.19.
-----------------
--
--
--
module E'8'19 where
copy :: IO ()
copy
= do line <- getLine
let whileCopy = do if (line == "")
then (return () )
else (
do putStrLn line
... | pascal-knodel/haskell-craft | _/links/E'8'19.hs | mit | 1,570 | 0 | 16 | 458 | 109 | 67 | 42 | 11 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-
Copyright (C) 2006-2010 Puneeth Chaganti <punchagan@gmail.com>
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 2 of the License, or
(at your optio... | Lythimus/lptv | sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Writers/Org.hs | gpl-2.0 | 11,782 | 0 | 20 | 3,027 | 3,470 | 1,731 | 1,739 | 220 | 6 |
module HyLoRes.Formula.TypeLevel
where
data Top
data Prop
data Nom
data Neg f
data Disj
data Conj
data Diam f
data Box f
data At f
data Down f
data Opaque
class IsSubformula f_a a | f_a -> a
instance IsSubformula (Neg f) f
instance IsSubformula (Diam f) f
instance IsSubformula (Box f) f
instance IsSubformul... | nevrenato/HyLoRes_Source | src/HyLoRes/Formula/TypeLevel.hs | gpl-2.0 | 1,872 | 0 | 12 | 700 | 768 | 408 | 360 | -1 | -1 |
module Lamdu.Paths
( getDataFileName
, getDataFileNameMaybe
, getLamduDir
, readDataFile
) where
import Control.Monad.Except (runExceptT, throwError)
import qualified Paths_Lamdu
import qualified System.Directory as Directory
import System.Environment.Executable (splitExecutable... | lamdu/lamdu | src/Lamdu/Paths.hs | gpl-3.0 | 1,620 | 0 | 15 | 392 | 394 | 213 | 181 | 41 | 1 |
module B1.Graphics.Rendering.OpenGL.Utils
( color3
, color4
, normal3
, scale3
, texCoord2
, vector3
, vertex2
, vertex3
) where
import Graphics.Rendering.OpenGL
color3 :: GLfloat -> GLfloat -> GLfloat -> Color3 GLfloat
color3 = Color3
color4 :: GLfloat -> GLfloat -> GLfloat -> GLfloat -> Color4 GL... | madjestic/b1 | src/B1/Graphics/Rendering/OpenGL/Utils.hs | bsd-3-clause | 789 | 0 | 9 | 152 | 239 | 131 | 108 | 26 | 1 |
{-# LANGUAGE TemplateHaskell #-}
--------------------------------------------------------------------------------
-- |
-- Module : Data.Comp.Derive.Ordering
-- Copyright : (c) 2010-2011 Patrick Bahr
-- License : BSD3
-- Maintainer : Patrick Bahr <paba@diku.dk>
-- Stability : experimental
-- Portabili... | spacekitteh/compdata | src/Data/Comp/Derive/Ordering.hs | bsd-3-clause | 2,704 | 0 | 17 | 795 | 793 | 419 | 374 | 46 | 2 |
module Dotnet.System.Xml.XmlAttributeCollection
( module Dotnet.System.Xml.XmlAttributeCollection ,
module Dotnet.System.Xml.XmlAttributeCollectionTy
) where
import Dotnet
import qualified Dotnet.System.Xml.XmlAttributeCollectionTy
import qualified Dotnet.System.Xml.XmlNamedNodeMap
import qualified Dotnet.System... | FranklinChen/Hugs | dotnet/lib/Dotnet/System/Xml/XmlAttributeCollection.hs | bsd-3-clause | 3,211 | 6 | 12 | 301 | 625 | 358 | 267 | -1 | -1 |
{-# LANGUAGE TemplateHaskell, DataKinds, PolyKinds
, TypeInType, TypeApplications, TypeFamilies #-}
module T12045TH1 where
import Data.Kind
import Language.Haskell.TH hiding (Type)
$([d| type family F (a :: k) :: Type where
F @Type Int = Bool
F @(Type->Type) May... | sdiehl/ghc | testsuite/tests/th/T12045TH1.hs | bsd-3-clause | 465 | 0 | 6 | 130 | 66 | 43 | 23 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Web.Offset.Init where
import Control.Concurrent.MVar
import Control.Monad.State
import qualified Data.Map as Map
import Data.Text (Text)
import qualified Database.Redis as R... | dbp/snaplet-wordpress | src/Web/Offset/Init.hs | bsd-3-clause | 2,046 | 0 | 14 | 735 | 435 | 234 | 201 | 42 | 2 |
{-# LANGUAGE GADTSyntax #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnliftedNewtypes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE UnboxedSums #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeFamilies #-}
import GHC.Int (Int(I#))
... | sdiehl/ghc | testsuite/tests/typecheck/should_run/UnliftedNewtypesCoerceRun.hs | bsd-3-clause | 506 | 0 | 13 | 76 | 119 | 73 | 46 | 19 | 1 |
{-# LANGUAGE StandaloneKindSignatures #-}
module SAKS_Fail002 where
import Data.Kind (Type)
data D
type D :: Type
type D :: Type
type D :: Type
| sdiehl/ghc | testsuite/tests/saks/should_fail/saks_fail002.hs | bsd-3-clause | 148 | 0 | 5 | 28 | 36 | 24 | 12 | -1 | -1 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wpartial-fields #-}
module T16411 where
import Data.Type.Equality
data T1 z where
MkT1a :: { rec1 :: () } -> T1 Int
MkT1b :: (z ~ Bool) => T1 z
data T2 z where
MkT2a :: { rec2 :: () } -> T2 Int
MkT2b :: (z ~~ Bool) => T2 z
| sdiehl/ghc | testsuite/tests/typecheck/should_compile/T16411.hs | bsd-3-clause | 305 | 0 | 8 | 72 | 99 | 60 | 39 | -1 | -1 |
module Let1 where
import Control.Parallel.Strategies (rpar, runEval)
fib n
| n <= 1 = 1
| otherwise =
let n1 = fib (n - 1)
n2 = fib (n - 2)
n1_2
=
runEval
(do n1_2 <- rpar n1
... | RefactoringTools/HaRe | old/testing/evalMonad/Let1AST.hs | bsd-3-clause | 372 | 0 | 15 | 212 | 119 | 60 | 59 | 13 | 1 |
{-# LANGUAGE PatternGuards #-}
module Main (main) where
import Network.HTTP hiding (password)
import Network.Browser
import Network.URI (URI(..), parseRelativeReference, relativeTo)
import Distribution.Client
import Distribution.Client.Cron (cron, rethrowSignalsAsExceptions,
Signal(..... | ocharles/hackage-server | BuildClient.hs | bsd-3-clause | 35,871 | 0 | 25 | 11,270 | 7,999 | 4,128 | 3,871 | 646 | 12 |
{-# OPTIONS_JHC -fno-prelude -fffi #-}
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.C.String
-- Copyright : (c) The FFI task force 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : ffi@haskell.org
-- Stability ... | m-alvarez/jhc | lib/jhc/Foreign/C/String.hs | mit | 14,685 | 113 | 13 | 3,005 | 1,825 | 1,106 | 719 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Yi.Keymap.Vim.Ex.Commands.Undo
-- License : GPL-2
-- Maintainer : yi-devel@googlegroups.com
-- Stability : experimental
-- Portability : portable
module Yi.Keymap.Vim.Ex.Commands.Undo (parse) where
import ... | siddhanathan/yi | yi-keymap-vim/src/Yi/Keymap/Vim/Ex/Commands/Undo.hs | gpl-2.0 | 1,176 | 0 | 10 | 413 | 247 | 152 | 95 | 20 | 1 |
{-@ LIQUID "--maxparams=3" @-}
{-# OPTIONS_GHC -cpp -fglasgow-exts #-}
-- |
-- Module : Data.ByteString.Lazy.Internal
-- License : BSD-style
-- Maintainer : dons@cse.unsw.edu.au, duncan@haskell.org
-- Stability : experimental
-- Portability : portable
--
-- A module containing semi-public 'ByteString' inte... | mightymoose/liquidhaskell | benchmarks/bytestring-0.9.2.1/Data/ByteString/Lazy/Internal.hs | bsd-3-clause | 6,807 | 0 | 11 | 1,623 | 710 | 422 | 288 | 52 | 3 |
{-# LANGUAGE CPP #-}
-- | Compatibility layer for "Control.Monad.Fail"
module Distribution.Compat.MonadFail ( MonadFail(fail) ) where
#if __GLASGOW_HASKELL__ >= 800
-- provided by base-4.9.0.0 and later
import Control.Monad.Fail (MonadFail(fail))
#else
-- the following code corresponds to
-- http://hackage.haskell.org... | sopvop/cabal | Cabal/Distribution/Compat/MonadFail.hs | bsd-3-clause | 873 | 0 | 6 | 147 | 37 | 27 | 10 | 21 | 0 |
module Main where
import Control.Concurrent
main = do
m <- newEmptyMVar
sync <- newEmptyMVar
let f = readMVar m
t1 <- forkIO (f >> error "FAILURE")
t2 <- forkIO (f >> putMVar sync ())
killThread t1
putMVar m (0 :: Int)
readMVar sync
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/concurrent/should_run/readMVar2.hs | bsd-3-clause | 267 | 0 | 12 | 77 | 110 | 51 | 59 | 11 | 1 |
module CommandLine where
import Control.Monad
import Data.List
import Expense
import System.Console.GetOpt
import System.Environment
import System.Exit
import System.IO
data Options = Options { input :: IO String
, output ::... | fredmorcos/attic | projects/pet/archive/pet_haskell_args/CommandLine.hs | isc | 4,249 | 0 | 14 | 1,467 | 1,232 | 640 | 592 | 80 | 5 |
{-# LANGUAGE FlexibleInstances #-}
module Club.Json (
) where
import Club.Model
import Data.Aeson.Compat
instance ToJSON Club
| matsumonkie/tennis | api/src/Club/Json.hs | mit | 129 | 0 | 5 | 19 | 28 | 17 | 11 | 5 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Config where
import Control.Monad.Except
import Control.Monad.Logger
import Control.Monad.Reader
import Control.Monad.Trans.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.Monoid ... | parsonsmatt/QuickLift | src/Config.hs | mit | 2,244 | 0 | 15 | 740 | 486 | 267 | 219 | 60 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE FlexibleContexts #-}
module Text.Atomos.Atom.Import where
import Control.Applicative ((<*), (*>), (<$>), (<$))
import qualified Contro... | philopon/atomos | Text/Atomos/Atom/Import.hs | mit | 16,795 | 0 | 27 | 5,173 | 5,837 | 2,963 | 2,874 | 338 | 7 |
module CFDI.Types.ProductOrService where
import CFDI.Chainable
import CFDI.Types.Type
import Control.Error.Safe (justErr)
import Data.Set (fromList, member, unions)
import Text.Read (readMaybe)
newtype ProductOrService = ProductOrService Int deriving (Eq, Show)
instance Chainable ProductOrService ... | yusent/cfdis | src/CFDI/Types/ProductOrService.hs | mit | 152,570 | 0 | 11 | 55,358 | 37,018 | 23,114 | 13,904 | 4,618 | 0 |
module CFDI.Types.ZipCode where
import CFDI.Chainable
import CFDI.Types.Type
import Control.Error.Safe (justErr)
import Text.Read (readMaybe)
newtype ZipCode = ZipCode Int deriving (Eq, Show)
instance Chainable ZipCode where
chain (ZipCode c) = chain c
instance Type ZipCode where
parseExpr c = justErr ... | yusent/cfdis | src/CFDI/Types/ZipCode.hs | mit | 1,156 | 0 | 13 | 402 | 463 | 229 | 234 | 29 | 0 |
import System.IO
import Data.List
import System.Directory
main = do
handle <- openFile "todo.txt" ReadMode
(tempName, tempHandle) <- openTempFile "." "temp"
contents <- hGetContents handle
let tasks = lines contents
numberedTasks = zipWith (\n line -> show n ++ " - " ++ line) [0..] tasks
putStrLn "Thes... | RAFIRAF/HASKELL | IO/todo.hs | mit | 664 | 0 | 15 | 132 | 206 | 93 | 113 | 20 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.