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 Parser where
import Data.Binary
import Data.Binary.Get
import qualified Data.ByteString.Lazy as BS
import Codec.Compression.GZip (decompress)
import Control.Monad
import Numeric.LinearAlgebra
import Numeric.LinearAlgebra.Devel
import qualified Data.Vector as V
import Control.Monad.ST
type Pixel = Wor... | pierric/neural-network | Backend-hmatrix/Example/MNIST/Parser.hs | bsd-3-clause | 1,889 | 0 | 15 | 440 | 641 | 331 | 310 | 48 | 1 |
module Paths_sandlib (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
catchIO = Exception.catc... | vertexclique/sandlib | dist/build/autogen/Paths_sandlib.hs | bsd-3-clause | 1,149 | 0 | 10 | 164 | 326 | 186 | 140 | 25 | 1 |
-- | Errors that may occur during decoding/encoding of HTTP message bodies
module Network.HTTP.Encoding.Error (EncodingError (..)
,ConversionError (..)) where
import Codec.Text.IConv (ConversionError
,reportConversionError)
-- | Encoding/Decoding error messag... | achudnov/http-encodings | Network/HTTP/Encoding/Error.hs | bsd-3-clause | 1,337 | 0 | 12 | 454 | 132 | 77 | 55 | 18 | 0 |
{-# LANGUAGE UnicodeSyntax #-}
module Shake.It.FileSystem
( module FileSystem
) where
import Shake.It.FileSystem.Dir as FileSystem
import Shake.It.FileSystem.File as FileSystem
| Heather/Shake.it.off | src/Shake/It/FileSystem.hs | bsd-3-clause | 204 | 0 | 4 | 46 | 32 | 24 | 8 | 5 | 0 |
{-# LANGUAGE TypeOperators #-}
module Web.ApiAi.API
( module Import
, ApiAiAPI
) where
import Servant.API
import Web.ApiAi.API.Core as Import
import Web.ApiAi.API.Entities as Import
import Web.ApiAi.API.Query as Import
type ApiAiAPI = ApiAiEntitiesAPI :<|> ApiAiQueryAPI
| CthulhuDen/api-ai | src/Web/ApiAi/API.hs | bsd-3-clause | 286 | 0 | 5 | 48 | 59 | 42 | 17 | 9 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Make
-- Copyright : Martin Sjögren 2004
--
-- Maintainer : [email protected]
-- Portability : portable
--
-- This is an alternative build system that delegates everything to the @make@
-- p... | dcreager/cabal | Distribution/Make.hs | bsd-3-clause | 8,739 | 0 | 16 | 1,920 | 1,317 | 703 | 614 | 105 | 8 |
-- | Here we use @dynamic-object@ to descibe the concept of point-like particles from
-- classical mechanics. Also read the HSpec tests :
-- <https://github.com/nushio3/dynamic-object/blob/master/test/ObjectSpec.hs>
-- for more details.
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE... | nushio3/dynamic-object | Data/Object/Dynamic/Examples/PointParticle.hs | bsd-3-clause | 6,339 | 0 | 15 | 1,281 | 1,307 | 717 | 590 | 81 | 1 |
module Main (main) where
import D12Lib
import System.Environment (getArgs)
import Text.Parsec.String (parseFromFile)
main :: IO ()
main = do
file <- head <$> getArgs
parseResult <- parseFromFile instructionsP file
let instructions = either (error . show) id parseResult
let vm = newVM instructions
let vmRan ... | wfleming/advent-of-code-2016 | 2016/app/D12.hs | bsd-3-clause | 481 | 0 | 12 | 100 | 170 | 82 | 88 | 15 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module InvalidateCacheTestCommon (test1Common) where
import qualified Data.ByteString.Char8 as BS
test1Common lookup3 keysCached3 invalidateCache3 = do
b <- lookup3 ("file1" :: BS.ByteString)
b <- lookup3 "file2"
b <- lookup3 "file3"
b <- lookup3 "file2"
b <- lookup3 "fi... | elblake/expiring-cache-map | tests/InvalidateCacheTestCommon.hs | bsd-3-clause | 1,344 | 0 | 21 | 419 | 467 | 204 | 263 | 48 | 3 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Init
-- Copyright : (c) Brent Yorgey 2009
-- License : BSD-like
--
-- Maintainer : [email protected]
-- Stability : provisional
-- Portability : portable
--
-... | IreneKnapp/Faction | faction/Distribution/Client/Init.hs | bsd-3-clause | 22,401 | 0 | 22 | 6,823 | 5,325 | 2,719 | 2,606 | 414 | 13 |
module Text.Email.Parser.Polymorphic (
addrSpec, -- addrSpec is from this module, the rest are re-exports.
localPart,
domainPart,
EmailAddress,
unsafeEmailAddress,
toByteString
) where
import Text.Email.Parser (localPart, domainPart, EmailAddress(..), unsafeEmailAddress, toByteString)
impo... | bitemyapp/email-validate-hs | src/Text/Email/Parser/Polymorphic.hs | bsd-3-clause | 3,833 | 0 | 16 | 719 | 1,481 | 778 | 703 | 88 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module NLP.Romkan.Internal
(
romKanAList
, romKanAList_H
, kanRomAList
, kanRomAList_H
, kunreiToHepburnAList
, hepburnToKunreiAList
) where
import Data.Text (Text)
romKanAList :: [(Text, Text)]
romKanAList =
[
("bbya"... | karlvoigtland/romkan-hs | NLP/Romkan/Internal.hs | bsd-3-clause | 29,985 | 0 | 6 | 7,373 | 13,112 | 8,737 | 4,375 | 1,468 | 1 |
module Main (
main
) where
import Test.HUnit (runTestTT)
import Yawn.Test.Common (withServer)
import qualified Yawn.Test.BlackBox.ParserTest as ParserTest (tests)
main :: IO ()
main = withServer "www" $ do
runTestTT ParserTest.tests
return ()
| ameingast/yawn | test/src/TestMain.hs | bsd-3-clause | 252 | 0 | 9 | 41 | 83 | 47 | 36 | 9 | 1 |
module Benchmarks.ListSet where
type Set a = [a]
empty :: Set a
empty = []
insert :: Ord a => a -> Set a -> Set a
insert a [] = [a]
insert a (x:xs)
| a < x = a:x:xs
| a > x = x:insert a xs
| a == x = x:xs
set :: Ord a => [a] -> Set a
set = foldr insert empty
ordered [] = True
ordered [x] = True
ordered (x:y:... | UoYCS-plasma/LazySmallCheck2012 | suite/performance/Benchmarks/ListSet.hs | bsd-3-clause | 616 | 0 | 8 | 156 | 370 | 188 | 182 | 23 | 1 |
module HsImport.Utils
( firstSrcLine
, lastSrcLine
, srcSpan
, declSrcLoc
, importDecls
) where
import qualified Language.Haskell.Exts as HS
import HsImport.Types
declSrcLoc :: Decl -> SrcLoc
declSrcLoc decl = HS.SrcLoc srcFile srcLine srcCol
where
declSrcSpan = srcSpan . HS.ann $ decl
... | dan-t/hsimport | lib/HsImport/Utils.hs | bsd-3-clause | 692 | 0 | 9 | 177 | 208 | 112 | 96 | 18 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Common where
-- orig in mu/Syntax.hs
-- N for name, but Name already used in Bound,
-- and Nm is a data type in Syntax, thus N - oh well
type N = String
data Binop = Add | Sub | Mul | Eql
deriving (Eq, Ord, Show, Read)
| reuleaux/pire | exe/Common.hs | bsd-3-clause | 283 | 0 | 6 | 67 | 49 | 31 | 18 | 5 | 0 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
module Language.Haskell.Refact.Utils.ExactPrint
(
replace
, replaceAnnKey
, copyAnn
, setAnnKeywordDP
, clearPriorComments
, balanceAllCo... | SAdams601/ParRegexSearch | test/HaRe/src/Language/Haskell/Refact/Utils/ExactPrint.hs | mit | 5,482 | 0 | 16 | 1,338 | 1,370 | 715 | 655 | 93 | 3 |
{-# LANGUAGE RelaxedPolyRec #-} -- needed for inlinesBetween on GHC < 7
{-# LANGUAGE ScopedTypeVariables #-}
{-
Copyright (C) 2006-2015 John MacFarlane <[email protected]>
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 S... | alexvong1995/pandoc | src/Text/Pandoc/Readers/Markdown.hs | gpl-2.0 | 74,433 | 0 | 28 | 20,763 | 21,971 | 10,854 | 11,117 | 1,644 | 7 |
{-# LANGUAGE TemplateHaskell #-}
module Lambda.Backward_Join.Solution where
import Lambda.Type
import Autolib.ToDoc
import Autolib.Reader
import Data.Typeable
data Type = Make
{ start :: Lambda
, left_steps :: [ Int ]
, right_steps :: [ Int ]
}
deriving ( Typeable, Eq, ... | florianpilz/autotool | src/Lambda/Backward_Join/Solution.hs | gpl-2.0 | 560 | 0 | 9 | 165 | 141 | 86 | 55 | 17 | 1 |
{-# OPTIONS_GHC -F -pgmF htfpp #-}
module GameTest where
import Test.Framework
prop_reverse :: [Int] -> Bool
prop_reverse xs = xs == (reverse (reverse xs))
| abailly/hsgames | acquire/test/GameTest.hs | apache-2.0 | 168 | 0 | 9 | 36 | 46 | 26 | 20 | 5 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-| Implementation of the Ganeti LUXI interface.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redi... | mbakke/ganeti | src/Ganeti/Luxi.hs | bsd-2-clause | 13,584 | 0 | 23 | 4,301 | 3,060 | 1,681 | 1,379 | 284 | 29 |
module Tandoori.GHC.Internals
(module SrcLoc,
module Outputable,
module Name,
module BasicTypes,
module Unique,
module FastString,
module HsExpr,
module HsTypes,
module HsPat,
module HsLit,
module HsBinds,
module DataCon,
module TysWiredIn,
mo... | bitemyapp/tandoori | src/Tandoori/GHC/Internals.hs | bsd-3-clause | 845 | 0 | 5 | 170 | 172 | 119 | 53 | 33 | 0 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1997-1998
Author: Juan J. Quintela <[email protected]>
-}
{-# LANGUAGE CPP #-}
module ETA.DeSugar.Check ( check , ExhaustivePat ) where
import ETA.HsSyn.HsSyn
import ETA.TypeCheck.TcHsSyn
import ETA.DeSugar.DsUtils
im... | pparkkin/eta | compiler/ETA/DeSugar/Check.hs | bsd-3-clause | 30,170 | 0 | 17 | 7,713 | 7,417 | 3,867 | 3,550 | 402 | 22 |
{-# LANGUAGE CPP #-}
-- |
-- Package configuration information: essentially the interface to Cabal, with
-- some utilities
--
-- (c) The University of Glasgow, 2004
--
module PackageConfig (
-- $package_naming
-- * PackageId
mkPackageId, packageConfigId,
-- * The PackageConfig type: i... | frantisekfarka/ghc-dsi | compiler/main/PackageConfig.hs | bsd-3-clause | 3,235 | 0 | 11 | 585 | 339 | 211 | 128 | 38 | 1 |
import WFA.Matrix
import WFA.Type
import WFA.RGB
import WFA.Write
import Data.Map ( Map )
import qualified Data.Map as M
import Data.Set ( Set )
import qualified Data.Set as S
main :: IO ()
main = writePBM "bild-b.pbm" Main.b 9
a :: WFA Quad Int RGB
a = let s = WFA.RGB.maxplus
in WFA
{ WFA.... | florianpilz/autotool | src/WFA/Main.hs | gpl-2.0 | 1,547 | 2 | 14 | 567 | 717 | 432 | 285 | 36 | 1 |
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}
{-
Copyright (C) 2011-2014 John MacFarlane <[email protected]>
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 o... | sapek/pandoc | src/Text/Pandoc/ImageSize.hs | gpl-2.0 | 15,318 | 0 | 21 | 5,476 | 4,027 | 2,157 | 1,870 | 335 | 18 |
module A1 where
import D1
sumSq xs ys= sum (map sq xs) + sumSquares xs ys
main = sumSq [1..4]
| kmate/HaRe | old/testing/rmOneParameter/A1.hs | bsd-3-clause | 99 | 0 | 8 | 25 | 50 | 26 | 24 | 4 | 1 |
{-# LANGUAGE TypeFamilyDependencies #-}
module T6018Bfail where
import Data.Kind (Type)
type family H a b c = (result :: Type) | result -> a b c
| sdiehl/ghc | testsuite/tests/typecheck/should_fail/T6018Bfail.hs | bsd-3-clause | 148 | 0 | 6 | 29 | 39 | 28 | 11 | -1 | -1 |
import GHC.Conc
main :: IO ()
main = setNumCapabilities 0
| ezyang/ghc | testsuite/tests/rts/T13832.hs | bsd-3-clause | 59 | 0 | 6 | 11 | 24 | 12 | 12 | 3 | 1 |
{-# LANGUAGE FlexibleContexts #-}
-- | Implementation of Kahan summation algorithm that tests
-- performance of tight loops involving unboxed arrays and floating
-- point arithmetic.
module Main (main) where
import Control.Monad.ST
import Data.Array.Base
import Data.Array.ST
import Data.Bits
import Data.Word
import S... | k-bx/ghcjs | test/nofib/imaginary/kahan/Main.hs | mit | 1,334 | 0 | 17 | 467 | 533 | 272 | 261 | 42 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilyDependencies #-}
module T13271 where
import GHC.TypeLits
data T1 = T1
type T2 = TypeError (Text "You can't do that!")
type family X i = r | r -> i where
X 1 = T1
X 2 = T2
| shlevy/ghc | testsuite/tests/indexed-types/should_fail/T13271.hs | bsd-3-clause | 229 | 0 | 7 | 53 | 64 | 39 | 25 | 9 | 0 |
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Data.Maybe (Maybe(..))
import Data.Ord (Ord)
import Language.Haskell.TH (mkName, nameSpace)
main :: IO ()
main = mapM_ (print . nameSpace)
[ 'Prelude.id
, mkName "id"
, 'Data.Maybe.Just
, ''Data.Maybe.Maybe
... | ezyang/ghc | testsuite/tests/th/TH_nameSpace.hs | bsd-3-clause | 364 | 0 | 8 | 119 | 105 | 64 | 41 | 12 | 1 |
main = interact wordCount
where wordCount input = show (length input) ++ "\n"
| akampjes/learning-realworldhaskell | ch01/WC.hs | mit | 80 | 0 | 8 | 15 | 32 | 15 | 17 | 2 | 1 |
{-# Language GADTs #-}
module Unison.Runtime.Vector where
import Unison.Prelude
import qualified Data.MemoCombinators as Memo
import qualified Data.Vector.Unboxed as UV
-- A `Vec a` denotes a `Nat -> Maybe a`
data Vec a where
Scalar :: a -> Vec a
Vec :: UV.Unbox a => UV.Vector a -> Vec a
Pair :: Vec a -> Vec ... | unisonweb/platform | parser-typechecker/src/Unison/Runtime/Vector.hs | mit | 1,622 | 0 | 17 | 417 | 667 | 334 | 333 | 38 | 6 |
import Control.Monad
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
bind :: Monad m => (a -> m b) -> m a -> m b
bind f n = join $ fmap f n
data Nope a = NopeDotJpg deriving (Show, Eq)
instance Functor Nope where
fmap f a = NopeDotJpg
instance Applicative Nope where
pur... | mitochon/hexercise | src/haskellbook/ch18/ch18.hs | mit | 3,911 | 0 | 12 | 1,065 | 2,025 | 1,010 | 1,015 | 115 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE Typ... | albertov/esqueleto-textsearch | test/Database/Esqueleto/TextSearchSpec.hs | mit | 11,840 | 0 | 25 | 3,394 | 3,663 | 1,804 | 1,859 | 262 | 5 |
{-
ghci c:\Users\Thomas\Documents\GitHub\practice\pe\nonvisualstudio\haskell\Spec\Problem0002.Spec.hs
c:\Users\Thomas\Documents\GitHub\practice\pe\nonvisualstudio\haskell\Implementation\Problem0002.hs
-}
-- :r :q :set +s for times
module Problem0002Tests where
import Test.HUnit
import System.IO
import Problem... | Sobieck00/practice | pe/nonvisualstudio/haskell/OldWork/Spec/Problem0002.Spec.hs | mit | 644 | 0 | 10 | 88 | 75 | 41 | 34 | 9 | 1 |
{-# OPTIONS #-}
-- ------------------------------------------------------------
module Holumbus.Crawler.XmlArrows
where
import Text.XML.HXT.Core
-- ------------------------------------------------------------
-- | Remove contents, when document status isn't ok, but remain meta info
checkDocumentStatus ... | ichistmeinname/holumbus | src/Holumbus/Crawler/XmlArrows.hs | mit | 578 | 0 | 6 | 151 | 43 | 28 | 15 | 7 | 1 |
{-|
Module : Control.Monad.Bayes.LogDomain
Description : Numeric types representing numbers using their logarithms
Copyright : (c) Adam Scibior, 2016
License : MIT
Maintainer : [email protected]
Stability : experimental
Portability : GHC
-}
-- Log-domain non-negative real numbers
-- Essentially a polymor... | ocramz/monad-bayes | src/Control/Monad/Bayes/LogDomain.hs | mit | 4,423 | 0 | 16 | 1,000 | 1,299 | 691 | 608 | -1 | -1 |
module Frontend.Values where
import Frontend.Types
import Internal
data Value = IntValue Int
| FloatValue Float
| BoolValue Bool
| UnitValue
deriving Eq
instance Show Value where
show (IntValue i) = show i
show (FloatValue f) = show f
show (BoolValue True) = "true"
... | alpicola/mel | src/Frontend/Values.hs | mit | 553 | 0 | 8 | 135 | 176 | 92 | 84 | 19 | 1 |
data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Show)
data Direction = L | R deriving (Show)
type Directions = [ Direction ]
freeTree :: Tree Char
freeTree =
Node 'P'
(Node 'O'
(Node 'L'
(Node 'N' Empty Empty)
(Node 'T' Empty Empty)
)
... | afronski/playground-fp | books/learn-you-a-haskell-for-great-good/zippers/trees.hs | mit | 1,321 | 0 | 11 | 489 | 580 | 304 | 276 | 34 | 1 |
module GameTests where
import Chess.FEN
import Chess.Internal.Piece
import Chess.Internal.Move
import Chess.Internal.Game
import TestUtils
import Test.Hspec
gameSpec :: IO ()
gameSpec = hspec $
describe "Game" $ do
applyMoveSpec
isCheckmateSpec
isStalemateSpec
isInsuffi... | nablaa/hchesslib | test/Chess/GameTests.hs | gpl-2.0 | 10,736 | 0 | 14 | 2,676 | 1,720 | 828 | 892 | 129 | 1 |
import Graphics.UI.Gtk hiding (Settings)
import Data.Time.Clock.POSIX
import Data.Time
import System.Directory
import Control.Exception
import System.Locale (defaultTimeLocale)
import Data.IORef
import Control.Monad (when,forM)
import Data.List
import Text.Printf
iDuration = 30
rDuration = 120
amountOfIntervals = rDur... | jsavatgy/hatupist | code/settings.hs | gpl-2.0 | 19,266 | 138 | 17 | 4,674 | 7,264 | 3,452 | 3,812 | 605 | 4 |
module Main where
import System.Console.GetOpt
import System.Environment
import System.Directory (doesDirectoryExist)
import System.IO
import System.Exit
import Control.Applicative
import Process
import Poll
data Options = Options { optCodeDir :: String
, optDocsDir :: String
... | cdosborn/lit | src/lit.hs | gpl-2.0 | 4,129 | 0 | 15 | 1,578 | 1,040 | 573 | 467 | 100 | 8 |
{-# LANGUAGE OverloadedLists #-}
module Nirum.Targets.DocsSpec where
import System.FilePath ((</>))
import Test.Hspec.Meta
import Text.Blaze.Html.Renderer.Utf8 (renderHtml)
import Nirum.Constructs.Annotation (empty)
import Nirum.Constructs.DeclarationSet (DeclarationSet)
import Nirum.Constructs.Module (Module (..))
i... | dahlia/nirum | test/Nirum/Targets/DocsSpec.hs | gpl-3.0 | 1,421 | 0 | 17 | 275 | 399 | 218 | 181 | 30 | 1 |
Config
{
font = "xft:Source Code Pro:size=8"
, borderColor = "#839496"
, bgColor = "#073642"
-- , border = FullBM 0
, border = NoBorder
, fgColor = "#839496"
-- , alpha = 120
, position = Static { xpos = 0, ypos = 0, width = 1600, height = 19 },
... | wlaaraki/dotfiles | xmobar/xmobarrc.hs | gpl-3.0 | 2,335 | 2 | 10 | 801 | 502 | 306 | 196 | -1 | -1 |
{-# OPTIONS -Wall #-}
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-}
module Graphics.UI.Bottle.Widgets.TextEdit(
Cursor, Style(..), make, defaultCursorColor, defaultCursorWidth,
atSCursorColor,
atSCursorWidth,
atSTextCursorId,
atSBackgroundCursorId,
atSEmptyString,
atSTextViewStyle) where
import Con... | alonho/bottle | src/Graphics/UI/Bottle/Widgets/TextEdit.hs | gpl-3.0 | 10,295 | 0 | 18 | 2,436 | 3,150 | 1,682 | 1,468 | 222 | 3 |
module OpenSandbox.Rules
( DiggingStatus (..)
) where
import Data.Serialize
import OpenSandbox.Protocol.Types (putVarInt,getVarInt)
data DiggingStatus
= StartedDigging
| CancelledDigging
| FinishedDigging
| DropItemStack
| DropItem
| ShootArrowOrFinishEating
| SwapItemInHand
deriving (Show,Eq,Enum... | oldmanmike/opensandbox | src/OpenSandbox/Rules.hs | gpl-3.0 | 420 | 0 | 6 | 71 | 100 | 60 | 40 | 16 | 0 |
import Control.Monad.Except
import Data.Char (isNumber, isPunctuation)
data PwdError = PwdError String
instance Monoid PwdError where
mempty = PwdError ""
(PwdError x) `mappend` (PwdError y) = PwdError $ x ++ y
type PwdErrorMonad = ExceptT PwdError IO
askPassword' :: PwdErrorMonad ()
askPassword' = do
li... | ItsLastDay/academic_university_2016-2018 | subjects/Haskell/11/my_pwd_valid.hs | gpl-3.0 | 1,255 | 7 | 11 | 312 | 360 | 165 | 195 | 29 | 1 |
instance Monoid [a] where
mempty = []
mappend = (++) | hmemcpy/milewski-ctfp-pdf | src/content/2.3/code/haskell/snippet02.hs | gpl-3.0 | 60 | 2 | 5 | 17 | 36 | 15 | 21 | 3 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/RegionBackendServices/Get.hs | mpl-2.0 | 4,033 | 0 | 16 | 903 | 466 | 278 | 188 | 79 | 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/Users/Aliases/Insert.hs | mpl-2.0 | 5,125 | 0 | 20 | 1,266 | 795 | 463 | 332 | 117 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-plus/gen/Network/Google/Resource/Plus/Activities/List.hs | mpl-2.0 | 4,336 | 0 | 16 | 1,006 | 561 | 333 | 228 | 82 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-sheets/gen/Network/Google/Resource/Sheets/Spreadsheets/Values/BatchUpdate.hs | mpl-2.0 | 6,602 | 0 | 20 | 1,592 | 944 | 549 | 395 | 140 | 1 |
{-
- This file is part of Bilder.
-
- Bilder is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Bilder i... | ingemaradahl/bilder | src/Compiler/Merge.hs | lgpl-3.0 | 11,129 | 0 | 23 | 2,572 | 3,983 | 2,016 | 1,967 | 221 | 4 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StandaloneDeriving #-}
module Nanocoin.Network.Peer (
Peer(..),
Peers,
) where
import Protolude hiding (put, get)
import Data.Aeson (ToJSON(..))
import Data.Binary (Binary, encode, decode)
import Data.Serialize (Serialize(..))
import Co... | tdietert/nanocoin | src/Nanocoin/Network/Peer.hs | apache-2.0 | 663 | 0 | 6 | 98 | 189 | 117 | 72 | 19 | 0 |
module Lycopene.Core.Record.Service where
import Control.Monad.Trans (liftIO)
import Data.Time.Clock (getCurrentTime)
import Data.Time.LocalTime (utcToLocalTime, getCurrentTimeZone, LocalTime)
import Lycopene.Core.Monad
import Lycopene.Core.Database
import qualified Ly... | utky/lycopene | src/Lycopene/Core/Record/Service.hs | apache-2.0 | 714 | 0 | 12 | 141 | 203 | 114 | 89 | 14 | 1 |
module Handler.ToPostList where
import Import
import Data.List (sort)
getToPostListR :: Handler RepHtml
getToPostListR = do
toposts <- liftIO getToPosts
defaultLayout $ do
setTitle "To post list"
$(widgetFile "topost-list")
| snoyberg/photosorter | Handler/ToPostList.hs | bsd-2-clause | 250 | 0 | 12 | 54 | 65 | 32 | 33 | 9 | 1 |
module Database.Narc.Common where
type Tabname = String
type Field = String
| ezrakilty/narc | Database/Narc/Common.hs | bsd-2-clause | 79 | 0 | 4 | 14 | 19 | 13 | 6 | 3 | 0 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QLineEdit.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:25
Warning : this file is machine generated - do not... | keera-studios/hsQt | Qtc/Gui/QLineEdit.hs | bsd-2-clause | 59,042 | 0 | 14 | 9,734 | 19,614 | 9,943 | 9,671 | -1 | -1 |
{-# LANGUAGE BangPatterns #-}
module AI.HMM.Type where
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Generic as G
import Numeric.LinearAlgebra.HMatrix
import AI.Function
-- constant: log (2*pi)
m_log_2_pi :: Double
m_log_2_pi = 1.8378770664093453
-- | multi... | kaizhang/HMM | src/AI/HMM/Type.hs | bsd-3-clause | 2,750 | 0 | 16 | 808 | 812 | 429 | 383 | 67 | 2 |
module Paths_bogre_banana (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
catchIO = Exception... | DavidEichmann/boger-banana | .dist-buildwrapper/dist/build/autogen/Paths_bogre_banana.hs | bsd-3-clause | 1,156 | 0 | 10 | 164 | 326 | 186 | 140 | 25 | 1 |
module Main where
import System.Environment (getArgs)
import Budget.App (run, BudgetCommand(..))
main :: IO ()
main = do
args <- getArgs
case parseOpts args of
Left m -> putStrLn m
Right c -> run c
parseOpts :: [String] -> Either String BudgetCommand
parseOpts ("configure":options)
... | utky/budget | app/Main.hs | bsd-3-clause | 808 | 0 | 10 | 189 | 304 | 156 | 148 | 24 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-|
Module : Numeric.AERN.RealArithmetic.Basis.MPFR.Effort
... | michalkonecny/aern | aern-mpfr-rounded/src/Numeric/AERN/RealArithmetic/Basis/MPFR/Basics.hs | bsd-3-clause | 5,210 | 0 | 14 | 1,162 | 1,404 | 747 | 657 | 124 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module Home.Routes where
import Servant
import Servant.HTML.Blaze
import Text.Blaze.Html5
type HomeRoutes = Home
type Home = Get '[HTML] Html
| hectorhon/autotrace2 | app/Home/Routes.hs | bsd-3-clause | 204 | 0 | 7 | 31 | 45 | 29 | 16 | 8 | 0 |
-- 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.
module Duckling.Distance.KO.Tests
( tests ) where
import Prelude
import Data.String
import Test.Tasty
import ... | facebookincubator/duckling | tests/Duckling/Distance/KO/Tests.hs | bsd-3-clause | 507 | 0 | 9 | 78 | 79 | 50 | 29 | 11 | 1 |
{-# LANGUAGE MultiParamTypeClasses #-}
-- | Internal only. Do Not Eat.
module Tea.TeaState ( TeaState (..)
, EventState (..)
) where
import Data.Map(Map)
import Data.Array(Array)
import Tea.Screen(Screen)
import Tea.Input(KeyCode)
data TeaState = TS { _screen :: Screen, _eventSt... | liamoc/tea-hs | Tea/TeaState.hs | bsd-3-clause | 524 | 0 | 9 | 156 | 134 | 83 | 51 | 10 | 0 |
{-|
Copyright : (c) Dave Laing, 2017
License : BSD3
Maintainer : [email protected]
Stability : experimental
Portability : non-portable
-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Fragment.Bool.Rules.Kind.Infe... | dalaing/type-systems | src/Fragment/Bool/Rules/Kind/Infer/Common.hs | bsd-3-clause | 1,494 | 0 | 16 | 411 | 444 | 237 | 207 | 37 | 1 |
-----------------------------------------------------------------------------
--
-- Pretty-printing assembly language
--
-- (c) The University of Glasgow 1993-2005
--
-----------------------------------------------------------------------------
{-# OPTIONS_GHC -fno-warn-orphans #-}
module PPC.Ppr (
pprNatCmmDe... | ml9951/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | 28,362 | 0 | 22 | 10,248 | 9,219 | 4,511 | 4,708 | 681 | 72 |
module Stars where
import Rumpus
-- Golden Section Spiral (via http://www.softimageblog.com/archives/115)
pointsOnSphere :: Int -> [V3 GLfloat]
pointsOnSphere (fromIntegral -> n) =
map (\k ->
let y = k * off - 1 + (off / 2)
r = sqrt (1 - y*y)
phi = k * inc
in V3 (c... | lukexi/rumpus | pristine/Intro/Stars.hs | bsd-3-clause | 1,339 | 0 | 21 | 501 | 465 | 236 | 229 | -1 | -1 |
module RevealHs.Sample.Env where
import Data.Time.Clock
import Data.Time.Format
import Data.Time.LocalTime
today :: IO String
today = do
tz <- getCurrentTimeZone
t <- fmap (utcToLocalTime tz) getCurrentTime
return $ formatTime defaultTimeLocale (iso8601DateFormat Nothing) t
| KenetJervet/reveal-hs | app/RevealHs/Sample/Env.hs | bsd-3-clause | 313 | 0 | 10 | 70 | 83 | 44 | 39 | 9 | 1 |
{-# LANGUAGE TemplateHaskell, GeneralizedNewtypeDeriving #-}
module Math.InfoRetrieval.TFIDF
( Document(..)
, Term(..)
, Corpus
, emptyCorpus
, addDocument
, removeDocument
, FreqScaling(..)
, tfidf
, search
) where
import Control.Lens
import Dat... | bgamari/tf-idf | Math/InfoRetrieval/TFIDF.hs | bsd-3-clause | 2,526 | 0 | 14 | 707 | 871 | 472 | 399 | 60 | 2 |
{-|
Module : Numeric.AERN.RealArithmetic.RefinementOrderRounding.Operators
Description : convenience operators and functions with default effort
Description : re-export of parent's operators for easier direct import
Copyright : (c) Michal Konecny
License : BSD3
Maintainer :... | michalkonecny/aern | aern-real/src/Numeric/AERN/RealArithmetic/RefinementOrderRounding/Operators.hs | bsd-3-clause | 862 | 0 | 4 | 189 | 145 | 115 | 30 | 9 | 0 |
import Language.Haskell.Exts.Parser
import Language.Haskell.Exts.Syntax
import System.FilePath
import System.Directory
import Control.Monad
import Data.Maybe
import Data.List
import Control.Applicative
import Data.GraphViz.Types.Graph
import Data.GraphViz.Commands.IO
import Data.GraphViz.Types.Canonical
import Data.Te... | bneijt/hs2dot | src/main/Main.hs | bsd-3-clause | 2,509 | 0 | 16 | 414 | 910 | 479 | 431 | 51 | 2 |
{-# LANGUAGE CPP #-}
module Database.PostgreSQL.PQTypes.Internal.Monad (
DBT_(..)
, DBT
, runDBT
, mapDBT
) where
import Control.Applicative
import Control.Concurrent.MVar
import Control.Monad.Base
import Control.Monad.Catch
import Control.Monad.Error.Class
import Control.Monad.Reader.Class
import Control.... | scrive/hpqtypes | src/Database/PostgreSQL/PQTypes/Internal/Monad.hs | bsd-3-clause | 5,271 | 0 | 14 | 1,012 | 1,479 | 822 | 657 | -1 | -1 |
{-# LANGUAGE EmptyDataDecls, FlexibleContexts, FlexibleInstances, RankNTypes #-}
{-# LANGUAGE TypeSynonymInstances, UndecidableInstances #-}
module Main where
import Data.Constraint.Unsafely
import Data.Proxy
class Semigroup a where
-- | binary operation which satisifies associative law:
-- ... | konn/unsafely | examples/semigroup.hs | bsd-3-clause | 1,564 | 0 | 10 | 288 | 226 | 137 | 89 | -1 | -1 |
{-
Author: George Karachalias <[email protected]>
Haskell expressions (as used by the pattern matching checker) and utilities.
-}
{-# LANGUAGE CPP #-}
module PmExpr (
PmExpr(..), PmLit(..), SimpleEq, ComplexEq, toComplex, eqPmLit,
truePmExpr, falsePmExpr, isTruePmExpr, isFalsePmExpr, ... | GaloisInc/halvm-ghc | compiler/deSugar/PmExpr.hs | bsd-3-clause | 16,939 | 0 | 15 | 3,946 | 3,341 | 1,730 | 1,611 | 199 | 4 |
{-# LANGUAGE CPP #-}
-- | Contains commons utilities when defining your own widget
module Glazier.React.ReactDOM
( renderDOM
) where
import Glazier.React.ReactElement
import qualified JS.DOM.EventTarget.Node.Element as DOM
-- | Using a React Element (first arg) give React rendering control over a DOM element (se... | louispan/glazier-react | src/Glazier/React/ReactDOM.hs | bsd-3-clause | 689 | 5 | 9 | 114 | 91 | 56 | 35 | 9 | 1 |
-- | This module supplies the types that are used in interacting with
-- and parsing from the database.
module Database.Influx.Types
( module Database.Influx.Types.Core
, module Database.Influx.Types.FromInfluxPoint
)
where
import Database.Influx.Types.Core
import Database.Influx.Types.FromInfluxPoint
| factisresearch/influx | src/Database/Influx/Types.hs | bsd-3-clause | 316 | 0 | 5 | 46 | 41 | 30 | 11 | 5 | 0 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE UnicodeSyntax #-}
{-|
[@ISO639-1@] fi
[@ISO639-2B@] fin
[@ISO639-3@] fin
[@Native name@] suomi
[@En... | telser/numerals | src/Text/Numeral/Language/FIN.hs | bsd-3-clause | 49,160 | 0 | 37 | 26,239 | 5,963 | 3,491 | 2,472 | 724 | 4 |
module Main where
import Test.HUnit hiding (path)
import TestUtil
import Database.TokyoCabinet.HDB
import Data.Maybe (catMaybes)
import Data.List (sort)
import Control.Monad
dbname :: String
dbname = "foo.tch"
withOpenedHDB :: String -> (HDB -> IO a) -> IO a
withOpenedHDB name action = do
h <- new
open h name [... | tom-lpsd/tokyocabinet-haskell | tests/HDBTest.hs | bsd-3-clause | 6,050 | 0 | 17 | 2,227 | 2,170 | 1,073 | 1,097 | 177 | 1 |
module CRF.Control.Monad.Lazy
( mapM'
-- , mapM_'
, sequence'
) where
import System.IO.Unsafe (unsafeInterleaveIO)
sequence' (mx:xs) = unsafeInterleaveIO $
combine xs =<< mx
where combine xs x = return . (x:) =<< sequence' xs
sequence' [] = return []
mapM' f (x:xs) = unsafeInterleaveIO $ do
y <- f x
... | kawu/tagger | src/CRF/Control/Monad/Lazy.hs | bsd-3-clause | 488 | 0 | 10 | 121 | 173 | 91 | 82 | 13 | 1 |
-- From Thinking Functionally with Haskell
-- One man went to mow
-- Went to mow a meadow
-- One man and his dog
-- Went to mow a meadow
-- Two men went to mow
-- Went to mow a meadow
-- Two men, one man and his dog
-- Went to mow a meadow
-- Three men went to mow
-- Went to mow a meadow
-- Three men, two men, one man ... | trymilix/cookbooks | Software/haskell/song.hs | apache-2.0 | 992 | 0 | 9 | 270 | 325 | 170 | 155 | 24 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Word (Word8, Word16)
import Data.List (unfoldr)
import Data.Bits (shiftL, (.&.))
import Data.ByteString.Char8 ()
import Data.Monoid
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as L
import qualified Data.Binary.BitBuilder a... | KrzyStar/binary-low-level | tests/BitBuilderTest.hs | bsd-3-clause | 1,956 | 0 | 14 | 396 | 698 | 404 | 294 | 35 | 2 |
-- | This module contains any objects relating to order theory
module SubHask.Algebra.Ord
where
import qualified Prelude as P
import qualified Data.List as L
import qualified GHC.Arr as Arr
import Data.Array.ST hiding (freeze,thaw)
import Control.Monad
import Control.Monad.Random
import Control.Monad.ST
import Pr... | abailly/subhask | src/SubHask/Algebra/Ord.hs | bsd-3-clause | 2,149 | 0 | 20 | 470 | 574 | 310 | 264 | -1 | -1 |
{- |
Module : $Header$
Description : Parser of common logic interface format
Copyright : (c) Karl Luc, DFKI Bremen 2010
License : GPLv2 or higher, see LICENSE.txt
Maintainer : [email protected]
Stability : provisional
Portability : portable
-- Tests and examples of Common Logic AS and... | mariefarrell/Hets | CommonLogic/ClTests.hs | gpl-2.0 | 2,912 | 0 | 29 | 586 | 779 | 400 | 379 | 70 | 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>Active Scan Rules - Alpha | ZAP Extension</title>
<maps>
<homeID>top</homeID... | 0xkasun/security-tools | src/org/zaproxy/zap/extension/ascanrulesAlpha/resources/help_de_DE/helpset_de_DE.hs | apache-2.0 | 986 | 80 | 67 | 163 | 422 | 213 | 209 | -1 | -1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ExtendedDefaultRules #-}
-- | A first example in equalional reasoning.
-- | From the definition of append we should be able to
-- | semi-automatically prove the two axioms.
-- | Note for soundness we need
-- | totallity: all the cases should be covered
-- | terminati... | abakst/liquidhaskell | tests/equationalproofs/pos/MapFusion.hs | bsd-3-clause | 2,338 | 0 | 12 | 733 | 371 | 201 | 170 | 25 | 1 |
module Lib where
data Value = Finite Integer | Infinity
deriving (Eq)
instance Num Value where
(+) = undefined
(*) = undefined
abs = undefined
signum = undefined
negate = undefined
fromInteger = Finite
-- | @litCon _@ should not elicit an overlapping patterns warning w... | sdiehl/ghc | testsuite/tests/pmcheck/should_compile/T16289.hs | bsd-3-clause | 667 | 0 | 6 | 186 | 135 | 78 | 57 | 18 | 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="ja-JP">
<title>FuzzDB Files</title>
<maps>
<homeID>fuzzdb</homeID>
<mapref location="ma... | thc202/zap-extensions | addOns/fuzzdb/src/main/javahelp/help_ja_JP/helpset_ja_JP.hs | apache-2.0 | 960 | 77 | 66 | 156 | 407 | 206 | 201 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Trustworthy #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Fun... | olsner/ghc | libraries/base/Data/Functor/Identity.hs | bsd-3-clause | 3,919 | 0 | 11 | 952 | 785 | 470 | 315 | 60 | 0 |
import Control.Exception
import System.Environment
import Control.Monad.Par.Scheds.Trace
-- NB. using Trace here, Direct is too strict and forces the fibs in
-- the parent; see https://github.com/simonmar/monad-par/issues/27
-- <<fib
fib :: Integer -> Integer
fib 0 = 1
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
-- >>
ma... | lywaterman/parconc-examples | parmonad.hs | bsd-3-clause | 747 | 0 | 14 | 308 | 220 | 113 | 107 | 19 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module T15502 where
import Language.Haskell.TH.Syntax (Lift(lift))
main = print ( $( lift (toInteger (maxBound :: Int) + 1) )
, $( lift (minBound :: Int) )
)
| sdiehl/ghc | testsuite/tests/th/T15502.hs | bsd-3-clause | 221 | 0 | 13 | 61 | 71 | 42 | 29 | 5 | 1 |
{-# LANGUAGE TypeFamilies #-}
module C where
import A
data C
type instance F (a,C) = Bool
| shlevy/ghc | testsuite/tests/driver/recomp017/C2.hs | bsd-3-clause | 90 | 0 | 5 | 17 | 27 | 18 | 9 | -1 | -1 |
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-unbox-small-strict-fields #-}
-- Makes f2 a bit more challenging
module Foo where
h :: Int -> Int -> Bool
h 0 y = y>0
h n y = h (n-1) y
-- The main point: all of these functions can have the CPR property
------- f1 -----------
-- x is used strictly... | urbanslug/ghc | testsuite/tests/stranal/T10482a.hs | bsd-3-clause | 1,448 | 0 | 10 | 424 | 392 | 206 | 186 | 29 | 2 |
import Control.Exception
import Control.DeepSeq
main = evaluate (('a' : undefined) `deepseq` return () :: IO ())
| ezyang/ghc | testsuite/tests/simplCore/should_fail/T7411.hs | bsd-3-clause | 113 | 0 | 9 | 16 | 48 | 26 | 22 | 3 | 1 |
-- !!! Monomorphism restriction
-- This one should work fine, despite the monomorphism restriction
-- Fails with GHC 5.00.1
module Test where
import Control.Monad.ST
import Data.STRef
-- Should get
-- apa :: forall s. ST s ()
apa = newSTRef () >> return ()
foo1 = runST apa
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/typecheck/should_compile/tc132.hs | bsd-3-clause | 278 | 0 | 7 | 52 | 47 | 28 | 19 | 5 | 1 |
module ShouldSucceed where
f x = a
a = (x,x)
x = x
| urbanslug/ghc | testsuite/tests/typecheck/should_compile/tc021.hs | bsd-3-clause | 54 | 0 | 5 | 16 | 28 | 17 | 11 | 4 | 1 |
module Main where
import Tracks.Network
import Tracks.Service
import Tracks.Train
import Tracks.Signals (Signals)
import qualified Tracks.Signals as Signals
import Control.Monad.STM
import Control.Concurrent
import qualified STMContainers.Set as Set
import System.Random
foxhole, riverford, tunwall, maccton, welbridg... | derkyjadex/tracks | Main.hs | mit | 1,749 | 0 | 14 | 460 | 506 | 250 | 256 | 49 | 2 |
import Algorithms.MDP.Examples.Ex_3_1
import Algorithms.MDP
import Algorithms.MDP.ValueIteration
import qualified Data.Vector as V
converging :: Double
-> (CF State Control Double, CF State Control Double)
-> Bool
converging tol (cf, cf') = abs (x - y) > tol
where
x = (\(_, _, c) -> c) (... | prsteele/mdp | src/run-ex-3-1.hs | mit | 634 | 0 | 11 | 160 | 295 | 162 | 133 | 16 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.