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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
------------------------------------------------------------------------------
-- | Defines a simple proxy type for complicated type classes.
module Snap.Snaplet.Rest.Proxy
( Proxy (..)
) where
------------------------------------------------------------------------------
-- | Uses a phantom type to indicate t... | zmthy/snaplet-rest | src/Snap/Snaplet/Rest/Proxy.hs | mit | 417 | 0 | 5 | 58 | 30 | 22 | 8 | 3 | 0 |
-- file: ch03/MySecond.hs
mySecond :: [a] -> a
mySecond xs = if null (tail xs)
then error "List too short"
else head (tail xs)
-- We can use the Maybe type for a more controlled approach
safeSecond :: [a] -> Maybe a
safeSecond [] = Nothing
safeSecond xs = if null (tail xs)
... | supermitch/learn-haskell | real-world-haskell/ch03/MySecond.hs | mit | 522 | 0 | 10 | 155 | 163 | 84 | 79 | 12 | 2 |
-- Error vs. Exception
-- ref: https://wiki.haskell.org/Error_vs._Exception
-- ref: https://wiki.haskell.org/Error
-- ref: https://wiki.haskell.org/Exception
-- Error
{-
An error denotes a programming error.
The Prelude function error represents an error with a message, undefined represents an error with a s... | Airtnp/Freshman_Simple_Haskell_Lib | Idioms/Error-vs-Exception.hs | mit | 11,867 | 0 | 14 | 2,547 | 1,184 | 620 | 564 | -1 | -1 |
module Stripe
( runStripe
, subscribeToPlan
, cancelSubscription
) where
import Import
import Control.Monad.Except (ExceptT, runExceptT, throwError)
import Web.Stripe ((-&-))
import qualified Web.Stripe as S
import qualified Web.Stripe.Customer as S
import qualified Web.Stripe.Error as S
import quali... | thoughtbot/carnival | Stripe.hs | mit | 1,951 | 0 | 15 | 455 | 618 | 309 | 309 | -1 | -1 |
{--
Copyright (c) 2014 Gorka Suárez García
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, including without limitation the rights
to use, copy, modify, merge, publish, distri... | gorkinovich/Haskell | Problems/Problem0003.hs | mit | 3,389 | 0 | 12 | 803 | 795 | 412 | 383 | 47 | 4 |
{-# LANGUAGE TupleSections, OverloadedStrings #-}
module Barch.Cart where
import Import
import Prelude
import Data.Maybe (catMaybes, fromMaybe)
import Data.Set as S (Set, delete, empty, insert, toList)
import Data.Text (unpack, pack)
listCart::Handler [ReferenceId]
listCart = do
oldCart <- lookupSession "citationCa... | klarh/barch | Barch/Cart.hs | mit | 1,117 | 0 | 16 | 172 | 396 | 200 | 196 | 29 | 1 |
module Paradise.Client
( VesselID
, PlayerData (..)
) where
import qualified Data.ByteString.Char8 as B
type VesselID = B.ByteString
data PlayerData = PlayerData { vessel :: VesselID
} | Hamcha/netslum | Paradise/Client.hs | mit | 228 | 0 | 8 | 70 | 50 | 33 | 17 | 6 | 0 |
{--*-Mode:haskell;coding:utf-8;tab-width:4;c-basic-offset:4;indent-tabs-mode:()-*-
ex: set ft=haskell fenc=utf-8 sts=4 ts=4 sw=4 et nomod: -}
{-
MIT License
Copyright (c) 2017 Michael Truog <mjtruog at protonmail dot com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this... | CloudI/CloudI | src/api/haskell/src/Foreign/Erlang/Function.hs | mit | 1,604 | 0 | 9 | 295 | 88 | 56 | 32 | 14 | 0 |
module Shipper.Event (
readAllEvents,
maxPacketSize
)
where
import Shipper.Types
import Control.Concurrent.STM (atomically)
import Control.Concurrent.STM.TBQueue
import Control.Concurrent
-- This is the maximum number of events that an output will try to stick into
-- one packet. Assuming they're doin' it ri... | christian-marie/pill-bug | Shipper/Event.hs | mit | 2,366 | 0 | 18 | 729 | 329 | 177 | 152 | 27 | 5 |
module SourceParser
(
parseExpr,
parse
) where
import Text.ParserCombinators.Parsec hiding (spaces)
import DataTypes
import Numeric (readHex, readOct)
import Control.Monad
{-import Control.Applicative hiding ((<|>), many)-}
symbol :: Parser Char
symbol = oneOf "!$#%&|*+-/:<=>?@^_~"
spaces :: Parser (... | Bolt64/wyas | src/SourceParser.hs | mit | 3,078 | 0 | 12 | 1,105 | 895 | 436 | 459 | 79 | 4 |
{-# LANGUAGE OverloadedStrings, RankNTypes #-}
module Lightstreamer.Client
( OK
, StreamContext(info, threadId)
, changeConstraints
, destroySession
, newStreamConnection
, reconfigureSubscription
, requestRebind
, sendAsyncMessage
, sendMessage
, subscribe
) where
import ... | jm4games/lightstreamer | src/Lightstreamer/Client.hs | mit | 5,637 | 0 | 20 | 1,842 | 1,408 | 710 | 698 | 131 | 6 |
-- Another one down—the Survival of the Fittest!
-- http://www.codewars.com/kata/563ce9b8b91d25a5750000b6/
module Codewars.Kata.RemoveSmallest where
import Data.List (delete)
removeSmallest :: Int -> [Int] -> [Int]
removeSmallest n | n <= 0 = id
| otherwise = (!!n) . iterate f
where... | gafiatulin/codewars | src/6 kyu/RemoveSmallest 2.hs | mit | 353 | 0 | 9 | 83 | 97 | 52 | 45 | 6 | 1 |
module EitherLib where
lefts' :: [Either a b] -> [a]
lefts' = foldr (\x acc -> if isLeft x then (left x):acc else acc) []
where isLeft (Left a) = True
isLeft _ = False
left (Left a) = a
-- Too much repetition here. Should I move it to foldr somehow?
-- Now I think we can use Maybe to write Right and... | raventid/coursera_learning | haskell/chapter12/either_lib.hs | mit | 1,098 | 0 | 11 | 265 | 478 | 249 | 229 | 22 | 3 |
{-# LANGUAGE NoMonomorphismRestriction
#-}
module Plugins.Gallery.Gallery.Manual14 where
import Diagrams.Prelude
example = beside (r2 (20,30))
(circle 1 # fc orange)
(circle 1.5 # fc purple)
# showOrigin
| andrey013/pluginstest | Plugins/Gallery/Gallery/Manual14.hs | mit | 260 | 0 | 9 | 82 | 68 | 37 | 31 | 7 | 1 |
dupli :: [a] -> [a]
dupli x = repli x 2
repli :: [a] -> Int -> [a]
repli [] _ = []
repli (x:xs) n = replicate n x ++ repli xs n
dropEvery :: [a] -> Int -> [a]
dropEvery x n = take (n - 1) x ++ dropEvery (drop n x) n
split :: [a] -> Int -> ([a], [a])
split x n = (take n x, drop n x)
slice :: [a] -> Int -> Int -> [a]... | maggy96/haskell | 99 Problems/11_20.hs | mit | 976 | 0 | 10 | 274 | 609 | 322 | 287 | 26 | 1 |
module SpecHelper
( withBiegunkaTempDirectory
) where
import qualified System.IO.Temp as IO
withBiegunkaTempDirectory :: (FilePath -> IO a) -> IO a
withBiegunkaTempDirectory = IO.withSystemTempDirectory "biegunka"
| biegunka/biegunka | test/spec/SpecHelper.hs | mit | 221 | 0 | 8 | 31 | 50 | 29 | 21 | 5 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import System.Taffybar
import System.Taffybar.Information.CPU
import System.Taffybar.SimpleConfig
import System.Taffybar.Widget
import System.Taffybar.Widget.Generic.Graph
import System.Taffybar.Widget.Generic.PollingGraph
cpuCallback = do
(_, systemLoad, totalLoad) <- cpuLoad
re... | Ericson2314/nixos-configuration | user/graphical/taffybar.hs | cc0-1.0 | 977 | 0 | 13 | 267 | 207 | 123 | 84 | 20 | 1 |
{- |
Module : $Header$
Description : analyse kinds using a class map
Copyright : (c) Christian Maeder and Uni Bremen 2003-2005
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : experimental
Portability : portable
analyse kinds using a class map
-}
modul... | nevrenato/Hets_Fork | HasCASL/ClassAna.hs | gpl-2.0 | 7,254 | 0 | 32 | 2,246 | 2,272 | 1,109 | 1,163 | 152 | 8 |
{-# LANGUAGE DeriveDataTypeable #-}
{- |
Module : ./RelationalScheme/Sign.hs
Description : signaturefor Relational Schemes
Copyright : Dominik Luecke, Uni Bremen 2008
License : GPLv2 or higher, see LICENSE.txt or LIZENZ.txt
Maintainer : luecke@informatik.uni-bremen.de
Stability : provisional
Portab... | spechub/Hets | RelationalScheme/Sign.hs | gpl-2.0 | 8,467 | 0 | 23 | 3,174 | 2,361 | 1,250 | 1,111 | 194 | 3 |
--The following iterative sequence is defined for the set of positive integers:
--
--n → n/2 (n is even)
--n → 3n + 1 (n is odd)
--
--Using the rule above and starting with 13, we generate the following sequence:
--13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1
--
--It can be seen that this sequence (starting at 13 and fin... | ciderpunx/project_euler_in_haskell | euler014.hs | gpl-2.0 | 1,478 | 6 | 11 | 357 | 390 | 211 | 179 | 23 | 3 |
{-|
Module : $Header$
Copyright : (c) 2014 Edward O'Callaghan
License : GPL-2
Maintainer : eocallaghan@alterapraxis.com
Stability : provisional
Portability : portable
-}
{-# LANGUAGE Safe #-}
module BTS.Version where
import qualified GitRev
commitHash :: String
commitHash = GitRev.hash
co... | victoredwardocallaghan/hbts | src/BTS/Version.hs | gpl-2.0 | 482 | 0 | 6 | 92 | 65 | 39 | 26 | 11 | 1 |
import Graphics.Rendering.Cairo
import Data.List (transpose)
import Text.Printf
data Point = Point Double Double
deriving Show
data Vector = Vector Double Double
deriving Show
data RGBA = RGB Double Double Double
| RGBA Double Double Double Double
tau = 6.28318530717958647692
uncurry3 f (a,b,c) = f a... | jsavatgy/xroads-game | code/blue-angles-text.hs | gpl-2.0 | 3,169 | 0 | 17 | 793 | 1,513 | 745 | 768 | 109 | 1 |
--- * doc
-- Lines beginning "--- *" are collapsible orgstruct nodes. Emacs users,
-- (add-hook 'haskell-mode-hook
-- (lambda () (set-variable 'orgstruct-heading-prefix-regexp "--- " t))
-- 'orgstruct-mode)
-- and press TAB on nodes to expand/collapse.
{-|
Some common parsers and helpers used by several readers.
... | ony/hledger | hledger-lib/Hledger/Read/Common.hs | gpl-3.0 | 35,166 | 0 | 23 | 8,157 | 7,488 | 3,910 | 3,578 | 468 | 10 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Rank2Types #-}
module Language.UHIM.Dictionary.Yaml... | na4zagin3/uhim-dict | src/Language/UHIM/Dictionary/Yaml.hs | gpl-3.0 | 12,818 | 313 | 16 | 3,826 | 3,923 | 2,092 | 1,831 | 238 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
module Flatten3 where
import Data.Typeable (Typeable)
import List
import HipSpec
import Prelude hiding ((++))
import Control.Monad
data Tree a = B (Tree a) (Tree a) | Leaf a
deriving (Typeable,Eq,Ord,Show)
instance Arbitrary a => Arbitrary (Tree a) where
arbitrary = sized arbT... | danr/hipspec | examples/Flatten3.hs | gpl-3.0 | 970 | 0 | 15 | 240 | 491 | 260 | 231 | 28 | 1 |
module RLESpec where
import Control.Monad
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck
import Compression
import Data.ByteString.Lazy as L
import ArbInstances
oneByte :: ByteString
oneByte = L.pack [42]
thousandSameBytes :: ByteString
thousandSameBytes = L.replicate 1000 42
compress = caCom... | kravitz/har | test/RLESpec.hs | gpl-3.0 | 1,330 | 0 | 18 | 255 | 385 | 196 | 189 | 32 | 1 |
{-# LANGUAGE OverlappingInstances, FlexibleInstances,FlexibleContexts #-}
-- Does not yet check put/get properties!
module MonadState where
import Hip.Prelude
import Prelude (Int,Eq)
-- Poor man's equality
instance Eq b => Eq (Int -> b)
type State s a = s -> (a,s)
uncurry f (a,b) = f a b
uncurry' f t = f (fst t) (... | danr/hipspec | examples/old-examples/hip/MonadState.hs | gpl-3.0 | 16,849 | 4 | 18 | 2,814 | 7,930 | 4,373 | 3,557 | -1 | -1 |
module CCTK.Group (
Group(..),
(<>),
i,
) where
import Control.Monad (join)
import Data.Monoid
infixl 6 |/|
infixl 7 |^|
i :: Group g => g
i = mempty
class Monoid g => Group g where
inv :: g -> g
(|^|) :: g -> Integer -> g
_ |^| 0 = i
g |^| 1 = g
g |^| n | n < 0 = inv $ g |^| ... | maugier/cctk | src/CCTK/Group.hs | gpl-3.0 | 530 | 0 | 12 | 208 | 292 | 156 | 136 | 22 | 1 |
{-# LANGUAGE DeriveGeneric #-}
module Types where
import Vector
import Keyboard (Key(..))
--import FRP.Helm.Color (rgba, Color, yellow, red, blue, green)
import Graphics.UI.SDL.Types (Texture (..), Rect (..))
import Foreign.Ptr (Ptr(..))
import Data.Serialize (Serialize)
import GHC.Generics (Generic)
--
data Color = C... | ZSarver/DungeonDash | src/Types.hs | gpl-3.0 | 1,645 | 0 | 11 | 571 | 418 | 241 | 177 | 73 | 0 |
{-# LANGUAGE OverloadedLists, OverloadedStrings, QuasiQuotes,
ScopedTypeVariables #-}
module Nirum.PackageSpec where
import Data.Either (isLeft, isRight)
import Data.Proxy (Proxy (Proxy))
import Data.Text
import System.IO.Error (isDoesNotExistError)
import qualified Data.SemVer as SV
import System.FilePa... | spoqa/nirum | test/Nirum/PackageSpec.hs | gpl-3.0 | 7,140 | 0 | 23 | 2,896 | 1,584 | 863 | 721 | 129 | 2 |
module Example.Eg44 (eg44) where
import Graphics.Radian
import ExampleUtils
eg44 :: IO Html
eg44 = do
let x = [0, 2 * pi / 100 .. 2 * pi]
plot = ((p1 ||| p2) === (p3 ||| p4)) #
[height.=800, aspect.=1, strokeWidth.=2, axisXLabel.="Time"]
p1 = Plot [Lines x (map sin x)] #
[title.=... | openbrainsrc/hRadian | examples/Example/Eg44.hs | mpl-2.0 | 874 | 10 | 15 | 236 | 344 | 182 | 162 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-apps-calendar/gen/Network/Google/Resource/Calendar/Events/Instances.hs | mpl-2.0 | 7,925 | 0 | 24 | 1,991 | 1,182 | 682 | 500 | 163 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-civicinfo/gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByAddress.hs | mpl-2.0 | 7,631 | 0 | 20 | 1,753 | 977 | 568 | 409 | 151 | 1 |
{-# LANGUAGE OverloadedStrings, MultiParamTypeClasses #-}
module Blog.Common
( AppSettings, newAppSettings, BlogSettings, AdminSettings
, verifyCSRF, httpManager, remoteIp
, baseDomain, withBlogDomain, currentBlog, dashboard
, routeAny
, module Web.Simple.PostgreSQL
) where
import Control.Monad
import Cont... | alevy/mappend | src/Blog/Common.hs | agpl-3.0 | 6,908 | 0 | 21 | 1,740 | 1,875 | 959 | 916 | 167 | 5 |
multThree :: Int -> Int -> Int -> Int
-- multThree :: Int -> (Int -> (Int -> Int))
multThree x y z = x * y * z
compareWithHundred :: Int -> Ordering
-- compareWithHundred x = compare 100 x
-- can be rewritten as
compareWithHundred = compare 100
divideByTen :: (Floating a) => a -> a
-- brackets around a partially app... | alexliew/learn_you_a_haskell | code/hof.hs | unlicense | 2,590 | 0 | 13 | 589 | 1,072 | 578 | 494 | 54 | 1 |
{-# LANGUAGE PolyKinds #-}
module Data.Proxify (module Data.Proxify, module X) where
import Data.Proxy as X
-- === Utils === --
type family Proxified a where
Proxified (Proxy a) = a
Proxified a = a
proxify :: a -> Proxy (Proxified a)
proxify _ = Proxy
type family Deproxy p where Deproxy (Proxy a... | wdanilo/typelevel | src/Data/Proxify.hs | apache-2.0 | 326 | 0 | 8 | 79 | 103 | 60 | 43 | -1 | -1 |
{-
Copyright 2020 The CodeWorld Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicab... | google/codeworld | codeworld-compiler/test/testcases/tooManyArguments/source.hs | apache-2.0 | 650 | 0 | 8 | 118 | 28 | 16 | 12 | 1 | 1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QAbstractSpinBox.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:25
Warning : this file is machine generated -... | uduki/hsQt | Qtc/Gui/QAbstractSpinBox.hs | bsd-2-clause | 57,194 | 0 | 14 | 8,559 | 17,207 | 8,720 | 8,487 | -1 | -1 |
{-| The following example program shows how to use 'execute' to spawn the
shell command @(grep -v foo)@. This program forwards
@Pipes.ByteString.'Pipes.ByteString.stdin'@ to the standard input of @grep@
and merges the standard output and standard error of @grep@ to
@Pipes.ByteString.'Pipes.ByteString.s... | Gabriel439/pipes-process | src/Pipes/Process.hs | bsd-3-clause | 3,512 | 0 | 18 | 813 | 573 | 306 | 267 | 48 | 1 |
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE Ty... | kcsongor/generic-lens | generic-lens/src/Data/Generics/Sum/Subtype.hs | bsd-3-clause | 3,989 | 0 | 12 | 826 | 369 | 247 | 122 | 39 | 0 |
{-# LANGUAGE TupleSections #-}
module CPD.GlobalControl where
import qualified CPD.LocalControl as LC
import Data.List (find, partition)
import Data.Tuple
import Descend
import Debug.Trace (trace)
import Embed
import qualified Eval as E... | kajigor/uKanren_transformations | src/CPD/GlobalControl.hs | bsd-3-clause | 5,664 | 0 | 42 | 1,716 | 1,925 | 1,034 | 891 | 90 | 3 |
{-# LANGUAGE RecursiveDo, ScopedTypeVariables #-}
module Main where
import LOGL.Application
import LOGL.Camera
import Foreign.Ptr
import Graphics.UI.GLFW as GLFW
import Graphics.Rendering.OpenGL.GL as GL hiding (normalize, position)
import Graphics.GLUtil
import System.FilePath
import Graphics.Rendering.OpenGL.GL.Shad... | atwupack/LearnOpenGL | app/2_Lighting/4_Lighting-maps/Lighting-maps-specular.hs | bsd-3-clause | 5,062 | 0 | 15 | 936 | 1,434 | 687 | 747 | 106 | 1 |
module Language.Haskell.GhcMod.List (listModules, listMods) where
import Control.Applicative ((<$>))
import Control.Monad (void)
import Data.List (nub, sort)
import GHC (Ghc)
import qualified GHC as G
import Language.Haskell.GhcMod.GHCApi
import Language.Haskell.GhcMod.Types
import Packages (pkgIdMap, exposedModules, ... | yuga/ghc-mod | Language/Haskell/GhcMod/List.hs | bsd-3-clause | 1,185 | 2 | 11 | 222 | 336 | 184 | 152 | 25 | 1 |
module Dickmine.ParseSpec where
import Test.Hspec
import Data.Time
import Dickmine.Parse
import Dickmine.Types
import System.Locale
incorrectLogEntry :: [String]
incorrectLogEntry =
[
"07/06/2015 08:46:41 am 37.201.171.211 /",
"Country: (Unknown Country?) (... | kRITZCREEK/dickminer | test/Dickmine/ParseSpec.hs | bsd-3-clause | 3,092 | 0 | 17 | 852 | 604 | 301 | 303 | 74 | 1 |
module Extractor where
import HJS.Parser
import HJS.Parser.JavaScript
import Data.List
data XType = XType { typeName :: String
, typeFields :: [String] } deriving (Show, Eq)
class ExtractC t where
extract :: t -> [XType] -> [XType]
instance ExtractC SourceElement where
extract (Stmt s) c = ext... | disnet/jscheck | src/Extractor.hs | bsd-3-clause | 2,315 | 0 | 15 | 551 | 978 | 506 | 472 | 62 | 3 |
-----------------------------------------------------------------------------
--
-- Module : Text.XML.Plist.PlObject
-- Copyright : (c) Yuras Shumovich 2009, Michael Tolly 2012
-- License : BSD3
--
-- Maintainer : shumovichy@gmail.com
-- Stability : experimental
-- Portability : portable
--
-- |PlOb... | Yuras/plist | src/Text/XML/Plist/PlObject.hs | bsd-3-clause | 1,795 | 0 | 9 | 340 | 482 | 259 | 223 | 37 | 1 |
-- 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 Over... | rfranek/duckling | Duckling/Distance/RO/Corpus.hs | bsd-3-clause | 1,163 | 0 | 9 | 365 | 200 | 119 | 81 | 28 | 1 |
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving #-}
-- | Tests for the 'Data.HashSet' module. We test functions by
-- comparing them to a simpler model, a list.
module Main (main) where
import qualified Data.Foldable as Foldable
import Data.Hashable (Hashable(hashWithSalt))
import qualified Data.List as L
import quali... | bgamari/unordered-containers | tests/HashSetProperties.hs | bsd-3-clause | 6,704 | 0 | 15 | 1,632 | 1,949 | 1,077 | 872 | 121 | 6 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1993-1998
-}
{-# LANGUAGE CPP #-}
module IfaceSyn (
module IfaceType,
IfaceDecl(..), IfaceFamTyConFlav(..), IfaceClassOp(..), IfaceAT(..),
IfaceConDecl(..), IfaceConDecls(..), IfaceEqSpec,
IfaceExpr(... | bitemyapp/ghc | compiler/iface/IfaceSyn.hs | bsd-3-clause | 70,388 | 76 | 27 | 23,556 | 17,400 | 8,654 | 8,746 | 1,343 | 11 |
module UnionFind(UF, Replacement((:>)), newSym, (=:=), rep, evalUF, execUF, runUF, S, isRep, initial) where
import Prelude hiding (min)
import Control.Monad.State.Strict
import Data.IntMap(IntMap)
import qualified Data.IntMap as IntMap
data S = S {
links :: IntMap Int,
sym :: Int
}
type UF = State S
... | jystic/QuickSpec | UnionFind.hs | bsd-3-clause | 1,304 | 0 | 16 | 354 | 679 | 346 | 333 | 50 | 2 |
{-# LANGUAGE FlexibleContexts #-}
import Test.Hspec
import Text.Parsec
import Control.Monad.State
intS :: Monad m => ParsecT String s m String
intS = many1 digit
getNext k s | x > n2 = n1 * base + x
| x <= n2 = (1 + n1) * base + x
where base = 10 ^ (length s)
(n1, n2) = k `quotRem` ... | wangbj/excises | e292.hs | bsd-3-clause | 2,607 | 2 | 21 | 547 | 1,331 | 717 | 614 | 70 | 1 |
{-# LANGUAGE OverloadedStrings, RankNTypes, TypeSynonymInstances,
FlexibleInstances, OverloadedLists, DeriveGeneric, DeriveAnyClass #-}
{-
Column datastore approach.
Starting with a lightweight directory structure - 1 database per 1 running instance, thus:
SYSDIR
|---- metadata: file with... | jhoxray/muon | src/Quark/Base/Storage.hs | bsd-3-clause | 4,113 | 0 | 13 | 1,212 | 602 | 328 | 274 | 54 | 2 |
{-# LANGUAGE Rank2Types, TemplateHaskell #-}
module Data.Zippable1 where
import Control.Arrow
import Data.Functor1
import Language.Haskell.TH
import Language.Haskell.TH.Util
class Zippable1 t where
zip1 :: (forall a. f a -> g a -> h a) -> t f -> t g -> t h
data Pair1 f g a = Pair1 { unPair1 :: (f a, g a) }
mkPai... | craffit/flexdb | src/Data/Zippable1.hs | bsd-3-clause | 2,225 | 0 | 17 | 684 | 1,120 | 570 | 550 | 43 | 2 |
module BLAKE
( benchmarks -- :: IO [Benchmark]
) where
import Criterion.Main
import Crypto.Hash.BLAKE
import qualified Data.ByteString as B
import Util ()
benchmarks :: IO [Benchmark]
benchmarks = return
[ bench "blake256" $ nf blake256 (B.replicate 512 3)... | thoughtpolice/hs-nacl | benchmarks/BLAKE.hs | bsd-3-clause | 380 | 0 | 11 | 116 | 104 | 58 | 46 | 10 | 1 |
{-# LANGUAGE Arrows #-}
{-# LANGUAGE RecordWildCards #-}
module Parse.Command where
import Spec.Command
import Parse.Utils
import Parse.CType
import Text.XML.HXT.Core
parseCommand :: ParseArrow XmlTree Command
parseCommand = hasName "command" >>>
(extract `orElse` failA "Failed to extract command fiel... | oldmanmike/vulkan | generate/src/Parse/Command.hs | bsd-3-clause | 2,673 | 2 | 17 | 727 | 596 | 289 | 307 | 52 | 1 |
{-# LANGUAGE TypeOperators, DataKinds #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Metrology.SI.Poly
-- Copyright : (C) 2013 Richard Eisenberg
-- License : BSD-style (see LICENSE)
-- Maintainer : Richard Eisenberg (rae@cs.brynmawr.edu)
-- Stabi... | goldfirere/units | units-defs/Data/Metrology/SI/Poly.hs | bsd-3-clause | 1,376 | 0 | 9 | 330 | 213 | 146 | 67 | 22 | 0 |
{-# LANGUAGE DeriveDataTypeable #-}
module Sgf.Control.Exception
( FileException (..)
, doesFileExist'
)
where
import Data.Typeable
import Control.Monad
import Control.Monad.IO.Class
import Control.Exception
import System.Directory
data FileException = FileDoesNotExist FilePath
deriving (Typeable)
... | sgf-dma/sgf-haskell-common | src/Sgf/Control/Exception.hs | bsd-3-clause | 615 | 0 | 10 | 115 | 165 | 88 | 77 | 18 | 1 |
{-# LANGUAGE ImplicitParams #-}
module Frontend.ExprFlatten(exprFlatten,
exprFlatten',
flattenName,
unflattenName) where
import Data.List.Split
import Name
import Frontend.Expr
import {-# SOURCE #-} Frontend.ExprOps
import Frontend.InstTree
import Frontend.T... | termite2/tsl | Frontend/ExprFlatten.hs | bsd-3-clause | 2,436 | 0 | 19 | 934 | 794 | 400 | 394 | 41 | 8 |
data X = X { foo :: Int,
bar :: String
} deriving ( Eq
, Ord
, Show )
f x = x
| itchyny/vim-haskell-indent | test/recordtype/after_deriving_lines_comma_first.in.hs | mit | 78 | 0 | 8 | 24 | 45 | 25 | 20 | -1 | -1 |
--
--
--
-----------------
-- Exercise 5.32.
-----------------
--
--
--
module E'5'32 where
import E'5'27
(
Book
, Person
)
type Database'' = [(Person, [Book])]
exampleDB'' :: Database''
exampleDB''
= [
( "Alice" , ["Tintin", "Asterix"] ) ,
( "Anna" , ["Little Women"] ) ,
( "Ror... | pascal-knodel/haskell-craft | _/links/E'5'32.hs | mit | 3,748 | 0 | 11 | 1,308 | 672 | 405 | 267 | 56 | 1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK show-extensions #-}
{-# LANGUAGE MultiWayIf #-}
-- |
-- Module : Yi.Buffer.HighLevel
-- License : GPL-2
-- Maintainer : yi-devel@googlegroups.com
-- Stability : experimental
-- Portability : portable
--
--... | noughtmare/yi | yi-core/src/Yi/Buffer/HighLevel.hs | gpl-2.0 | 40,031 | 0 | 22 | 11,158 | 9,583 | 4,882 | 4,701 | 832 | 8 |
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Tar
-- Copyright : (c) 2007 Bjorn Bringert,
-- 2008 Andrea Vezzosi,
-- 2008-2009 Duncan Coutts
-- License : ... | jwiegley/ghc-release | libraries/Cabal/cabal-install/Distribution/Client/Tar.hs | gpl-3.0 | 33,029 | 0 | 19 | 9,167 | 7,184 | 3,813 | 3,371 | 600 | 15 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/DeleteVaultAccessPolicy.hs | mpl-2.0 | 4,500 | 0 | 9 | 813 | 434 | 268 | 166 | 62 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | olorin/amazonka | amazonka-iam/gen/Network/AWS/IAM/RemoveRoleFromInstanceProfile.hs | mpl-2.0 | 4,626 | 0 | 9 | 826 | 448 | 275 | 173 | 65 | 1 |
<?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="de-DE">
<title>Python Scripting</title>
<maps>
<homeID>top</homeID>
<mapref location="... | veggiespam/zap-extensions | addOns/jython/src/main/javahelp/org/zaproxy/zap/extension/jython/resources/help_de_DE/helpset_de_DE.hs | apache-2.0 | 961 | 79 | 66 | 157 | 409 | 207 | 202 | -1 | -1 |
{-# LANGUAGE LambdaCase #-}
module Language.K3.Driver.Interactive where
import Control.Monad
import System.Console.Readline
import System.Exit
import Language.K3.Interpreter
import Language.K3.Parser
import Language.K3.Pretty
-- | Run an interactive prompt, reading evaulating and printing at each step.
runInteract... | DaMSL/K3 | src/Language/K3/Driver/Interactive.hs | apache-2.0 | 773 | 0 | 15 | 174 | 190 | 96 | 94 | 20 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Distribution.Types.Module
( Module(..)
) where
import Prelude ()
import Distribution.Compat.Prelude
import qualified Distribution.Compat.ReadP as Parse
import qualified Text.PrettyPrint as Disp
i... | mydaum/cabal | Cabal/Distribution/Types/Module.hs | bsd-3-clause | 1,326 | 0 | 10 | 252 | 245 | 136 | 109 | 26 | 0 |
{-# LANGUAGE DataKinds #-}
-- | Finding files.
module Path.Find
(findFileUp
,findDirUp
,findFiles)
where
import Control.Monad
import Control.Monad.Catch
import Control.Monad.IO.Class
import System.IO.Error (isPermissionError)
import Data.List
import Path
import Path.IO
-- | Find the location of a file match... | mathhun/stack | src/Path/Find.hs | bsd-3-clause | 2,885 | 0 | 14 | 1,013 | 728 | 376 | 352 | 54 | 3 |
------------------------------------------------------------------
-- A primop-table mangling program --
------------------------------------------------------------------
module Main where
import Parser
import Syntax
import Data.Char
import Data.List
import Data.Maybe ( catMaybes )
impo... | nushio3/ghc | utils/genprimopcode/Main.hs | bsd-3-clause | 36,795 | 0 | 39 | 14,602 | 9,908 | 4,988 | 4,920 | 686 | 74 |
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS -fno-warn-orphans #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS -fno-warn-name-shadowing #-}
-- | Yesod foundation.
module HL.Foundation
(module HL.Static
,App(..)
,Route(..)
,Handler
,Widget
... | chrisdone/hl | src/HL/Foundation.hs | bsd-3-clause | 2,081 | 0 | 12 | 646 | 503 | 269 | 234 | 66 | 0 |
module Records where
import GHC.CString -- This import interprets Strings as constants!
import DataBase
data Value = I Int
{-@ rec :: {v:Dict <{\x y -> true}> String Value | listElts (ddom v) ~~ (Set_sng "bar")} @-}
rec :: Dict String Value
rec = ("foo" := I 8) += empty
unsafe :: Dict String Value
unsafe =... | Kyly/liquidhaskell | benchmarks/icfp15/neg/Records.hs | bsd-3-clause | 344 | 0 | 8 | 75 | 81 | 45 | 36 | 8 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/CopyClusterSnapshot.hs | mpl-2.0 | 6,175 | 0 | 9 | 1,190 | 584 | 364 | 220 | 72 | 1 |
module Main where
import System.Directory (findExecutable)
import System.Exit (exitFailure)
import System.IO
import qualified CommandLine.Arguments as Arguments
import qualified Manager
main :: IO ()
main =
do requireGit
manager <- Arguments.parse
env <- Manager.defaultEnvironment
result <- Man... | laszlopandy/elm-package | src/Main.hs | bsd-3-clause | 1,090 | 0 | 14 | 314 | 254 | 127 | 127 | 30 | 3 |
#!/usr/bin/env runhaskell
module Main (main) where
import Distribution.Simple
main :: IO ()
main = defaultMain
| tkonolige/dbignore | bytestring-trie/Setup.hs | bsd-3-clause | 114 | 0 | 6 | 18 | 30 | 18 | 12 | 4 | 1 |
module Test7 where
-- uses a variable in the lhs of f which is not used
f x y = y + 1
g = 1 + 1
| SAdams601/HaRe | old/testing/refacFunDef/Test7.hs | bsd-3-clause | 101 | 0 | 5 | 33 | 28 | 16 | 12 | 3 | 1 |
module LiftOneLevel.WhereIn1 where
--A definition can be lifted from a where or let to the top level binding group.
--Lifting a definition widens the scope of the definition.
--In this example, lift 'sq' in 'sumSquares'
--This example aims to test add parameters to 'sq'.
sumSquares x y = sq x + sq y
where... | RefactoringTools/HaRe | test/testdata/LiftOneLevel/WhereIn1.hs | bsd-3-clause | 445 | 0 | 7 | 145 | 84 | 44 | 40 | 7 | 2 |
-----------------------------------------------------------------------------
--
-- Pretty-printing assembly language
--
-- (c) The University of Glasgow 1993-2005
--
-----------------------------------------------------------------------------
{-# OPTIONS_GHC -fno-warn-orphans #-}
module PPC.Ppr (
pprNatCmmDe... | frantisekfarka/ghc-dsi | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | 22,463 | 0 | 18 | 8,045 | 7,215 | 3,552 | 3,663 | 540 | 72 |
main = print (id2 (id2 id2) (42::Int))
-- where
-- id2 = s k k
-- id2 x = s k k x
id2 = s k k
s x y z = x z (y z)
k x y = x
| olsner/ghc | testsuite/tests/codeGen/should_run/cgrun003.hs | bsd-3-clause | 138 | 0 | 9 | 56 | 75 | 39 | 36 | 4 | 1 |
{-# LANGUAGE TypeFamilies #-}
module T2436a( S ) where
data family S a
| ezyang/ghc | testsuite/tests/rename/should_compile/T2436a.hs | bsd-3-clause | 72 | 0 | 4 | 14 | 15 | 11 | 4 | 3 | 0 |
{-# LANGUAGE FlexibleContexts #-}
module GrammarParser where
import Data.Char (isSpace)
import Text.Parsec
import Grammar
grammarParser :: Stream s m Char => ParsecT s u m Grammar
grammarParser =
do spaces
prules <- many prule
eof
return (Grammar prules)
prule :: Stream s m Char => ParsecT s u m P... | romildo/gsynt | src/GrammarParser.hs | isc | 1,209 | 0 | 18 | 414 | 480 | 228 | 252 | 38 | 1 |
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE StandaloneDeri... | ihc/futhark | src/Futhark/Representation/AST/Attributes/Scope.hs | isc | 7,916 | 0 | 11 | 1,781 | 1,925 | 1,019 | 906 | 141 | 1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.SVGFilterPrimitiveStandardAttributes
(js_getX, getX, js_getY, getY, js_getWidth, getWidth, js_getHeight,
getHeight, js_getResult, getResult,
SVGFilterPrimitiveStandardAttributes,
cas... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/SVGFilterPrimitiveStandardAttributes.hs | mit | 3,891 | 30 | 11 | 609 | 753 | 434 | 319 | 71 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module Network.Xmpp.Xep.Jingle where
import Network.Xmpp.Xep.Jingle.Types
import Control.Arrow (first)
import Control.Concurrent
import Control.Concurrent.STM
import Control.Monad
import ... | Philonous/hs-jingle | source/Network/Xmpp/Xep/Jingle.hs | mit | 8,568 | 0 | 23 | 3,660 | 1,879 | 953 | 926 | 166 | 13 |
{-# LANGUAGE OverloadedStrings #-}
module CommandSwitch
( cmdSwitch
) where
import Control.Monad
import Data.Char
import Data.Maybe
import System.Directory
import System.Environment
import System.Exit
import Text.ParserCombinators.ReadP as P
import Turtle.Prelude
import qualified Data.Text as T
import qualified D... | Javran/misc | kernel-tool/src/CommandSwitch.hs | mit | 2,169 | 0 | 16 | 442 | 593 | 304 | 289 | 55 | 2 |
#!/usr/bin/env stack
-- stack runghc --resolver lts-7.15 --install-ghc --package text --package cassava
{-# LANGUAGE DeriveGeneric #-}
import qualified Data.Text as T
import qualified System.Environment as Env
import qualified Data.Csv as Csv
import Data.Csv ((.!))
import qualified Data.Vector as V
import qualified D... | NickAger/SGBASurveyExtraction | extractInstructors.hs | mit | 1,487 | 0 | 17 | 265 | 442 | 233 | 209 | 29 | 2 |
module Main where
import Control.Monad (forever)
import Data.Char (toLower)
import Data.Maybe (isJust)
import Data.List (intersperse)
import System.Exit (exitSuccess)
import System.Random (randomRIO)
newtype WordList = WordList [String]
deriving (Eq, Show)
allWords :: IO WordList
allWords = do
dict <- readFile "... | diminishedprime/.org | reading-list/haskell_programming_from_first_principles/hangman/src/Main.hs | mit | 3,290 | 0 | 14 | 818 | 1,066 | 530 | 536 | 96 | 3 |
module AppManagedEntity.Data.Virus
( Virus(..)
, VirusDiscoveredAt(..)
, VirusId(..)
, VirusName(..)
, bpsDiscoveredAt
, bpsVirusName
, brnDiscoveredAt
, brnVirusName
, bpsVirus
, brnVirus
) where
import Data.Int (Int64)
import Data.Text (Text)
import qualified Data.Text as Text
import qualified ... | flipstone/orville | orville-postgresql/test/AppManagedEntity/Data/Virus.hs | mit | 1,477 | 0 | 9 | 278 | 389 | 233 | 156 | 51 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
module Test.Smoke.Bless
( blessResult,
)
where
import Control.Exception (catch, throwIO)
import Control.Monad (foldM)
import Data.Map.Strict ((!))
import qualified Data.Map.Strict as Map
import Data.Text (Tex... | SamirTalwar/Smoke | src/lib/Test/Smoke/Bless.hs | mit | 3,804 | 0 | 22 | 602 | 1,269 | 651 | 618 | 67 | 3 |
{-# LANGUAGE OverloadedStrings, OverloadedLists, LambdaCase #-}
module Text.EasyJson.AST where
import Data.Text (Text)
import qualified Data.Text as T
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as H
import Data.List (intercalate)
import Data.Monoid
import Data.Vector (Vector)
import qual... | thinkpad20/easyjson | src/Text/EasyJson/AST.hs | mit | 1,095 | 0 | 11 | 291 | 381 | 199 | 182 | 36 | 6 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.WebKitCSSMatrix
(js_newWebKitCSSMatrix, newWebKitCSSMatrix, js_setMatrixValue,
setMatrixValue, js_multiply, multiply, js_inverse, inverse,
js_translate, translate, js_scale, scale, js_rotate... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/WebKitCSSMatrix.hs | mit | 21,654 | 408 | 11 | 3,499 | 4,888 | 2,606 | 2,282 | 301 | 1 |
module MemorySetQueue
( Q
, empty
, enque
, deque
, fromList
, toList
, getSet
, getAll
) where
import Prelude hiding (all)
import qualified Data.Set as S
data Q e t = Q [e] [e] [e] (S.Set t) (e -> t)
enque :: Ord t => e -> Q e t -> Q e t
enque x (Q [] _ _ _ f) = Q [x] [... | ornicar/haskant | src/MemorySetQueue.hs | mit | 1,067 | 0 | 10 | 373 | 680 | 349 | 331 | 30 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- Cards in The Gathering Storm expansion
module Game.RftG.Cards.Promo where
import Game.RftG.Core
import Game.RftG.Card
-------------------------------------------------------------------------------
-- Cards
-- reference: http://racepics.weihwa.com/tgs.html
---------------------... | gspindles/rftg-cards | src/Game/RftG/Cards/Promo.hs | mit | 1,887 | 0 | 8 | 310 | 403 | 228 | 175 | 74 | 1 |
module Hearthstone.CardType (
CardType(..)
, toCardType
, fromCardType
) where
import Control.Lens
data CardType = CtMinion -- 4
| CtSpell -- 5
deriving (Show, Eq)
fromCardType :: CardType -> Int
fromCardType CtMinion = 4
fromCardType CtSpell = 5
toCardType :: Int -> Maybe CardType
... | jb55/hearthstone-cards | src/Hearthstone/CardType.hs | mit | 401 | 0 | 6 | 96 | 116 | 64 | 52 | 15 | 1 |
{- Raybox.hs; Mun Hon Cheong (mhch295@cse.unsw.edu.au) 2005
This module performs collision tests between AABBs, spheres and rays.
-}
module Raybox where
import Matrix
-- tests if a ray intersects a box
rayBox :: (Double,Double,Double) -> (Double,Double,Double) ->
(Double,Double,Double) -> (Double,D... | pushkinma/frag | src/Raybox.hs | gpl-2.0 | 2,202 | 0 | 15 | 497 | 1,130 | 620 | 510 | 40 | 1 |
module Account where
import Control.Concurrent
import Control.Concurrent.STM
-- Represent the balance of the account
type Account = TVar Int
-- transfer `amount` from account `from` to account `to`
transfer :: Account -> Account -> Int -> IO ()
transfer from to amount =
atomically (
do deposit to amount
... | ardumont/haskell-lab | src/concurrency/account.hs | gpl-2.0 | 2,288 | 0 | 11 | 558 | 641 | 313 | 328 | 55 | 1 |
{-
pandoc-crossref is a pandoc filter for numbering figures,
equations, tables and cross-references to them.
Copyright (C) 2015 Nikolay Yakimov <root@livid.pp.ru>
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... | lierdakil/pandoc-crossref | lib/Text/Pandoc/CrossRef.hs | gpl-2.0 | 5,161 | 0 | 15 | 1,110 | 605 | 333 | 272 | 59 | 1 |
{- |
Module : ./Common/AnnoParser.hs
Description : parsers for annotations and annoted items
Copyright : (c) Klaus Luettich, Christian Maeder and Uni Bremen 2002-2006
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : portable
Pa... | gnn/Hets | Common/AnnoParser.hs | gpl-2.0 | 8,171 | 0 | 20 | 2,261 | 2,679 | 1,326 | 1,353 | 208 | 6 |
module Machine.Akzeptieren
where
-- $Id$
import Machine.Class
-- import Machine.Vorrechnen
import Machine.History
import Control.Monad (guard)
import Autolib.Reporter hiding ( output )
import Autolib.ToDoc
import Autolib.Set
-- | einige akzeptierende Rechnungen
akzeptierend
:: Machine m dat conf
=> Int... | florianpilz/autotool | src/Machine/Akzeptieren.hs | gpl-2.0 | 2,479 | 52 | 12 | 757 | 878 | 453 | 425 | -1 | -1 |
--- 9. ukol - #2 (ceasar) ---
--- Petr Belohlavek ---
import Data.Char
-- caesar n slovo - prevede slovo na ceaserovskou sifru s posunem n
-- funguje i na zaporna n
-- prevedi mala pismena, velka pismena a cislice
-- ostatni znaky necha jak jsou
-- pr:
---- > caesar 3 "Caesar123,.!?"
---- "Fdhvdu456,.!?"
---- > caesa... | machl/NPRG005-non-procedural-programming | task9/caesar.hs | gpl-2.0 | 1,067 | 0 | 18 | 257 | 405 | 217 | 188 | 7 | 1 |
-- -*- mode: haskell -*-
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses #-}
module Boolean.Instance where
-- $Id$
import Boolean.Op
import qualified Autolib.TES.Binu as B
import qualified Boolean.Equiv
import Challenger.Partial
import qualified Aut... | Erdwolf/autotool-bonn | src/Boolean/Instance.hs | gpl-2.0 | 2,652 | 64 | 16 | 690 | 781 | 438 | 343 | 68 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.