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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE Ran... | advancedtelematic/quickcheck-state-machine-model | test/RQlite.hs | bsd-3-clause | 25,838 | 0 | 19 | 8,644 | 8,263 | 4,194 | 4,069 | -1 | -1 |
module Data.Functor.CompatSpec (main, spec) where
import Test.Hspec
import Data.Functor.Compat
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "void" $ do
it "discards computation result" $ do
void (return 1 :: IO Int) `shouldReturn` ()
describe "$>" $ do
it "is... | beni55/base-compat | test/Data/Functor/CompatSpec.hs | mit | 416 | 0 | 16 | 115 | 157 | 80 | 77 | 13 | 1 |
module Tests.TextZipper
( tests
)
where
import Control.Applicative
import Test.QuickCheck
import Tests.Instances ()
import qualified Data.Text as T
import Graphics.Vty.Widgets.TextZipper
textGen :: Gen T.Text
textGen = T.pack <$> (listOf $ oneof [ pure 'a'
, pure ' '
... | KommuSoft/vty-ui | test/src/Tests/TextZipper.hs | bsd-3-clause | 1,165 | 0 | 14 | 322 | 366 | 192 | 174 | 31 | 1 |
-- This program is intended for performance analysis. It simply
-- builds a Bloom filter from a list of words, one per line, and
-- queries it exhaustively.
module Main (main) where
import Control.Monad (forM_, mapM_)
import qualified Data.BloomFilter as BF
import Data.BloomFilter.Hash (cheapHashes)
import Data.Bloo... | bos/bloomfilter | examples/Words.hs | bsd-3-clause | 1,490 | 0 | 15 | 305 | 446 | 234 | 212 | 32 | 1 |
--
-- 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 | updatemgr/UpdateMgr/UpdateReq.hs | gpl-2.0 | 3,014 | 0 | 11 | 570 | 527 | 289 | 238 | 47 | 0 |
import Test.Cabal.Prelude
-- Test that unqualified command line constraints do not constrain setup
-- dependencies. cabal should be able to install the local time-99999 by
-- building its setup script with the installed time, even though the installed
-- time doesn't fit the constraint.
main = cabalTest $ withRepo "re... | mydaum/cabal | cabal-testsuite/PackageTests/Regression/T4154/install-time-with-constraint.test.hs | bsd-3-clause | 809 | 0 | 14 | 138 | 90 | 48 | 42 | 6 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Elm.Docs where
import Control.Applicative ((<$>),(<*>),(<|>))
import Control.Monad
import Data.Aeson ((.:), (.:?), (.=))
import qualified Data.Aeson as Json
import qualified Data.Aeson.Encode.Pretty as Json
import qualified Data.ByteString.Lazy.Char8 as BS
import qualified Dat... | johnpmayer/elm-compiler | src/Elm/Docs.hs | bsd-3-clause | 5,643 | 0 | 16 | 1,709 | 1,609 | 883 | 726 | 153 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Prompt.Man
-- Copyright : (c) 2007 Valery V. Vorotyntsev
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Valery V. Vorotyntsev <valery.vv@gmail.com>
-- Portability : non-portable (uses "manpat... | markus1189/xmonad-contrib-710 | XMonad/Prompt/Man.hs | bsd-3-clause | 3,396 | 0 | 18 | 867 | 806 | 430 | 376 | 57 | 2 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
module IxOutputM
(HasOutput(..), OutputM, foldOutput, listOutput, mapOutput) where
import MT
import Control_Monad_Fix
import Tree
data OutputM o a = O a (Tree o)
foldOutput :: b -> (o -> b) -> (b -> b -> b) -> OutputM o a -> (a,b)
foldOut... | kmate/HaRe | old/tools/base/lib/Monads/IxOutputM.hs | bsd-3-clause | 1,062 | 0 | 12 | 313 | 526 | 271 | 255 | 26 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- | Downloads page controller.
module HL.Controller.Downloads where
import HL.Controller
import HL.Model.Markdown
import HL.View.Downloads
import HL.View
-- | Downloads controller.
getDownloadsR :: C (Html ())
getDownloadsR = lucid downloadsV
-- | Downloads for particular OS.
ge... | josefs/hl | src/HL/Controller/Downloads.hs | bsd-3-clause | 695 | 0 | 10 | 145 | 162 | 85 | 77 | 18 | 3 |
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
FlexibleInstances,
UndecidableInstances #-}
-- Rather exotic example posted to Haskell mailing list 17 Oct 07
-- It concerns context reduction and functional dependencies
module Fo... | siddhanathan/ghc | testsuite/tests/indexed-types/should_compile/Gentle.hs | bsd-3-clause | 1,843 | 0 | 7 | 371 | 113 | 63 | 50 | -1 | -1 |
{-# LANGUAGE MagicHash, UnboxedTuples #-}
-- test the representation of unboxed literals
module Main where
import GHC.Exts
import GHC.Float
import Language.Haskell.TH
import Text.PrettyPrint
import System.IO
main :: IO ()
main = do putStrLn $ show $ $( do e <- [| 20# |]
runIO $ putS... | urbanslug/ghc | testsuite/tests/th/TH_repPrim2.hs | bsd-3-clause | 1,369 | 0 | 13 | 743 | 323 | 161 | 162 | -1 | -1 |
{-# LANGUAGE FlexibleContexts #-}
module DB where
import Control.Monad.Logger
import Control.Monad.Trans.Control
import Control.Monad.Trans.Resource
import Control.Monad.IO.Class
import Data.Text (pack)
import Database.Persist.Sqlite
import System.Environment
runDB :: (MonadBaseControl IO m, MonadIO m)
=> (Sql... | lexi-lambda/haskell-rolodex | src/DB.hs | isc | 469 | 0 | 13 | 65 | 139 | 77 | 62 | 14 | 1 |
{-|
Module : BreadU.Handlers
Description : Handlers for endpoints.
Stability : experimental
Portability : POSIX
Handlers for all endpoints defined in API.
-}
module BreadU.Handlers
( indexPageCommon
, indexPage
, addFood
, calculateFood
, autoComplete
) where
import BreadU.Ty... | denisshevchenko/breadu.info | src/lib/BreadU/Handlers.hs | mit | 4,765 | 0 | 14 | 1,687 | 783 | 441 | 342 | -1 | -1 |
{-# htermination (gtGtMaybe :: Maybe b -> Maybe a -> Maybe a) #-}
import qualified Prelude
data MyBool = MyTrue | MyFalse
data List a = Cons a (List a) | Nil
data Maybe a = Nothing | Just a ;
gtGt0 q vv = q;
gtGtEsMaybe :: Maybe c -> (c -> Maybe b) -> Maybe b
gtGtEsMaybe (Just x) k = k x;
gtGtEsMaybe N... | ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/GTGT_1.hs | mit | 430 | 0 | 9 | 111 | 166 | 88 | 78 | 10 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Models.Json
( Matchup(..)
, Game(..)
, Period(..)
, Event(..)
, Bracket(..)
, toMatchup
) where
import Data.Char as Char
import Data.List as List
import Data.Text
import Hockey.Database hiding (Team(..))
import Hockey.Formatting
... | petester42/haskell-hockey | web/Models/Json.hs | mit | 5,610 | 0 | 13 | 1,272 | 1,617 | 866 | 751 | 157 | 5 |
{-# LANGUAGE RecordWildCards #-}
import Data.Foldable (for_)
import GHC.Exts (fromList, toList)
import Test.Hspec (Spec, describe, it, shouldMatchList)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import Anagram (anagramsFor)
main :: IO ()
main = hspecWith defaultConfig {co... | vaibhav276/exercism_haskell | anagram/test/Tests.hs | mit | 4,640 | 0 | 15 | 1,965 | 895 | 563 | 332 | 87 | 1 |
import Control.Monad
import Data.Array.Unboxed
import Data.List
import Data.Maybe
import Data.Tree
import System.Environment
data Direction = R | D | Init
type Index = (Int,Int)
type Board = UArray Index Int
newtype ValidBoard = ValidBoard { getBoard :: Board }
deriving (Eq,Show)
leaves :: Tree a -> [a]
leaves t... | brocoli/domino-tilings | Main.hs | mit | 5,142 | 62 | 22 | 1,060 | 2,356 | 1,272 | 1,084 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Y2021.M03.D01.Solution where
{--
Okay, we have some matches of wineries between the wikidata-set and our
graph-set using the double-metaphone algorithm. Great! Now, let's actually
match those matches, that is to say: upload the matching wikidata data to our
graph-store.
Se... | geophf/1HaskellADay | exercises/HAD/Y2021/M03/D01/Solution.hs | mit | 4,748 | 0 | 17 | 1,005 | 709 | 409 | 300 | 61 | 1 |
module ParseAST where
import Lexer
import AST
import Parse
data Parsed
parseParens :: Parse x -> Parse x -> Parse x
parseParens inside outside = check LexSpecial "(" ??? (do value <- inside; _ <- expect LexSpecial ")"; return value, outside)
parseBetween :: Parse x -> Parse (Maybe loc) -> (x -> loc -> x -> x) -> Pa... | Nathan-Fenner/New-Nickel | ParseAST.hs | mit | 14,115 | 0 | 19 | 2,290 | 4,436 | 2,184 | 2,252 | -1 | -1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-|
Module : PostgREST.QueryBuilder
Description : PostgREST SQL generating functions.
This module provides functions to... | begriffs/postgrest | src/PostgREST/QueryBuilder.hs | mit | 21,109 | 0 | 22 | 4,900 | 5,221 | 2,768 | 2,453 | -1 | -1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
-- | Files, directories, and encoding / decoding file functions.
--
module Network.AWS.Wolf.File
( dataDirectory
, storeDirectory
, inputDirectory
, outputDirectory
, metaDirectory
, writeText
, readText
, writeJson
, writeYaml
,... | swift-nav/wolf | src/Network/AWS/Wolf/File.hs | mit | 4,620 | 0 | 15 | 1,024 | 1,285 | 643 | 642 | 101 | 2 |
module Main where
import qualified Numeric.Container as NC
import System.IO (readFile)
import KMeans (fit)
parseFromFile :: String -> [[Double]]
parseFromFile = map (map read . words) . lines
main :: IO ()
main = do
contents <- readFile "faithful.txt"
let points = map NC.fromList $ parseFromFile contents
... | kubkon/hkmeans | Main.hs | mit | 435 | 0 | 12 | 108 | 148 | 77 | 71 | 13 | 1 |
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
-- | Reexports "Foreign.Marshal.Unsafe.Compat"
-- from a globally unique namespace.
module Foreign.Marshal.Unsafe.Compat.Repl.Batteries (
module Foreign.Marshal.Unsafe.Compat
) where
import "this" Foreign.Marshal.Unsa... | haskell-compat/base-compat | base-compat-batteries/src/Foreign/Marshal/Unsafe/Compat/Repl/Batteries.hs | mit | 330 | 0 | 5 | 31 | 32 | 25 | 7 | 5 | 0 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE
DeriveDataTypeable
, DeriveGeneric
, TemplateHaskell
, TypeFamilies
#-}
module Api.Type.Calc (Calc) where
import Data.Aeson
import Data.JSON.Schema
import Generics.Regular
import Generics.Regular.XmlPickler
import Text.XML.HXT.Arrow.Pickle
import MatCalc ... | tinkerthaler/matcalc | src/Api/Type/Calc.hs | mit | 588 | 0 | 6 | 94 | 125 | 72 | 53 | 21 | 0 |
main = print $ sum [ x | x <- [2..999999], x == sum [ read [d] ^ 5 | d <- show x ] ]
| nickspinale/euler | complete/030.hs | mit | 85 | 0 | 14 | 26 | 64 | 32 | 32 | 1 | 1 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.EXTTextureFilterAnisotropic
(pattern TEXTURE_MAX_ANISOTROPY_EXT,
pattern MAX_TEXTURE_MAX_ANISOTROPY_EXT,
... | ghcjs/jsaddle-dom | src/JSDOM/Generated/EXTTextureFilterAnisotropic.hs | mit | 1,235 | 0 | 6 | 143 | 318 | 210 | 108 | 22 | 0 |
module MyMap where
import Data.Bool
myMap :: (a -> b) -> [a] -> [b]
myMap _ [] = []
myMap f (x:xs) = f x : myMap f xs
vowels :: String -> [Bool]
vowels = map (\x -> elem x "aeiou")
foldBool :: (Num b, Eq b) => [b] -> [b]
foldBool xs = map (\x -> bool x (-x) $ x == 3) xs
| andrewMacmurray/haskell-book-solutions | src/ch9/map.hs | mit | 274 | 0 | 12 | 69 | 180 | 97 | 83 | 9 | 1 |
{-# LANGUAGE DeriveGeneric #-}
module ConfigVals
( decodeYAML
, PHPClass
, className
, implements
, properties
, PHPProperty
, name
, typeHint
, getterName
, serializationOptions
, extends
, locked
, serializable
) where
import GHC.Generics
import Data.Aeson
import Data.Yaml
import Control.Applicative
import qualifie... | richardmiller/phsgen | ConfigVals.hs | mit | 1,037 | 0 | 10 | 264 | 256 | 149 | 107 | 40 | 1 |
import Bang
import Data.Monoid
import Data.Ratio
-- | The very first rhythm most drummers learn to play.
simple :: Music Dur PercussionSound
simple = double $ (4 #> hc) >< (bd <> qr <> sn <> qr)
-- | An example of taking simple pieces and doing crazy stuff with it.
complex :: Music Dur PercussionSound
complex = mirro... | 5outh/Bang | src/Examples/play.hs | mit | 2,566 | 0 | 16 | 766 | 750 | 417 | 333 | 63 | 1 |
import Graphics.Rendering.Cairo
data Point = Point Double Double
data Vector = Vector Double Double
data RGBA = RGB Double Double Double
| RGBA Double Double Double Double
tau = 6.28318530717958647692
uncurry3 f (a,b,c) = f a b c
intToDouble :: Int -> Double
intToDouble i = fromRational (toRational i)
... | jsavatgy/xroads-game | code/circle-area-demo-1.hs | gpl-2.0 | 5,262 | 0 | 17 | 1,438 | 2,491 | 1,262 | 1,229 | 139 | 4 |
{- |
Module : Language.PiCalc.Parser
Description : A Parser for pi-calculus
Copyright : Copyright (C) 2013 Emanuele D'Osualdo
License : GPLv2
Maintainer : emanuele.dosualdo@gmail.com
A Parser for pi-calculus based on @Parsec@.
-}
module Language.PiCalc.Parser(
Parser
, pa... | bordaigorl/jamesbound | src/Language/PiCalc/Parser.hs | gpl-2.0 | 6,128 | 0 | 14 | 1,831 | 1,806 | 954 | 852 | 142 | 2 |
{-# LANGUAGE OverlappingInstances #-}
-- | abstraction to simple CGI input elements
-- the state is in the CGI parameters (the Env)
module Gateway.CGI
( Form, Tag, execute, look, write, delete
, io, embed, wrap
, gensym
, begin, click, end, end0, end_with_default, end_maybe
, cc
, click_choice
, click_choice_with_d... | Erdwolf/autotool-bonn | test/src/Gateway/CGI.hs | gpl-2.0 | 30,860 | 456 | 29 | 9,578 | 9,511 | 5,088 | 4,423 | -1 | -1 |
module QHaskell.Nat.TH where
import QHaskell.MyPrelude
import Language.Haskell.TH.Syntax
nat :: Word32 -> String -> Q Exp
nat 0 p = do Just nm <- lookupValueName (p ++ "Zro")
return (ConE nm)
nat n p = do Just nm <- lookupValueName (p ++ "Suc")
AppE (ConE nm) <$> (nat (n - 1) p)
natP :: Wor... | shayan-najd/QHaskell | QHaskell/Nat/TH.hs | gpl-3.0 | 781 | 0 | 11 | 242 | 385 | 185 | 200 | 19 | 1 |
module Diagrams.Backend.Drawille ( renderToCanvas
, renderToString
, Canvas
) where
import Diagrams.Prelude hiding (frame)
import Diagrams.Backend.Rasterific (Rasterific(..))
import Codec.Picture.Types ( Image
... | zudov/diagrams-drawille | src/Diagrams/Backend/Drawille.hs | gpl-3.0 | 1,293 | 0 | 13 | 438 | 286 | 156 | 130 | 21 | 1 |
-- | Exception module for P
-- | Juan García Garland (Nov. 2016)
{-# LANGUAGE DeriveFunctor #-}
module Exception where
import Control.Monad
data Exc a = Return a
| Error String
deriving (Read,Show,Functor)
instance Applicative Exc where
(<*>) = ap
pure = return
instance Monad Exc wher... | jota191/LambdaInterp | src/Old/Exception.hs | gpl-3.0 | 522 | 0 | 9 | 163 | 162 | 86 | 76 | 18 | 1 |
{-# LANGUAGE ScopedTypeVariables, TypeOperators #-}
{-# OPTIONS_GHC -Wall #-}
----------------------------------------------------------------------
-- |
-- Module : FRP.Reactive.Internal.TVal
-- Copyright : (c) Conal Elliott 2008
-- License : GNU AGPLv3 (see COPYING)
--
-- Maintainer : conal@conal.net... | ekmett/reactive | src/FRP/Reactive/Internal/TVal.hs | agpl-3.0 | 10,135 | 0 | 18 | 3,613 | 1,216 | 705 | 511 | 78 | 2 |
{-
Copyright (C) 2009 Andrejs Sisojevs <andrejs.sisojevs@nextmail.ru>
All rights reserved.
For license and copyright information, see the file COPYRIGHT
-}
--------------------------------------------------------------------------
--------------------------------------------------------------------------
{-# OPTION... | Andrey-Sisoyev/haskell-PCLT | Text/PCLT/Catalog__.hs | lgpl-2.1 | 9,228 | 0 | 15 | 1,595 | 1,202 | 667 | 535 | 59 | 0 |
data Heap a = Heap {arr :: [a]} deriving (Eq,Ord)
type Index = Int
data Node a = Empty | Node {val::a,
index::Index}
deriving (Eq,Ord)
(>@) :: (Ord a) => a -> Node a -> Bool
(>@) i x
| x == Empty = True
| otherwise = i > (val x)
(>@@) :: (Ord a) => Node a -> Node ... | ccqpein/Arithmetic-Exercises | Heap-Sort/HS.hs | apache-2.0 | 1,774 | 2 | 14 | 533 | 1,029 | 511 | 518 | 48 | 3 |
module Network.IRC.Protocol
( defaultParsers
, defaultCommandFormatter
) where
import ClassyPrelude
import Data.Maybe (fromJust)
import Data.List ((!!))
import Data.Text (strip)
import Network.IRC.Types
pingParser :: MessageParser
pingParser = MessageParser "ping" go
where
go _ time line _
| "PIN... | abhin4v/hask-irc | hask-irc-core/Network/IRC/Protocol.hs | apache-2.0 | 6,875 | 0 | 25 | 2,240 | 2,182 | 1,099 | 1,083 | -1 | -1 |
module TestTemplateRepeat where
import Test.HUnit
import Text.Proton.Template
import Utils
repeatApplyValues tmp [] = return tmp
repeatApplyValues tmp (x:xs) = do
tmp <- setElementValue tmp "list-item" ("test" ++ (show $ x - 1)) x
repeatApplyValues tmp xs
repeatTest = TestCase (do
tmps <- loadTemplat... | jasonrbriggs/proton | haskell/testsuite/TestTemplateRepeat.hs | apache-2.0 | 3,291 | 0 | 17 | 741 | 702 | 321 | 381 | 51 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TupleSections #-}
module HERMIT.Dictionary.WorkerWrapper.FixResult
( -- * The Worker/Wrapper Transformation (Result Variant)
-- | Note that many of these operations require 'Data.Function.fix' to be in scope.
HERMIT.Dictionary.WorkerWrapper.FixResult.exte... | beni55/hermit | src/HERMIT/Dictionary/WorkerWrapper/FixResult.hs | bsd-2-clause | 29,499 | 0 | 30 | 10,785 | 5,293 | 2,687 | 2,606 | 391 | 3 |
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, RecordWildCards #-}
-- |
-- Module : Criterion.Main.Options
-- Copyright : (c) 2014 Bryan O'Sullivan
--
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : GHC
--
-- Benchmarking command-line configuration.... | osa1/criterion | Criterion/Main/Options.hs | bsd-2-clause | 7,178 | 0 | 22 | 2,145 | 1,855 | 963 | 892 | 146 | 2 |
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-|
Copyright : (C) 2015, University of Twente
License : BSD2 (see the file LICENSE)
Maintainer : Christiaan Baaij <christiaan.baaij@gmail.com>
-}
module GHC.TypeLits.Normalise.Unify
( -- * 'Nat' expressions \<-\> 'SOP' terms
Co... | mstksg/ghc-typelits-natnormalise | src/GHC/TypeLits/Normalise/Unify.hs | bsd-2-clause | 10,180 | 0 | 16 | 3,039 | 3,578 | 1,857 | 1,721 | 174 | 4 |
module Analysis where
import Types
countType :: HTTPMethod -> Int
countType Get = 1
countType _ = 0
countGets :: [HTTPMethod] -> Int
countGets = sum . (map countType)
countSuccessful :: Maybe HTTPStatus -> Int
countSuccessful (Just status)
| status < 300 = 1
| otherwise = 0
countSuccessful Nothing = 0
c... | mazelife/logparser_blog_post | src/Analysis.hs | bsd-2-clause | 411 | 0 | 8 | 79 | 142 | 74 | 68 | 14 | 1 |
module Excellent where
intLen :: Int -> Int
intLen x = ceiling $ logBase 10 $ fromIntegral y
where y = if mod x 10 == 0 then x + 1 else x
intSplit :: Int -> Maybe (Int, Int, Int)
intSplit x
| x < 10 = Nothing
| odd l = Nothing
| otherwise = Just (x, top, bottom)
where l = intLen x
h ... | dnmfarrell/Excellent | Excellent.hs | bsd-2-clause | 768 | 0 | 9 | 226 | 370 | 194 | 176 | 23 | 2 |
{-# LANGUAGE OverloadedStrings, PackageImports #-}
import Control.Applicative
import Control.Monad
import "monads-tf" Control.Monad.Trans
import Data.HandleLike
import System.Environment
import Network
import Network.PeyoTLS.ReadFile
import Network.PeyoTLS.Client
import "crypto-random" Crypto.Random
import qualified ... | YoshikuniJujo/peyotls | peyotls/examples/simpleClient.hs | bsd-3-clause | 914 | 3 | 14 | 154 | 331 | 171 | 160 | 26 | 2 |
{-|
Module : Idris.Inliner
Description : Idris' Inliner.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE PatternGuards #-}
module Idris.Inliner(inlineDef, inlineTerm) where
import Idris.AbsSyntax
import Idris.Core.TT
inlineDef :: IState -> [([Name], Term, Term)] -> [([Name], ... | uuhan/Idris-dev | src/Idris/Inliner.hs | bsd-3-clause | 1,246 | 0 | 12 | 293 | 345 | 188 | 157 | 15 | 5 |
{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | This example performs a number of criterion benchmarks calculating various
-- Lp (Lebesgue) metrics. The variable p is specified at the type level.
module Main
where
import Control.DeepSeq
import Control.Monad
import... | liyang/fast-math | test/benchl2.hs | bsd-3-clause | 3,735 | 0 | 16 | 940 | 1,132 | 586 | 546 | 64 | 2 |
module Main where
import FP
main ∷ IO ()
main = pprint "..."
| davdar/darailude | src/Main.hs | bsd-3-clause | 65 | 0 | 6 | 15 | 25 | 14 | 11 | -1 | -1 |
{-|
Module : Grammar
Description : Export the most useful functions to manipulate context-free grammars.
Copyright : (c) Davide Mancusi, 2017
License : BSD3
Maintainer : arekfu@gmail.com
Stability : experimental
Portability : POSIX
This module exports the most important datatypes and functions that can b... | arekfu/grammar-haskell | src/Grammar.hs | bsd-3-clause | 1,949 | 0 | 5 | 411 | 144 | 100 | 44 | 36 | 0 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}
{- |
Module : Verifier.SAW.Typechecker.Simplification
Copyright : Galois, Inc. 2012-2015
License : BSD3
Maintainer : jhendrix@galois.com
Stability : experimental
Portability : non-portable (language extensions)
-}
module Verifier.SAW.Typechecker.... | iblumenfeld/saw-core | src/Verifier/SAW/Typechecker/Simplification.hs | bsd-3-clause | 5,720 | 0 | 20 | 1,497 | 1,809 | 932 | 877 | 118 | 10 |
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Parsing Dhall expressions.
module Dhall.Parser.Expression where
import Control.Applicative (Alternative (..), liftA2, option... | Gabriel439/Haskell-Dhall-Library | dhall/src/Dhall/Parser/Expression.hs | bsd-3-clause | 39,850 | 10 | 32 | 17,920 | 8,761 | 4,286 | 4,475 | 809 | 26 |
-- ------------------------------------------------------------
{- |
Module : Yuuko.Text.XML.HXT.Arrow.XPath
Copyright : Copyright (C) 2006 Uwe Schmidt
License : MIT
Maintainer : Uwe Schmidt (uwe@fh-wedel.de)
Stability : experimental
Portability: portable
Arrows for working with XPath a... | nfjinjing/yuuko | src/Yuuko/Text/XML/HXT/Arrow/XPath.hs | bsd-3-clause | 9,120 | 123 | 17 | 1,842 | 1,525 | 837 | 688 | 117 | 5 |
import System.Environment (getArgs)
count :: (Eq a) => a -> [a] -> Int
count x ys = length (filter (== x) ys)
nrc :: Int -> String -> String -> String
nrc i xs ys | i == length ys = ""
| elem y xs = nrc (succ i) xs ys
| c > 1 = nrc (succ i) (y:xs) ys
| otherwis... | nikai3d/ce-challenges | moderate/nrc.hs | bsd-3-clause | 526 | 1 | 11 | 207 | 269 | 129 | 140 | 15 | 1 |
transpose' :: Int -> [[a]] ->[[a]]
transpose' n list
| (length . head) list < n = []
| otherwise = concatMap (drop (n-1) . take n) list : transpose' (n+1) list
main :: IO ()
main = do
let tList = transpose' 1 [[1,2,3,4],[2,3,4,5],[3,4,5,6]]
putStrLn "The result of My Test"
print tList
putStrLn "Test End!"
| v97ug/connect-four | test/Spec.hs | bsd-3-clause | 320 | 2 | 12 | 69 | 201 | 104 | 97 | 10 | 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/Numeral/RU/Corpus.hs | bsd-3-clause | 2,813 | 0 | 11 | 1,236 | 500 | 290 | 210 | 82 | 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.
------------------... | facebookincubator/duckling | Duckling/Ranking/Classifiers/FI_XX.hs | bsd-3-clause | 828 | 0 | 6 | 105 | 66 | 47 | 19 | 8 | 1 |
import Control.Applicative
import System.IO.Unsafe
nums :: Int -> IO [Int]
nums n = unsafeInterleaveIO $ print n >> (n :) <$> nums (n + 1)
| YoshikuniJujo/simple-pipe | try/testLazy.hs | bsd-3-clause | 141 | 0 | 8 | 27 | 68 | 35 | 33 | 4 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.Indexed.Fix
-- Copyright : (C) 2008 Edward Kmett
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Reiner Pope <reiner.pope@gmail.com>
-- Stability : experimental
-- Portability... | bitemyapp/indexed | Control/Monad/Indexed/Fix.hs | bsd-3-clause | 579 | 4 | 10 | 93 | 84 | 51 | 33 | 5 | 0 |
{-# LANGUAGE CPP, BangPatterns, OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module : Codec.MsgPack.Encoder
-- Copyright : 2013, Simon Meier <iridcode@gmail.com>
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Simon Meier <iridcode@gmai... | meiersi/blaze-binary | src/Codec/MsgPack/Encoder.hs | bsd-3-clause | 18,428 | 0 | 19 | 4,453 | 2,962 | 1,605 | 1,357 | 240 | 13 |
module Physics.AABB
( AABB(..)
, valid
, diameter
, union
, vertices
) where
import Control.Applicative
import Control.Lens
import Control.Lens.Rep
import Control.Monad.Trans.Class
import Data.Semigroup
import Data.Foldable as Foldable
import Data.Traversable
import Physics.Metric
data AABB f a = AABB (f ... | ekmett/physics | Physics/AABB.hs | bsd-3-clause | 1,842 | 0 | 13 | 426 | 1,012 | 519 | 493 | 44 | 1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
The @TyCon@ datatype
-}
{-# LANGUAGE CPP, FlexibleInstances #-}
module TyCon(
-- * Main TyCon data types
TyCon, AlgTyConRhs(..), visibleDataCons,
AlgTyConFlav(..), isNoParent,
FamTyConFlav... | sgillespie/ghc | compiler/types/TyCon.hs | bsd-3-clause | 91,700 | 2 | 16 | 26,196 | 11,139 | 6,283 | 4,856 | 999 | 7 |
module Lib
( someFunc
, emit
, installProjection
) where
import Control.Concurrent.STM ( STM
, atomically
)
import Control.Concurrent.STM.TVar ( TVar
, newTVar
, readTVar
... | lgastako/sesh | src/Lib.hs | bsd-3-clause | 3,175 | 0 | 11 | 900 | 969 | 500 | 469 | 77 | 1 |
{-# LANGUAGE PolyKinds, DataKinds, TemplateHaskell, TypeFamilies,
GADTs, TypeOperators, RankNTypes, FlexibleContexts, UndecidableInstances,
FlexibleInstances, ScopedTypeVariables, MultiParamTypeClasses,
OverlappingInstances, KindSignatures, EmptyDataDecls #-}
module Oxymoron.Scene.Image where
import Data.Ar... | jfischoff/oxymoron | src/Oxymoron/Scene/Image.hs | bsd-3-clause | 2,053 | 0 | 12 | 610 | 471 | 270 | 201 | 49 | 1 |
module DataStructures.Answer09 where
import DataStructures.Answer01 (List(..))
import DataStructures.Answer08 (foldRight)
length :: List a -> Int
length list = foldRight list 0 (\_ n -> n + 1)
| mohsen3/Haskell4ScalaDevelopers | src/DataStructures/Answer09.hs | bsd-3-clause | 196 | 0 | 8 | 30 | 71 | 40 | 31 | 5 | 1 |
{-# LANGUAGE RecordWildCards #-}
module Main (main) where
import Control.Applicative hiding (many)
import Control.Exception
import Control.Monad
import Data.Char
import Data.Maybe
import Prelude hiding (negate)
import System.Enviro... | aristidb/filefind | Filefind.hs | bsd-3-clause | 7,124 | 0 | 20 | 2,553 | 2,258 | 1,177 | 1,081 | 151 | 5 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Snap.Snaplet.Config where
------------------------------------------------------------------------------
import Data.Function (on)
import Data.Maybe (fromMaybe)
i... | snapframework/snap | src/Snap/Snaplet/Config.hs | bsd-3-clause | 3,563 | 0 | 13 | 791 | 509 | 293 | 216 | 42 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Handler.Edit where
import Import hiding (length)
import Data.Time.Clock (getCurrentTime)
import Data.Char (isAlphaNum)
import Data.Maybe (isJust, fromMaybe)
import Data.Text (isPrefixOf, append, length, head, find, pack)
import Network.HTTP hiding (getRequest)
import Control.... | ehamberg/rssqueue | Handler/Edit.hs | bsd-3-clause | 4,443 | 0 | 18 | 1,319 | 1,248 | 613 | 635 | -1 | -1 |
{-# LANGUAGE ScopedTypeVariables #-}
module Config where
import Distribution.Simple
import Distribution.Simple.Setup
import Distribution.PackageDescription
import Distribution.Simple.LocalBuildInfo
import System.Exit
import System.Process
config :: LocalBuildInfo -> IO (Maybe HookedBuildInfo)
config bInfo = do
... | wavewave/HROOT | HROOT-generate/template/HROOT-RooFit-RooStats/Config.hs | gpl-3.0 | 3,586 | 0 | 23 | 1,420 | 879 | 443 | 436 | 75 | 5 |
{-# LANGUAGE MultiParamTypeClasses
, FunctionalDependencies
, ExistentialQuantification
#-}
module Data.BTree.Cache.Class where
import Control.Concurrent.STM
data R b = forall a. Inter (IO a) (a -> STM ())
| Final b
class Monad m => Cache m p k v | m -> p, p -> k, p -> v, p -> m w... | br0ns/hindsight | src/Data/BTree/Cache/Class.hs | gpl-3.0 | 494 | 0 | 11 | 166 | 195 | 106 | 89 | 13 | 0 |
{-
Copyright 2019 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... | alphalambda/codeworld | codeworld-game-api/src/CodeWorld/Message.hs | apache-2.0 | 2,160 | 0 | 6 | 548 | 128 | 77 | 51 | 23 | 0 |
-- this is test string used in the 'spec' --- don't touch me!
module System.Torrent.FileMapSpec (spec) where
import Control.Monad.Loops
import Data.List as L
import Data.ByteString.Lazy as BL
import System.Directory
import System.FilePath
import System.IO.Temp
import Test.Hspec
import Data.Torrent
import System.Torre... | DavidAlphaFox/bittorrent | tests/System/Torrent/FileMapSpec.hs | bsd-3-clause | 3,586 | 0 | 19 | 964 | 1,229 | 588 | 641 | 95 | 1 |
module Hi.Template
(
isTemplate
, readTemplates
, untemplate
) where
import Hi.Directory (inTemporaryDirectory)
import qualified Hi.Git as Git
import Hi.Types
import Control.Applicative ((<$>))
import qualified Data.ByteString as BS (readFil... | jonathankochems/hi | src/Hi/Template.hs | bsd-3-clause | 1,493 | 0 | 12 | 422 | 306 | 164 | 142 | 30 | 2 |
module Main where
import Control.Monad
import Graphics.Gnuplot.Simple
import Perceptron
import NeuralNetwork
runAndPrint op x1 x2 = do
putStr $ show (x1, x2)
putStr " "
print $ op x1 x2
main :: IO ()
main = do
putStrLn "AND"
sequence $ runAndPrint andGate <$> [0, 1] <*> [0, 1]
putStrLn "NAND"
sequence ... | kayhide/deep-learning-from-scratch | app/Main.hs | bsd-3-clause | 1,747 | 0 | 16 | 473 | 655 | 349 | 306 | 44 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
#ifndef MIN_VERSION_mtl
#define MIN_VERSION_mtl(x,y,z) 1
#endif
... | Icelandjack/lens | src/Control/Lens/Zoom.hs | bsd-3-clause | 8,766 | 0 | 15 | 1,864 | 1,959 | 1,091 | 868 | 86 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Test.Property where
import Prelude (($), (.), not)
import Control.Applicative
import qualified Data.List as List
import qualified Data.List.Non... | wolftune/titlecase | tests/Test/Property.hs | bsd-3-clause | 1,837 | 0 | 13 | 418 | 422 | 233 | 189 | 45 | 1 |
{-
Author: George Karachalias <george.karachalias@cs.kuleuven.be>
Pattern Matching Coverage Checking.
-}
{-# LANGUAGE CPP, GADTs, DataKinds, KindSignatures #-}
module Eta.DeSugar.Check (
-- Actual check and pretty printing
checkSingle, checkMatches, isAnyPmCheckEnabled,
-- See Note [Type and... | rahulmutt/ghcvm | compiler/Eta/DeSugar/Check.hs | bsd-3-clause | 59,462 | 1 | 22 | 14,680 | 11,267 | 5,899 | 5,368 | 658 | 22 |
{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-orphans #-}
{-# LANGUAGE UndecidableInstances #-} -- FIXME
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE... | mitchellwrosen/persistent | persistent-test/PersistentTest.hs | mit | 32,790 | 0 | 22 | 9,443 | 8,863 | 4,236 | 4,627 | 628 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-| The Ganeti WConfd core functions.
This module defines all the functions that WConfD exports for
RPC calls. They are in a separate module so that in a later
stage, TemplateHaskell can generate, e.g., the python interface
for those.
-}
{-
Copyright (C) 2013, 2014 Google Inc.
All ... | ganeti/ganeti | src/Ganeti/WConfd/Core.hs | bsd-2-clause | 17,143 | 0 | 15 | 4,029 | 2,643 | 1,478 | 1,165 | 231 | 4 |
{-@ LIQUID "--notermination" @-}
{-# OPTIONS_GHC -cpp -fglasgow-exts -fno-warn-orphans #-}
-- |
-- Module : Data.ByteString.Fusion
-- License : BSD-style
-- Maintainer : dons@cse.unsw.edu.au
-- Stability : experimental
-- Portability : portable
--
-- Functional array fusion for ByteStrings.
--
-- Originally... | ssaavedra/liquidhaskell | benchmarks/bytestring-0.9.2.1/Data/ByteString/Fusion.hs | bsd-3-clause | 28,356 | 0 | 19 | 7,313 | 4,698 | 2,500 | 2,198 | -1 | -1 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Main
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
-- Maintainer : lemmih@gmail.com
-- Stability : provisional
-- Portability : portable
--
-- Entry point to the ... | enolan/cabal | cabal-install/Main.hs | bsd-3-clause | 55,684 | 0 | 24 | 15,154 | 10,011 | 5,234 | 4,777 | 905 | 13 |
haskell comment {-|
haskell blank
haskell comment -}
haskell blank
| codeimpossible/ohcount | test/expected_dir/haskell2.hs | gpl-2.0 | 77 | 6 | 4 | 20 | 15 | 8 | 7 | -1 | -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>Directory List v2.3 LC</title>
<maps>
<homeID>directorylistv2_3_lc</homeID>
... | thc202/zap-extensions | addOns/directorylistv2_3_lc/src/main/javahelp/help_de_DE/helpset_de_DE.hs | apache-2.0 | 984 | 78 | 66 | 158 | 414 | 210 | 204 | -1 | -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="ur-PK">
<title>Passive Scan Rules - Beta | ZAP Extension</title>
<maps>
<homeID>top</homeID>... | thc202/zap-extensions | addOns/pscanrulesBeta/src/main/javahelp/org/zaproxy/zap/extension/pscanrulesBeta/resources/help_ur_PK/helpset_ur_PK.hs | apache-2.0 | 986 | 78 | 67 | 162 | 420 | 212 | 208 | -1 | -1 |
{-# OPTIONS_GHC -fglasgow-exts #-}
{-# LANGUAGE UndecidableInstances #-}
-- UndecidableInstances now needed because the Coverage Condition fails
-- !!! Functional dependency test. Hugs [Apr 2001] fails to typecheck this
-- Rather bizarre example submitted by Jonathon Bell
module ShouldCompile where
-- module Foo whe... | hvr/jhc | regress/tests/1_typecheck/2_pass/ghc/tc126.hs | mit | 1,025 | 0 | 10 | 227 | 200 | 115 | 85 | -1 | -1 |
module GildedRose where
type GildedRose = [Item]
data Item = Item String Int Int
deriving (Eq)
instance Show Item where
show (Item name sellIn quality) =
name ++ ", " ++ show sellIn ++ ", " ++ show quality
updateQuality :: GildedRose -> GildedRose
updateQuality = map updateQualityItem
where
updateQual... | qwaneu/gilded-rose-haskell-solution | src/GildedRose.hs | mit | 2,117 | 0 | 22 | 1,046 | 451 | 247 | 204 | 50 | 17 |
{-# LANGUAGE DataKinds, PolyKinds, GADTs, TypeOperators, TypeFamilies,
TypeInType #-}
{-# OPTIONS_GHC -fwarn-unticked-promoted-constructors #-}
module RaeBlogPost where
import Data.Kind
-- a Proxy type with an explicit kind
data Proxy k (a :: k) = P
prox :: Proxy * Bool
prox = P
prox2 :: Proxy Bool 'Tr... | sgillespie/ghc | testsuite/tests/dependent/should_compile/RaeBlogPost.hs | bsd-3-clause | 1,491 | 3 | 11 | 418 | 574 | 315 | 259 | -1 | -1 |
{-# LANGUAGE NoNondecreasingIndentation #-}
module ShouldCompile where
f :: IO ()
f = do if True then f else do
f
if True then f else do
f
| urbanslug/ghc | testsuite/tests/parser/should_fail/NondecreasingIndentationFail.hs | bsd-3-clause | 163 | 0 | 12 | 52 | 48 | 26 | 22 | -1 | -1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.HTMLAnchorElement
(js_toString, toString, js_setCharset, setCharset, js_getCharset,
getCharset, js_setCoords, setCoords, js_getCoords, getCoords,
js_setDownload, setDownload, js_getDownload,... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/HTMLAnchorElement.hs | mit | 19,635 | 298 | 10 | 3,165 | 4,281 | 2,286 | 1,995 | 279 | 1 |
module Main ( main ) where
import TestLib
import Test.HUnit
tests :: IO Test
tests = TestList <$> sequence [
mkTestSuite "Numerals" "numbers",
mkTestSuite "Operation symbols" "op-sym",
mkTestSuite "Miscellaneous symbols" "misc-sym",
mkTestSuite "Relation symbols" "rel-sym",
mkTestSuite "Greek letters" "greek... | Kerl13/AsciiMath | tests/TestAsciiMath.hs | mit | 634 | 0 | 8 | 99 | 152 | 79 | 73 | 19 | 1 |
module Math where
absolute :: Int -> Int
absolute x = if x < 0 then negate x else x
| Sgoettschkes/learning | haskell/LearnYouAHaskell/old/Math.hs | mit | 85 | 0 | 6 | 21 | 36 | 20 | 16 | 3 | 2 |
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
module SumTypes.THSpec (spec) where
import Test.Hspec
import SumTypes.TH
data TypeA = TypeA deriving (Show, Eq)
data TypeB = TypeB deriving (Show, Eq)
data TypeC = TypeC deriving (Show, Eq)
constructSumType "MySum" defaultSumTypeOptions [''TypeA,... | jdreaver/sum-type-boilerplate | tests/SumTypes/THSpec.hs | mit | 1,424 | 0 | 16 | 233 | 397 | 197 | 200 | 30 | 1 |
module Main where
-- import Prelude hiding (map, filter, zip, taske, head, zipWith, zipWith3, takeWhile, dropWhile, break, foldr, foldl)
class CanFoo a where
toFoo :: a -> String
instance CanFoo Int where
toFoo 42 = "42!"
toFoo _ = "Oops!"
main = do
print $ toFoo (42::Int)
| aquatir/remember_java_api | code-sample-haskell/typed_fp_basics_cource/04_typeclasses/code.hs | mit | 296 | 0 | 9 | 69 | 68 | 36 | 32 | 8 | 1 |
module CalcInpt where
import CalcInptStoreModule
import CalcInptType (Expr (..), Ops (..), Parse)
import Data.Char
import System.IO
import System.IO.Unsafe (unsafePerformIO)
none :: Parse a b
none _ = []
spot :: (a -> Bool) -> Parse a a
spot f (x : xs) |... | tonyfloatersu/solution-haskell-craft-of-FP | CalcInpt.hs | mit | 5,759 | 2 | 13 | 1,922 | 1,840 | 976 | 864 | 98 | 2 |
{-# LANGUAGE ScopedTypeVariables #-}
import Control.Monad
import Control.Monad.Error
import Data.Either
import Control.Monad.Trans.Control (control,liftBaseOp)
import Control.Exception
import System.IO
import Prelude hiding (catch)
data FibException = FileUnreadable IOError
| FormatError String St... | danidiaz/haskell-sandbox | monadcontrol2.hs | mit | 2,001 | 0 | 13 | 476 | 551 | 285 | 266 | 44 | 1 |
module Statements where
import Data.ByteString (ByteString)
import qualified Hasql as H
import qualified Hasql.Postgres as HP
import qualified Data.Text as T
add :: T.Text -> T.Text -> H.Stmt HP.Postgres
add user description = [H.stmt|
insert into suggestion (submitter, description, created_at, active) values ($u... | harlanhaskins/What-If-CSH | Backend/src/Statements.hs | mit | 3,269 | 0 | 11 | 776 | 550 | 308 | 242 | -1 | -1 |
module Test where
import Grammar
import Lexer
import Parser
import Semantics
ifTree=TokenNode (If,"if")
(TokenNode (OpBool,"==")
(TokenLeaf (Number, "3"))
(TokenLeaf (Var, "c")))
(TokenNode (Then,"then")
(TokenNode (Semicolon, "" ) Nop Nop) --thentree
(TokenNode (Semicolon, "" ) Nop Nop)) --elsetree
... | Oboema/FP-GO1 | Test.hs | mit | 975 | 27 | 10 | 152 | 419 | 221 | 198 | 38 | 1 |
{-# OPTIONS_GHC -Wall #-}
module HW01 where
-- Exercise 1 -----------------------------------------
-- Get the last digit from a number
lastDigit :: Integer -> Integer
lastDigit x = x `mod` 10
-- Drop the last digit from a number
dropLastDigit :: Integer -> Integer
dropLastDigit x
| x < 10 = 0
| otherwise =... | limdauto/learning-haskell | cis194/week1/HW01.hs | mit | 1,219 | 4 | 11 | 222 | 317 | 173 | 144 | 19 | 2 |
{- |
Module : $Header$
Copyright : (c) C. Maeder, DFKI GmbH 2010
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : experimental
Portability : portable
-}
module Main where
import Text.ParserCombinators.Parsec
import qualified Data.Map as Map
import Syst... | nevrenato/Hets_Fork | utils/itcor/GenItCorrections.hs | gpl-2.0 | 5,665 | 0 | 19 | 1,531 | 1,602 | 818 | 784 | 146 | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.