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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# OPTIONS -cpp #-}
------------------------------------------------------------------
-- A primop-table mangling program --
------------------------------------------------------------------
module Main where
import Parser
import Syntax
import Data.Char
import Data.List
import Data.May... | lukexi/ghc-7.8-arm64 | utils/genprimopcode/Main.hs | bsd-3-clause | 41,034 | 0 | 34 | 16,606 | 11,469 | 5,769 | 5,700 | 794 | 75 |
{-| Some utility functions, based on the Confd client, providing data
in a ready-to-use way.
-}
{-
Copyright (C) 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. Redistributions of... | apyrgio/ganeti | src/Ganeti/Confd/ClientFunctions.hs | bsd-2-clause | 3,574 | 0 | 13 | 616 | 530 | 275 | 255 | 41 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
module Common where
import Web.Twitter.Conduit
import Control.Applicative
import Control.Lens
import qualified Data.ByteString.Char8 as S8
import qualified Data.CaseInsensitive as CI
import qualified Data.Map as M
i... | asi1024/twchs | src/Common.hs | mit | 1,751 | 0 | 15 | 404 | 468 | 254 | 214 | 44 | 3 |
<?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="fa-IR">
<title>TreeTools</title>
<maps>
<homeID>treetools</homeID>
<mapref location="ma... | kingthorin/zap-extensions | addOns/treetools/src/main/javahelp/help_fa_IR/helpset_fa_IR.hs | apache-2.0 | 960 | 77 | 66 | 155 | 404 | 205 | 199 | -1 | -1 |
-- (c) The FFI task force, [2000..2001]
--
-- Bundles the language-independent FFI library functionality
module Foreign (
module Int,
module Word,
module Ptr,
module ForeignPtr,
module StablePtr,
module Storable,
module MarshalAlloc,
module MarshalArray,
module MarshalError,
module MarshalUtils
) ... | mimi1vx/gtk2hs | tools/c2hs/doc/c2hs/lib/Foreign.hs | gpl-3.0 | 492 | 0 | 4 | 83 | 79 | 57 | 22 | 21 | 0 |
foo = qux (\x -> f x >>= g)
| mpickering/hlint-refactor | tests/examples/Default128.hs | bsd-3-clause | 28 | 0 | 9 | 9 | 24 | 12 | 12 | 1 | 1 |
-- | The organization members API as described on
-- <http://developer.github.com/v3/orgs/members/>.
module Github.Organizations.Members (
membersOf
,module Github.Data
) where
import Github.Data
import Github.Private
-- | All the users who are members of the specified organization.
--
-- > membersOf "thoughtbot"
me... | bitemyapp/github | Github/Organizations/Members.hs | bsd-3-clause | 442 | 0 | 9 | 58 | 76 | 46 | 30 | 7 | 1 |
-- Test type errors contain field names, not selector names
{-# LANGUAGE DuplicateRecordFields #-}
data T = MkT { x :: Int }
y = x x
main = return ()
| sgillespie/ghc | testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.hs | bsd-3-clause | 154 | 0 | 8 | 35 | 36 | 20 | 16 | 4 | 1 |
{-# OPTIONS -XImpredicativeTypes -fno-warn-deprecated-flags #-}
module ShouldFail where
import Control.Concurrent
-- Attempt to put a polymorphic value in an MVar
-- Fails, but the error message is worth keeping an eye on
--
-- Actually (Dec 06) it succeeds now
--
-- In GHC 7.0 it fails again! (and rightly so)
foo ... | forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/typecheck/should_fail/tcfail165.hs | bsd-3-clause | 456 | 0 | 14 | 94 | 89 | 50 | 39 | -1 | -1 |
module Main (main) where
import T4012_A
import T4012_B
main :: IO ()
main = do a
b
| urbanslug/ghc | testsuite/tests/ffi/should_run/T4012.hs | bsd-3-clause | 97 | 0 | 6 | 31 | 36 | 20 | 16 | 6 | 1 |
{-# htermination lookupWithDefaultFM :: (Ord a, Ord k) => FiniteMap (a,k) b -> b -> (a,k) -> b #-}
import FiniteMap
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/FiniteMap_lookupWithDefaultFM_12.hs | mit | 116 | 0 | 3 | 21 | 5 | 3 | 2 | 1 | 0 |
data List a = Empty | Cons a (List a)
deriving Show
fromList :: [a] -> List a
fromList (x:xs) = Cons x (fromList xs)
fromList [] = Empty
toList :: List a -> [a]
toList (Cons x xs) = x:(toList xs)
toList Empty = []
| dzeban/haskell-exercises | rwh/ch03/List.hs | mit | 230 | 0 | 8 | 62 | 137 | 68 | 69 | 8 | 1 |
module Jakway.Blackjack.Match where
import Jakway.Blackjack.CardOps
import Jakway.Blackjack.Result
data Match = Match
{ dealersHand :: Hand
, playerIds :: [Int]
, playersHands :: [Hand]
, playerResults :: [Result]
}
deriving (Eq, Show)
| tjakway/blackjack-simulator | src/Jakway/Blackjack/Match.hs | mit | 310 | 0 | 9 | 105 | 72 | 46 | 26 | 9 | 0 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE PackageImports #-}
import "class-load" Application (getApplicationDev)
import Network.Wai.Handler.Warp
(runSettings, defaultSettings, setPort)
import Control.Concurrent (forkIO)
import System.Directory (doesFileExist, removeFile)
import System.Exit (exitSuccess)
import Control.Conc... | gsingh93/class-load | devel.hs | mit | 894 | 2 | 12 | 134 | 245 | 131 | 114 | 24 | 2 |
-- Printer Errors
-- http://www.codewars.com/kata/56541980fa08ab47a0000040/
module Codewars.G964.Printer where
printerError :: String -> String
printerError s = show ((+ length s) . negate . length . filter (`elem` ['a'..'m']) $ s) ++ "/" ++ show (length s)
| gafiatulin/codewars | src/7 kyu/Printer.hs | mit | 260 | 0 | 14 | 38 | 86 | 48 | 38 | 3 | 1 |
module Diamond (diamond) where
import Data.Char (ord, chr)
diamond :: Char -> Maybe [String]
diamond c | c `notElem` ['A'..'Z'] = Nothing
diamond c = Just . mirror . map row $ [0..n] where
n = ord c - ord 'A'
mirror top = top ++ tail (reverse top)
row i = mirror $ spaces (n - i) ++ [letter i] ++ spaces i
lett... | exercism/xhaskell | exercises/practice/diamond/.meta/examples/success-standard/src/Diamond.hs | mit | 374 | 0 | 12 | 91 | 201 | 102 | 99 | 10 | 1 |
module ProjectEuler.Problem7
( problem
) where
import Petbox
import ProjectEuler.Types
problem :: Problem
problem = pureProblem 7 Solved result
result :: Int
result = primes !! (10001-1) -- since list indices are 0-based
| Javran/Project-Euler | src/ProjectEuler/Problem7.hs | mit | 230 | 0 | 7 | 42 | 58 | 34 | 24 | 8 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Y2020.M11.D20.Solution where
{--
Okay, so we created folders, and, hypothetically, we can even create sub-
folders, if we wished, but, today, instead of building on this folder-
skeleton, we're going to focus on just one country and its airbases.
Which country?
Let's find o... | geophf/1HaskellADay | exercises/HAD/Y2020/M11/D20/Solution.hs | mit | 6,393 | 0 | 15 | 1,247 | 1,057 | 559 | 498 | 67 | 1 |
module Y2017.M04.D05.Exercise where
import Data.Time
import Network.HTTP
-- below modules available via 1HaskellADay git repository
import Control.Scan.CSV
import Data.Monetary.BitCoin
import Data.Monetary.USD
import Data.Percentage
{--
In this tweet
https://twitter.com/ohiobitcoin/status/849368023588909057
@ohio... | geophf/1HaskellADay | exercises/HAD/Y2017/M04/D05/Exercise.hs | mit | 2,038 | 0 | 6 | 296 | 198 | 116 | 82 | 22 | 1 |
-- | Author : John Allard
-- | Date : Jan 15th 2016
-- | Class : CMPS 112 UCSC
-- | I worked alone, no partners to list.
-- | Homework #1 |--
import Data.Char
import Data.List
import Text.Regex
import Text.Regex.Posix
-- | 1.) Write a function that turns a first and last name into "$last, $first"
citeAuthor :: S... | jhallard/WinterClasses16 | CS112/hw/hw1/hw1.hs | mit | 2,789 | 0 | 12 | 572 | 567 | 314 | 253 | 27 | 2 |
module Ratscrew.Cards.Arbitrary where
import Ratscrew.Cards
import Test.Tasty.QuickCheck
instance Arbitrary Suit where
arbitrary = oneof (map return [Diamonds .. Spades])
instance Arbitrary Rank where
arbitrary = oneof $ map return [Ace .. King]
instance Arbitrary Card where
arbitrary = do
s <- ... | smobs/Ratscrew | tests/Ratscrew/Cards/Arbitrary.hs | mit | 379 | 0 | 10 | 89 | 117 | 62 | 55 | 12 | 0 |
module Servant (
-- | This module and its submodules can be used to define servant APIs. Note
-- that these API definitions don't directly implement a server (or anything
-- else).
module Servant.API,
-- | For implementing servers for servant APIs.
module Servant.Server,
-- | Utilities on top of the serva... | zoomhub/zoomhub | vendor/servant/servant-server/src/Servant.hs | mit | 688 | 0 | 5 | 182 | 85 | 58 | 27 | 14 | 0 |
{-
Hake: a meta build system for Barrelfish
Copyright (c) 2009, ETH Zurich.
All rights reserved.
This file is distributed under the terms in the attached LICENSE file.
If you do not find this file, copies can be found by writing to:
ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Gro... | UWNetworksLab/arrakis | hake/Main.hs | mit | 18,163 | 39 | 22 | 4,960 | 4,997 | 2,611 | 2,386 | -1 | -1 |
module Oczor.Parser.Types where
import Text.Megaparsec hiding (label)
import qualified Oczor.Parser.Lexer as L
import ClassyPrelude as C hiding (try)
import Oczor.Syntax.Syntax
import qualified Oczor.Desugar.Desugar as Desugar
import Oczor.Parser.ParserState
import Oczor.Utl
typeDecl :: Parser Expr
typeDecl = do
na... | ptol/oczor | src/Oczor/Parser/Types.hs | mit | 2,202 | 0 | 15 | 358 | 725 | 376 | 349 | 65 | 1 |
module Protocol where
class Connection a where
connect :: a -> IO a
disconnect :: a -> IO a
readMessage :: a -> IO String
writeMessage :: a -> String -> IO ()
| nablaa/hirchess | src/Protocol.hs | gpl-2.0 | 192 | 0 | 10 | 66 | 67 | 34 | 33 | 6 | 0 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Unittests for ganeti-htools.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software ... | damoxc/ganeti | test/hs/Test/Ganeti/HTools/Instance.hs | gpl-2.0 | 7,132 | 0 | 13 | 1,457 | 1,763 | 925 | 838 | 136 | 2 |
module TS.Page.Caesar where
import TS.Logic
import TS.Utils
import TS.App
import Yesod
caesarForm :: Html -> MForm Handler (FormResult CSubmission, Widget)
caesarForm =
renderDivs $ CSubmission
<$> areq (selectFieldList opLst) "Would you like to encrypt or decrypt a message? " Nothing
<*> (unTextarea <$>... | Sheerfreeze/thoughtspread | TS/Page/Caesar.hs | gpl-2.0 | 1,088 | 0 | 14 | 282 | 250 | 134 | 116 | -1 | -1 |
{--
GenReconOS.hs
This file contains all of the necessary functions to generate an executable VHDL model of
an ReconOS FSM description
--}
module GenReconOS where
import LangAST
import Text.PrettyPrint
import Data.List(groupBy,sortBy,intersperse,nub,mapAccumL,find)
import Data.Maybe(catMaybes)
import ExpandMem(ad... | luebbers/reconos | tools/fsmLanguage/fpga_scripts/generate_fsm/src/GenReconOS.hs | gpl-3.0 | 27,909 | 480 | 17 | 6,508 | 8,442 | 4,345 | 4,097 | 514 | 5 |
{---------------------------------------------------------------------}
{- Copyright 2015 Nathan Bloomfield -}
{- -}
{- This file is part of Feivel. -}
{- ... | nbloomf/feivel | src/Feivel/Parse.hs | gpl-3.0 | 1,530 | 0 | 5 | 563 | 90 | 67 | 23 | 11 | 0 |
module Main
where
import Prelude hiding (FilePath)
import Orwell.Analyse
import Orwell.Elastic
import Data.Maybe
import Shelly hiding (find)
import Control.Monad
import System.Console.GetOpt
import System.Environment
import Data.List as L
import Data.Text as T (Text, pack)
data Flag = TestOwner | TestContrib |
El... | Ragnaroek/orwell | src/Main.hs | gpl-3.0 | 2,858 | 3 | 16 | 553 | 866 | 464 | 402 | 69 | 2 |
module Log (logHvc) where
import System.IO (withFile, hGetLine, IOMode(..))
import System.Directory (getDirectoryContents)
import Control.Monad (forM, forM_)
import System.FilePath (combine)
import Data.List
import Data.Time.Clock (UTCTime)
import Utils
loadCommitSummary :: FilePath -> IO CommitSummary
loadCommitSum... | federicotdn/hvc | src/Log.hs | gpl-3.0 | 1,221 | 0 | 12 | 214 | 434 | 220 | 214 | 32 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.QPXExpress.Types.Sum
-- Copyright : (c) 2015-2016 Bren... | brendanhay/gogol | gogol-qpxexpress/gen/Network/Google/QPXExpress/Types/Sum.hs | mpl-2.0 | 609 | 0 | 5 | 101 | 35 | 29 | 6 | 8 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-replicapool/gen/Network/Google/Resource/ReplicaPool/Replicas/List.hs | mpl-2.0 | 4,697 | 0 | 19 | 1,184 | 651 | 383 | 268 | 101 | 1 |
{-# 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/SSLCertificates/Insert.hs | mpl-2.0 | 4,514 | 0 | 16 | 1,000 | 484 | 292 | 192 | 76 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-cloudiot/gen/Network/Google/Resource/CloudIOT/Projects/Locations/Registries/Groups/TestIAMPermissions.hs | mpl-2.0 | 6,860 | 0 | 16 | 1,409 | 788 | 463 | 325 | 126 | 1 |
module HTTP.Form.Data
( FormData(..)
) where
import Control.Applicative ((<|>))
import qualified Data.Aeson as JSON
import qualified Data.ByteString as BS
import qualified Data.Map.Strict as Map
import Network.Wai.Parse (FileInfo)
data FormData a = FormData
{ formDataQuery :: Map.Map BS.ByteString (Maybe BS.Byt... | databrary/databrary | src/HTTP/Form/Data.hs | agpl-3.0 | 699 | 0 | 12 | 121 | 248 | 140 | 108 | 16 | 0 |
module Linguisticks.Parser where
import Linguisticks.Util ( P
, maybeP
, zeroState
, primaryStress
, secondaryStress
, Syllables ( Syllables )
, SyllState ( nextStress )... | jmacmahon/syllabify | Linguisticks/Parser.hs | agpl-3.0 | 5,470 | 0 | 16 | 1,675 | 1,753 | 1,026 | 727 | 79 | 2 |
{-|
Module : HackerRank.Utilities.Manager
Description : Exposes Manager.
License : Unlicense
Stability : experimental
Portability : POSIX
Re-exposes Manager
-}
module HackerRank.Utilities (
-- * Modules
module HackerRank.Utilities.Manager
) where
import HackerRank.Utilities.Manager
| oopsno/hrank | src/HackerRank/Utilities.hs | unlicense | 303 | 0 | 5 | 52 | 23 | 16 | 7 | 3 | 0 |
module IO.Step where
import Data.Const
import Data.World
import Data.Define
import Data.Monster (units)
import Utils.Changes
import Utils.Monsters
import Utils.Step
import Utils.Items
import Items.Items
import Items.ItemsOverall
import Items.Craft
import Monsters.Move
import Monsters.AI (runAI)
import Monsters.AIrepr
... | green-orange/trapHack | src/IO/Step.hs | unlicense | 6,350 | 88 | 19 | 1,484 | 2,532 | 1,322 | 1,210 | 167 | 45 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DeriveGeneric, GeneralizedNewtypeDeriving, DeriveTraversable #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
module Kubernetes.Utils where
import Data.Aeson
import Servant.API
import GHC.Generics
import qualified Data.Text as T... | minhdoboi/deprecated-openshift-haskell-api | kubernetes/lib/Kubernetes/Utils.hs | apache-2.0 | 3,193 | 0 | 10 | 465 | 772 | 404 | 368 | 52 | 1 |
module Main where
import Control.Monad
import System.Random
printDiceRolls = do
gen <- newStdGen
print $ takeWhile (/=(6::Int)) $ randomRs (1,6) gen
hi5 = endLine $ replicateM_ 5 action
where action = putStr "Hello"
endLine a = a >> putChar '\n'
countDown = mapM_ (\n -> putStr $ show n ++ " ..... | dterei/Scraps | haskell/langreg.org.hs | bsd-3-clause | 356 | 0 | 11 | 84 | 144 | 76 | 68 | 10 | 1 |
module Types.Plugin
( module RPC.Util
, Plugins
, PluginName (..)
, PluginOptions (..)
) where
import RPC.Util
import Control.Applicative ((<$>))
import qualified Data.Map as Map
--------------------------------------------------------------------------------
newtype PluginName = PluginName
{ pluginName... | GaloisInc/msf-haskell | src/Types/Plugin.hs | bsd-3-clause | 997 | 0 | 8 | 137 | 227 | 130 | 97 | 23 | 0 |
{-# LANGUAGE TemplateHaskell, TypeOperators #-}
--------------------------------------------------------------------
-- |
-- Executable : mbox-pick
-- Copyright : (c) Nicolas Pouillard 2008, 2009, 2011
-- License : BSD3
--
-- Maintainer: Nicolas Pouillard <nicolas.pouillard@gmail.com>
-- Stability : provisional
-- Po... | np/mbox-tools | mbox-pick.hs | bsd-3-clause | 2,570 | 1 | 16 | 545 | 784 | 420 | 364 | 51 | 5 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Exception
import Control.Monad
import Data.Time.Clock
import Data.Time.Format
import Debug.Trace
import System.Directory
import System.Environment
import System.Exit
import System.FilePat... | mpickering/ghc-exactprint | tests/Roundtrip.hs | bsd-3-clause | 4,889 | 0 | 20 | 1,086 | 1,468 | 707 | 761 | 118 | 4 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Lib
( toField
, Field
, GameState
, gsStatus
, gsPos
, Direction(..)
, GameUI(..)
, GameStatus(..)
, playGame
, runGame
, execGame
, evalGame
, cellToChar
) where
import Control.Monad.Trans.Class
import Contro... | xosmig/haskell-hw-game | src/Lib.hs | bsd-3-clause | 3,352 | 0 | 21 | 937 | 1,293 | 681 | 612 | 103 | 6 |
module River.Effect (
HasEffect(..)
) where
class HasEffect p where
hasEffect :: p -> Bool
| jystic/river | src/River/Effect.hs | bsd-3-clause | 101 | 0 | 7 | 25 | 33 | 19 | 14 | 4 | 0 |
{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-name-shadowing -fno-warn-unused-imports #-}
{-# LANGUAGE UnboxedTuples #-}
-- We expect unused binds and name shadowing in foo5 test.
module Singletons.Lambdas where
import Data.Proxy
import Data.Singletons
import Data.Singletons.TH
$(singletons [d|
-- nothing in ... | int-index/singletons | tests/compile-and-dump/Singletons/Lambdas.hs | bsd-3-clause | 1,954 | 0 | 7 | 480 | 277 | 151 | 126 | -1 | -1 |
--
-- Functions to generate VHDL from FlatFunctions
--
module CLasH.VHDL where
-- Standard modules
import qualified Data.Map as Map
import qualified Maybe
import qualified Control.Arrow as Arrow
import Data.Accessor
import qualified Data.Accessor.Monad.Trans.StrictState as MonadState
-- VHDL Imports
import qualified ... | christiaanb/clash | clash/CLasH/VHDL.hs | bsd-3-clause | 3,575 | 0 | 15 | 591 | 926 | 490 | 436 | 66 | 1 |
#!/usr/bin/env runhaskell
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}
{-# OPTIONS_GHC -fno-cse #-}
module Main where
import Control.Applicative
import Control.Concurrent
import Control.Monad
import Data.Function
import Data.Global
import Data.IORef
import Data.Time.Clock.POSIX
import System.CPUTime
import Text.Prin... | bairyn/global | examples/semaphore/Main.hs | bsd-3-clause | 7,786 | 0 | 11 | 2,777 | 1,720 | 885 | 835 | 177 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
-- | This module contains Dhall's parsing logic
module Dhall.Parser (
-- * Utilities
exprFromText
, exprAndHeaderFromText
, censor
, createHeader
-- * Parsers
, expr, exprA
-- * Types
, Header(..)
, Src(.... | Gabriel439/Haskell-Dhall-Library | dhall/src/Dhall/Parser.hs | bsd-3-clause | 4,203 | 0 | 17 | 1,063 | 779 | 447 | 332 | 74 | 2 |
{-# LANGUAGE Rank2Types #-}
module Test.Sloth.Generics
(
Compose(..), inCompose,
fromConstrWithChildren,
gunfoldM, gunfoldWithIndex
) where
import Control.Monad.State ( State, evalState, get, put )
import Data.Data ( Data, Constr, gunfold, fromConstrM )
-- | Compose two type constructors
newtype Compose... | plancalculus/sloth | Test/Sloth/Generics.hs | bsd-3-clause | 1,818 | 0 | 15 | 478 | 650 | 339 | 311 | 34 | 2 |
import System.Environment (getArgs)
import Data.List (intercalate)
factors :: Int -> [Int]
factors n = [x | x <- [1..n], mod n x == 0]
prime :: Int -> Bool
prime x = factors x == [1, x]
m :: Int -> Int
m x = 2^x - 1
mersenne :: Int -> [Int]
mersenne n = map m $ takeWhile (\x -> m x < n) [x | x <- 2 : [3, 5..], ... | nikai3d/ce-challenges | easy/mersenne_prime.hs | bsd-3-clause | 498 | 3 | 14 | 129 | 292 | 144 | 148 | 15 | 1 |
{-# LANGUAGE TemplateHaskell #-}
-- | In this module there is a helper function called 'wsass''. You need to use
-- it to define another function where the first argument is the path to be used
-- to resolve @include, like this:
--
-- >>> let wsass = wass' "sass_include/"
--
-- Please, check the install instructions o... | fgaray/yesod-sass | src/Text/Sass/QQ.hs | bsd-3-clause | 2,180 | 0 | 14 | 651 | 482 | 264 | 218 | 44 | 3 |
{-# LANGUAGE FlexibleInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.LAPACK
-- Copyright : Copyright (c) 2010, Patrick Perry <patperry@gmail.com>
-- License : BSD3
-- Maintainer : Patrick Perry <patperry@gmail.com>
-- Stability : experimental... | patperry/hs-linear-algebra | lib/Foreign/LAPACK.hs | bsd-3-clause | 10,594 | 0 | 32 | 3,947 | 3,914 | 1,933 | 1,981 | 254 | 1 |
module Haskell99Pointfree.P33
(p33_1, p33_2, p33_3, p33_4,p33_5
) where
import Control.Monad
import Haskell99Pointfree.P32
p33_1 :: Int -> Int -> Bool
p33_1 = ((==) 1 . ) . gcd
--using own gcd version
p33_2 :: Int -> Int -> Bool
p33_2 = ((==) 1 . ) . p32_1
p33_3 :: Int -> Int -> Bool
p33_3 = ap (const (=... | SvenWille/Haskell99Pointfree | src/Haskell99Pointfree/P33.hs | bsd-3-clause | 444 | 0 | 9 | 107 | 189 | 109 | 80 | 14 | 1 |
{-# LANGUAGE CPP #-}
module Driver (
E,
V,
M,
AEq,
(===),
(~==),
field,
mytest,
mycheck,
mytests,
done,
) where
import Data.AEq( AEq )
import qualified Data.AEq as AEq
import Data.Complex
import Data.List
import Debug.Trace
import System.IO
import System.Random
i... | patperry/lapack | tests/Driver.hs | bsd-3-clause | 3,216 | 0 | 18 | 1,002 | 1,095 | 572 | 523 | 81 | 3 |
-- 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.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Time.BG.Tests
( tests
) where
import Data.Aeson
import D... | facebookincubator/duckling | tests/Duckling/Time/BG/Tests.hs | bsd-3-clause | 881 | 0 | 9 | 118 | 185 | 117 | 68 | 22 | 1 |
module Llvm.Pass.PassTester where
import Llvm.Hir.Data
import Llvm.Query.HirCxt
import Llvm.Query.Hir
import qualified Compiler.Hoopl as H
import qualified Data.Set as Ds
type Optimization m a u x = IrCxt -> a -> H.Label -> H.Graph (Node u) H.C H.C -> m (H.Graph (Node u) H.C H.C, x)
opt :: (H.CheckpointMonad m, H... | sanjoy/hLLVM | src/Llvm/Pass/PassTester.hs | bsd-3-clause | 1,037 | 0 | 14 | 260 | 485 | 258 | 227 | 20 | 1 |
module Main where
import Lib
main :: IO ()
main = do
putStrLn "Excercises from Chapter 27: Non-strictness."
putStrLn "Some examples commented out in main function."
putStrLn "Use 'stack ghci' to start ghci to play around. Enjoy."
-- Examples for playing around
-- print $ take' 10 $ map' (+1) (repeat' 1) -... | backofhan/HaskellExercises | CH27/app/Main.hs | bsd-3-clause | 343 | 0 | 7 | 71 | 42 | 21 | 21 | 7 | 1 |
{-# OPTIONS -Wall #-}
module Chap7 where
-- import Lib
--test x = x * 42
-- Exercises: Grap Bag
-- 1.
mTh1 x y z = x * y * z
test1 = mTh1 99 2 27
mTh2 x y = \z -> x * y * z
test2 = mTh2 99 2 27
mTh3 x = \y -> \z -> x * y * z
test3 = mTh3 99 2 27
mTh4 = \x -> \y -> \z -> x * y * z
test4 = mTh4 99 2 27
testB... | tkasu/haskellbook-adventure | app/Chap7.hs | bsd-3-clause | 3,919 | 0 | 10 | 1,270 | 1,870 | 993 | 877 | 135 | 3 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE NoImplicitPrelude #-}
------------------------------------------------------------------------------
-- |
-- Module : Instances
-- Copyright : (C) 2014 Samuli Thomasson
-- License : BSD-style (see the file LICENSE)
-- Maintainer : Samuli Thomas... | SimSaladin/animu-watch | src/Instances.hs | bsd-3-clause | 684 | 0 | 7 | 105 | 55 | 39 | 16 | 8 | 0 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
-- | Blockchain listener.
-- Callbacks on application and rollback.
module Pos.DB.Block.BListener
( MonadBListener (..)
, onApplyBlocksStub
, onRollbackBlocksStub
) where
import Universum
import Control.Monad... | input-output-hk/pos-haskell-prototype | db/src/Pos/DB/Block/BListener.hs | mit | 1,611 | 0 | 10 | 374 | 344 | 189 | 155 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-}
{- |
Module : ./Comorphisms/CoCASL2CoSubCFOL.hs
Description : Extension of CASL2SubCFOL to CoCASL
Copyright : (c) Till Mossakowski, C.Maeder, Uni Bremen 2006
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christia... | spechub/Hets | Comorphisms/CoCASL2CoSubCFOL.hs | gpl-2.0 | 4,122 | 0 | 15 | 960 | 906 | 474 | 432 | 81 | 1 |
{-# LANGUAGE MultiParamTypeClasses, DeriveDataTypeable #-}
{- |
Module : $Header$
Description : Morphism extension for modal signature morphisms
Copyright : DFKI GmbH 2009
License : GPLv2 or higher, see LICENSE.txt
Maintainer : codruta.liliana@gmail.com
Stability : experimental
Portability : portab... | keithodulaigh/Hets | ExtModal/MorphismExtension.hs | gpl-2.0 | 3,901 | 0 | 22 | 892 | 1,180 | 590 | 590 | 86 | 6 |
{-#LANGUAGE TypeOperators, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-}
module Carnap.Languages.PureFirstOrder.Logic.IchikawaJenkins (ichikawaJenkinsQLCalc, parseIchikawaJenkinsQL) where
import Data.Map as M (lookup, Map,empty)
import Text.Parsec
import Carnap.Core.Data.Types (Form)
import Carnap.L... | gleachkr/Carnap | Carnap/src/Carnap/Languages/PureFirstOrder/Logic/IchikawaJenkins.hs | gpl-3.0 | 3,453 | 0 | 17 | 756 | 906 | 494 | 412 | 61 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-cloudtrail/gen/Network/AWS/CloudTrail/UpdateTrail.hs | mpl-2.0 | 10,278 | 0 | 18 | 2,302 | 1,577 | 938 | 639 | 179 | 1 |
module Main where
import HplAssets.Hephaestus.IO
import FeatureModel.Types
main = buildHpl fcAllIn
where
fcAllIn = FeatureConfiguration
$ Root
(f { fId = "HephaestusPL_AllIn" })
[
Root
(f { fId = "SPLAsset" }) [
Leaf $ f { fId = "UseCase" }, ... | alessandroleite/hephaestus-pl | src/meta-hephaestus/HplDrivers/BuildAllFeatures.hs | lgpl-3.0 | 1,159 | 2 | 14 | 602 | 278 | 167 | 111 | 28 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving, BangPatterns #-}
-- | Definitions concerning the 'ScionM' monad.
module Scion.Types.Monad
( module Scion.Types.Monad,
module Scion.Types.Core
)
where
import Scion.Types.Compiler
import Scion.Types.Session
import Scion.Types.Core
import ... | nominolo/scion | src/Scion/Types/Monad.hs | bsd-3-clause | 5,547 | 0 | 19 | 1,322 | 1,809 | 941 | 868 | 124 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
module Ros.Sensor_msgs.Imu where
import qualified Prelude as P
import Prelude ((.), (+), (*))
import qualified Data.Typeable as T
import Control.Applicative
import Ros.Internal.RosBinar... | acowley/roshask | msgs/Sensor_msgs/Ros/Sensor_msgs/Imu.hs | bsd-3-clause | 1,966 | 1 | 14 | 357 | 522 | 300 | 222 | 42 | 0 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Main (main) where
import Prelude ()
import Prelude.Compat
import Blaze.ByteString.Builder (toLazyByteString)
import Blaze.ByteString.Builder.Char.Utf8 (fromString)
import Control.DeepSeq (NFData(rnf))
import Criterion.Main
import qualified Data.Aeson as A
import qualified... | tolysz/prepare-ghcjs | spec-lts8/aeson/benchmarks/CompareWithJSON.hs | bsd-3-clause | 2,775 | 0 | 16 | 704 | 922 | 476 | 446 | 71 | 2 |
module School (School, empty, grade, add, sorted) where
import qualified Data.Map as M
import qualified Data.Set as S
import Control.Arrow (second)
type Grade = Int
type Student = String
newtype School = School { unSchool :: M.Map Grade (S.Set Student) }
empty :: School
empty = School M.empty
sorted :: School -> [(G... | pminten/xhaskell | grade-school/example.hs | mit | 655 | 0 | 10 | 109 | 246 | 139 | 107 | 16 | 1 |
import StackTest
main :: IO ()
main = do
putStrLn "Disabled: CI doesn't have GHC 8.8.1"
--stack ["build"]
| juhp/stack | test/integration/tests/cabal-public-sublibraries/Main.hs | bsd-3-clause | 111 | 0 | 7 | 23 | 26 | 13 | 13 | 4 | 1 |
module Invariant where
import General
import Dictionary
data Invariant = Invariant
deriving (Show,Eq,Enum,Ord,Bounded)
instance Param Invariant
where values = enum
instance Dict Invariant
where category = const "Invariant"
invar = "Invariant"
type Invar = (Invariant -> Str)
invarEntry :: String -> Ent... | isido/functional-morphology-for-koine-greek | lib/Invariant.hs | gpl-3.0 | 408 | 0 | 7 | 77 | 131 | 72 | 59 | 15 | 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 | upgrade-db/Migrations/M_12.hs | gpl-2.0 | 1,467 | 0 | 11 | 392 | 192 | 112 | 80 | 18 | 1 |
module Types where
import Control.Monad.Except (ExceptT)
import Data.Carthage.Cartfile (Version)
import Data.Carthage.TargetPlatform
import qualified Data.Map.Strict as M
import Data.Romefile (FrameworkName, GitRepoName)
import qualified... | mheinzel/Rome | src/Types.hs | mit | 2,697 | 0 | 9 | 1,068 | 352 | 222 | 130 | 30 | 0 |
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
module Morse.Web.Json where
import Data.Aeson
import Data.Text (Text)
data MorseRes = MorseRes
{ morseResInput :: Text
, morseResResult :: Text
}
instance ToJSON MorseRes where
toJSON MorseRes{..} = object
[ "input" .= morseResInput
, "result" .... | rjregenold/morse | src/Morse/Web/Json.hs | mit | 455 | 0 | 8 | 100 | 124 | 69 | 55 | 15 | 0 |
module Main where
data Expr a = Lit Integer
| Add (Expr a) (Expr a)
| Let (Expr a) (a -> Expr a)
| Var a
eval :: Expr Integer -> Integer
eval (Lit d ) = d
eval (Add e0 e1) = eval e0 + eval e1
eval (Let e f ) = eval (f (eval e))
eval (Var v ) = v
instance Num (Expr a) where
... | genos/Programming | workbench/edsl/src/Main.hs | mit | 1,033 | 0 | 13 | 334 | 577 | 294 | 283 | -1 | -1 |
{-# LANGUAGE TypeOperators #-}
module PigmentPrelude
( ev
, fakeNameSupply
, assertRight
, assertChecks
, assertNoCheck
, module X
) where
import Data.Either
import Test.Tasty
import Test.Tasty.HUnit
import Evidences.DefinitionalEquality as X
import Evidences.Eval as X
im... | kwangkim/pigment | tests/PigmentPrelude.hs | mit | 3,093 | 0 | 15 | 852 | 884 | 469 | 415 | 61 | 2 |
{-# LANGUAGE FlexibleContexts #-}
module Yage.Image.SDF
( signedNearDistance
, signedDistanceFieldProgressed
, signedDistanceField
) where
import Yage.Prelude
import Yage.Math
import Control.Monad.ST
import Codec.Picture
import Codec.Picture.Types
data InOut = Inside | Outside
deriving (Show, Eq)... | MaxDaten/yage | src/Yage/Image/SDF.hs | mit | 2,832 | 0 | 14 | 854 | 791 | 405 | 386 | 60 | 3 |
module Main (main) where
import Data.List (genericLength)
import Data.Maybe (catMaybes)
import System.Exit (exitFailure, exitSuccess)
import System.Process (readProcess)
import Text.Regex (matchRegex, mkRegex)
average :: (Fractional a, Real b) => [b] -> a
average xs = realToFrac (sum xs) / genericLength xs
expected ... | cackharot/heub | test/Haddock.hs | mit | 676 | 0 | 11 | 135 | 251 | 134 | 117 | 19 | 2 |
-----------------------------------------------------------------------------
--
-- Module : Language.PureScript.Exhaustive
-- Copyright : (c) 2013-15 Phil Freeman, (c) 2014-15 Gary Burgess
-- License : MIT (http://opensource.org/licenses/MIT)
--
-- Maintainer : Phil Freeman <paf31@cantab.net>
-- Stabil... | michaelficarra/purescript | src/Language/PureScript/Linter/Exhaustive.hs | mit | 13,649 | 0 | 19 | 2,729 | 3,895 | 2,069 | 1,826 | 165 | 18 |
-- | Курс функционального программирования (Осень'2015).
--
-- Пример полноценной программы на языке Haskell.
-- Программа моделирует карточную игру "Бура" по
-- упрощённым правилам.
--
import System.Random
-- | Количество очков, которое необходимо набрать для победы
winScore :: Int
winScore = 31
-- | Отладочн... | dmalkr/fp-course-2015 | game.hs | mit | 15,426 | 0 | 24 | 3,877 | 2,392 | 1,293 | 1,099 | 188 | 8 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE DeriveDataTypeable #-}
-- | This app transformer equips an application with the ability to have
-- multiple seats. WARNING: We're not doin... | LumiGuide/blaze-react | src/Blaze/React/Examples/MultiUser.hs | mit | 4,919 | 0 | 17 | 1,278 | 1,252 | 660 | 592 | -1 | -1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE CPP #-}
module Data.Store.StreamingSpec where
import Control.Concurrent (threadDelay)
import Control.Concurrent.Async (race, concurrently)
import Control.Concurrent.MVar
import... | fpco/store | store-streaming/test/Data/Store/StreamingSpec.hs | mit | 7,727 | 0 | 25 | 1,896 | 2,505 | 1,258 | 1,247 | -1 | -1 |
module Wrapper where
import Data.Char
import System.Random
import Cards
-- The interface to the students' implementation.
data Interface = Interface
{ iEmpty :: Hand
, iFullDeck :: Hand
, iValue :: Hand -> Integer
, iGameOver :: Hand -> Bool
, iWinner :: Hand -> Hand -> Player
, iDraw :: Hand... | tdeekens/tda452-code | Lab-2/Wrapper.hs | mit | 1,472 | 0 | 16 | 377 | 475 | 243 | 232 | 37 | 3 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Main
( main
) where
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Either (EitherT)
import Data.Aeson (FromJSO... | kosmoskatten/react-play | src/Main.hs | mit | 1,521 | 0 | 14 | 427 | 414 | 229 | 185 | 50 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
module Stackage.Prelude
( module X
, module Stackage.Prelude
) where
import C... | fpco/stackage-curator | src/Stackage/Prelude.hs | mit | 3,525 | 0 | 14 | 931 | 896 | 483 | 413 | 67 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : Text.BlogLiterately.LaTeX
-- Copyright : (c) 2012 Brent Yorgey
-- License : GPL (see LICENSE)
-- Maintainer : Brent Yorgey <byorgey@gmail.com>
--
-- Utilities for working with embedded LaTeX.
--
-------------... | jwiegley/BlogLiterately | src/Text/BlogLiterately/LaTeX.hs | gpl-3.0 | 1,476 | 0 | 15 | 355 | 273 | 147 | 126 | 21 | 3 |
-- |
-- Module : Graphics.Text.Annotation
-- Copyright : (c) Justus Sagemüller 2015
-- License : GPL v3
--
-- Maintainer : (@) sagemueller $ geo.uni-koeln.de
-- Stability : experimental
-- Portability : requires GHC>6 extensions
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE GADTs ... | leftaroundabout/dynamic-plot | Graphics/Text/Annotation.hs | gpl-3.0 | 9,604 | 14 | 25 | 3,656 | 2,391 | 1,301 | 1,090 | 185 | 15 |
module Main where
import Test.Tasty
-- library tests
import Test.Gophermap
-- server executable tests
import Test.FileTypeDetection
import Test.Integration
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests = testGroup "tests"
[ gophermapTests
, fileTypeDetectionTests
, integrationTests
]
| sternenseemann/spacecookie | test/Main.hs | gpl-3.0 | 315 | 0 | 6 | 53 | 68 | 40 | 28 | 12 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
-- STDLIB
import Data.Map (Map)
import Data.Maybe (fromJust)
import Data.List (foldl')
import System.Environment (getArgs)
import qualified Data.Map as M
-- SITE PACKAGES
import Control.Monad.CryptoRandom (CRandom(..))
import Crypto.Random (SystemRandom, newGenIO)
... | weissi/diplomarbeit | bench/BenchRAE.hs | gpl-3.0 | 5,862 | 0 | 14 | 1,912 | 2,083 | 1,057 | 1,026 | 117 | 2 |
module NumberTheory.Permutations.CycManip
where
import Data.List
{- Replaces part of a list with a specific element in a list. If the
list has multiple arguments, the elements of the list are substituted. -}
replacePart :: Eq a => Int -> [a] -> [a] -> [a]
replacePart n x l = take (n-1) l ++ x ++ drop n l
{- ... | mathlover2/number-theory | NumberTheory/Permutations/CycManip.hs | gpl-3.0 | 3,308 | 0 | 13 | 874 | 1,311 | 664 | 647 | 64 | 6 |
module RewriteRules (simplify, dedual, unexpt,
prop_simplify_idempotent,
prop_dedual_onlyNegativeAtoms,
prop_unexpt_inExponentialLattice1,
prop_unexpt_inExponentialLattice2)
where
import Test.QuickCheck
import Arbitrary
import Syntax
import Parser
import Rewrite
l --@ r = (tt l, tt r)
dedual_rules = [
... | andykitchen/linear-logic | RewriteRules.hs | gpl-3.0 | 3,576 | 0 | 11 | 901 | 1,182 | 618 | 564 | 101 | 10 |
module Gis.Saga.Node (getAllRoutes)
where
import qualified Data.Map as M
import Gis.Saga.Types
-- | find all possible edges between Nodes
findEdges :: NodeMap -> [((String,String),[String])]
findEdges nds =
[((fromNme,toNme),[o]) | (fromNme, (_, fromOuts)) <- M.toList nds
, (toNme, (toIns, _))... | michelk/bindings-saga-cmd.hs | src/Gis/Saga/Node.hs | gpl-3.0 | 1,181 | 0 | 11 | 394 | 405 | 242 | 163 | 21 | 1 |
import Data.Unsafe.Global
myGlobalVar = newGlobal 2
incMyGlob = modifyIORef myGlobalVar (+1)
main = do
incMyGlob
incMyGlob
myGlobVar' <- readIORef myGlobalVar
print myGlobVar' | xpika/global | example.hs | gpl-3.0 | 206 | 0 | 8 | 52 | 56 | 27 | 29 | 8 | 1 |
module Lambia.Unlambda () where
import Prelude hiding (lookup)
import Lambia.Types hiding (simple,apply)
import qualified Lambia.Types as T (simple,apply)
simple :: Int -> Unlambda -> (Bool, Unlambda)
simple n l = s l n where
s :: Unlambda -> Int -> (Bool, Unlambda)
s e 0
| size e == size l = (True,e)
| ... | phi16/Lambia | src/Lambia/Unlambda.hs | gpl-3.0 | 1,134 | 0 | 12 | 304 | 667 | 357 | 310 | 36 | 4 |
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : HEP.Automation.MadGraph.Machine
-- Copyright : (c) 2011-2013,2015 Ian-Woo Kim
--
-- License : GPL-3
-- Maintainer : Ian-Woo Kim <ianwookim@gmail.co... | wavewave/madgraph-auto | src/HEP/Automation/MadGraph/Card.hs | gpl-3.0 | 6,389 | 0 | 18 | 1,767 | 1,641 | 874 | 767 | 123 | 11 |
{-# LANGUAGE OverloadedStrings #-}
module Coala.Input.SingleFile
( SingleFile (SingleFile)
, singleFile
, file
, settings
) where
import Coala ( Filename (Filename), FileRef )
import qualified Coala as C (filename)
import Coala.Input ( Settings, emptySettings )
import Data.Text ( Text )
import Dat... | maweki/coalaHs | src/Coala/Input/SingleFile.hs | gpl-3.0 | 1,281 | 0 | 14 | 419 | 319 | 188 | 131 | 33 | 1 |
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Orphans () where
import Data.De... | davidspies/regret-solver | game/src/Orphans.hs | gpl-3.0 | 982 | 0 | 9 | 180 | 188 | 114 | 74 | 24 | 0 |
{-# LANGUAGE RankNTypes #-}
module Language.Mulang.Parsers.Prolog (pl, parseProlog) where
import Text.Parsec
import Text.Parsec.Expr
import Text.Parsec.Numbers
import Language.Mulang.Ast
import Language.Mulang.Builder (compact)
import Language.Mulang.Parsers
import Data.Maybe (fromMaybe)
import Data.Char (isUpper,... | mumuki/mulang | src/Language/Mulang/Parsers/Prolog.hs | gpl-3.0 | 5,026 | 139 | 15 | 1,098 | 1,644 | 884 | 760 | 143 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.