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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
import Data.List
import Data.Char
countsOf :: Int -> [Int] -> Int
countsOf _ [] = 0
countsOf x (y:ys)
| x == y = 1 + countsOf x ys
| otherwise = countsOf x ys
counts :: [Int] -> [(Int, Int)]
counts [] = []
counts xs = nub $ map (\a -> (a, (countsOf a xs))) (xs `union` [1..9])
addChars :: Char -> Int -> Stri... | richard12511/potential-golf-waffle | app/Histogram.hs | bsd-3-clause | 949 | 0 | 11 | 202 | 459 | 238 | 221 | 27 | 1 |
module Tct.Common.Ring
(
module Tct.Core.Common.SemiRing
, AdditiveGroup (..)
, Ring
) where
import Tct.Core.Common.SemiRing
-- | Extends 'Additive' to a additive group with inverse elements.
class Additive a => AdditiveGroup a where
neg :: a -> a
sub :: a -> a -> a
sub a b = a `add` neg b
-- | ... | ComputationWithBoundedResources/tct-common | src/Tct/Common/Ring.hs | bsd-3-clause | 580 | 0 | 8 | 129 | 130 | 78 | 52 | 13 | 0 |
module Holes where
import Text.Syntactical
import Text.Syntactical.Data
table :: Table String
table = buildTable
[ [ closed_ "(" Distfix ")"
, closed_ "⟨" SExpression "⟩"
, closed "</" Distfix "/>"
, closed "{" SExpression "}"
, closed "{" SExpression "|" `distfix` "}"
, closed "[" Distfix "]"
, cl... | noteed/syntactical | tests/Holes.hs | bsd-3-clause | 2,104 | 0 | 10 | 496 | 570 | 356 | 214 | 59 | 1 |
module Paths_k_means (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
catchIO :: IO a -> (Exception.IOException -> IO a) -... | daniel-pape/haskell-meetup-k-means | .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/autogen/Paths_k_means.hs | bsd-3-clause | 1,641 | 0 | 10 | 177 | 362 | 206 | 156 | 28 | 1 |
-- Copyright (c) 1998 Chris Okasaki.
-- See COPYRIGHT file for terms and conditions.
module Assoc ( -- associative collections
{-
-- non-observable classes
AssocX(..),
OrdAssocX(..),
FiniteMapX(..),
OrdFiniteMapX(..),
-- observable classes
Assoc(..),
OrdAssoc(..),
FiniteMap(..),
... | OS2World/DEV-UTIL-HUGS | oldlib/Assoc.hs | bsd-3-clause | 8,029 | 0 | 12 | 2,869 | 3,360 | 1,699 | 1,661 | -1 | -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.
module Duckling.D... | rfranek/duckling | Duckling/Dimensions/PL.hs | bsd-3-clause | 516 | 0 | 6 | 98 | 64 | 39 | 25 | 9 | 1 |
{-# language CPP #-}
-- No documentation found for Chapter "Promoted_From_VK_KHR_shader_subgroup_extended_types"
module Vulkan.Core12.Promoted_From_VK_KHR_shader_subgroup_extended_types ( PhysicalDeviceShaderSubgroupExtendedTypesFeatures(..)
, S... | expipiplus1/vulkan | src/Vulkan/Core12/Promoted_From_VK_KHR_shader_subgroup_extended_types.hs | bsd-3-clause | 5,014 | 0 | 14 | 688 | 797 | 469 | 328 | -1 | -1 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.InstallPlan
-- Copyright : (c) Duncan Coutts 2008
-- License : BSD-like
--
-- Maintainer : duncan@community.haskell.org
-- Stability : provisional
-- Portability : portable
--
-- Packag... | yihuang/cabal-install | Distribution/Client/InstallPlan.hs | bsd-3-clause | 20,709 | 0 | 16 | 4,521 | 3,540 | 1,914 | 1,626 | 303 | 6 |
{-# LANGUAGE OverloadedStrings #-}
module Codex.Meetup.M1.Compression.GZip (
compress,
decompress,
compressFile,
decompressFile
) where
import qualified Codex.Lib.Compression as C
(Compression (..))
import Data.List
(stripPrefix)
import qualified Data.ByteString.Lazy as B
import qualified Codec.Compression.GZi... | adarqui/Codex | src/Codex/Meetup/M1/Compression/GZip.hs | bsd-3-clause | 1,302 | 0 | 16 | 214 | 425 | 223 | 202 | 38 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
module Dummy.Api.Api where
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Reader (ReaderT, lift, runReaderT)
import Control.Monad.Trans.Either (EitherT... | denibertovic/dummy-api | src/Dummy/Api/Api.hs | bsd-3-clause | 7,637 | 0 | 22 | 2,389 | 2,840 | 1,405 | 1,435 | 207 | 2 |
{-# LANGUAGE ViewPatterns, MagicHash, BangPatterns #-}
module CVUtils where
import Codec.Image.DevIL
import Data.Array.Unboxed
import Math.Probably.MCMC
import Math.Probably.Sampler
import Math.Probably.FoldingStats
import Control.Monad.State.Strict
import System.Cmd
import System.Environment
import Data.Array.IO
im... | glutamate/cvutils | CVUtils.hs | bsd-3-clause | 5,345 | 0 | 18 | 1,675 | 2,233 | 1,165 | 1,068 | 146 | 2 |
-- -*- flycheck-disabled-checkers: '(haskell-ghc haskell-stack-ghc); -*-
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ScopedTypeV... | conal/reification-rules | test/Shaped.hs | bsd-3-clause | 10,102 | 0 | 14 | 2,253 | 2,558 | 1,399 | 1,159 | 95 | 1 |
divisibleByEleven = filter (\x -> mod x 11 == 0) [100..999]
isPalindrome :: Integer -> Bool
isPalindrome x = read(reverse(show x)) == x
problem4 = maximum [x*y|x <- [100..999], y<-divisibleByEleven, isPalindrome (x*y)]
| thomas-oo/projectEulerHaskell | src/Problem4.hs | bsd-3-clause | 221 | 0 | 10 | 34 | 119 | 61 | 58 | 4 | 1 |
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances #-}
-- TODO: DataTypeConvertor
module Lambda.Convertor (
module Lambda.Convertor.Type,
module Lambda.Convertor.PatternMatch,
module Lambda.Convertor.SExpr,
module Lambda.Convertor.Expr,
module Lambda.Convertor.Term,
) where
import DeepContro... | ocean0yohsuke/Simply-Typed-Lambda | src/Lambda/Convertor.hs | bsd-3-clause | 7,077 | 0 | 13 | 2,035 | 2,464 | 1,246 | 1,218 | 97 | 0 |
module SpaceAge (Planet(..), ageOn) where
data Planet = Mercury
| Venus
| Earth
| Mars
| Jupiter
| Saturn
| Uranus
| Neptune
type Seconds = Double
type Years = Double
ageOn :: Planet -> Seconds -> Years
ageOn planet seconds = seconds... | stevejb71/xhaskell | space-age/example.hs | mit | 652 | 0 | 9 | 208 | 178 | 99 | 79 | 24 | 8 |
{-# 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-opsworks/gen/Network/AWS/OpsWorks/StopStack.hs | mpl-2.0 | 3,265 | 0 | 12 | 720 | 403 | 245 | 158 | 57 | 1 |
-- | Startup up the frontend together with the server, which starts up clients.
module Game.LambdaHack.Client.UI.StartupFrontendClient
( srtFrontend
) where
import Control.Concurrent.Async
import qualified Control.Concurrent.STM as STM
import Control.Exception.Assert.Sugar
import Game.LambdaHack.Client.State
impo... | Concomitant/LambdaHack | Game/LambdaHack/Client/UI/StartupFrontendClient.hs | bsd-3-clause | 3,078 | 0 | 18 | 733 | 573 | 314 | 259 | -1 | -1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
-- |
-- This module contains the Protobuf Parser.
module Data.Katydid.Parser.Protobuf.Protobuf
( tests
)
where
import Data.ByteString ( ByteString )
import Data.Word ( Word64
... | katydid/haslapse | src/Data/Katydid/Parser/Protobuf/Protobuf.hs | bsd-3-clause | 11,728 | 0 | 24 | 4,115 | 3,055 | 1,629 | 1,426 | 231 | 21 |
module AddLocalDecl2 where
-- |This is a function
foo = x -- comment 0
where p = 2 -- comment 1
-- |Another fun
bar = a -- comment 2
where p = 2 -- comment 3
nn = 2
| mpickering/ghc-exactprint | tests/examples/transform/AddLocalDecl3.hs | bsd-3-clause | 179 | 0 | 6 | 54 | 39 | 26 | 13 | 6 | 1 |
------------------------------------------------------------------------
-- |
-- Module : Main
-- Copyright : (c) Amy de Buitléir 2013-2018
-- License : BSD-style
-- Maintainer : amy@nualeargais.ie
-- Stability : experimental
-- Portability : portable
--
-- Do a full analysis of a wain and generate ... | mhwombat/prediction-wains | appExamineAgent/Main.hs | bsd-3-clause | 678 | 0 | 9 | 105 | 101 | 62 | 39 | 9 | 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="hi-IN">
<title>ToDo-List</title>
<maps>
<homeID>todo</homeID>
<mapref location="map.jhm... | kingthorin/zap-extensions | addOns/todo/src/main/javahelp/help_hi_IN/helpset_hi_IN.hs | apache-2.0 | 955 | 77 | 67 | 155 | 408 | 207 | 201 | -1 | -1 |
{-# LANGUAGE PolyKinds #-}
module T11964a where
import Data.Kind
type Star = Type
newtype T k (t :: k) = T ()
| sdiehl/ghc | testsuite/tests/dependent/should_run/T11964a.hs | bsd-3-clause | 110 | 0 | 6 | 22 | 34 | 23 | 11 | 5 | 0 |
{-# LANGUAGE TypeFamilies #-}
module T6018Bfail where
type family H a b c = (result :: *) | result -> a b c
| acowley/ghc | testsuite/tests/typecheck/should_fail/T6018Bfail.hs | bsd-3-clause | 110 | 0 | 6 | 25 | 29 | 22 | 7 | 3 | 0 |
{-# LANGUAGE Arrows #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RecordWildCards #-}
{-
Copyright (C) 2015 Martin Linnemann <theCodingMarlin@googlemail.com>
This program is free software; you can redistribute it and/or modify
it under the... | ddssff/pandoc | src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs | gpl-2.0 | 44,519 | 4 | 18 | 15,229 | 6,685 | 3,616 | 3,069 | -1 | -1 |
module Workers (initialiseWorkers) where
import Crawl
import Errors as E
import Output as O
import Settings
import Types as T
import CountedQueue (CountedQueue)
import Control.Concurrent (ThreadId, forkIO)
import Control.Concurrent.STM (STM, atomically)
import qualified Service
import... | jahaynes/crawler | src/Workers.hs | mit | 2,024 | 0 | 11 | 539 | 510 | 266 | 244 | 41 | 1 |
module Graphics.Gloss.Data.Quad
( Quad(..)
, allQuads)
where
-- | Represents a Quadrant in the 2D plane.
data Quad
= NW -- ^ North West
| NE -- ^ North East
| SW -- ^ South West
| SE -- ^ South East
deriving (Show, Eq, Enum)
-- | A list of all quadrants. Same as @[NW .. SE]@.
allQuads :: [Quad]
allQuads =... | gscalzo/HaskellTheHardWay | gloss-try/gloss-master/gloss/Graphics/Gloss/Data/Quad.hs | mit | 332 | 6 | 6 | 80 | 82 | 53 | 29 | 11 | 1 |
module ProjectEuler.Problem103
( problem
) where
import ProjectEuler.Types
import ProjectEuler.Problem105 (findSpecialSubsets)
problem :: Problem
problem = pureProblem 103 Solved result
{-
First guess: looking at last number of each optimum set:
> 1,2,4,7,13,25
From the looks of it we may want to assume ... | Javran/Project-Euler | src/ProjectEuler/Problem103.hs | mit | 1,376 | 0 | 8 | 275 | 80 | 45 | 35 | 10 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Network.HMAC.Types where
import Data.ByteString
data AuthAttrKey
= IdKey
| TsKey
| NonceKey
| ExtKey
| MacKey
deriving (Enum,Eq,Ord,Show)
data AuthAttrVal
= IdVal { idVal :: ByteString }
| TsVal { tsVal :: Int... | dysinger/hmac | src/Network/HMAC/Types.hs | mit | 954 | 0 | 9 | 262 | 296 | 176 | 120 | 42 | 0 |
module SFML.Utils
(
err
, tagErr
)
where
import Control.Exception (Exception, throwIO)
-- | Run the given IO action and throw an error if it fails.
err :: Exception e => IO (Either e a) -> IO a
err = (either throwIO return =<<)
-- | Potentially tag a 'Maybe' value with an error.
tagErr :: e -> Maybe a -> Ei... | SFML-haskell/SFML | src/SFML/Utils.hs | mit | 391 | 0 | 9 | 91 | 126 | 66 | 60 | 10 | 1 |
-- Haskell
-- note
-- whereのありがたみをちゃんと理解できていない
-- Pattern matchの基礎であるMaybe型をしっかりやり直す
-- folrの考え方をやり直す
-- 型シノニム
-- uncurry忘れかけてない?
-- 次回復習はここからrepeat replicate cycle
-- 次回は直交座標と極座標 https://skami.iocikun.jp/computer/haskell/web_lecture/for_programmer/cartesian_polar.html
import Data.Char
-- type Cartesian = (Doubl... | threetreeslight/learning-haskell | practice/old/20151115.hs | mit | 4,551 | 0 | 9 | 890 | 1,171 | 647 | 524 | 63 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module SocialDB
( SocialDB(..), User(..), Post(..), PostId(..)
, emptySocialDB
, feed, waitForFe... | mcschroeder/social-example | social2/SocialDB.hs | mit | 7,485 | 0 | 15 | 1,913 | 2,325 | 1,157 | 1,168 | 191 | 2 |
{-# LANGUAGE NamedFieldPuns #-}
module Hage.Game.Arkanoid.EventHandler where
import Control.Arrow
import qualified Graphics.UI.SDL as SDL
import Reactive.Banana
import Reactive.Banana.SDL
import Hage.Game.Arkanoid.Consts
import Hage.Game.Arkanoid.GameState
keyboardHandle :: WrappedEvent t -> Event t (GameState -> G... | Hinidu/Arkanoid | src/Hage/Game/Arkanoid/EventHandler.hs | mit | 1,042 | 0 | 14 | 218 | 292 | 158 | 134 | 25 | 4 |
module Import
( module Import
) where
import Foundation as Import
import Import.NoFoundation as Import
import Storage as Import
| wfleming/tee-io | src/Import.hs | mit | 164 | 0 | 4 | 55 | 27 | 20 | 7 | 5 | 0 |
module CSharp.Definitions
(
Argument (..)
, ClassMember (..)
, ClassRef (..)
, Definition (..)
, Expression (..)
, File (..)
, FuncRef (..)
, Project (..)
, Statement (..)
) where
type Name = String
data Project = Project [File] deriving (Show)
data File = File FilePath [... | danstiner/transpiler | src/CSharp/Definitions.hs | mit | 1,001 | 0 | 7 | 238 | 304 | 185 | 119 | 35 | 0 |
module CovenantEyes.Api.Internal.UrlEncoding where
import CovenantEyes.Api.Internal.Prelude
import Data.CaseInsensitive (CI)
import qualified Data.CaseInsensitive as CI
import Data.Text.Encoding (encodeUtf8, decodeUtf8)
import qualified Network.HTTP.Types.URI as Uri
import Cov... | 3noch/covenanteyes-api-hs | src/CovenantEyes/Api/Internal/UrlEncoding.hs | mit | 910 | 0 | 7 | 168 | 232 | 134 | 98 | 22 | 0 |
module SRC.Interaction
( display
, showPercentage
, newSection
, askNumber
, selectionMenu
, askFolderHavingFiles
, plural
) where
import qualified System.Directory as D
import qualified Text.Printf as T
import qualified SRC.File as F
showPercentage :: Double -> String
showPercentage = showPercentageWithPrecision de... | Fornost461/drafts-and-stuff | Haskell/projects/teacher/SRC/Interaction.hs | cc0-1.0 | 4,100 | 1 | 23 | 1,225 | 1,127 | 571 | 556 | 83 | 4 |
{-
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-internal/Text/Pandoc/CrossRef/Util/CustomLabels.hs | gpl-2.0 | 2,046 | 0 | 12 | 373 | 472 | 235 | 237 | 31 | 1 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GADT... | tlaitinen/receipts | backend/Handler/DB/RouteUsergroupitemsUserGroupItem.hs | gpl-3.0 | 4,907 | 0 | 23 | 1,272 | 1,154 | 664 | 490 | 114 | 5 |
{-
nix-eval: Dependency-injecting Haskell evaluator
Copyright (C) 2015 Chris Warburton
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later ... | Warbo/nix-eval | src/Language/Eval.hs | gpl-3.0 | 926 | 0 | 5 | 177 | 72 | 50 | 22 | 15 | 0 |
module Application.Game.Engine.Runtime where
import Application.Game.GameState
import View.Runtime
import Middleware.Config.Facade
import Control.Monad.State (get, put, StateT(..))
import Control.Monad.State.Class
import Control.Monad (liftM)
data GameRt = GameRt { grtConfiguration :: Configuration
... | graninas/ICFPC2007 | Endo/Application/Game/Engine/Runtime.hs | gpl-3.0 | 984 | 0 | 9 | 200 | 283 | 161 | 122 | 24 | 1 |
------------------------------------------------------------------------------
--
-- LANGLANG.HS
--
-- Copyright © 2009-2010, Rehno Lindeque. All rights reserved.
--
------------------------------------------------------------------------------
{-# LANGUAGE ForeignFunctionInterface #-}
module LangLang.Debug( prin... | rehno-lindeque/poet | src/haskell/LangLang/Debug.hs | gpl-3.0 | 2,321 | 0 | 9 | 558 | 445 | 228 | 217 | 30 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-cloudtasks/gen/Network/Google/Resource/CloudTasks/Projects/Locations/Queues/Tasks/List.hs | mpl-2.0 | 7,988 | 0 | 19 | 1,742 | 980 | 574 | 406 | 144 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-admin-directory/gen/Network/Google/Resource/Directory/Roles/Update.hs | mpl-2.0 | 4,988 | 0 | 21 | 1,301 | 865 | 502 | 363 | 123 | 1 |
wrapPatPrepend pat prepElem = do
patDocs <- layoutPat pat
case Seq.viewl patDocs of
Seq.EmptyL -> return $ Seq.empty
x1 Seq.:< xR -> do
x1' <- docSeq [prepElem, return x1]
return $ x1' Seq.<| xR
| lspitzner/brittany | data/Test282.hs | agpl-3.0 | 221 | 0 | 15 | 60 | 91 | 42 | 49 | 7 | 2 |
module Jaek.UI.Controllers (
module C
)
where
import Jaek.UI.Controllers.Base as C
import Jaek.UI.Controllers.Clipboard as C
import Jaek.UI.Controllers.Drags as C
import Jaek.UI.Controllers.Edit1 as C
import Jaek.UI.Controllers.Nav as C
| JohnLato/jaek | src/Jaek/UI/Controllers.hs | lgpl-3.0 | 241 | 0 | 4 | 31 | 58 | 44 | 14 | 7 | 0 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Main where
import qualified Data.ByteString as B
import qualified Data.ByteString.Builder as B
import qualified Data.Attoparsec.ByteString as A
import Data.ByteString.Lazy (toStrict)
import Data.Word
import ... | tsahyt/midi-simple | test/Test.hs | lgpl-3.0 | 8,305 | 0 | 18 | 2,647 | 2,190 | 1,151 | 1,039 | 200 | 1 |
module Haskoin.Protocol.InvVector
( InvVector(..)
, InvType(..)
) where
import Control.Applicative ((<$>),(<*>))
import Data.Binary (Binary, get, put)
import Data.Binary.Get (getWord32le)
import Data.Binary.Put (putWord32le)
import Haskoin.Crypto (Hash256)
data InvType = InvError | InvTx | InvBlock
deriving (... | OttoAllmendinger/haskoin-protocol | src/Haskoin/Protocol/InvVector.hs | unlicense | 931 | 0 | 11 | 288 | 294 | 163 | 131 | 32 | 0 |
module Data.BDoc where
import Data.Bson
import Data.Text(Text)
class BDoc a where
model :: a
collection :: a -> Text
toDocument :: a -> Document
fromDocument :: Document -> Maybe a
| lucasdicioccio/haskell-paris-src | Data/BDoc.hs | apache-2.0 | 223 | 0 | 8 | 72 | 65 | 36 | 29 | 8 | 0 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UnicodeSyntax #-}
import Options.Applicative (fullDesc, progDesc)
import LogicGrowsOnTrees.Parallel.Main
import LogicGrowsOnTrees.Parallel.Adapter.Threads
import LogicGrowsOnTrees.Utils.PerfectTree
import LogicGrowsOnTrees.Utils.WordSum
main :: IO ()
main =
mainFor... | gcross/LogicGrowsOnTrees | LogicGrowsOnTrees/examples/count-all-trivial-tree-leaves.hs | bsd-2-clause | 767 | 0 | 15 | 190 | 162 | 86 | 76 | 19 | 3 |
{-#LANGUAGE OverloadedStrings#-}
module HsVerilog.Library where
import HsVerilog.Type
import HsVerilog.Verilog
dff :: Circuit
dff = circuit "dff" $ do
clk <- input "clk" Bit
rstn <- input "rstn" Bit
din <- input "din" Bit
_dout <- output "dout" Bit
reg' "dout" Bit [Posedge clk,Negedge rstn] $
If (Not (S... | junjihashimoto/hsverilog | src/HsVerilog/Library.hs | bsd-3-clause | 624 | 0 | 13 | 161 | 283 | 133 | 150 | 24 | 1 |
{-# OPTIONS -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- fo... | ekmett/ghc | compiler/nativeGen/SPARC/Imm.hs | bsd-3-clause | 1,630 | 45 | 11 | 365 | 273 | 164 | 109 | 35 | 7 |
{-# LANGUAGE CPP, RecordWildCards, FlexibleInstances, MultiParamTypeClasses #-}
-- |
-- Package configuration information: essentially the interface to Cabal, with
-- some utilities
--
-- (c) The University of Glasgow, 2004
--
module PackageConfig (
-- $package_naming
-- * UnitId
packageConfig... | snoyberg/ghc | compiler/main/PackageConfig.hs | bsd-3-clause | 5,552 | 0 | 11 | 1,332 | 1,058 | 558 | 500 | 94 | 2 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Distributed.Process.Task.Pool
-- C... | haskell-distributed/distributed-process-task | src/Control/Distributed/Process/Task/Pool.hs | bsd-3-clause | 6,015 | 0 | 12 | 1,274 | 908 | 546 | 362 | 102 | 1 |
module Validations.Parsers.Helpers
( testPhoneParser
, testPhoneParserDoesNotParse
) where
import Validations.Parsers
import Data.Text(Text)
import Validations.Types.PhoneNumber(PhoneNumber)
import Test.Framework (Test, TestName)
import Test.Framework.Providers.HUnit (testCase)
imp... | mavenraven/validations-checkers | tests/Validations/Parsers/Helpers.hs | bsd-3-clause | 1,025 | 0 | 11 | 195 | 287 | 153 | 134 | 19 | 2 |
module RealWorld.Api.Prelude
( module A ) where
import RealWorld.Prelude as A
import Servant as A
import RealWorld.Model.Errors as A (Errors)
import RealWorld.Model.Field as A (Field)
import RealWorld.Monad as A
| zudov/servant-realworld-example-app | src/RealWorld/Api/Prelude.hs | bsd-3-clause | 226 | 0 | 5 | 43 | 58 | 41 | 17 | 7 | 0 |
module Target.TypeCheck (typecheck, eval) where
import Common
import Control.Applicative
import Control.Monad.Except
import Control.Monad.Trans.Maybe
import qualified Data.Text as T
import Env
import PrettyPrint
import Target.... | lihuanglx/disjoint-intersection | src/Target/TypeCheck.hs | bsd-3-clause | 3,526 | 0 | 17 | 1,272 | 1,619 | 790 | 829 | 121 | 8 |
{-# OPTIONS -Wall #-}
{-# LANGUAGE DeriveDataTypeable #-}
-- The pec embedded compiler
-- Copyright 2011-2012, Brett Letner
module Main where
import Data.Char
import Grm.Prims
import Pec.HUtil
import Pec.PUtil
import System.Console.CmdArgs
import System.FilePath
import qualified Language.Haskell as H
data Args = Ar... | stevezhee/pec | src/PecGenCnt.hs | bsd-3-clause | 1,446 | 0 | 18 | 352 | 567 | 293 | 274 | 46 | 2 |
-- |Primitive parsers
module Data.Deciparsec.Prim
( -- * Single Token
satisfy, token, char, anyToken, eof
-- * Multiple Tokens
, takeWith, take, tokenSeq, string
-- * Error Reporting
, (<?>), unexpected
-- * Combinator
, notFollowedBy, lookAhead
) where
import Prelude hiding... | d3tucker/deciparsec | src/Data/Deciparsec/Prim.hs | bsd-3-clause | 4,782 | 0 | 15 | 1,101 | 1,250 | 666 | 584 | -1 | -1 |
module LSC2012.TestRedBlack where
import Data.Data
import Test.LazySmallCheck2012
import Benchmarks.RedBlack
import System.Environment
instance Serial Colour where
series = cons0 R \/ cons0 B
instance Serial a => Serial (Tree a) where
series = cons0 E \/ cons4 T
bench d = depthCheck (read d) prop_insertRB
| UoYCS-plasma/LazySmallCheck2012 | suite/performance/LSC2012/TestRedBlack.hs | bsd-3-clause | 317 | 0 | 7 | 54 | 104 | 53 | 51 | 10 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
module Events where
import Data.Time.Clock.POSIX
import Client.Facebook
import Client.Login
import Text.JSON
import Text.JSON.Generic
import FUtil
data Event = Event
{name:: String,
tagline:: Maybe String,
description:: Maybe String
} deriving (Data, Typeable, S... | srush/TextBook | src/Events.hs | bsd-3-clause | 637 | 0 | 11 | 128 | 163 | 88 | 75 | 18 | 1 |
module Main where
import qualified Apps.X.Repl as Repl
main :: IO ()
main = Repl.main
| haroldcarr/juno | z-no-longer-used/app/X/Repl.hs | bsd-3-clause | 88 | 0 | 6 | 17 | 30 | 19 | 11 | 4 | 1 |
--------------------------------------------------------------------
-- |
-- Module : Text.XML.Light.Proc
-- Copyright : (c) Galois, Inc. 2007
-- License : BSD3
--
-- Maintainer: Iavor S. Diatchki <diatchki@galois.com>
-- Stability : provisional
-- Portability:
--
--------------------------------------------------... | amremam2004/vxmlizer | Text/XML/Light/Proc.hs | bsd-3-clause | 4,074 | 0 | 10 | 873 | 867 | 470 | 397 | 42 | 1 |
module Zero.SessionToken.Relations
(
defineSessionTokenRelation
, sessionTokenAttributes
) where
import qualified Data.Vector as V
import Control.Monad (unless)
import Zero.Persistence
import Zero.Token.Internal
------------------------------------------------------------------------------
-- Relational At... | et4te/zero | server/src/Zero/SessionToken/Relations.hs | bsd-3-clause | 2,303 | 0 | 13 | 380 | 537 | 281 | 256 | 52 | 2 |
{-# LANGUAGE NoImplicitPrelude #-}
module Protocol.ROC.PointTypes.PointType177 where
import Data.Binary.Get (getByteString,
getWord8,
getWord16le,
getWord32le,
Get)
import Data.ByteString (ByteString)
im... | plow-technologies/roc-translator | src/Protocol/ROC/PointTypes/PointType177.hs | bsd-3-clause | 12,940 | 0 | 9 | 3,528 | 1,049 | 614 | 435 | 211 | 1 |
module System.IO.Temp (
withSystemTempFile, withSystemTempDirectory,withCanonicalizedSystemTempDirectory,
withTempFile, withTempDirectory,
module Distribution.Compat.TempFile
) where
-- NB: this module was extracted directly from "Distribution/Simple/Utils.hs"
-- in a Cabal tree whose most recent commit ... | robstewart57/temporary-1 | System/IO/Temp.hs | bsd-3-clause | 4,593 | 0 | 13 | 978 | 621 | 353 | 268 | 46 | 1 |
module Chap5 where
import Lib
-- CHAPTER 5
-- Exercises: Type Matching
-- 1.
-- not :: Bool -> Bool
-- length :: [a] -> Integer
-- real length :: Foldable t => t a -> Int
-- concat :: Foldable t => t [a] -> [a]
-- head :: Foldable t => t a => a
-- real head :: [a] -> a
-- (<) :: Ord a => a -> a -> Bool
-- f t
... | tkasu/haskellbook-adventure | app/Chap5.hs | bsd-3-clause | 1,552 | 0 | 8 | 422 | 412 | 239 | 173 | 30 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE ExistentialQ... | chrisdone/ghc-server | src/GHC/Server/Types.hs | bsd-3-clause | 15,050 | 0 | 22 | 4,199 | 3,853 | 2,021 | 1,832 | 321 | 0 |
module Control.Exception.Labeled
( labeledCatch
) where
import Control.Exception (catch, SomeException)
-- Labels and rethrows an exception.
labeledCatch :: String -> IO a -> IO a
labeledCatch lbl f = catch f labelAndRethrow
where labelAndRethrow :: SomeException -> IO a
labelAndRethrow e = error $ lbl ++ "... | sethfowler/pygmalion | src/Control/Exception/Labeled.hs | bsd-3-clause | 336 | 0 | 9 | 63 | 100 | 53 | 47 | 7 | 1 |
{-# LANGUAGE
DeriveDataTypeable
, DeriveGeneric
, TemplateHaskell
, TypeFamilies
#-}
module Type.CustomerInfo where
import Data.Aeson
import Data.JSON.Schema
import Data.Typeable
import GHC.Generics
import Generics.Regular
import Generics.Regular.XmlPickler
import Text.XML.HXT.Arrow.Pickle
import qualifie... | tinkerthaler/basic-invoice-rest | example-api/Type/CustomerInfo.hs | bsd-3-clause | 718 | 0 | 9 | 101 | 147 | 85 | 62 | 23 | 0 |
class Growable g where
grow :: g -> Maybe g
add :: g -> g -> g
growingSum :: g -> g
growingSum g = case grow g of
Just g' -> g `add` growingSum g'
Nothing -> g
instance Growable Integer where
grow n | n < 100 = Just $ n + 1
| otherwise = Nothing
add = (+)
growingSum n = (100 - n + 1) * (100 + n) `div` 2
| YoshikuniJujo/funpaala | samples/26_type_class/growable1.hs | bsd-3-clause | 319 | 0 | 11 | 90 | 169 | 86 | 83 | 12 | 0 |
increment :: (Integer, Integer, Integer) -> (Integer, Integer, Integer)
increment (year, month, day) = (year', month', day')
where
day' :: Integer
day' = day + (num_days_in_month year month)
month' :: Integer
month' = (month `mod` 12) + 1
year' :: Integer
year' = if month' == 1
then year + 1
else ... | bgwines/project-euler | src/solved/problem19.hs | bsd-3-clause | 1,013 | 16 | 13 | 261 | 487 | 272 | 215 | 44 | 13 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-}
-- |
-- Module : Statistics.Distribution.Normal
-- Copyright : (c) 2009 Bryan O'Sullivan
-- License : BSD3
--
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability... | bos/statistics | Statistics/Distribution/Normal.hs | bsd-2-clause | 5,909 | 1 | 12 | 1,564 | 1,481 | 785 | 696 | 120 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- | This module provides list utility functions and specialized list
-- representations used within Hagl.
module Hagl.Lists where
import Control.Monad.IO.Class
import Data.List (elemIndex,intercalate,nub,sort)
import Data.Maybe (fromJust)
import System.Random (ra... | pparkkin/Hagl | Hagl/Lists.hs | bsd-3-clause | 7,641 | 0 | 12 | 1,628 | 1,945 | 1,027 | 918 | 108 | 1 |
{-# LANGUAGE DeriveGeneric #-}
module UUT where
import qualified Arrays as A
import qualified Bags as B
import qualified Sets as S
import qualified Sequences as Q
import Assertion
import GHC.Generics
-- Searching in a Binary Search tree
-- This is an example where the user defines a new type
data Tree a = Node (Tr... | pegartillo95/CaseGenerator | src/UUT.hs | bsd-3-clause | 1,016 | 0 | 8 | 263 | 388 | 211 | 177 | 31 | 1 |
module Models.Tree where
import BasicPrelude
import Data.Aeson ( ToJSON )
import GHC.Generics ( Generic )
import Models.Chapter
import Models.Title
data Tree =
Tree {
chapter0 :: Chapter,
titles :: [Title]
} deri... | dogweather/nevada-revised-statutes-parser | src/Models/Tree.hs | bsd-3-clause | 363 | 0 | 9 | 146 | 81 | 48 | 33 | 12 | 0 |
--
-- Copyright (c) 2012 Citrix Systems, Inc.
--
-- 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 option) any later version.
--
-- This progra... | jean-edouard/manager | disksync/Main.hs | gpl-2.0 | 6,072 | 0 | 29 | 1,824 | 1,228 | 612 | 616 | -1 | -1 |
{-# LANGUAGE PatternGuards #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Actions.CopyWindow
-- Copyright : (c) David Roundy <droundy@darcs.net>, Ivan Veselov <veselov@gmail.com>, Lanny Ripple <lan3ny@gmail.com>
-- License : BSD3-style (see LICENS... | pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Actions/CopyWindow.hs | bsd-2-clause | 7,080 | 0 | 16 | 1,965 | 1,260 | 688 | 572 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses, UndecidableInstances #-}
module Bug where
class A a oops
data D d = D d
instance A a oops => Read (D a)
-- Actually this instance is ambiguous
-- and is now rightly rejected
data E e = E (D e) deriving Read
instance A Int Bool
| urbanslug/ghc | testsuite/tests/deriving/should_fail/T5287.hs | bsd-3-clause | 269 | 0 | 8 | 57 | 76 | 41 | 35 | -1 | -1 |
module ShouldSucceed where
main = iD iD
iD x = x
| urbanslug/ghc | testsuite/tests/typecheck/should_compile/tc022.hs | bsd-3-clause | 51 | 0 | 5 | 13 | 20 | 11 | 9 | 3 | 1 |
import Data.Either
digits :: Int -> Int
digits = length . show
showResult :: (Either a b) -> Int
showResult a = if (isRight a) then 1 else 2
| sonsongithub/LearnHaskell | sample.hs | mit | 144 | 0 | 7 | 32 | 63 | 34 | 29 | 5 | 2 |
module Commands.Backends.OSX.Constants where
import Commands.Backends.OSX.Types
import Data.BitVector
-- | line 236 of </System/Library/Frameworks/IOKit.framework/Versions/A/Headers/hidsystem/IOLLEvent.h>
--
--
mask :: Modifier -> BitVector
mask Command = 0x00100000
mask Control = 0x00040000
mask Shift = 0x0002... | sboosali/commands-backends-osx9 | sources/Commands/Backends/OSX/Constants.hs | mit | 3,201 | 0 | 5 | 1,166 | 747 | 381 | 366 | 93 | 1 |
import Geometry
import Drawing
import Exercises
main = drawPicture myPicture
myPicture points =
drawTriangle (a,b,c) &
drawTriangle (b,c,d) &
drawTriangle (c,d,e) &
drawTriangle (d,e,f) &
drawTriangle (e,f,g) &
drawAutoLabels list &
message "Triangle strip : triangles sharing a side"
... | alphalambda/k12math | prog/demo/demo07tristrip.hs | mit | 1,001 | 0 | 12 | 299 | 274 | 152 | 122 | 20 | 1 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.Selection
(collapse, collapseToEnd, collapseToStart, deleteFromDocument,
containsNode, containsNode_, sel... | ghcjs/jsaddle-dom | src/JSDOM/Generated/Selection.hs | mit | 12,683 | 0 | 12 | 1,950 | 2,833 | 1,512 | 1,321 | -1 | -1 |
module Antemodulum.Text (
Strippable(..)
) where
--------------------------------------------------------------------------------
import Antemodulum.ClassyPrelude
import qualified Antemodulum.Text.Strict as TS
import qualified Antemodulum.Text.Lazy as TL
-------------------------------------------------------------... | docmunch/antemodulum | src/Antemodulum/Text.hs | mit | 691 | 0 | 7 | 99 | 137 | 82 | 55 | 17 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module Game.Helper (normalize, Location(..), moveLocation, changeOri,getSocketId,add,moveWithFPS,divide,Id,getCurrentMilli) where
import Linear.V2
import Linear.Vector
import Control.Lens
import GHC.Generics
import Data.ByteString.Char8
impo... | bruno-cadorette/TheLambdaReactor | src/Backend/Game/Helper.hs | mit | 1,495 | 0 | 13 | 313 | 556 | 299 | 257 | 35 | 1 |
{-# LANGUAGE JavaScriptFFI #-}
module Doppler.GHCJS.DOM (
DomNode, startEventCapturing, stopEventCapturing, replaceBody
) where
import GHCJS.Foreign.Callback
import GHCJS.Types (JSVal)
import Data.JSString (JSString)
newtype DomNode = DomNode JSVal
foreign import javascript unsafe "document.a... | oinuar/doppler | src/Doppler/GHCJS/DOM.hs | mit | 770 | 10 | 9 | 116 | 164 | 90 | 74 | 13 | 0 |
{----------
# Chapter 1
## 1.7 Definitions
Definitions associate a name with a value:
name :: type
name = expression
e.g.:
size :: Integer
size = 12 + 13
More examples:
data Picture
invertColour :: Picture -> Picture
whiteHorse :: Picture
whiteHorse = invertColour horse
rotateHorse :: Picture
rotateHorse = f... | chsm/code | hs/hcofp/01.hs | mit | 5,494 | 0 | 10 | 1,143 | 525 | 272 | 253 | 39 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Views (root, Views.list) where
import Problems (Problem(..), problems)
import Data.Monoid (mempty)
import qualified Web.Scotty as S
import Text.Blaze.Html5
import Text.Blaze.Html5.Attributes
import Text.Blaze.Html5 as H
import Text.Blaze.Html5.Attributes as A
import Text.Blaz... | bramgg/99haskell | Views.hs | mit | 3,968 | 0 | 29 | 1,483 | 1,114 | 524 | 590 | 91 | 1 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.CSSKeyframesRule
(insertRule, appendRule, deleteRule, findRule, findRule_,
findRuleUnsafe, findRuleUnchec... | ghcjs/jsaddle-dom | src/JSDOM/Generated/CSSKeyframesRule.hs | mit | 4,894 | 0 | 14 | 737 | 1,152 | 641 | 511 | -1 | -1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module Models.Comic
( Comic(..)
, ComicId
, getMarvelUrl
, getNonEmptyDescription
, hasCharacters
, getCharacters
) where
import BasicPrelude hiding (id)
import Data.Aeson (FromJSON(..), ToJSON(..))
imp... | nicolashery/example-marvel-haskell | Models/Comic.hs | mit | 1,437 | 0 | 11 | 253 | 403 | 227 | 176 | 47 | 3 |
double :: Integer->Integer
double x= 2*x
main=print(map double [1,2,3,4])
| manuchandel/Academics | Principles-Of-Programming-Languages/mapDouble.hs | mit | 75 | 0 | 8 | 10 | 50 | 27 | 23 | 3 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE CPP, TypeFamilies #-}
{-# LANGUAGE RankNTypes#-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving, FlexibleContexts, UndecidableInstances #-}
module Data.Derive.TopDown.Lib (
isInstance'
, generateClassContext
, getTyVarCons,getTVBName
, getCompos... | HaskellZhangSong/derive-topdown | src/Data/Derive/TopDown/Lib.hs | mit | 19,361 | 0 | 20 | 6,381 | 4,550 | 2,332 | 2,218 | 266 | 6 |
import qualified Control.Monad as Monad
import qualified Flow
import qualified System.Exit as Exit
import qualified Test.HUnit as Test
main :: IO ()
main = do
counts <- Test.runTestTT $ Test.TestList
[ True Test.~?= True
, (3 Flow.|> succ Flow.|> recip Flow.|> negate) Test.~?= (-0.25 :: Double)
, (negate... | tfausak/flow | source/test-suite/Main.hs | mit | 2,005 | 0 | 17 | 448 | 969 | 551 | 418 | 38 | 1 |
module Rebase.Data.Text.Foreign
(
module Data.Text.Foreign
)
where
import Data.Text.Foreign
| nikita-volkov/rebase | library/Rebase/Data/Text/Foreign.hs | mit | 95 | 0 | 5 | 12 | 23 | 16 | 7 | 4 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.html
module Stratosphere.ResourceProperties.CodeBuildProjectArtifacts where
impo... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/CodeBuildProjectArtifacts.hs | mit | 5,780 | 0 | 13 | 548 | 902 | 508 | 394 | 63 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import Control.Applicative
import Data.Csv (FromNamedRecord (..), Record,
ToNamedRecord (..), namedRecord, (.:),
(.=))
import Data.Vector (fromList)
import ... | jb55/pipes-csv | test/stdin/Stdin.hs | mit | 1,702 | 0 | 12 | 516 | 537 | 287 | 250 | 42 | 2 |
-- Project Euler Problem 21 - amicable numbers
--
-- Number of amicable numbers under 10000
--
import Data.List
divisors num = [x | x<-[1..num-1], num `mod` x == 0]
neighbor num = sum (divisors num)
main = do
print (sum ((nub . concat) [ [x,y] | x<-[1..10000], let y=(neighbor(x)), x==neighbor(y), x/=y]))
--print (... | yunwilliamyu/programming-exercises | project_euler/p021_amicable_numbers.hs | cc0-1.0 | 338 | 2 | 19 | 62 | 165 | 89 | 76 | 5 | 1 |
module ParserSpec (
spec
) where
import Test.Hspec
import Test.QuickCheck
import Control.Monad
import Parser
import Syntax
spec :: SpecWith ()
spec = describe "parse" $ do
it "should parse the omega combinator" $
parse "\\x.x x" `shouldBe` Right (Lambda "x" (Apply (Var "x") (Var "x")))
it "should... | iemxblog/ulci | tests/ParserSpec.hs | gpl-2.0 | 1,115 | 0 | 19 | 286 | 410 | 211 | 199 | 28 | 2 |
{- |
Module : ./RDF/Parse.hs
Copyright : (c) Felix Gabriel Mance
License : GPLv2 or higher, see LICENSE.txt
Maintainer : f.mance@jacobs-university.de
Stability : provisional
Portability : portable
RDF syntax parser
-}
module RDF.Parse where
import Common.Parsec
import Common.Lexer
import Common.... | spechub/Hets | RDF/Parse.hs | gpl-2.0 | 5,354 | 0 | 14 | 1,125 | 1,536 | 756 | 780 | 137 | 1 |
forall a. p a a | hmemcpy/milewski-ctfp-pdf | src/content/3.10/code/haskell/snippet05.hs | gpl-3.0 | 15 | 0 | 6 | 4 | 16 | 6 | 10 | -1 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.