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 : Gen.AST
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : provisional
-- Portability : non-portable (GHC extensions)
module Gen.AST where
import Control.Monad.Except
import ... | brendanhay/gogol | gen/src/Gen/AST.hs | mpl-2.0 | 786 | 0 | 11 | 245 | 170 | 94 | 76 | 13 | 1 |
-- GSoC 2015 - Haskell bindings for OpenCog.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
-- | Simple example on defining many atom types and testing the compiler type checking.
import OpenCog.AtomSpace (TruthVal(..),Atom(..),AtomType(..),Gen(..),
runOnNewAtomSpace,ge... | printedheart/atomspace | examples/haskell/example_data_types.hs | agpl-3.0 | 2,857 | 0 | 17 | 1,049 | 609 | 308 | 301 | 50 | 4 |
{-# LANGUAGE DeriveDataTypeable
, FlexibleContexts
, TemplateHaskell
, FlexibleInstances
, MultiParamTypeClasses
, OverlappingInstances
, RankNTypes
, TypeOperators
, RecordWildCards
#-}
{- |
Module : Main
Descripti... | wxzh/fcore | compiler/Main.hs | bsd-2-clause | 6,809 | 0 | 19 | 2,414 | 1,198 | 622 | 576 | 140 | 4 |
{-# LANGUAGE ParallelListComp #-}
{-# LANGUAGE TemplateHaskell #-}
module Database.DSH.VSL.Opt.Rewrite.Expressions where
-- This module contains rewrites which aim to simplify and merge complex expressions
-- which are expressed through multiple operators.
import Control.Monad
import Database.A... | ulricha/dsh | src/Database/DSH/VSL/Opt/Rewrite/Expressions.hs | bsd-3-clause | 3,933 | 0 | 7 | 1,126 | 252 | 164 | 88 | 46 | 1 |
module Network.Loli
(
module Network.Loli.DSL
, module Network.Loli.Template
, module Network.Loli.Engine
)
where
import Network.Loli.Engine (loli)
import Network.Loli.Template
import Network.Loli.DSL | skade/loli | src/Network/Loli.hs | bsd-3-clause | 209 | 0 | 5 | 28 | 52 | 35 | 17 | 8 | 0 |
{-# LANGUAGE ForeignFunctionInterface #-}
-- This module is a quick-and-dirty way to run an executable
-- within a pseudoterminal and obtain its output.
--
-- It is not intended for general use. In particular:
-- - It expects the output to be available quickly (<0.2s)
-- after each chunk of input.
-- - It expects e... | judah/haskeline | tests/Pty.hs | bsd-3-clause | 3,370 | 0 | 13 | 827 | 780 | 400 | 380 | 65 | 3 |
{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-}
module EmbedTestGenerator (testGen) where
import Data.Default
import Network.Mime (MimeType)
import Yesod.EmbeddedStatic.Types
import Yesod.EmbeddedStatic.Generators (pathToName)
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
impo... | ygale/yesod | yesod-static/test/EmbedTestGenerator.hs | mit | 2,085 | 0 | 10 | 513 | 458 | 286 | 172 | 45 | 1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Applicative ((<$>))
import Yesod
import Yesod.Hunt
-- main a... | hunt-framework/yesod-hunt | test/main.hs | mit | 812 | 0 | 8 | 202 | 129 | 76 | 53 | 21 | 1 |
module Y2017.M01.D13.Solution where
import Control.Arrow (first)
import Data.Array
import Data.Tuple (swap)
-- below import available via 1HaskellADay git repository
import Control.Logic.Frege (adjoin)
import Data.Matrix
{--
We're going to start looking at Applicative functors, because Applicative
functors are more... | geophf/1HaskellADay | exercises/HAD/Y2017/M01/D13/Solution.hs | mit | 1,879 | 0 | 12 | 374 | 113 | 65 | 48 | 9 | 1 |
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeFamilies #-}
--------------------------------------------------------------------
-- |
-- Copyright : © Oleg Grenrus 2014
-- License : MIT
-- Maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>
-- Stability : experimental
-- Portabili... | phadej/boolean-normal-forms | src/Data/Algebra/Boolean/NNF/Set.hs | mit | 3,449 | 0 | 10 | 944 | 1,158 | 604 | 554 | 78 | 2 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE ScopedTypeVariables #-}
{- |
Keep track of lists that are in some kind o... | ublubu/shapes | shapes/src/Utils/Descending.hs | mit | 2,297 | 0 | 17 | 627 | 637 | 341 | 296 | 58 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Data.Mole.Builder.Internal.Template where
import Control.Applicative
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Attoparsec.Text as AP
import Data.Maybe
import Data.Mole.Types
type Bracket = (Tex... | wereHamster/mole | src/Data/Mole/Builder/Internal/Template.hs | mit | 2,558 | 0 | 15 | 717 | 734 | 395 | 339 | 50 | 3 |
{-# LANGUAGE ScopedTypeVariables, CPP #-}
module Main where
import Data.Maybe
import Development.Shake
import Development.Shake.Command
import Development.Shake.FilePath
import Development.Shake.Util
import Text.Printf
#ifdef mingw32_HOST_OS
#else
#endif
main :: IO ()
main = shakeArgs shakeOptions{shakeFiles="_buil... | tcsavage/aglgui | BuildSystem.hs | mit | 2,046 | 0 | 17 | 483 | 510 | 253 | 257 | 37 | 1 |
module Graphics.Urho3D.UI.Internal.LineEdit(
LineEdit
, lineEditCntx
, sharedLineEditPtrCntx
, SharedLineEdit
) where
import qualified Language.C.Inline as C
import qualified Language.C.Inline.Context as C
import qualified Language.C.Types as C
import Graphics.Urho3D.Container.Ptr
import qualified Data.Ma... | Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/UI/Internal/LineEdit.hs | mit | 516 | 0 | 11 | 89 | 120 | 80 | 40 | -1 | -1 |
{-------------------------------------------------------------------------------
In the following equation x, y, and n are positive integers.
1/x + 1/y = 1/n
For n = 4 there are exactly three distinct solutions:
1/5 + 1/20 = 1/4
1/6 + 1/12 = 1/4
1/8 + 1/ 8 = 1/4
What is the least v... | dpieroux/euler | 0108b.hs | mit | 1,745 | 0 | 12 | 329 | 161 | 86 | 75 | 8 | 1 |
-- | state transitions systems
module CSP.STS
( module CSP.STS.Type
)
where
import CSP.STS.Type | marcellussiegburg/autotool | collection/src/CSP/STS.hs | gpl-2.0 | 109 | 0 | 5 | 27 | 22 | 15 | 7 | 3 | 0 |
-- -*- mode: haskell -*-
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-}
module PCProblem.Konfig where
import PCProblem.Type
import Autolib.ToDoc
import Autolib.Reader
data Konfig =
Konfig { instanz :: PCP
, folge :: Folge -- ^ achtung, falschrum! (damit wir vorn dranbauen)
, tief :: Int -- ^ ... | Erdwolf/autotool-bonn | src/PCProblem/Konfig.hs | gpl-2.0 | 956 | 4 | 9 | 226 | 249 | 138 | 111 | 21 | 1 |
{-# LANGUAGE FlexibleContexts, MultiParamTypeClasses, OverloadedStrings, TupleSections #-}
module Web.Crane.Form where
import Web.Crane.Types
import Web.Crane.Internal
import Web.Crane.Request
import Control.Arrow
import Control.Applicative
import Control.Monad.Reader
import Control.Monad.Error
import Data.List (loo... | tathougies/crane | src/Web/Crane/Form.hs | gpl-2.0 | 4,271 | 0 | 27 | 1,369 | 762 | 398 | 364 | 52 | 5 |
{- |
Module :$Header$
Description : utilitary functions used throughout the CMDL interface
Copyright : uni-bremen and DFKI
License : GPLv2 or higher, see LICENSE.txt
Maintainer : r.pascanu@jacobs-university.de
Stability : provisional
Portability : portable
CMDL.Utils contains different basic functions th... | nevrenato/Hets_Fork | CMDL/DataTypesUtils.hs | gpl-2.0 | 7,353 | 1 | 31 | 2,289 | 1,795 | 950 | 845 | 163 | 9 |
{-# LANGUAGE ScopedTypeVariables, OverloadedStrings #-}
{-
Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>
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, ... | sapek/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | 45,130 | 0 | 29 | 12,050 | 15,703 | 8,082 | 7,621 | 1,147 | 5 |
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Control.Monad.Trans
import Data.Text.Lazy
import Language.Haskell.Interpreter hiding (get)
import Text.Read (readMaybe)
import Control.Applicative
import Data.Monoid (mconcat)
import TypeHelper
import Paths_interpreter_haskell
import System.IO
import System... | xpika/interpreter-haskell | interpreter.hs | gpl-3.0 | 1,630 | 0 | 25 | 515 | 490 | 237 | 253 | 49 | 2 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DuplicateRecordFields #-}
-- Response and related data types
module Web.BitTorrent.Tracker.Types.Response where
import qualified Data.ByteString.Char8 as BS
import qualified Data.Sequence as Sequence
import Data.Int (Int32)
import Web.BitTorrent.Tracker.Types... | greatest-ape/hs-bt-tracker | src/Web/BitTorrent/Tracker/Types/Response.hs | gpl-3.0 | 2,000 | 0 | 12 | 379 | 465 | 267 | 198 | 75 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-|
| BlogLiterately Config file format:
| It lives in ~/.blogliterately/config
| Right now It is a sequence of blocks
| describing blog accounts.
|
| Each blog account must be in form:
| blog <blog-name>
| url <xml-rpc-url>
| api <xml-api> ('metaweblog... | trofi/BlogLiterately | src/Config.hs | gpl-3.0 | 4,835 | 0 | 20 | 2,125 | 874 | 466 | 408 | 81 | 4 |
{---------------------------------------------------------------------}
{- Copyright 2015, 2016 Nathan Bloomfield -}
{- -}
{- This file is part of Carl. -}
{- ... | nbloomf/carl | test/Tests/Lib/Ring.hs | gpl-3.0 | 20,334 | 0 | 13 | 4,769 | 5,769 | 3,042 | 2,727 | 315 | 1 |
{-# OPTIONS_GHC -Wall -Werror #-}
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
module Swearjure.AST where
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.State
import Data.Generics.Fixplate
impo... | hyPiRion/swearjure | src/Swearjure/AST.hs | gpl-3.0 | 7,680 | 0 | 17 | 2,392 | 3,040 | 1,584 | 1,456 | 190 | 19 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-shopping-content/gen/Network/Google/Resource/Content/Regions/List.hs | mpl-2.0 | 5,755 | 0 | 19 | 1,392 | 906 | 523 | 383 | 128 | 1 |
{-# LANGUAGE ApplicativeDo #-}
module Kotlin where
import Control.Applicative
import Control.Monad
import Parsers
import LexicalStructure
import Annotations
import {-# SOURCE #-} Rules
import {-# SOURCE #-} Functions
import {-# SOURCE #-} Expressions
import {-# SOURCE #-} Types
import {-# SOURCE #-} Modifiers
import... | ice1000/Kt2Dart | src/Kotlin.hs | agpl-3.0 | 1,747 | 0 | 14 | 378 | 514 | 244 | 270 | 68 | 1 |
import Prelude hiding (mapM,foldl1)
import Data.Word
import Data.Traversable
import Data.Time.Clock
import System.IO
import System.Exit
import HaskellPU.Platform
import HaskellPU.Data
import HaskellPU.Data.Matrix
import HaskellPU.HighDataTypes
import HaskellPU.Data.FloatMatrix
import HaskellPU.Data.TriangularMatrix
... | hsyl20/HaskellPU | apps/Test.hs | lgpl-3.0 | 6,846 | 0 | 23 | 1,572 | 2,178 | 1,032 | 1,146 | 167 | 25 |
module ELists (koans) where
import Test.Hspec
import Test.HUnit (assertBool, assertEqual)
import Koan
__ = error "Replace __ with a valid value"
-- cons
--The colon is called the "cons" operator;
--the process of adding an element is called "consing."
koanCons1 = koan "cons function 1" $ do
0:[1,2] == [0,1,2]
koa... | gregberns/HaskellKoans | src/koans/ELists.hs | apache-2.0 | 1,224 | 0 | 14 | 248 | 511 | 271 | 240 | 39 | 1 |
{-# LANGUAGE FlexibleContexts #-}
module HERMIT.Dictionary.Undefined
( -- * Working with Undefined Values
-- | Note that many of these operations require 'GHC.Err.undefined' to be explicitly imported if it is not used in the source file.
externals
, buildStrictnessLemmaT
, verifyStrictT
, ap... | beni55/hermit | src/HERMIT/Dictionary/Undefined.hs | bsd-2-clause | 12,746 | 0 | 13 | 2,541 | 2,956 | 1,524 | 1,432 | 161 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
module OCanrenize where
import Control.Applicative ((<|>))
import Data.Char ( toLower )
import Data.Maybe (fromMaybe)
import Data.List (intercalate)
import Syntax ( freshVars, Def(..), G(..), Term(..), X )
import System.IO ( IOMode(WriteMode)... | kajigor/uKanren_transformations | src/OCanrenize.hs | bsd-3-clause | 4,513 | 0 | 15 | 1,262 | 1,600 | 799 | 801 | 96 | 4 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
module Mapnik.Bindings.Transform (
parse
, unsafeNew
, unsafeNewMaybe
, toText
) where
import Mapnik.Bindings.Ty... | albertov/hs-mapnik | bindings/src/Mapnik/Bindings/Transform.hs | bsd-3-clause | 1,830 | 0 | 11 | 305 | 402 | 218 | 184 | 40 | 1 |
module Code22 where
import Data.List
-- School-book method
det1 :: [[Integer]] -> Integer
det1 [[x]] = x
det1 xss = foldr1 (-) (zipWith (*) col1 (map det1 (minors cols)))
where col1 = map head xss
cols = map tail xss
minors :: [a] -> [[a]]
minors ... | sampou-org/pfad | Code/Code22.hs | bsd-3-clause | 3,533 | 0 | 17 | 1,201 | 1,864 | 1,014 | 850 | 81 | 3 |
module Main where
import Application
main :: IO ()
main = startApp
| CarstenKoenig/YouVote | app/Main.hs | bsd-3-clause | 69 | 0 | 6 | 14 | 22 | 13 | 9 | 4 | 1 |
module Futhark.CodeGen.Backends.SequentialPython
( compileProg
) where
import Control.Monad
import Data.Traversable
import Futhark.Representation.ExplicitMemory
import qualified Futhark.CodeGen.ImpCode.Sequential as Imp
import qualified Futhark.CodeGen.ImpGen.Sequential as ImpGen
import qualified Futhark.Co... | mrakgr/futhark | src/Futhark/CodeGen/Backends/SequentialPython.hs | bsd-3-clause | 1,258 | 0 | 11 | 284 | 272 | 154 | 118 | 29 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Main where
import qualified Control.Exception as Exception
import Data.Acid
import Data.Foldable
import qualified Data.Version as Version
import Options.Applicative
import qualified Paths_hasken as M... | tippenein/hasken | executable/Main.hs | bsd-3-clause | 4,466 | 0 | 18 | 974 | 1,225 | 627 | 598 | 119 | 5 |
{-
Author: Wishnu Prasetya
Copyright 2011 Utrecht University
The use of this sofware is free under the Modified BSD License.
-}
{- |
This module provides ...
-}
module Eu.Fittest.Logging.Analysis.Base
where
import Data.List
import Data.Maybe
-- | Representing a way to treat ... | aelyasov/Haslog | src/Eu/Fittest/Logging/Analysis/Base.hs | bsd-3-clause | 8,939 | 0 | 17 | 3,304 | 2,684 | 1,448 | 1,236 | 135 | 3 |
{-# LANGUAGE LambdaCase, RankNTypes, EmptyCase,
StandaloneDeriving, FlexibleContexts,
DeriveDataTypeable, DeriveFoldable,
DeriveFunctor, DeriveTraversable,
ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-} -- for Series show instance
module Series.Types wh... | michaelt/series | Series/Types.hs | bsd-3-clause | 10,606 | 0 | 19 | 3,098 | 3,062 | 1,602 | 1,460 | 214 | 4 |
module Andromeda.Types.Hardware ( module X ) where
import Andromeda.Types.Hardware.Types as X
import Andromeda.Types.Hardware.Component as X
import Andromeda.Types.Hardware.Parameter as X
import Andromeda.Types.Hardware.Handle as X
import Andromeda.Types.Hardware.Device as X
| graninas/Andromeda | src/Andromeda/Types/Hardware.hs | bsd-3-clause | 277 | 0 | 4 | 28 | 58 | 44 | 14 | 6 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : Main
-- Copyright : (c) 2008, 2009 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
-----------------------------------------------------------------------------
module Main (ma... | spl/emgm | tests/Main.hs | bsd-3-clause | 1,337 | 0 | 11 | 373 | 230 | 142 | 88 | 29 | 2 |
-- |
-- Module : Database.RocksDB.Types
-- Copyright : (c) 2012-2013 The leveldb-haskell Authors
-- (c) 2014 The rocksdb-haskell Authors
-- License : BSD3
-- Maintainer : mail@agrafix.net
-- Stability : experimental
-- Portability : non-portable
--
module Database.RocksDB.Types
( BatchO... | agrafix/rocksdb-haskell | src/Database/RocksDB/Types.hs | bsd-3-clause | 7,542 | 0 | 13 | 2,167 | 742 | 494 | 248 | 108 | 1 |
module GtkHelper(gtkDiaMain) where
import Graphics.UI.Gtk
import Control.Monad (void)
import Control.Monad.IO.Class (liftIO)
import Diagrams.Backend.Cairo.Internal
import Diagrams.Prelude
gtkDiaMain :: Diagram Cairo R2 -> IO ()
gtkDiaMain dia = do
void $ initGUI
window <- windowNew
void $ onDestroy window mainQ... | taruti/diagrams-cairo-raster | example/GtkHelper.hs | bsd-3-clause | 708 | 0 | 17 | 129 | 241 | 120 | 121 | 21 | 1 |
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
module Ivory.Language.Loop where
import Ivory.Language.IIntegral
import Ivory.Language.IBool
import Ivory.Language.Assert
import Ivory.Language.Array
import Ivory.La... | Hodapp87/ivory | ivory/src/Ivory/Language/Loop.hs | bsd-3-clause | 2,449 | 0 | 16 | 541 | 931 | 476 | 455 | 56 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
module Ivory.Language.BoundedInteger where
import Text.Printf
import Ivory.Language.Proxy
import Ivory.Language.Type
import qualified Ivory.Language.Syntax as I
--------------------------------------------------------------------------------
-- | It is an error if a constant im... | Hodapp87/ivory | ivory/src/Ivory/Language/BoundedInteger.hs | bsd-3-clause | 910 | 0 | 10 | 192 | 224 | 125 | 99 | 17 | 3 |
module GOA (
module Prelude,
lambdabot,
wakeup,
query,
setLambdabotHome,
setLambdabotFlags
) where
import Data.List (isPrefixOf, find)
import Data.Char (isSpace)
import Data.Maybe
import System.IO
import System.Process
import System.IO.Unsafe
import System.Directory
i... | IKEGAMIDaisuke/goa | GOA.hs | bsd-3-clause | 5,248 | 0 | 21 | 1,575 | 1,241 | 636 | 605 | 115 | 3 |
module TestUtil(
(==>), QFilePath(..), QFilePathValidW(..), QFilePathValidP(..),
test, Test,
module Test.QuickCheck,
module Data.List
) where
import Test.QuickCheck hiding ((==>))
import Data.List
import Control.Monad
import qualified System.FilePath.Windows as W
import qualified System.FilePath.P... | DavidAlphaFox/ghc | libraries/filepath/tests/TestUtil.hs | bsd-3-clause | 1,958 | 0 | 14 | 378 | 586 | 317 | 269 | 40 | 1 |
module FruitShopKata.Day9 (process) where
type Bill = (Money, [Product])
type Product = String
type Money = Int
process :: [Product] -> [Money]
process = map fst . tail . scanl addProduct (0, [])
where
addProduct :: Bill -> Product -> Bill
addProduct (... | Alex-Diez/haskell-tdd-kata | old-katas/src/FruitShopKata/Day9.hs | bsd-3-clause | 1,197 | 0 | 19 | 529 | 363 | 200 | 163 | 21 | 3 |
{-# LANGUAGE TupleSections, OverloadedStrings, QuasiQuotes, TemplateHaskell, TypeFamilies, RecordWildCards,
DeriveGeneric ,MultiParamTypeClasses ,FlexibleInstances #-}
module Protocol.ROC.PointTypes.PointType5 where
import GHC.Generics
import qualified Data.ByteString as BS
import Data.Word
import Data.... | jqpeterson/roc-translator | src/Protocol/ROC/PointTypes/PointType5.hs | bsd-3-clause | 4,819 | 0 | 9 | 1,926 | 587 | 323 | 264 | 125 | 1 |
{-# LANGUAGE BangPatterns, TypeFamilies, TypeOperators, FlexibleInstances, FlexibleContexts, GADTs #-}
{-# LANGUAGE MultiParamTypeClasses, UndecidableInstances #-}
module Data.NeuralNetwork.Backend.HMatrix.Layers where
import Numeric.LinearAlgebra hiding (R, C)
import Numeric.LinearAlgebra.Devel
import qualified Data.... | pierric/neural-network | Backend-hmatrix/Data/NeuralNetwork/Backend/HMatrix/Layers.hs | bsd-3-clause | 14,500 | 4 | 24 | 4,209 | 4,957 | 2,537 | 2,420 | -1 | -1 |
module Control.Concurrent.Future (Future, promise, completed, executeIO,
execute, complete, onCompleteIO, await, await_,
tryAwait, isComplete, bindIO, fmapIO, zipIO) where
import Control.Concurrent.MVar
import Control.Concurrent
import Control.Excepti... | derekjw/haskell-future | src/Control/Concurrent/Future.hs | bsd-3-clause | 4,454 | 0 | 19 | 1,569 | 1,806 | 840 | 966 | 133 | 4 |
{-# OPTIONS_GHC -Wall -fno-warn-unused-do-bind #-}
module Parse.Declaration where
import Text.Parsec ( (<|>), (<?>), choice, digit, optionMaybe, string, try )
import AST.Declaration
import qualified Parse.Expression as Expr
import Parse.Helpers as Help
import qualified Parse.Type as Type
import AST.V0_16
import Parse... | rgrempel/frelm.org | vendor/elm-format/parser/src/Parse/Declaration.hs | mit | 3,020 | 0 | 16 | 864 | 748 | 381 | 367 | 73 | 2 |
module Haskmon.Types.Evolutions(
module Haskmon.Types.Evolutions,
I.Evolution, I.EvolutionMethod, I.LevelUpDetail
) where
import qualified Haskmon.Types.Internals as I
evolutionName :: I.Evolution -> String
evolutionName = I.evolutionName
evolutionMethod :: I.Evolution -> I.EvolutionMethod
evolutionMethod = ... | bitemyapp/Haskmon | src/Haskmon/Types/Evolutions.hs | mit | 425 | 0 | 7 | 51 | 101 | 60 | 41 | 10 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.Reader
-- Copyright : (c) Andy Gill 2001,
-- (c) Oregon Graduate Institute of Science and Technology, 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : lib... | kaoskorobase/mescaline | resources/hugs/packages/mtl/Control/Monad/Reader.hs | gpl-3.0 | 3,851 | 24 | 14 | 779 | 1,224 | 652 | 572 | -1 | -1 |
{-|
Purely functional bottom-up splay sets.
* D.D. Sleator and R.E. Rarjan,
\"Self-Adjusting Binary Search Tree\",
Journal of the Association for Computing Machinery,
Vol 32, No 3, July 1985, pp 652-686.
<http://www.cs.cmu.edu/~sleator/papers/self-adjusting.pdf>
-}
module Data.Set.BUSplay (
... | kazu-yamamoto/llrbtree | Data/Set/BUSplay.hs | bsd-3-clause | 8,813 | 0 | 13 | 2,267 | 2,926 | 1,498 | 1,428 | 153 | 5 |
{-# LANGUAGE TemplateHaskellQuotes #-}
module T4170 where
import Language.Haskell.TH
class LOL a
lol :: Q [Dec]
lol = [d|
instance LOL Int
|]
instance LOL Int
| mpickering/ghc-exactprint | tests/examples/ghc8/T4170.hs | bsd-3-clause | 171 | 0 | 6 | 38 | 45 | 27 | 18 | -1 | -1 |
-- |
-- Module : Codec.Binary.Url
-- Copyright : (c) 2009 Magnus Therning
-- License : BSD3
--
-- URL encoding, sometimes referred to as URI encoding or percent encoding.
-- Implemented based on RFC 3986 (<http://tools.ietf.org/html/rfc3986>).
--
-- Further documentation and information can be found at
-- <http://... | magthe/dataenc | src/Codec/Binary/Url.hs | bsd-3-clause | 2,692 | 0 | 16 | 816 | 837 | 451 | 386 | 62 | 6 |
{-# LANGUAGE RankNTypes #-}
module Ef.Pipes.Prelude where
import Ef (foldn,lift)
import Ef.Pipes
import Control.Monad (when)
import qualified Prelude
import Prelude hiding (
all
, and
, any
, concat
, drop
, dropWhile
, elem
, filter
, head
, last
, length
, map
,... | grumply/mop | tests/Ef/Pipes/Prelude.hs | bsd-3-clause | 3,960 | 0 | 21 | 1,609 | 1,648 | 829 | 819 | 158 | 3 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module BrokerSpec(spec) where
#if __GLASGOW_HASKELL__ < 710
import Control.Monad (void)
#endif
import Control.Monad.State
import Monto.Broker (Response(..),Server(..),Dependency(..),ProductDependency(..))
import qualified Monto.Brok... | svenkeidel/monto-broker | test/BrokerSpec.hs | bsd-3-clause | 3,690 | 0 | 23 | 1,111 | 1,237 | 633 | 604 | 70 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Network.Wai.Handler.Warp.HTTP2.Response (
fromResponse
) where
import qualified UnliftIO
import qualified Data.ByteString.Builder as BB
import qualified Network.HTTP.Type... | kazu-yamamoto/wai | warp/Network/Wai/Handler/Warp/HTTP2/Response.hs | mit | 5,333 | 0 | 21 | 1,154 | 1,422 | 731 | 691 | 97 | 5 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Unittests for ganeti-htools.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012 Google 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 ... | dblia/nosql-ganeti | test/hs/Test/Ganeti/Luxi.hs | gpl-2.0 | 5,790 | 0 | 16 | 1,350 | 1,125 | 580 | 545 | 105 | 2 |
{-# OPTIONS -XExistentialQuantification #-}
--
-- This is a quick-and-dirty Haskell script for convering docs/manual.txt from
-- the GoogleCode wiki format to LaTeX. It contains a fairly complete parser
-- for the wiki format, but should only be expected to give good results with
-- docs/manual.txt.
--
-- Obtain GHC fr... | ezaroukian/sortaPn | GoCoWiToTex.hs | bsd-3-clause | 19,940 | 0 | 22 | 6,101 | 6,553 | 3,471 | 3,082 | -1 | -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... | green-haskell/ghc | libraries/base/Data/OldList.hs | bsd-3-clause | 42,487 | 0 | 16 | 12,273 | 7,440 | 4,282 | 3,158 | 452 | 8 |
{-|
Module : Idris.Parser.Ops
Description : Parser for operators and fixity declarations.
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE ConstraintKinds, FlexibleContexts, GeneralizedNewtypeDeriving,
MultiParamTypeClasses, PatternGuards #-}
module Idris.Parser.Ops where
import... | kojiromike/Idris-dev | src/Idris/Parser/Ops.hs | bsd-3-clause | 9,278 | 0 | 18 | 3,080 | 2,720 | 1,374 | 1,346 | 149 | 11 |
-- Set up n threads in a chain. Each thread retrieves from its MVar and
-- dumps that value on the next MVar
-- This benchmark adapted from Bryan O'Sullivan's blog. The difference is
-- that the threads are each given their own MVar to reduce contention.
-- Compile with ghc -O2 --make Chain.hs
-- Run ./Chain 100000
-... | killme2008/kilim | bench/haskell/Chain.hs | mit | 1,248 | 0 | 13 | 381 | 280 | 134 | 146 | 25 | 1 |
import GetURL
import Async
import qualified Data.ByteString as B
-----------------------------------------------------------------------------
-- <<main
main = do
(r1,r2) <- concurrently
(getURL "http://www.wikipedia.org/wiki/Shovel")
(getURL "http://www.wikipedia.org/wiki/Spade")
... | prt2121/haskell-practice | parconc/geturls8.hs | apache-2.0 | 359 | 0 | 10 | 67 | 75 | 41 | 34 | 8 | 1 |
{-# LANGUAGE OverloadedStrings, TypeFamilies, TupleSections, CPP #-}
-- | Events relating to mouse clicks and movement.
module Haste.Events.MouseEvents (
MouseEvent (..), MouseData (..), MouseButton (..)
) where
import Haste.Events.Core
import Haste.Foreign
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative... | beni55/haste-compiler | libraries/haste-lib/src/Haste/Events/MouseEvents.hs | bsd-3-clause | 1,725 | 0 | 12 | 436 | 401 | 225 | 176 | 51 | 1 |
module HR where
import Data.Maybe
import Control.Monad
import qualified System.Console.Terminal.Size as Size
hr :: [String] -> Int -> [String]
hr _ 0 = [""]
hr [] n = [[x | x <- take n $ repeat '#']]
hr xs n = map (take n . concat . repeat) xs
putHR :: [String] -> IO ()
putHR l = Size.size >>= mapM_ putStrLn . hr l... | HalosGhost/hs | hr/HR.hs | isc | 355 | 0 | 10 | 75 | 178 | 94 | 84 | 10 | 1 |
{-# htermination even :: Int -> Bool #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_even_1.hs | mit | 41 | 0 | 2 | 8 | 3 | 2 | 1 | 1 | 0 |
{-# LANGUAGE TemplateHaskell #-}
{- |
Description : OptDesc type
Copyright : (c) Martyn J. Pearce 2014, 2015
License : BSD
Maintainer : haskell@sixears.com
OptDesc type
-}
module Console.Getopt.OptDescT
-- OptDesc constructor and fields exported only for testing
( OptDesc(..), descn, dflt, lensname, mun... | sixears/getopt | src/Console/Getopt/OptDescT.hs | mit | 15,739 | 2 | 19 | 5,533 | 2,825 | 1,583 | 1,242 | 200 | 2 |
module Problem4Spec (main, spec) where
import Test.Hspec
import Problem4
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "listLength" $ do
it "should return the number of elements in a list" $
listLength [1,2,3,4,5,6,1] `shouldBe` 7
it "should return 0 for an empty li... | chanind/haskell-99-problems | Problem4Spec.hs | mit | 365 | 0 | 13 | 103 | 119 | 65 | 54 | 12 | 1 |
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
import qualified Workflow.OSX.Example
main = Workflow.OSX.Example.main
| sboosali/workflow-osx | workflow-osx/Main.hs | mit | 120 | 0 | 5 | 10 | 18 | 12 | 6 | 3 | 1 |
{-|
Module : Text.ByoParser.Error
Description : Error types and handling strategies for parsers
Copyright : (c) 2016 Nicolas Godbout
License : MIT
Maintainer : nicolas.godbout@gmail.com
Stability : unstable
-}
module Text.ByoParser.Error (
(<?>)
) where
import Text.ByoParser.... | DrNico/byoparser | Text/ByoParser/Error.hs | mit | 630 | 0 | 12 | 180 | 129 | 73 | 56 | 10 | 1 |
main = do cs <- getContents
print [ read c :: Int | c <- lines cs ]
| ryuichiueda/UspMagazineHaskell | Study1_Q4/q1_4_1.hs | mit | 78 | 0 | 11 | 28 | 39 | 18 | 21 | 2 | 1 |
module Ch04NaiveBayes.Vocabulary
( vocabulary
, wordBagVec
, wordSetVec
) where
import qualified Data.Map as M
import qualified Data.Set as S
import Data.Vector ((//))
import qualified Data.Vector as V
-- cf bayes.createVocabList
vocabulary :: [String] -> V.Vector String
vocabulary = V.fromL... | rcook/mlutil | ch04-naive-bayes/lib/Ch04NaiveBayes/Vocabulary.hs | mit | 925 | 0 | 21 | 232 | 361 | 196 | 165 | -1 | -1 |
module Cain.Init (initFolder) where
import Cain.Utils
import Control.Monad
import Control.Applicative
import System.Directory
defaultConfig :: String
defaultConfig = unlines [ "# Basic Cain Configuration"
, "main-url: \"http://your-url.com\""
, ""
... | angelini/cain | Cain/Init.hs | mit | 3,440 | 0 | 9 | 1,817 | 374 | 223 | 151 | 79 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module BroadcastServer (runServer, Handler) where
import Data.Monoid (mappend)
import Control.Monad (forever, unless)
import Control.Exception (finally)
import Data.ByteString.Lazy (ByteString)
import Control.Concurrent (MVar, newMVar, modifyMVar_, readMVar)
import qualified Data.T... | kovach/web2 | server/BroadcastServer.hs | mit | 2,750 | 0 | 13 | 578 | 954 | 518 | 436 | 57 | 1 |
data OnOff a = On a
| chreekat/vim-haskell-syntax | test/golden/toplevel/data.hs | mit | 20 | 0 | 6 | 6 | 11 | 6 | 5 | 1 | 0 |
{-# htermination insert :: (Ord a, Ord k) => (a,k) -> [(a,k)] -> [(a,k)] #-}
import List
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/List_insert_12.hs | mit | 89 | 0 | 3 | 17 | 5 | 3 | 2 | 1 | 0 |
{-# LANGUAGE ScopedTypeVariables, FlexibleInstances #-}
module DepTypes where
data Zero = Zero deriving Show
data Suc n = Suc n deriving Show
class Nat n where
toInt :: n -> Int
instance Nat Zero where
toInt Zero = 0
instance forall n. (Nat n) => Nat (Suc n) where
toInt (Suc n) = 1 + to... | plneappl/HaskellVectorsETC | DepTypes.hs | mit | 381 | 0 | 8 | 105 | 113 | 62 | 51 | 10 | 0 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ViewPatterns #-}
module ConnectFour.Server where
-- import Debug.Trace
import Prelude hiding (lookup)
import Data.Aeson ((.=))
import Data.Map.Strict hiding (map, filte... | tcoenraad/connect-four | src/ConnectFour/Server.hs | mit | 18,601 | 165 | 26 | 4,591 | 4,937 | 2,610 | 2,327 | 371 | 9 |
{-|
Module: Flaw.Sdl
Description: SDL helper routines.
License: MIT
-}
module Flaw.Sdl
( SdlException(..)
, initSdlVideo
, checkSdlError
, checkSdlResult
) where
import Control.Concurrent.MVar
import Control.Exception
import Control.Monad
import Data.Bits
import Foreign.C.String
import Foreign.C.Types
impor... | quyse/flaw | flaw-sdl/Flaw/Sdl.hs | mit | 1,901 | 0 | 14 | 340 | 602 | 320 | 282 | 49 | 2 |
module PlasmaCutter where
import PCBasicTypes
import LineSintaticScanner
import BoolExprSintaticScanner
extractCode :: [String] -> Environment -> [String]
extractCode [] _ = []
extractCode (x:xs) env = extr ++ (extractCode xs newEnv)
where
extr = [snd $ extractLine (parseLine x) env]
newEnv = fst $ extractLine (... | hephaestus-pl/hephaestus | willian/hephaestus-integrated/plasma-cutter/src/PlasmaCutter.hs | mit | 1,181 | 0 | 11 | 222 | 498 | 266 | 232 | 26 | 2 |
module Database.Mongodb () where
| lambda-llama/mnogo | src/Database/Mongodb.hs | mit | 33 | 0 | 3 | 4 | 9 | 6 | 3 | 1 | 0 |
module Enigma (enigma) where
import Data.Char
import Data.Tuple
rotateLeft :: [a] -> Int -> [a]
rotateLeft xs 0 = xs
rotateLeft (x:xs) n = rotateLeft (xs ++ [x]) (n-1)
rotateRight :: [a] -> Int -> [a]
rotateRight xs 0 = xs
rotateRight xs n = rotateRight (last xs : init xs) (n-1)
rotate :: [a] -> Int -> [a]
rotate x... | mespinosaz/enigma | src/Enigma.hs | mit | 1,423 | 0 | 9 | 315 | 702 | 371 | 331 | 41 | 1 |
-- Copyright 2015 Mitchell Kember. Subject to the MIT License.
-- Project Euler: Problem 17
-- Number letter counts
module Problem17 where
letters :: Int -> Int
letters n
| n >= 0 && n <= 19 = upTo19 n
| n <= 99 = tens (n `div` 10) + letters (n `mod` 10)
| n <= 999 && n `mod` 100 == 0 = letters (n `div` 1... | mk12/euler | haskell/Problem17.hs | mit | 703 | 0 | 11 | 208 | 358 | 204 | 154 | 16 | 1 |
module E18 where
sum :: [Int] -> Int
sum [] = 0
sum (i : is)
= i + (sum is)
{-
import Prelude hiding (sum)
sum :: [Int] -> Int
sum [] = 0
sum (i : is)
= i + (sum is)
-} | pascal-knodel/haskell-craft | Examples/· Errors/E18.hs | mit | 184 | 0 | 7 | 60 | 52 | 29 | 23 | 5 | 1 |
import Data.List
-- works only on small dimensions
ascend :: [Int] -> [Int]
ascend = head . sortBy (\x y -> compare (length y) (length x)) .
filter (\xs -> xs == sort xs) . subsequences
-- works only on small dimensions
descend :: [Int] -> [Int]
descend = head . sortBy (\x y -> compare (length y) (length x)) .
... | forgit/Rosalind | lgis.hs | gpl-2.0 | 1,955 | 0 | 21 | 680 | 960 | 520 | 440 | 42 | 2 |
-- | BlastHTTP test script
--runghc -package-db --ghc-arg=.cabal-sandbox/x86_64-linux-ghc-8.0.1-packages.conf.d/ BlastTabularHTTPTest.hs aeromonas.fa
module Main where
import System.Environment (getArgs)
import System.Process
import Text.ParserCombinators.Parsec
import System.IO
import System.Environment
import ... | eggzilla/BlastHTTP | BlastHTTPTest.hs | gpl-3.0 | 943 | 0 | 13 | 131 | 227 | 123 | 104 | 25 | 2 |
class X a where
f :: a -> Int
f = id
instance X Int where
f n = 'a'
main = f 3 | Helium4Haskell/helium | test/typeClasses/ClassInstaneError5.hs | gpl-3.0 | 92 | 0 | 7 | 37 | 48 | 24 | 24 | 6 | 1 |
{-# LANGUAGE NoImplicitPrelude, RankNTypes, NoMonomorphismRestriction, FlexibleContexts #-}
module Lamdu.Expr.Lens
-- ValLeaf prisms:
( _LGlobal
, _LHole
, _LRecEmpty
, _LAbsurd
, _LVar
, _LLiteral
-- ValBody prisms:
, _BLeaf
, _BApp
, _BAbs
, _BGetField
, _BRecExtend... | da-x/Algorithm-W-Step-By-Step | Lamdu/Expr/Lens.hs | gpl-3.0 | 10,030 | 0 | 13 | 2,503 | 3,560 | 1,834 | 1,726 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-directconnect/gen/Network/AWS/DirectConnect/CreateConnection.hs | mpl-2.0 | 7,293 | 0 | 25 | 1,639 | 1,160 | 684 | 476 | 119 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-apps-reseller/gen/Network/Google/Resource/Reseller/Subscriptions/Suspend.hs | mpl-2.0 | 3,413 | 0 | 16 | 782 | 389 | 233 | 156 | 65 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.IAP.Types
-- Copyright : (c) 2015-2016 Brendan Hay
-- ... | brendanhay/gogol | gogol-iap/gen/Network/Google/IAP/Types.hs | mpl-2.0 | 4,260 | 0 | 7 | 1,071 | 447 | 310 | 137 | 126 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Application
( makeApplication
, getApplicationDev
, makeFoundation
) where
import Import
import Settings
import Yesod.Auth
import Yesod.Default.Config
import Yesod.Default.Main
import Yesod.Default.Handlers
import Network.Wai.Middleware.RequestLogger
( m... | ciderpunx/snippio | Application.hs | agpl-3.0 | 2,870 | 0 | 13 | 542 | 505 | 283 | 222 | -1 | -1 |
-- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft }
func
:: Trither
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
(lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> asd)
| lspitzner/brittany | data/Test375.hs | agpl-3.0 | 285 | 0 | 7 | 42 | 24 | 12 | 12 | 5 | 0 |
{-# LANGUAGE DeriveDataTypeable
, GeneralizedNewtypeDeriving
#-}
module Data.BTree.UUID
( UUID
, uuid
)
where
import Data.Word
import Text.Printf
import Control.Concurrent
import Data.Typeable
import qualified Data.Char as C
import Data.Serialize
import System.IO.Unsafe
im... | brinchj/btree-concurrent | Data/BTree/UUID.hs | lgpl-3.0 | 876 | 0 | 11 | 210 | 245 | 147 | 98 | 28 | 1 |
-- vim: ts=2 sw=2 et :
{-# LANGUAGE NoMonomorphismRestriction, RankNTypes #-}
{- | Some minimal bits of E Kmett's parser combinator library,
<https://github.com/ekmett/parsers>.
-}
module Parsing (
module Parsing,
module Control.Applicative
)
where
import Control.Applicative
import Control.Monad
-- | Generi... | phlummox/ghci-history-parser | src/Parsing.hs | unlicense | 2,678 | 0 | 13 | 651 | 600 | 318 | 282 | 36 | 0 |
-- http://www.codewars.com/kata/54411212cf36259c04000f04
module KthElement where
import Prelude hiding ((!!))
-- | Returns Just the k-th element of the list, or Nothing if k is out of bounds.
elementAt :: Int -> [a] -> Maybe a
elementAt _ [] = Nothing
elementAt 1 (x:xs) = Just x
elementAt n xs
| n <= 0 = Nothing
... | Bodigrim/katas | src/haskell/7-Find-the-k-th-Element-of-a-list-safely.hs | bsd-2-clause | 361 | 0 | 8 | 69 | 115 | 61 | 54 | 8 | 1 |
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE BangPatterns #-}
module DuckTest.Types
(union, intersection, difference, prettyType, prettyType',
getCallType, PyType(..), (><), (<>), fromList, mkAlpha,
TypeError(..), getAttribute,... | jrahm/DuckTest | src/DuckTest/Types.hs | bsd-2-clause | 13,408 | 0 | 20 | 3,492 | 3,763 | 1,922 | 1,841 | 220 | 14 |
{-# LANGUAGE ScopedTypeVariables, OverloadedStrings #-}
module Kiwi.Storage (
addWiki, addPage, editPage, getPage, getPageNames, getPageVersion,
getPageVersions, getWikiNames, createTablesIfNecessary,
Error(..), Result(..)
) where
import Control.Applicative ((<$>))
import Control.Monad (forM_, unless)
import q... | acieroid/kiwi | Kiwi/Storage.hs | bsd-3-clause | 18,526 | 0 | 42 | 7,658 | 4,123 | 2,102 | 2,021 | 362 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.