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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
-----------------------------------------------------------------------------
-- StaticMonad: Static environment for Monad
--
-- Part of `Typing Haskell in Haskell', version of November 23, 2000
-- Copyright (c) Mark P Jones and the Oregon Graduate Institute
-- of Science and Technology, 1999-2000
--
-- This progra... | yu-i9/thih | src/Thih/Static/Monad.hs | bsd-3-clause | 1,687 | 0 | 15 | 430 | 320 | 181 | 139 | 19 | 1 |
-- | Peano-style natural numbers.
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
module Data.Type.Nat where
import Data.Functor
import Data.Proxy
import Data.Singletons.TH
import Data.Typeable
import Data.Type.Equality
import GHC.Exts (Constraint)
import Language.Haskell.TH
import Language.Ha... | kosmikus/tilt | src/Data/Type/Nat.hs | bsd-3-clause | 4,219 | 0 | 13 | 1,172 | 1,274 | 717 | 557 | -1 | -1 |
-- | Some additional functions on top of "System.FSNotify".
--
-- Example of compiling scss files with compass
--
-- @
-- compass :: WatchManager -> FilePath -> IO ()
-- compass man dir = do
-- putStrLn $ "compass " ++ encodeString dir
-- treeExtExists man dir "scss" $ \fp ->
-- when ("deploy" `notElem` splitDirec... | tomv564/hfsnotify | src/System/FSNotify/Devel.hs | bsd-3-clause | 2,460 | 0 | 12 | 570 | 492 | 263 | 229 | 41 | 3 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
module Lib
( startApp
) where
import Control.Lens
import Control.Monad.Except
import Control.Monad.Reader
import Data.Aeson
import Da... | vulgr/vulgr | src/Lib.hs | bsd-3-clause | 3,027 | 0 | 17 | 658 | 818 | 429 | 389 | 77 | 2 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
-------------------------------------------------------------------------------
--
-- | Dynamic flags
--
-- Most flags are dynamic flags, which means they can change from compilation
-- to compilation using @OPTIONS_GHC@ pragmas, and in a multi-session GHC each
-... | mcschroeder/ghc | compiler/main/DynFlags.hs | bsd-3-clause | 208,853 | 0 | 37 | 55,774 | 37,565 | 20,590 | 16,975 | -1 | -1 |
{-# OPTIONS -Wall -Werror #-}
-- #hide
module Data.Time.LocalTime.TimeOfDay
(
-- * Time of day
TimeOfDay(..),midnight,midday,
utcToLocalTimeOfDay,localToUTCTimeOfDay,
timeToTimeOfDay,timeOfDayToTime,
dayFractionToTimeOfDay,timeOfDayToDayFraction
) where
import Data.Time.LocalTime.TimeZone
import Data.Time.Calend... | FranklinChen/hugs98-plus-Sep2006 | packages/time/Data/Time/LocalTime/TimeOfDay.hs | bsd-3-clause | 2,674 | 14 | 12 | 461 | 658 | 359 | 299 | 44 | 1 |
{-# LANGUAGE QuasiQuotes #-}
import LiquidHaskell
bar = 0
[lq| assume (Prelude.++) :: [a] -> [a] -> [a] |]
| spinda/liquidhaskell | tests/gsoc15/unknown/pos/Foo.hs | bsd-3-clause | 114 | 0 | 4 | 26 | 17 | 11 | 6 | 4 | 1 |
{-# LANGUAGE CPP, RankNTypes, PolyKinds, DataKinds, TypeOperators,
TypeFamilies, FlexibleContexts, UndecidableInstances,
GADTs, TypeApplications #-}
{-# OPTIONS_GHC -Wno-orphans #-}
#if __GLASGOW_HASKELL__ < 806
{-# LANGUAGE TypeInType #-}
#endif
#if __GLASGOW_HASKELL__ >= 810
{-# LANGUAGE S... | goldfirere/singletons | singletons/src/Data/Singletons/Decide.hs | bsd-3-clause | 3,234 | 2 | 12 | 616 | 542 | 316 | 226 | 36 | 2 |
{-# LANGUAGE OverloadedStrings, FlexibleContexts,
PackageImports #-}
import Control.Applicative
import Control.Arrow
import Control.Monad
import "monads-tf" Control.Monad.State
import "monads-tf" Control.Monad.Error
import Control.Monad.Trans.Control
import Control.Concurrent hiding (yield)
import Control.Concurrent.... | YoshikuniJujo/forest | subprojects/xml-push/try/xmppServerTls.hs | bsd-3-clause | 4,859 | 34 | 20 | 878 | 1,955 | 1,036 | 919 | 111 | 4 |
module Main where
import Criterion.Main
import Control.Applicative
import Control.Monad.IO.Class (liftIO)
import Data.Vector (Vector)
import qualified Data.Vector as V
import NoteScript
import Prosper hiding (Money)
imp... | WraithM/notescript | bench/RunBench.hs | bsd-3-clause | 952 | 0 | 13 | 294 | 249 | 131 | 118 | 25 | 1 |
{-# OPTIONS_GHC -Wall #-}
-----------------------------------------------------------------------------
-- |
-- Module : Main
-- Copyright : (c) Masahiro Sakai 2007-2014
-- License : BSD3-style (see LICENSE)
--
-- Maintainer: masahiro.sakai@gmail.com
-- Stability : experimental
-- Portability : no... | msakai/ptq | haste/ptq.hs | lgpl-2.1 | 1,024 | 0 | 22 | 243 | 271 | 140 | 131 | 20 | 1 |
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Native Haskell value construction from K3 literals.
module Language.K3.Runtime.Literal where
import Control.Applicative ( (<$>), (<*>) )
import Control.Concurrent.MVar
import Control.Monad.IO.Class
import Data.Word (Word8)
import Language.K3.Core.An... | DaMSL/K3 | src/Language/K3/Runtime/Literal.hs | apache-2.0 | 3,248 | 0 | 10 | 571 | 1,273 | 648 | 625 | 58 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE MultiParamTypeClasses #-}
#if __GLASGOW_HASKELL__ < 710
{-# LANGUAGE OverlappingInstances #-}
#define OVERLAPPING_PRAGMA
#... | Gabriel439/lens | src/Control/Lens/Plated.hs | bsd-3-clause | 27,699 | 0 | 13 | 5,320 | 4,254 | 2,404 | 1,850 | 229 | 1 |
module ShowIssue where
import qualified Github.Issues as Github
main = do
possibleIssue <- Github.issue "thoughtbot" "paperclip" 549
putStrLn $ either (\e -> "Error: " ++ show e)
formatIssue
possibleIssue
formatIssue issue =
(Github.githubOwnerLogin $ Github.issueUser is... | jwiegley/github | samples/Issues/ShowIssue.hs | bsd-3-clause | 570 | 0 | 17 | 140 | 166 | 85 | 81 | 14 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DataKinds #-}
import Data.ML
import Data.Attoparsec.Text
import Data.Text (Text)
... | bitemyapp/machine-learning | example/GlobalWarming.hs | mit | 4,833 | 0 | 19 | 1,071 | 1,247 | 647 | 600 | 109 | 2 |
module String00001 where
s = "There's trailing spaces after this backslash \
\Trust me, they're there!"
| charleso/intellij-haskforce | tests/gold/parser/String00001.hs | apache-2.0 | 111 | 6 | 4 | 23 | 21 | 13 | 8 | 2 | 1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
module TrieMap(
... | tjakway/ghcjvm | compiler/coreSyn/TrieMap.hs | bsd-3-clause | 39,875 | 0 | 18 | 13,037 | 12,583 | 6,373 | 6,210 | 652 | 11 |
import Debug.Trace
newtype Id a = Id a
unId True _ = Nothing -- make lazy
unId False (Just (Id x)) = (Just x)
unId False Nothing = Nothing
{-# NOINLINE unId #-}
val n = trace "evaluated once, as it should" (Just (Id n))
{-# NOINLINE val #-}
foo b n = unId b (val n)
{-# NOINLINE foo #-}
main = print (foo False 1)
| ezyang/ghc | testsuite/tests/simplStg/should_run/T13536.hs | bsd-3-clause | 320 | 0 | 9 | 73 | 129 | 67 | 62 | 11 | 1 |
{-# LANGUAGE BangPatterns #-}
data Test = Test !Int
{-# NOINLINE f #-}
f a = Test (a + 1)
main = let (Test x) = f 1 in print x
| ezyang/ghc | testsuite/tests/rts/T8308/T8308.hs | bsd-3-clause | 129 | 0 | 10 | 33 | 60 | 29 | 31 | 7 | 1 |
{-# LANGUAGE TypeFamilies #-}
module T11164b where
import T11164a
data instance T Int = MkT
| ezyang/ghc | testsuite/tests/rename/should_compile/T11164b.hs | bsd-3-clause | 94 | 0 | 5 | 17 | 20 | 12 | 8 | 4 | 0 |
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{- BlockId module should probably go away completely, being superseded by Label -}
module BlockId
( BlockId, mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet
, BlockSet, BlockEnv
, IsSet(..), setInsertList, setDeleteList, ... | urbanslug/ghc | compiler/cmm/BlockId.hs | bsd-3-clause | 2,087 | 0 | 9 | 317 | 388 | 221 | 167 | 39 | 1 |
{-# LANGUAGE PartialTypeSignatures #-}
module NamedWildcardsEnabled where
foo :: Eq a => a -> (a, _)
foo x = (x, x)
test = foo id
-- As id (forall a. a -> a) doesn't implement Eq, the we cannot apply
-- foo with it. This test checks that foo gets the annotated type,
-- including constraints, not just the inferred ty... | urbanslug/ghc | testsuite/tests/partial-sigs/should_fail/AnnotatedConstraint.hs | bsd-3-clause | 324 | 0 | 7 | 64 | 52 | 31 | 21 | 5 | 1 |
{-# LANGUAGE TemplateHaskell #-}
-- Test Trac #2386
module T2386 where
import T2386_Lib
foo = $(makeOne)
| siddhanathan/ghc | testsuite/tests/th/T2386.hs | bsd-3-clause | 109 | 0 | 6 | 20 | 18 | 12 | 6 | 4 | 1 |
{-# LANGUAGE GADTs #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
-- Test for trac #366
-- The C2 case is impossible due to the types
module ShouldCompile where
data T a where
C1 :: T Char
C2 :: T Float
exhaustive :: T Char -> Char
exhaustive C1 = ' '
| wxwxwwxxx/ghc | testsuite/tests/typecheck/should_compile/tc215.hs | bsd-3-clause | 269 | 0 | 6 | 62 | 49 | 29 | 20 | 8 | 1 |
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PartialTypeSignatures #-}
module Data.Array.Accelerate.TypeLits
(
-- * Types
AccScalar,
AccV... | epsilonhalbe/accelerate-typelits | src/Data/Array/Accelerate/TypeLits.hs | isc | 15,279 | 0 | 15 | 5,719 | 2,992 | 1,673 | 1,319 | 152 | 2 |
module Main where
fib :: Integer -> Integer
fib 0 = 1
fib 1 = 1
fib x = fib(x - 1) + fib(x - 2)
main = print(fib(8))
| skywind3000/language | haskell/fib.hs | mit | 149 | 0 | 8 | 61 | 78 | 41 | 37 | 6 | 1 |
module Main where
import qualified Data.Map as M
import System.Environment (getArgs)
import System.Exit (exitFailure)
import System.IO (hPrint, stderr)
import qualified Language.CFrp.Syntax as S
import Language.CFrp.Parser (parseProgramString)
import Language.CFrp.TypeInf (typeInf)
import Language.CFrp.KNormal (kNorm... | psg-titech/cfrp | Main.hs | mit | 1,508 | 0 | 21 | 295 | 631 | 336 | 295 | 38 | 3 |
{-# LANGUAGE RecordWildCards #-}
module Learning.IOHMM
( IOHMM (..)
, LogLikelihood
, init
, withEmission
, euclideanDistance
, viterbi
, baumWelch
, baumWelch'
, simulate
) where
import Control.Applicative ( (<$>) )
import Control.Arrow ... | mnacamura/learning-hmm | src/Learning/IOHMM.hs | mit | 12,080 | 13 | 19 | 4,175 | 2,934 | 1,584 | 1,350 | 152 | 4 |
{-|
Module : EU4.Missions
Description : Feature handler for Europa Universalis IV missions
-}
module EU4.Missions where
import Control.Monad.Except (MonadError (..))
import Data.Text (Text)
import qualified Data.Text as T
import System.FilePath (FilePath)
import Text.PrettyPrint.Leijen.Text (Doc)
import Abstr... | HairyDude/pdxparse | src/EU4/Missions.hs | mit | 511 | 0 | 10 | 74 | 124 | 74 | 50 | -1 | -1 |
module Sudoku.TaskReader (
parseTask, readTask
) where
import Sudoku.Sudoku
import Data.Char (isDigit,isSpace)
import System.IO (readFile)
import Control.Applicative((<$>),(<*>))
-- | Replace all non-relevant chars with spaces for the sake of simpler parsing.
cook :: [Char] -> [Char]
cook = foldr (\x a -> re... | sukhmel/experiments.haskell | Sudoku/TaskReader.hs | mit | 889 | 0 | 17 | 288 | 271 | 149 | 122 | 23 | 2 |
/*Owner & Copyrights: Vance King Saxbe. A.*//* Copyright (c) <2014> Author Vance King Saxbe. A, and contributors Power Dominion Enterprise, Precieux Consulting and other contributors. Modelled, Architected and designed by Vance King Saxbe. A. with the geeks from GoldSax Consulting and GoldSax Technologies email @vsaxbe... | VanceKingSaxbeA/GoldSaxMachineStore | GoldSaxMachineModule16/src/Chapter16/FreeMonads.hs | mit | 2,644 | 23 | 16 | 610 | 900 | 463 | 437 | 34 | 5 |
-- 4h
main = print $ answer 1 2
answer :: Int -> Int -> Int
answer t n | length (factors t) > 500 = t
| otherwise = answer (t+n) (n+1)
factors :: Int -> [Int]
factors n = [ x | x <- [1..n], n `mod` x == 0 ]
| lekto/haskell | Project-Euler-Solutions/problem0012.hs | mit | 220 | 0 | 11 | 66 | 136 | 70 | 66 | 6 | 1 |
module Vector (
Vector,
Dimension,
innerProduct,
(|*|),
l2Norm,
vectorSum,
(|+|),
scalaProduct,
sign,
) where
type Vector = [Double]
type Dimension = Int
innerProduct :: Vector -> Vector -> Double
innerProduct x y = sum $ zipWith (*) x y
(|*|) :: Vector -> Vector -> Double
x |*| y... | kenkov/nlp | haskell/learn/Vector.hs | mit | 660 | 0 | 7 | 163 | 265 | 153 | 112 | 26 | 2 |
module Graphics.DrawGL.Util where
import Data.Maybe
import Graphics.DrawGL.Fold
import Graphics.DrawGL.Internal
import Graphics.DrawGL.Types
fromPolar :: (Angle, Radius) -> Point
fromPolar (a, r) = (-sin a * r, cos a * r)
between :: Ord a => (a,a) -> a -> a
between (min, max) v
| v < min = min
| v > max ... | shangaslammi/hdrawgl | src/Graphics/DrawGL/Util.hs | mit | 611 | 1 | 11 | 137 | 301 | 165 | 136 | 17 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE UnicodeSyntax #-}
module MasterPlan.Arbitrary () where
import qualified Data.List.NonEmpty as NE
import Data.Maybe (isNothing)
import MasterPlan.Data
import Test.QuickCheck
import Test.QuickCheck.Instances... | rodrigosetti/master-plan | test/MasterPlan/Arbitrary.hs | mit | 1,708 | 0 | 17 | 564 | 563 | 309 | 254 | 33 | 0 |
module Fao.Utils where
import Data.List (deleteBy, foldl')
import Data.Function (on)
import Control.Monad (msum)
import Control.Monad.Trans.Maybe
import System.Log.FastLogger
import System.IO.Unsafe (unsafePerformIO)
import qualified Data.Set as S
import Fao.Types
findM :: (Monad m) => (a -> m (Maybe b)) -> [a] -> m... | ksaveljev/vindinium-bot | Fao/Utils.hs | mit | 2,123 | 0 | 13 | 524 | 928 | 490 | 438 | 54 | 5 |
module Lib
( someFunc
) where
import qualified Network.Wreq as Wreq
import Data.Text (pack, unpack)
import Control.Lens as Lens
someFunc :: IO ()
someFunc = do r <- Wreq.get "http://httpbin.org/get"
print (r ^. Wreq.responseBody)
-- someFunc = do r <- Wreq.get "http://httpbin.org/get"
-- ... | tripattern/haskell | restClient/src/Lib.hs | mit | 379 | 0 | 10 | 89 | 82 | 48 | 34 | 8 | 1 |
module Cafe.CLI.Transformer
( CLI
, runCLI
, runDB
, cliEventStore
, cliGloballyOrderedEventStore
) where
import Control.Monad.Reader
import Database.Persist.Sql
import Eventful
import Eventful.Store.Sqlite
type CLI = ReaderT ConnectionPool IO
-- | Main entry point into a CLI program.
runCLI :: Connecti... | jdreaver/eventful | examples/cafe/src/Cafe/CLI/Transformer.hs | mit | 897 | 0 | 8 | 139 | 203 | 109 | 94 | 21 | 1 |
-- Boiled Eggs
-- http://www.codewars.com/kata/52b5247074ea613a09000164/
module BoiledEggs where
cookingTime :: Integer -> Integer
cookingTime 0 = 0
cookingTime n = 5 * (1 + (n-1) `div` 8)
| gafiatulin/codewars | src/7 kyu/BoiledEggs.hs | mit | 191 | 0 | 10 | 29 | 55 | 32 | 23 | 4 | 1 |
module Graphics.Urho3D.Graphics.Internal.DebugRenderer(
DebugRenderer
, debugRendererCntx
) where
import qualified Language.C.Inline as C
import qualified Language.C.Inline.Context as C
import qualified Language.C.Types as C
import qualified Data.Map as Map
-- | Debug geometry rendering component. Should be ... | Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Graphics/Internal/DebugRenderer.hs | mit | 542 | 0 | 11 | 93 | 102 | 70 | 32 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module KaitenZushi (server) where
import Data.Aeson ((.=))
import Data.Aeson.Types
import Control.Applicative
import Control.Monad (mzero)
import Control.Monad.Trans.State.Strict (StateT)
import qualified Data.Aeson as Aeson
import qualified Data.Text as Text
import qualified Networ... | jewel12/KaitenZushi | KaitenZushi.hs | mit | 912 | 0 | 11 | 124 | 236 | 136 | 100 | 22 | 1 |
-- The maximum sum value of ranges -- Simple version
-- https://www.codewars.com/kata/583d10c03f02f41462000137
module Kata.MaxSumValRanges (maxSum) where
import qualified Data.Vector as V
maxSum :: [Int] -> [(Int,Int)] -> Int
maxSum arr = maximum . map (\(s, e) -> V.sum . V.slice s (e - s + 1) $ v)
where v = V.f... | gafiatulin/codewars | src/6 kyu/MaxSumValRanges.hs | mit | 332 | 0 | 14 | 60 | 115 | 66 | 49 | 5 | 1 |
module OidTable where
import Data.Word
import qualified Data.ByteString.Lazy as LB
import Graphics.PDF
import Control.Monad hiding (forM_)
import Data.Foldable (forM_)
import Data.List.Split
import Text.Printf
import Control.Arrow ((***))
import Codec.Compression.Zlib
import OidCode
import KnownCodes
import Utils
imp... | entropia/tip-toi-reveng | src/OidTable.hs | mit | 5,535 | 1 | 34 | 1,771 | 1,553 | 812 | 741 | 119 | 2 |
{-# LANGUAGE OverloadedStrings, OverloadedLists, LambdaCase #-}
module Text.EasyJson.Parser where
import Control.Applicative
import Control.Monad.Identity
import qualified Data.HashMap.Strict as H
import Data.Monoid
import Data.Text (Text, pack, unpack)
import qualified Data.Text as T
import qualified Data.Vector as V... | thinkpad20/easyjson | src/Text/EasyJson/Parser.hs | mit | 1,974 | 0 | 18 | 507 | 738 | 379 | 359 | 56 | 10 |
module Handler.Sandbox where
import Import
getSandboxR :: Handler Html
getSandboxR = defaultLayout $ do
setTitle' "サンドボックス"
addScript $ StaticR js_sandbox_js
$(widgetFile "sandbox")
| jabaraster/minibas-web | Handler/Sandbox.hs | mit | 210 | 0 | 10 | 36 | 52 | 25 | 27 | 7 | 1 |
-- KMeans2.hs
{-# LANGUAGE TemplateHaskell #-}
import Control.Lens
import Chapter6.Vector
import Data.List
import qualified Data.Map as M
data KMeansState e v = KMeansState { _centroids :: [v], _points :: [e]
, _err :: Double, _threshold :: Double
... | hnfmr/beginning_haskell | chapter6/src/Chapter6/KMeans2.hs | mit | 1,915 | 0 | 20 | 584 | 696 | 364 | 332 | -1 | -1 |
#!/usr/bin/env stack
{- stack runghc --verbosity info
--package hledger
--package Chart
--package Chart-diagrams
--package cmdargs
--package colour
--package data-default
--package here
--package safe
--package text
-}
{-# OPTIONS_GHC -Wno-missing-signatures -Wno-unused-do-bind #-}
{-# LANGU... | mstksg/hledger | bin/hledger-chart.hs | gpl-3.0 | 7,106 | 0 | 14 | 1,588 | 1,546 | 847 | 699 | 105 | 3 |
module Handler.Register (getRegisterR, getRegisterEnrollR, getEnrollR, postEnrollR, postRegisterR, postRegisterEnrollR) where
import Import
import Yesod.Form.Bootstrap3
import Util.Database
import Util.Data
getRegister :: ([Entity Course] -> UserId -> Html -> MForm Handler (FormResult (Maybe UserData), Widget)) -> Ro... | gleachkr/Carnap | Carnap-Server/Handler/Register.hs | gpl-3.0 | 7,231 | 0 | 19 | 2,828 | 1,492 | 737 | 755 | -1 | -1 |
module Parser.Program where
import Text.Parsec
import Text.Parsec.Expr
import Text.Parsec.Char
import Text.Parsec.Token
import Text.Parsec.String
import Parser.Declarations
data Program
= Program [ObjectDeclaration]
deriving Show
parseProgram :: Parser Program
parseProgram = fmap Program (many parseObjectDecla... | w0301/preon-lang-compiler | src/Parser/Program.hs | gpl-3.0 | 453 | 0 | 7 | 59 | 124 | 70 | 54 | 14 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
-- |
-- Module : Network.Google.AdSenseHost
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla ... | rueshyna/gogol | gogol-adsense-host/gen/Network/Google/AdSenseHost.hs | mpl-2.0 | 9,857 | 0 | 29 | 2,096 | 1,104 | 811 | 293 | 217 | 0 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | olorin/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/UploadMultipartPart.hs | mpl-2.0 | 9,114 | 0 | 13 | 1,851 | 959 | 593 | 366 | 117 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-youtube/gen/Network/Google/Resource/YouTube/LiveChatMessages/List.hs | mpl-2.0 | 6,090 | 0 | 18 | 1,429 | 761 | 446 | 315 | 110 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.DialogFlow.Types
-- Copyright : (c) 2015-2016 Brendan ... | brendanhay/gogol | gogol-dialogflow/gen/Network/Google/DialogFlow/Types.hs | mpl-2.0 | 114,358 | 0 | 7 | 17,264 | 7,383 | 5,116 | 2,267 | 2,176 | 1 |
{-# LANGUAGE MultiParamTypeClasses #-}
module Math.Topology.KnotTh.Invariants.KnotPolynomials
( SkeinRelation(..)
, reduceSkein
, skeinRelationPostMinimization
, skeinRelationMidMinimization
, skeinRelationPreMinimization
) where
import Math.Topology.KnotTh.Algebra.PlanarAlgebra.Reduction
impor... | mishun/tangles | src/Math/Topology/KnotTh/Invariants/KnotPolynomials.hs | lgpl-3.0 | 1,425 | 0 | 11 | 239 | 441 | 229 | 212 | -1 | -1 |
{-# LANGUAGE
TypeSynonymInstances
, FlexibleInstances
, DeriveGeneric
, DeriveDataTypeable
#-}
module OskarBinReader
( TaskData(..)
, SortType(..)
, tdVisibilitiesSize
, tdUVWSize
, finalizeTaskData
, mkSortedClone
, finalizeSortedClone
, readOskarData
, writeTaskData
, readTask... | SKA-ScienceDataProcessor/RC | MS3/Sketches/Oskar_New_Reader/OskarBinReader.hs | apache-2.0 | 5,555 | 0 | 21 | 1,626 | 1,686 | 835 | 851 | 169 | 3 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QStyleOptionProgressBarV2.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:35
Warning : this file is machine ge... | keera-studios/hsQt | Qtc/Enums/Gui/QStyleOptionProgressBarV2.hs | bsd-2-clause | 4,860 | 0 | 18 | 921 | 1,080 | 532 | 548 | 90 | 1 |
module Shapes (surface,nudge,baseCircle, baseRect, Point(..), Shape(..)) where
surface :: Shape -> Float
surface (Circle _ r) = pi * r ^ 2
surface (Rectangle (Point x1 y1) (Point x2 y2)) = abs (x2 - x1) * abs (y2 - y1)
nudge :: Shape -> Float -> Float -> Shape
nudge (Circle (Point x y) r) a b = Circle (Point (x+a) (y+... | Hidowga/Projetos | Shapes.hs | bsd-3-clause | 719 | 0 | 9 | 135 | 390 | 207 | 183 | 13 | 1 |
{-# LANGUAGE PackageImports, ScopedTypeVariables, BangPatterns #-}
-- |
-- Copyright : (c) 2011 Simon Meier
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Simon Meier <iridcode@gmail.com>
-- Stability : experimental
-- Portability : tested on GHC only
--
-- Benchmark all 'Builder' functions.
module M... | markflorisson/hpack | testrepo/bytestring-0.10.2.0/bench/BenchAll.hs | bsd-3-clause | 9,063 | 0 | 17 | 2,189 | 2,039 | 1,073 | 966 | 153 | 1 |
{-#LANGUAGE LambdaCase #-}
{-#LANGUAGE OverloadedStrings #-}
module Twilio.Types.AddressRequirement where
import Control.Monad
import Data.Aeson
data AddressRequirement
= None
| Any
| Local
| Foreign
deriving (Bounded, Enum, Eq, Ord)
instance Read AddressRequirement where
readsPrec _ = \case
"none" ... | seagreen/twilio-haskell | src/Twilio/Types/AddressRequirement.hs | bsd-3-clause | 879 | 0 | 10 | 202 | 262 | 137 | 125 | 29 | 0 |
import Test.Tasty
import qualified TestPlanning as TP
import TestDP as TDP
tests :: TestTree
tests = testGroup "Tests" [TP.unitTests]
main :: IO ()
main = do
defaultMain tests
print TDP.calcVI
| DbIHbKA/hmdp | test/Spec.hs | bsd-3-clause | 204 | 0 | 8 | 41 | 66 | 36 | 30 | 9 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : NLP.WordNet
-- Copyright : (c) Hal Daume III 2003-2004
-- License : BSD-style
--
-- Maintainer : hdaume@isi.edu
-- Stability : experimental
-- Portability : non-portable (H98 + implicit parameters)
--
-- T... | pikajude/WordNet-ghc74 | NLP/WordNet.hs | bsd-3-clause | 13,042 | 0 | 28 | 3,501 | 2,500 | 1,332 | 1,168 | -1 | -1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
TcSplice: Template Haskell splices
-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE GADTs #-}
{-# LANGUA... | vikraman/ghc | compiler/typecheck/TcSplice.hs | bsd-3-clause | 77,999 | 0 | 16 | 23,592 | 1,395 | 789 | 606 | 85 | 4 |
module HLint.Default where
import Control.Arrow
import Control.Exception
import Control.Monad
import Control.Monad.Trans.State
import qualified Data.Foldable
import Data.Foldable(asum, sequenceA_, traverse_, for_)
import Data.Traversable(traverse, for)
import Control.Applicative
import Data.Function
import Data.Int
i... | fpco/hlint | data/Default.hs | bsd-3-clause | 28,019 | 0 | 11 | 6,180 | 9,725 | 5,005 | 4,720 | -1 | -1 |
module Main where
import Ciphers (inCaesar, unCaesar, inVig, unVig)
import Test.QuickCheck
genCaesar :: Gen (Int, String)
genCaesar = do
k <- arbitrary
t <- arbitrary
return (k, t)
genVig :: Gen (String, String)
genVig = do
k <- arbitrary
t <- arbitrary
return (k, t)
prop_Caesar :: Property
prop_Caesar... | dmvianna/ciphers | tests/tests.hs | bsd-3-clause | 734 | 0 | 11 | 172 | 247 | 129 | 118 | 27 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.TestSuite
-- Copyright : Thomas Tuegel 2010
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This module defines the detailed test suite interface whic... | sopvop/cabal | Cabal/Distribution/TestSuite.hs | bsd-3-clause | 3,418 | 0 | 11 | 1,116 | 480 | 306 | 174 | 54 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Mafia.Options.Applicative (
module X
, RunType (..)
, SafeCommand (..)
, eitherTextReader
, pOption
, command'
, dispatch
, cli
, safeCommand
, versionFlag
, dryRunFlag
, orDie
, orDieWithCode
) where
import ... | ambiata/mafia | src/Mafia/Options/Applicative.hs | bsd-3-clause | 3,767 | 0 | 17 | 883 | 953 | 516 | 437 | 86 | 4 |
-----------------------------------------------------------------------------
-- |
-- Copyright : (C) 2015 Dimitri Sabadie
-- License : BSD3
--
-- Maintainer : Dimitri Sabadie <dimitri.sabadie@gmail.com>
-- Stability : experimental
-- Portability : portable
-----------------------------------------------------... | phaazon/quaazar | src/Quaazar/Render/Projection.hs | bsd-3-clause | 1,094 | 0 | 9 | 191 | 165 | 96 | 69 | 19 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Set2.Challenge09Spec
( spec
) where
import Test.Hspec
import Test.QuickCheck
import Control.Exception (evaluate)
import Challenges.Set2 as S2
main :: IO ()
main = hspec spec
key =
"YELLOW SUBMARINE"
solution =
"YELLOW SUBMARINE\x04\x04\x04\x04"
spec :: Spec
... | eelcoh/cryptochallenge | test/Set2/Challenge09Spec.hs | bsd-3-clause | 434 | 0 | 15 | 91 | 113 | 62 | 51 | 18 | 1 |
{-# LANGUAGE CPP, GADTs, RankNTypes #-}
-----------------------------------------------------------------------------
--
-- Cmm utilities.
--
-- (c) The University of Glasgow 2004-2006
--
-----------------------------------------------------------------------------
module CmmUtils(
-- CmmType
primRepC... | sgillespie/ghc | compiler/cmm/CmmUtils.hs | bsd-3-clause | 24,570 | 0 | 18 | 5,206 | 6,304 | 3,314 | 2,990 | 399 | 6 |
{- TGA.hs; Mun Hon Cheong (mhch295@cse.unsw.edu.au) 2005
This module was based on lesson 24 from neon helium productions
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=24
The TGA format is a used bitmap image file format. They are
quite easy to load compared to other formats and have
good support in im... | gbluma/opengl1 | src/TGA.hs | bsd-3-clause | 3,258 | 4 | 16 | 732 | 865 | 451 | 414 | 50 | 2 |
{-# OPTIONS_GHC -Wall -fno-warn-orphans #-}
module Language.JavaScript.Pretty (
-- | This module just defines and exports 'Pretty' and 'PrettyPrec' instances
Pretty(..)
) where
-- System libraries
import Text.PrettyPrint.Leijen
import Text.PrettyPrint.Leijen.PrettyPrec
import Prelude hiding (GT, LT, (<$>))
-- frien... | sseefried/js-good-parts | src/Language/JavaScript/Pretty.hs | bsd-3-clause | 10,904 | 0 | 15 | 2,693 | 3,324 | 1,607 | 1,717 | 223 | 13 |
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
module PFDS.Sec2.Ex5 where
data Tree a = E | T (Tree a) a (Tree a) deriving (Show)
-- practice 2.5a
complete :: Ord a => a -> Int -> Tree a
complete _ 0 = E
complete x d = T t x t where t = complete x (d-1)
-- practice 2.5b
balanced :: Ord a => a -> Int -> Tree a
ba... | matonix/pfds | src/PFDS/Sec2/Ex5.hs | bsd-3-clause | 464 | 0 | 9 | 127 | 231 | 121 | 110 | 12 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module State.Setup.Threads
( startUserRefreshThread
, startTypingUsersRefreshThread
, updateUserStatuses
, startSubprocessLoggerThread
, startTimezoneMonitorThread
, maybeStartSpellChecker
, startAsyncWorkerThread
, startSyntaxMapLoaderThread
, module State.Setup.Thr... | aisamanra/matterhorn | src/State/Setup/Threads.hs | bsd-3-clause | 13,030 | 0 | 26 | 3,941 | 2,849 | 1,415 | 1,434 | -1 | -1 |
{-# LANGUAGE ExistentialQuantification, MultiParamTypeClasses, FlexibleInstances, StandaloneDeriving #-}
-----------------------------------------------------------------------------------------
-- |
-- Module : FRP.Yampa.Point2
-- Copyright : (c) Antony Courtney and Henrik Nilsson, Yale University, 2003
-- Li... | meimisaki/Yampa | src/FRP/Yampa/Point2.hs | bsd-3-clause | 2,222 | 0 | 9 | 345 | 412 | 224 | 188 | 27 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.BitVectors.Splittable
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Implementation of bit-vector concatanetation and splits
--... | Copilot-Language/sbv-for-copilot | Data/SBV/BitVectors/Splittable.hs | bsd-3-clause | 4,256 | 0 | 11 | 867 | 1,202 | 641 | 561 | 74 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE FlexibleContexts #-}
module Yesod.Core.Internal.Run where
import Yesod.Core.Internal.Response
... | s9gf4ult/yesod | yesod-core/Yesod/Core/Internal/Run.hs | mit | 14,837 | 0 | 20 | 4,813 | 2,957 | 1,570 | 1,387 | 286 | 9 |
import System.Directory
import System.FilePath
import Text.XML.Light
import System.IO
import System.IO.Temp (withTempDirectory)
import System.Process
import Text.TeXMath
import System.Exit
import Control.Applicative
import Control.Monad
import GHC.IO.Encoding (setLocaleEncoding)
import qualified Data.Text as T
import q... | beni55/texmath | tests/test-texmath.hs | gpl-2.0 | 7,192 | 1 | 19 | 2,123 | 2,315 | 1,155 | 1,160 | 158 | 3 |
module Llvm.AsmHirConversion
(module Llvm.AsmHirConversion.AsmToHir
,module Llvm.AsmHirConversion.HirToAsm
,module Llvm.AsmHirConversion.LabelMapM
) where
import Llvm.AsmHirConversion.AsmToHir
import Llvm.AsmHirConversion.HirToAsm
import Llvm.AsmHirConversion.LabelMapM (IdLabelMap(..),a2h,i... | mlite/hLLVM | src/Llvm/AsmHirConversion.hs | bsd-3-clause | 329 | 0 | 6 | 45 | 62 | 42 | 20 | 7 | 0 |
{-# LANGUAGE FlexibleContexts #-}
-- | Type checking for FKL expressions
module Database.DSH.FKL.Typing
( inferFKLTy
) where
import Control.Monad.Except
import Control.Monad.Reader
import Data.List
import qualified Data.List.NonEmpty as N
import Text.Printf
imp... | ulricha/dsh | src/Database/DSH/FKL/Typing.hs | bsd-3-clause | 10,923 | 0 | 16 | 3,149 | 4,249 | 2,063 | 2,186 | 240 | 7 |
module Lang.Hask
( module Lang.Hask.CPS
, module Lang.Hask.Semantics
) where
import Lang.Hask.CPS hiding (atom)
import Lang.Hask.Semantics
| davdar/maam | src/Lang/Hask.hs | bsd-3-clause | 146 | 0 | 5 | 23 | 40 | 27 | 13 | 5 | 0 |
{-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor, TemplateHaskell,
FlexibleContexts, MultiParamTypeClasses, FlexibleInstances #-}
module Language.Java.Paragon.Syntax (
module Language.Java.Paragon.Syntax,
module Language.Java.Paragon.Annotated
) where
... | bvdelft/parac2 | src/Language/Java/Paragon/Syntax.hs | bsd-3-clause | 33,833 | 0 | 14 | 8,084 | 7,310 | 3,996 | 3,314 | 406 | 3 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ConstraintKinds #-}
-- | Cache information about previous builds
module Stack.Build.Cache
( tryGetBuildCache
, tryGetConfigCache
, tr... | rrnewton/stack | src/Stack/Build/Cache.hs | bsd-3-clause | 13,267 | 0 | 17 | 3,604 | 3,107 | 1,589 | 1,518 | 268 | 2 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
{-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types]
... | fmthoma/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | 78,894 | 0 | 15 | 22,191 | 13,855 | 7,262 | 6,593 | 886 | 9 |
module Turbinado.Environment.Params(
getParam,
getParam_u,
populateParamsAndFiles
) where
import Control.Monad
import qualified Data.ByteString.Lazy.Char8 as BS
import Data.ByteString.Lazy.Char8 (ByteString)
import qualified Data.Map as M
import Data.Int (Int64)
import Data.List
import Data.Maybe
import Network.HTTP
i... | alsonkemp/turbinado-website | Turbinado/Environment/Params.hs | bsd-3-clause | 6,058 | 0 | 19 | 2,185 | 1,538 | 799 | 739 | 96 | 4 |
module Stack.Options.ConfigParser where
import Data.Char
import Data.Either.Combinators
import Data.Monoid.Extra
import qualified Data.Set as Set
import Options.Applicative
import Options.Applicative.Builder.Extra
import Path
import ... | mrkkrp/stack | src/Stack/Options/ConfigParser.hs | bsd-3-clause | 5,961 | 0 | 37 | 1,886 | 1,000 | 524 | 476 | 129 | 3 |
foo = let x = 5
in let zig x = zag x
zag y = zig x
in zag
fco = let fst (x:xs) = x
in fst 5
fbo = \ x -> y
fbo = let head (x:xs) = x
head (x:xs) = xs
in head
fao = let id x = x
in (id, id)
fzo = let fst (x, y) = x
fst [] = 0
... | themattchan/tandoori | input/input-1.hs | bsd-3-clause | 739 | 13 | 11 | 361 | 474 | 228 | 246 | 33 | 2 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE GADTSyntax #-}
module T17379b where
import Language.Haskell.TH
$(let typ = mkName "T" in pure [ DataD [] typ [] Nothing [RecGadtC [] [] (ConT typ)] [] ])
| sdiehl/ghc | testsuite/tests/th/T17379b.hs | bsd-3-clause | 203 | 0 | 15 | 36 | 78 | 40 | 38 | 5 | 0 |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ma... | getyourguide/fbthrift | thrift/lib/hs/Thrift/Serializable.hs | apache-2.0 | 1,857 | 0 | 10 | 325 | 374 | 216 | 158 | 23 | 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="sk-SK">
<title>AMF Support</title>
<maps>
<homeID>amf</homeID>
<mapref location="map.jh... | kingthorin/zap-extensions | addOns/amf/src/main/javahelp/help_sk_SK/helpset_sk_SK.hs | apache-2.0 | 956 | 82 | 52 | 156 | 390 | 206 | 184 | -1 | -1 |
{-+
Reusable functions for translation from the (non-recursive) base structure
to Stratego.
-}
module BaseStruct2Stratego where
import StrategoAST
import BaseSyntax hiding (EntSpec(..)) -- non-recursive base syntax structure
import PrettyPrint(pp)
transP trId trP p =
case mapPI trId trP p of
HsPId n -> Pvar (getH... | forste/haReFork | tools/Phugs/BaseStruct2Stratego.hs | bsd-3-clause | 2,386 | 1 | 16 | 763 | 935 | 459 | 476 | 47 | 15 |
{-# LANGUAGE MagicHash #-}
module T7287 where
import GHC.Prim
{-# RULES
"int2Word#/word2Int#" forall x. int2Word# (word2Int# x) = x
#-}
{- We get a legitimate
T7287.hs:7:3: warning:
Rule int2Word#/word2Int# may never fire because
rule "word2Int#" for ‘word2Int#’ might fire first
Probab... | sdiehl/ghc | testsuite/tests/simplCore/should_compile/T7287.hs | bsd-3-clause | 566 | 0 | 4 | 118 | 12 | 9 | 3 | 5 | 0 |
{- ------------------------------------------------------------------------
(c) The GHC Team, 1992-2012
DeriveConstants is a program that extracts information from the C
declarations in the header files (primarily struct field offsets)
and generates various files, such as a header file that can be #included
into non-... | forked-upstream-packages-for-ghcjs/ghc | utils/deriveConstants/DeriveConstants.hs | bsd-3-clause | 42,401 | 200 | 19 | 13,623 | 9,636 | 4,998 | 4,638 | 707 | 28 |
module Data.Maybe.Utils(unsafeUnjust, maybeToMPlus) where
import Control.Monad (MonadPlus(..))
unsafeUnjust :: String -> Maybe a -> a
unsafeUnjust msg Nothing = error ("unsafeUnjust: " ++ msg)
unsafeUnjust _ (Just x) = x
maybeToMPlus :: MonadPlus m => Maybe a -> m a
maybeToMPlus Nothing = mzero
maybeToMPlus (Just x)... | da-x/lamdu | bottlelib/Data/Maybe/Utils.hs | gpl-3.0 | 332 | 0 | 7 | 53 | 128 | 67 | 61 | 8 | 1 |
{-# OPTIONS_GHC -XScopedTypeVariables #-}
-- We don't actually want scoped type variables, but this flag makes the
-- forall be recognised by the parser
module ShouldCompile where
newtype Swizzle = MkSwizzle (forall a. Ord a => [a] -> [a])
| urbanslug/ghc | testsuite/tests/typecheck/should_fail/tcfail184.hs | bsd-3-clause | 243 | 0 | 10 | 42 | 40 | 25 | 15 | -1 | -1 |
-- | Axis aligned rectangles in two-dimensional space.
--
{-# LANGUAGE ForeignFunctionInterface, RecordWildCards #-}
{-# LANGUAGE MultiParamTypeClasses, DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances, ViewPatterns #-}
{-# LANGUAGE NoImplicitPrelude, DeriveDataTypeable #-}
module Caramia.Extras.Rectangle
(
-... | Noeda/caramia-extras | lib/Caramia/Extras/Rectangle.hs | mit | 17,243 | 0 | 20 | 4,427 | 4,277 | 2,318 | 1,959 | -1 | -1 |
main = putStrLn $ show solve
solve :: Int
solve = head [a*b*c | c <- [1..1000], b <- [1..(c-1)], a <- [1..(b-1)], a^2 + b^2 == c^2, a+b+c == 1000]
| pshendry/project-euler-solutions | 0009/solution.hs | mit | 149 | 1 | 12 | 33 | 139 | 69 | 70 | 3 | 1 |
module VizTree where
import Treedot
data VizTree = VizNode String [VizTree]
instance Tree (VizTree) where
subtrees (VizNode x xs) = xs
instance LabeledTree (VizTree) where
label (VizNode x xs) = x
class Viz a where
toVizTree :: a -> VizTree
-- handling a list is implemented under Viz class instead of the insta... | craynafinal/cs557_functional_languages | project/haskell-rest-api/src/VizTree.hs | mit | 1,549 | 0 | 15 | 308 | 616 | 317 | 299 | 32 | 1 |
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings, TupleSections, GADTs, FlexibleContexts #-}
{-# LANGUAGE ViewPatterns #-}
module Day22 where
import AdventPrelude
import Control.Arrow (returnA)
import qualified Data.Sequence as S
import Data.Ratio ((%))
import Data.Text.Format
import Data.Set (size)
input :: IO Tex... | farrellm/advent-2016 | src/Day22.hs | mit | 4,162 | 0 | 22 | 1,321 | 1,810 | 955 | 855 | -1 | -1 |
-- | Types for a variety of puzzle elements.
module Data.Elements where
import Data.GridShape
type Clue a = Maybe a
data MasyuPearl = MWhite | MBlack
deriving (Eq, Show)
type MasyuClue = Clue MasyuPearl
type IntClue = Clue Int
-- | A Compass clue, specifiying optional numbers in the
-- four cardinal direction... | robx/puzzle-draw | src/Data/Elements.hs | mit | 2,524 | 0 | 10 | 539 | 672 | 382 | 290 | 64 | 1 |
module Main
( main
)
where
-- doctest
import qualified Test.DocTest as DocTest
main :: IO ()
main =
DocTest.doctest
[ "-isrc"
, "src/Fibonacci.hs"
]
| mauriciofierrom/cis194-homework | homework06/test/examples/Main.hs | mit | 172 | 0 | 6 | 48 | 44 | 27 | 17 | 8 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.