_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
1b2d3be92dd6c62ec20286e2f97ee72ff44ae42a41e542a10467522c088794e4 | xapi-project/xen-api | xapi_vm_lifecycle_helpers.ml |
* Copyright ( C ) 2017 Citrix Systems Inc.
*
* This program 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 ; version 2.1 only . with the special
* exception on linking described in fi... | null | https://raw.githubusercontent.com/xapi-project/xen-api/fa6f118fb512a2c90159368a1a0bc1cc730c895b/ocaml/xapi/xapi_vm_lifecycle_helpers.ml | ocaml | * VM is considered as "live" when it's either Running or Paused, i.e. with a live domain |
* Copyright ( C ) 2017 Citrix Systems Inc.
*
* This program 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 ; version 2.1 only . with the special
* exception on linking described in fi... |
c08381cd503a879bc38b6852a6ef6cfddd472102e35920947b7c848152e5fe14 | ocsigen/js_of_ocaml | gh1354.ml | Js_of_ocaml tests
* /
* Copyright ( C ) 2022 Hugo Heuzard
*
* This program 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 , with linking exception ;
* either version 2.1 of the L... | null | https://raw.githubusercontent.com/ocsigen/js_of_ocaml/77ad64fccbc103d3e8168d599a50298f6c123200/compiler/tests-compiler/gh1354.ml | ocaml | Js_of_ocaml tests
* /
* Copyright ( C ) 2022 Hugo Heuzard
*
* This program 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 , with linking exception ;
* either version 2.1 of the L... | |
9e472ba2bd7d889f8c5c65614509b02605f8d954085e0a2d1c715bcf78fe2beb | vollcheck/aoc | core.clj | (ns core
(:require [clojure.string :as str]
[clojure.java.io :as io]))
(defn parse-int
[x]
(if (char? x)
(Character/digit x 10)
(Integer/parseInt x)))
(defn parse-uint
[x]
(Integer/parseUnsignedInt x))
(defn split-by-space [s]
(str/split s #" "))
(defn in?
[e coll]
(some #(= e %)... | null | https://raw.githubusercontent.com/vollcheck/aoc/10bb2b9dad1f8582d6116ae55582724e2252309b/src/core.clj | clojure | TODO: make it working
=> `[[0 0 0] [0 0 0] [0 0 0]]`
Use a stack to store nodes we need to explore
A vector to store the sequence of visited nodes
Base case - return visited nodes if the stack is empty
Use a queue to store the nodes we need to explore
A vector to store the sequence of visited nodes
Base case - ... | (ns core
(:require [clojure.string :as str]
[clojure.java.io :as io]))
(defn parse-int
[x]
(if (char? x)
(Character/digit x 10)
(Integer/parseInt x)))
(defn parse-uint
[x]
(Integer/parseUnsignedInt x))
(defn split-by-space [s]
(str/split s #" "))
(defn in?
[e coll]
(some #(= e %)... |
0c42864327f1dba5233c959dce3d0430f95f552bd69585aee78a8e0323d6856f | chunsj/TH | ch08.lisp | (defpackage :gdrl-ch08
(:use #:common-lisp
#:mu
#:th
#:th.layers
#:th.env
#:th.env.examples))
(in-package :gdrl-ch08)
(defun fcq (input-dim output-dim)
(let ((h1 5)
(h2 5))
(sequential-layer
(affine-layer input-dim h1 :activation :tanh)
(affine-layer h... | null | https://raw.githubusercontent.com/chunsj/TH/890f05ab81148d9fe558be3979c30c303b448480/examples/books/gdrl/ch08.lisp | lisp | following is copy of it. | (defpackage :gdrl-ch08
(:use #:common-lisp
#:mu
#:th
#:th.layers
#:th.env
#:th.env.examples))
(in-package :gdrl-ch08)
(defun fcq (input-dim output-dim)
(let ((h1 5)
(h2 5))
(sequential-layer
(affine-layer input-dim h1 :activation :tanh)
(affine-layer h... |
b90cdf6ce3a5842f2aab1d39e3a45aa8c58c3d08f4a4854ec633f41648e09c2e | Washi1337/bfhs | Interpreter.hs | module BfHs.Interpreter
( eval,
IODevice (..) )
where
import BfHs.Language
( BfProgram,
BfAstNode(..) )
import BfHs.Tape
( Tape(cell),
writeCell,
moveLeft,
moveRight,
incrementCell,
decrementCell )
import Control.Monad
( foldM )
|
Provides a co... | null | https://raw.githubusercontent.com/Washi1337/bfhs/a8a7c1b937ef650f3b5c7ba2ed4de8b34f2fab5c/src/BfHs/Interpreter.hs | haskell | ^ Reads a single value from the input stream.
^ Writes a single value to the output stream.
^ The device used by the interpreter to interact with the device it is running on.
^ The current state of the memory tape.
|
Transforms the tape inside a program state according to the provided tape transformation functi... | module BfHs.Interpreter
( eval,
IODevice (..) )
where
import BfHs.Language
( BfProgram,
BfAstNode(..) )
import BfHs.Tape
( Tape(cell),
writeCell,
moveLeft,
moveRight,
incrementCell,
decrementCell )
import Control.Monad
( foldM )
|
Provides a co... |
e040852d47f05e76f9bb5a813392336260d81e154c95d8ea02d7953f12addaed | babashka/babashka | profile.clj | (ns babashka.profile
(:require [babashka.main :as main]))
(comment)
clojure -A : profile -e " ( prn ( loop [ val 0 cnt 1000000 ] ( if ( pos ? ) ( recur ( inc val ) ( ) ) ) ) ) "
(require '[clj-async-profiler.core :as prof])
(defn -main [& options]
(prof/profile (apply main/main options))
(shutdown-agent... | null | https://raw.githubusercontent.com/babashka/babashka/3dfc15f5a40efaec07cba991892c1207a352fab4/test/babashka/profile.clj | clojure | (ns babashka.profile
(:require [babashka.main :as main]))
(comment)
clojure -A : profile -e " ( prn ( loop [ val 0 cnt 1000000 ] ( if ( pos ? ) ( recur ( inc val ) ( ) ) ) ) ) "
(require '[clj-async-profiler.core :as prof])
(defn -main [& options]
(prof/profile (apply main/main options))
(shutdown-agent... | |
8411bd3019967148857493c8b03c3afc2dfe4a36b2475af03b323b57d16bea88 | openmusic-project/openmusic | om2bach.lisp | ;=========================================================================
OpenMusic : Visual Programming Language for Music Composition
;
Copyright ( c ) 1997- ... IRCAM - Centre , Paris , France .
;
This file is part of the OpenMusic environment sources
;
OpenMusic is free software : you can redist... | null | https://raw.githubusercontent.com/openmusic-project/openmusic/0bd8613a844a382e5db7185be1b5a5d026d66b20/OPENMUSIC/code/projects/musicproject/import-export/om2bach.lisp | lisp | =========================================================================
(at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
=================... | OpenMusic : Visual Programming Language for Music Composition
Copyright ( c ) 1997- ... IRCAM - Centre , Paris , France .
This file is part of the OpenMusic environment sources
OpenMusic is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License ... |
68404cdf17bf69c92cd1041875a1fd4059bc69941811df312580bfdb26fc628d | chanshunli/clojurescript-study | env.clj | (ns highcharts-reagent-gp.env
(:require [selmer.parser :as parser]
[clojure.tools.logging :as log]
[highcharts-reagent-gp.dev-middleware :refer [wrap-dev]]))
(def defaults
{:init
(fn []
(parser/cache-off!)
(log/info "\n-=[highcharts-reagent-gp started successfully using the dev... | null | https://raw.githubusercontent.com/chanshunli/clojurescript-study/60f72e0a9198189d8a5a8f80e455909b5368b19f/reagent-use-plugin/highcharts-reagent-gp/env/dev/clj/highcharts_reagent_gp/env.clj | clojure | (ns highcharts-reagent-gp.env
(:require [selmer.parser :as parser]
[clojure.tools.logging :as log]
[highcharts-reagent-gp.dev-middleware :refer [wrap-dev]]))
(def defaults
{:init
(fn []
(parser/cache-off!)
(log/info "\n-=[highcharts-reagent-gp started successfully using the dev... | |
2aa4778756a64e655a591e381edc9aa09eb5ff8ceb132123fbed826055cc9531 | Dasudian/DSDIN | dsdo_oracles_tests.erl |
-module(dsdo_oracles_tests).
-include_lib("eunit/include/eunit.hrl").
-import(dsdo_oracles, [ deserialize/1
, expires/1
, id/1
, new/2
, owner/1
, query_fee/1
, query_format/1
... | null | https://raw.githubusercontent.com/Dasudian/DSDIN/b27a437d8deecae68613604fffcbb9804a6f1729/apps/dsdoracle/test/dsdo_oracles_tests.erl | erlang |
-module(dsdo_oracles_tests).
-include_lib("eunit/include/eunit.hrl").
-import(dsdo_oracles, [ deserialize/1
, expires/1
, id/1
, new/2
, owner/1
, query_fee/1
, query_format/1
... | |
2c3a3f1b33fb1a80c871362eae7f762dd9c17c867a5574cc127dfda5f2eac1c8 | kudelskisecurity/scannerl | fp_tcp.erl | TODO fingerprint module
%%%
%%% Output:
TODO
%%%
-module(fp_todo).
-author("TODO").
-behavior(fp_module).
-include("../includes/args.hrl").
-export([callback_next_step/1]).
-export([get_default_args/0]).
-export([get_description/0]).
-export([get_arguments/0]).
-define(TIMEOUT, 3000). % milli-seconds
TODO
-de... | null | https://raw.githubusercontent.com/kudelskisecurity/scannerl/8133065030d014401c47b2470e67a36e9df81b1e/skeletons/fp_tcp.erl | erlang |
Output:
milli-seconds
transport type
API
TODO parse
debug
send debug | TODO fingerprint module
TODO
-module(fp_todo).
-author("TODO").
-behavior(fp_module).
-include("../includes/args.hrl").
-export([callback_next_step/1]).
-export([get_default_args/0]).
-export([get_description/0]).
-export([get_arguments/0]).
TODO
TODO
-define(DESCRIPTION, "TCP/TODO: TODO").
-define(ARGUMENT... |
715b5b766ae017336b0b5d21ca3eea8f2259d7cbdba981415923953407ce6568 | clash-lang/clash-compiler | WrongReference.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
module WrongReference where
import qualified Prelude as P
import Data.List (isInfixOf)
import System.Environment (getArgs)
import System.FilePath ((</>))
import Clash.Prelude hiding (Text)
import Clash.Netlist.Types
import Clash.Netlist.BlackBox.Types
import ... | null | https://raw.githubusercontent.com/clash-lang/clash-compiler/8e461a910f2f37c900705a0847a9b533bce4d2ea/tests/shouldfail/BlackBox/WrongReference.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DataKinds #
module WrongReference where
import qualified Prelude as P
import Data.List (isInfixOf)
import System.Environment (getArgs)
import System.FilePath ((</>))
import Clash.Prelude hiding (Text)
import Clash.Netlist.Types
import Clash.Netlist.BlackBox.Types
import Clash.Annotations.Primitive (Primit... |
04ff19282d2d31baedb8305bb4c934ed521d1bac9cb0fc6d7f18d1ba0cc4109e | mentat-collective/emmy | impl.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns ^:no-doc emmy.polynomial.impl
(:require [emmy.generic :as g]
[emmy.polynomial.exponent :as xpt]
[emmy.util :as u]
[emmy.util.aggregate :as ua]
[emmy.value :as v]))
# # Flat Polynomial Form
;;
;; This namespace uses the sparse... | null | https://raw.githubusercontent.com/mentat-collective/emmy/535b237a8e3fd7067b9c0ade8b2a4b3419f9f132/src/emmy/polynomial/impl.cljc | clojure |
This namespace uses the sparse exponent representation introduced in
`emmy.polynomial.exponent` to build up a polynomial arithmetic package
represent polynomial terms in the [[Polynomial]] data structure.
a monomial is a pair of some non - zero
coefficient and a product of some number of variables, each raised t... | #_"SPDX-License-Identifier: GPL-3.0"
(ns ^:no-doc emmy.polynomial.impl
(:require [emmy.generic :as g]
[emmy.polynomial.exponent :as xpt]
[emmy.util :as u]
[emmy.util.aggregate :as ua]
[emmy.value :as v]))
# # Flat Polynomial Form
using Clojure vectors . ` emmy.pol... |
d2c2b85a3ae705c74d1210ccf04ce3e7ab9efcc399d0e16f7b8fc009cd7843e7 | agda/agda | List.hs | -- | Utility functions for lists.
module Agda.Utils.List where
import Control.Monad (filterM)
import Data.Array (Array, array, listArray)
import qualified Data.Array as Array
import Data.Bifunctor
import Data.Function (on)
import Data.Hashable
import qualified Data.List as List
import qualified Data.List.NonEmpty as... | null | https://raw.githubusercontent.com/agda/agda/4f3899c597792fa4455e0f8134dfd63bc89b1c07/src/full/Agda/Utils/List.hs | haskell | | Utility functions for lists.
# SOURCE #
-------------------------------------------------------------------------
* Variants of list case, cons, head, tail, init, last
-------------------------------------------------------------------------
| Append a single element at the end.
| Case distinction for lists, wi... |
module Agda.Utils.List where
import Control.Monad (filterM)
import Data.Array (Array, array, listArray)
import qualified Data.Array as Array
import Data.Bifunctor
import Data.Function (on)
import Data.Hashable
import qualified Data.List as List
import qualified Data.List.NonEmpty as List1
import Data.List.NonEmpty (... |
b2765f3059775e49cee251988d85222c9b44f9d748b7f9641ac589347e4ac35f | coccinelle/coccinelle | weak.mli | type !'a t
val create : int -> 'a t
val length : 'a t -> int
val set : 'a t -> int -> 'a option -> unit
val get : 'a t -> int -> 'a option
val get_copy : 'a t -> int -> 'a option
val check : 'a t -> int -> bool
val fill : 'a t -> int -> int -> 'a option -> unit
val blit : 'a t -> int -> 'a t -> int -> int -> unit
modul... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/5448bb2bd03491ffec356bf7bd6ddcdbf4d36bc9/bundles/stdcompat/stdcompat-current/interfaces/4.12/weak.mli | ocaml | type !'a t
val create : int -> 'a t
val length : 'a t -> int
val set : 'a t -> int -> 'a option -> unit
val get : 'a t -> int -> 'a option
val get_copy : 'a t -> int -> 'a option
val check : 'a t -> int -> bool
val fill : 'a t -> int -> int -> 'a option -> unit
val blit : 'a t -> int -> 'a t -> int -> int -> unit
modul... | |
d57dc0cb250bf0a33e7d1f5be6355a3deb64800620ad77d3b851131059aa2abd | lispnik/cl-http | html2.lisp | -*- mode : lisp ; syntax : ansi - common - lisp ; package : html2 ; base : 10 -*-
;;;
( C ) Copyright 1994 - 97 , .
;;; All Rights Reserved.
;;;
;;;-------------------------------------------------------------------
;;;
;;; INTERFACE CODE FOR AUTHORING HTML DOCUMENTS
;;;
;;; See http:standards;draft-ietf-... | null | https://raw.githubusercontent.com/lispnik/cl-http/84391892d88c505aed705762a153eb65befb6409/server/html2.lisp | lisp | syntax : ansi - common - lisp ; package : html2 ; base : 10 -*-
All Rights Reserved.
-------------------------------------------------------------------
INTERFACE CODE FOR AUTHORING HTML DOCUMENTS
See http:standards;draft-ietf-html-spec-00.txt
Extra fast version
Extra fast environment macro that avoids c... | ( C ) Copyright 1994 - 97 , .
Updated to html 2.0 conformance -- JCMa 1/21/1995 .
(in-package :html2)
(eval-when (compile eval load)
(mapc #'(lambda (x)
(import (intern x :http) :html2))
'("WITH-STRING-FOR-NULL-STREAM")))
(define-parameter *output-stream* *standard-output*
... |
b6c35d012b3f7807a34c513f5aa0af3994ccd486b2821414c64ecd7fa90a3414 | eriksvedang/unity-lisp | project.clj | (defproject unity-lisp "0.1.0"
:description "Lisp to Unity Script converter"
:url "-lisp"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[instaparse "1.2.15"]
[org.clojure/core.match "0.2.1"]
... | null | https://raw.githubusercontent.com/eriksvedang/unity-lisp/fee8903a48dd436b5d123be42176f808f2414180/project.clj | clojure | (defproject unity-lisp "0.1.0"
:description "Lisp to Unity Script converter"
:url "-lisp"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[instaparse "1.2.15"]
[org.clojure/core.match "0.2.1"]
... | |
d4e23a46e95c2610bc092c26295f792bb64a51c2350e701f5b2bd7069fb55316 | intolerable/reddit | Listing.hs | module Reddit.Types.Listing where
import Reddit.Parser
import Control.Applicative
import Data.Aeson
import Data.Traversable
import Data.Semigroup
import Network.API.Builder.Query
import Prelude
data ListingType = Hot
| New
| Rising
| Controversial
|... | null | https://raw.githubusercontent.com/intolerable/reddit/588901f79e684536a6839d63e6f9c6a4847fe001/src/Reddit/Types/Listing.hs | haskell | module Reddit.Types.Listing where
import Reddit.Parser
import Control.Applicative
import Data.Aeson
import Data.Traversable
import Data.Semigroup
import Network.API.Builder.Query
import Prelude
data ListingType = Hot
| New
| Rising
| Controversial
|... | |
8076a282579e7ee30486f740b35cb621dfc61b01747d3b2d902b9453465c4fa2 | ajhc/ajhc | read008.hs | module ShouldCompile where
{-# SPECIALISE f :: Int -> Int #-}
f n = n + 1
| null | https://raw.githubusercontent.com/ajhc/ajhc/8ef784a6a3b5998cfcd95d0142d627da9576f264/regress/tests/0_parse/2_pass/ghc/read008.hs | haskell | # SPECIALISE f :: Int -> Int # | module ShouldCompile where
f n = n + 1
|
7d14c8d4d8b52826882bf670209fc7080d054cfe78c2aabe9c714ab98da20030 | dannypsnl/racket-tree-sitter | query.rkt | #lang racket/base
(provide (all-defined-out))
(require ffi/unsafe
ffi/unsafe/alloc
"definer.rkt"
"types.rkt")
(define-treesitter query-delete (_fun _TSQueryRef -> _void)
#:c-id ts_query_delete
#:wrap (deallocator))
(define-treesitter query-new (_fun (lang src src-len err-offset err-ty) :... | null | https://raw.githubusercontent.com/dannypsnl/racket-tree-sitter/69bee3fdb187c9a56a07b1b4e5c9a1579043aac9/query.rkt | racket | #lang racket/base
(provide (all-defined-out))
(require ffi/unsafe
ffi/unsafe/alloc
"definer.rkt"
"types.rkt")
(define-treesitter query-delete (_fun _TSQueryRef -> _void)
#:c-id ts_query_delete
#:wrap (deallocator))
(define-treesitter query-new (_fun (lang src src-len err-offset err-ty) :... | |
4e5e18466dd5d13c307c94ac0f0a5f04b74d24a2712255e180101dc1f0483ea7 | dstarcev/stepic-haskell | Task27.hs | module Module4.Task27 where
newtype Maybe' a = Maybe' { getMaybe :: Maybe a } deriving (Eq,Show)
instance Monoid a => Monoid (Maybe' a) where
mempty = Maybe' $ Just mempty
mappend (Maybe' Nothing) _ = Maybe' Nothing
mappend _ (Maybe' Nothing) = Maybe' Nothing
mappend (Maybe' a) (Maybe' b) = Maybe' (ma... | null | https://raw.githubusercontent.com/dstarcev/stepic-haskell/6a8cf4b3cc17333ac4175e825db57dbe151ebae0/src/Module4/Task27.hs | haskell | module Module4.Task27 where
newtype Maybe' a = Maybe' { getMaybe :: Maybe a } deriving (Eq,Show)
instance Monoid a => Monoid (Maybe' a) where
mempty = Maybe' $ Just mempty
mappend (Maybe' Nothing) _ = Maybe' Nothing
mappend _ (Maybe' Nothing) = Maybe' Nothing
mappend (Maybe' a) (Maybe' b) = Maybe' (ma... | |
62d2f0c7d50f2cdcb8b47196bf3d500ba37e6c4ab0d8ac79f18ff4454fd7e09f | WorksHub/client | events.cljs | (ns wh.company.register.events
(:require
[re-frame.core :refer [path reg-event-db reg-event-fx]]
[wh.common.logo]
[wh.company.common :as company]
[wh.company.register.db :as register]
[wh.company.register.graphql :as graphql]
[wh.company.register.subs :as register-subs]
[wh.db :as db]
... | null | https://raw.githubusercontent.com/WorksHub/client/e6105f56dad0b8ec2906fc41026116277b3eb729/client/src/wh/company/register/events.cljs | clojure | these events are manually specified
TODO this only works if user arrives from pricing page | (ns wh.company.register.events
(:require
[re-frame.core :refer [path reg-event-db reg-event-fx]]
[wh.common.logo]
[wh.company.common :as company]
[wh.company.register.db :as register]
[wh.company.register.graphql :as graphql]
[wh.company.register.subs :as register-subs]
[wh.db :as db]
... |
a5608ca63ed0283d9cb3294a240560c08f5ab5ad4fc6f2cc641ec986bbb72b43 | erlangonrails/devdb | yaws_log.erl | %%----------------------------------------------------------------------
%%% File : yaws_log.erl
Author : < >
%%% Purpose :
Created : 26 Jan 2002 by < >
%%%----------------------------------------------------------------------
-module(yaws_log).
-author('').
-include_lib("kernel/include/file.hrl").
-... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/scalaris/contrib/yaws/src/yaws_log.erl | erlang | ----------------------------------------------------------------------
File : yaws_log.erl
Purpose :
----------------------------------------------------------------------
External exports
gen_server callbacks
----------------------------------------------------------------------
API
--------------------------... | Author : < >
Created : 26 Jan 2002 by < >
-module(yaws_log).
-author('').
-include_lib("kernel/include/file.hrl").
-behaviour(gen_server).
-export([start_link/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
handle_event/2]).
-export([accesslog/5,
acces... |
0c97be214b8006fc7dcae29953f15a4c075df77ba8df55e6813209b4611165b8 | seereason/logic-classes | Unif.hs | {-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wall -Wwarn #-}
module Harrison.Unif
( tests
) where
import FOL (IsTerm(fApp, vt), tsubst)
import Lib (Failing(..), failing)
import Unif (fullunify)
import FOL (Term)
import Test.HUnit (Test(TestCase, TestList, TestLabel), assertEqual)
import FOL (FName)
tes... | null | https://raw.githubusercontent.com/seereason/logic-classes/819059218027c3ee77bd2ef3a873fcca230d54b4/Tests/Harrison/Unif.hs | haskell | # LANGUAGE OverloadedStrings #
# OPTIONS_GHC -Wall -Wwarn #
-------------------------------------------------------------------------
Examples.
-------------------------------------------------------------------------
cyclic | module Harrison.Unif
( tests
) where
import FOL (IsTerm(fApp, vt), tsubst)
import Lib (Failing(..), failing)
import Unif (fullunify)
import FOL (Term)
import Test.HUnit (Test(TestCase, TestList, TestLabel), assertEqual)
import FOL (FName)
tests :: Test
tests = TestLabel "Data.Logic.Tests.Harrison.Unif" $ Test... |
8d4297191914ff303b88da8d09e5221c0e409bcf9c794bea11953bbb53e2b2e1 | 8c6794b6/haskell-sc-scratch | Zipper.hs | # LANGUAGE TemplateHaskell #
------------------------------------------------------------------------------
-- |
-- Module : $Header$
CopyRight : ( c ) 8c6794b6
-- License : BSD3
Maintainer :
-- Stability : unstable
-- Portability : portable
--
module Test.Sound.SC3.Tree.Zipper where
import Contro... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/hsc3-tree/src/test/Test/Sound/SC3/Tree/Zipper.hs | haskell | ----------------------------------------------------------------------------
|
Module : $Header$
License : BSD3
Stability : unstable
Portability : portable
| Insert and then delete the same node. This is doing almost same thing | # LANGUAGE TemplateHaskell #
CopyRight : ( c ) 8c6794b6
Maintainer :
module Test.Sound.SC3.Tree.Zipper where
import Control.Applicative
import Text.Show.Functions ()
import Sound.SC3 hiding (label)
import Test.Tasty (TestTree, localOption)
import Test.Tasty.QuickCheck (testProperty, QuickCheckMaxSize(..))
... |
4ea1aede494a12aef7986545f751c46670c29a0c85a05005e8e0687bd696ec79 | sunshineclt/Racket-Helper | 8-深度反转一棵树.rkt | #lang racket
(define (joinli li li2)
(if(null? li)
li2
(cons (car li) (joinli (cdr li) li2))))
(define (join li item)
(if(null? li)
(list item)
(cons (car li) (join (cdr li) item))))
(define (reverttree tree)
(if(null? tree)
tree
(if(pair? (car tree))
(joinli (reverttree (... | null | https://raw.githubusercontent.com/sunshineclt/Racket-Helper/bf85f38dd8d084db68265bb98d8c38bada6494ec/%E5%BE%90%E7%8E%89%E9%BA%9F/%E4%BD%9C%E4%B8%9A2/8-%E6%B7%B1%E5%BA%A6%E5%8F%8D%E8%BD%AC%E4%B8%80%E6%A3%B5%E6%A0%91.rkt | racket | #lang racket
(define (joinli li li2)
(if(null? li)
li2
(cons (car li) (joinli (cdr li) li2))))
(define (join li item)
(if(null? li)
(list item)
(cons (car li) (join (cdr li) item))))
(define (reverttree tree)
(if(null? tree)
tree
(if(pair? (car tree))
(joinli (reverttree (... | |
2ad9b93c99d243d35c64088f6ee5442401cb085751613166552784857ac51166 | ralsei/graphite | 3.17.rkt | #lang racket
(require data-frame graphite)
(define gapminder (df-read/csv "../data/all_gapminder.csv"))
(df-add-derived! gapminder "logPop" '("pop")
(λ (x) (log (first x) 10)))
(graph #:data gapminder
#:mapping (aes #:x "gdpPercap" #:y "lifeExp")
#:x-transform logarithmic-transform
... | null | https://raw.githubusercontent.com/ralsei/graphite/2e353be9d3c7e727b6f28597e0f6d64a7c42ee63/graphite-examples/socviz/3.17.rkt | racket | I don't like this color-map, tbh -- | #lang racket
(require data-frame graphite)
(define gapminder (df-read/csv "../data/all_gapminder.csv"))
(df-add-derived! gapminder "logPop" '("pop")
(λ (x) (log (first x) 10)))
(graph #:data gapminder
#:mapping (aes #:x "gdpPercap" #:y "lifeExp")
#:x-transform logarithmic-transform
... |
8a9efea05d228e11705d3d4b845fb8b446f142da6610a64d9e52d0064b2f6c13 | serioga/webapp-clojure-2020 | rum.clj | (ns clj-kondo.rum
(:require [clj-kondo.hooks-api :as api]))
(defn fn-body? [x]
(and (seq? x)
(vector? (first x))))
(defn rewrite-body [mixins body defcs?]
(if defcs?
(let [[binding-vec & body] (:children body)
[state-arg & rest-args] (:children binding-vec)
... | null | https://raw.githubusercontent.com/serioga/webapp-clojure-2020/199c7ce2ceee0920d9a1f7731608d224385e27bb/.clj-kondo/clj_kondo/rum.clj | clojure | the original vector without the state argument
assume mixin | (ns clj-kondo.rum
(:require [clj-kondo.hooks-api :as api]))
(defn fn-body? [x]
(and (seq? x)
(vector? (first x))))
(defn rewrite-body [mixins body defcs?]
(if defcs?
(let [[binding-vec & body] (:children body)
[state-arg & rest-args] (:children binding-vec)
... |
9ed5a8c88d4a6c120020564d45979b6a9d075aefad00d940591222a3866fa8ff | CDSoft/abp | Spec.hs |
This file is part of ABP .
ABP 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 3 of the License , or
( at your option ) any later version .
ABP is distributed... | null | https://raw.githubusercontent.com/CDSoft/abp/98e042066869aa5b898096c31b51d2b6dc316456/test/Spec.hs | haskell | By default all the tests are run.
- The command line can be used to execute a subset of the tests.
- e.g.:
- stack test --test-arguments "-m <test name>"
|
This file is part of ABP .
ABP 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 3 of the License , or
( at your option ) any later version .
ABP is distributed... |
3434a817c3a0485b9eb6ca0c0465f7ffaf9c722c6e17078d429c5a7befe5bb5f | vmchale/atspkg | Rewrite.hs | # LANGUAGE FlexibleContexts #
module Language.ATS.Rewrite ( rewriteDecl
-- * Fixity
, defaultFixityState
) where
import Control.Composition
import Control.Recursion
import qualified Data.Map as M
imp... | null | https://raw.githubusercontent.com/vmchale/atspkg/45be7ece6b9e9b09a7151efe53ff7e278112e84d/language-ats/src/Language/ATS/Rewrite.hs | haskell | * Fixity
| Default fixities from @fixity.ats@
| Among other things, this rewrites expressions so that operator precedence
expression. | # LANGUAGE FlexibleContexts #
module Language.ATS.Rewrite ( rewriteDecl
, defaultFixityState
) where
import Control.Composition
import Control.Recursion
import qualified Data.Map as M
import Data.Maybe (i... |
621a3a24205562a7556efe0f41fd26ec603c8e10c08266a42dcdc746ffd0d34b | racket/typed-racket | tc-envops.rkt | #lang racket/base
(require "../utils/utils.rkt"
racket/match racket/list
(for-syntax racket/base syntax/parse)
(contract-req)
"../rep/type-rep.rkt"
"../rep/prop-rep.rkt"
"../rep/object-rep.rkt"
"../rep/rep-utils.rkt"
"../utils/tc-utils.rkt"
... | null | https://raw.githubusercontent.com/racket/typed-racket/6ea20bec8d41e1a188d7f831c35423293a89c98e/typed-racket-lib/typed-racket/typecheck/tc-envops.rkt | racket | Returns #f if anything becomes (U)
fix the order of paths to the same object.
move objects with fewer path elements forward.
sometimes we need to update the object's type directly -- this helper
does that and continues looping
it's a new type! check if there are any logical propositions that can
be extracted fro... | #lang racket/base
(require "../utils/utils.rkt"
racket/match racket/list
(for-syntax racket/base syntax/parse)
(contract-req)
"../rep/type-rep.rkt"
"../rep/prop-rep.rkt"
"../rep/object-rep.rkt"
"../rep/rep-utils.rkt"
"../utils/tc-utils.rkt"
... |
2820011f0f6319020d6b71ea08c2e6551fc05c86e9035b40a1b6b55f9ae5e96c | GrammaTech/sel | java-project.lisp | ;;;; java-project.lisp --- Java project.
(defpackage :software-evolution-library/test/java-project
(:nicknames :sel/test/java-project)
(:use
:gt/full
#+gt :testbot
:software-evolution-library/test/util
:stefil+
:software-evolution-library
:software-evolution-library/software/parseable
:software... | null | https://raw.githubusercontent.com/GrammaTech/sel/a59174c02a454e8d588614e221cf281260cf12f8/test/java-project.lisp | lisp | java-project.lisp --- Java project. | (defpackage :software-evolution-library/test/java-project
(:nicknames :sel/test/java-project)
(:use
:gt/full
#+gt :testbot
:software-evolution-library/test/util
:stefil+
:software-evolution-library
:software-evolution-library/software/parseable
:software-evolution-library/software/tree-sitter
... |
affc921aa49c36b7b423f94cb78a6ae01b3f6b55ed14795593ed59575c505063 | Harleqin/arrows | arrows.lisp | (in-package #:cl-user)
(defpackage #:arrows
(:use #:common-lisp)
(:export #:->
#:->>
#:-<>
#:-<>>
#:as->
#:some->
#:some->>
#:cond->
#:cond->>
#:->*
#:as->*))
(in-package #:arrows)
(defun simple-inserter... | null | https://raw.githubusercontent.com/Harleqin/arrows/df7cf0067e0132d9697ac8b1a4f1b9c88d4f5382/arrows.lisp | lisp | (in-package #:cl-user)
(defpackage #:arrows
(:use #:common-lisp)
(:export #:->
#:->>
#:-<>
#:-<>>
#:as->
#:some->
#:some->>
#:cond->
#:cond->>
#:->*
#:as->*))
(in-package #:arrows)
(defun simple-inserter... | |
6749a4e96aa708ac4fefa855ad8475f89d140189ddf6459f821d2c85ddc395c0 | zotonic/zotonic | filter_filter.erl | @author < >
2013
%% @doc 'filter' filter, filters a list to only display elements with a certain property
Copyright 2013
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License a... | null | https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/apps/zotonic_mod_base/src/filters/filter_filter.erl | erlang | @doc 'filter' filter, filters a list to only display elements with a certain property
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIN... | @author < >
2013
Copyright 2013
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(filter_filter).
-export([
filter/2,
filter/3,
filter/4
]).
filter(undefined, _Context) -> [];
filter(In, Context) ->... |
b38ed3cee9565251a5c49f5771abf44b4cabca1537977d6486fa7d88198f3de6 | docker-in-aws/docker-in-aws | list.cljs | (ns swarmpit.component.service.list
(:require [material.component :as comp]
[material.component.label :as label]
[material.component.panel :as panel]
[material.component.list-table :as list]
[material.component.list-table-auto :as list-auto]
[swarmpit.compon... | null | https://raw.githubusercontent.com/docker-in-aws/docker-in-aws/bfc7e82ac82ea158bfb03445da6aec167b1a14a3/ch16/swarmpit/src/cljs/swarmpit/component/service/list.cljs | clojure | (ns swarmpit.component.service.list
(:require [material.component :as comp]
[material.component.label :as label]
[material.component.panel :as panel]
[material.component.list-table :as list]
[material.component.list-table-auto :as list-auto]
[swarmpit.compon... | |
6a045441fb2a570754e0afd25cf63862f0ec11f686b879cac8e6d8e6a4146779 | appleshan/cl-http | mail-archive-index.lisp | -*- mode : lisp ; package : http ; base : 10 ; syntax : ansi - common - lisp ; default - character - style : ( : fix : roman : normal);-*-
( C ) Copyright 1997 ,
;;; All Rights Reserved.
;;;
;;;
;;;-------------------------------------------------------------------
;;;
;;; Adds indexing functionality... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/examples/mail-archive-index.lisp | lisp | package : http ; base : 10 ; syntax : ansi - common - lisp ; default - character - style : ( : fix : roman : normal);-*-
All Rights Reserved.
-------------------------------------------------------------------
Adds indexing functionality to the mail-archive.
See the files in http:lambda-ir;* for the backgro... |
( C ) Copyright 1997 ,
Note that all classes must be passed in and that recache - p must be T or
the indexing code loses . 4/23/97 -- JCMa .
: mailing - list " "
: pathname " wilson:>http > mail > WWW - CL.text "
: title " World Wide Web and Common Lisp "
... |
543297d98809b81ee5f6eec5407fc02040c5bf2a8bc1a4e53795480cafc55009 | f-me/carma-public | HttpErrors.hs | module Utils.HttpErrors (finishWithError) where
import qualified Data.Text as T
import Snap.Snaplet
import Snap.Core
finishWithError :: Int -> String -> Handler a b c
finishWithError code message = do
modifyResponse $ setResponseCode code
writeText $ T.pack message
getResponse >>= finishWith
| null | https://raw.githubusercontent.com/f-me/carma-public/82a9f44f7d919e54daa4114aa08dfec58b01009b/srv/src/Utils/HttpErrors.hs | haskell | module Utils.HttpErrors (finishWithError) where
import qualified Data.Text as T
import Snap.Snaplet
import Snap.Core
finishWithError :: Int -> String -> Handler a b c
finishWithError code message = do
modifyResponse $ setResponseCode code
writeText $ T.pack message
getResponse >>= finishWith
| |
1a54451017b6b26756e4db1e6419f3a6a7f4ef8f556403105fee7fb0b503f85d | tengstrand/lein-polylith | create_workspace_test.clj | (ns leiningen.polylith.cmd.create-workspace-test
(:require [clojure.string :as str]
[clojure.test :refer :all]
[leiningen.polylith :as polylith]
[leiningen.polylith.cmd.test-helper :as helper]
[leiningen.polylith.file :as file]
[leiningen.polylith.version :a... | null | https://raw.githubusercontent.com/tengstrand/lein-polylith/27bf508a7b4806e4d2dfac01787e99edf2c1c306/test/leiningen/polylith/cmd/create_workspace_test.clj | clojure | (ns leiningen.polylith.cmd.create-workspace-test
(:require [clojure.string :as str]
[clojure.test :refer :all]
[leiningen.polylith :as polylith]
[leiningen.polylith.cmd.test-helper :as helper]
[leiningen.polylith.file :as file]
[leiningen.polylith.version :a... | |
c0cde766ff9e10c382b223adc6953490ac0f0298beb7fcab1c3f4c09c41e379c | NorfairKing/smos | Convenience.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
module Smos.Actions.Convenience
( allConveniencePlainActions,
convDoneAndWaitForResponse,
convRepinged,
convResponded,
convRespondedButStillWaiting,
convNewEntryAndClockIn,
con... | null | https://raw.githubusercontent.com/NorfairKing/smos/cf1669f353dce8c5d5fc2f378a89a9bc945f3f0b/smos/src/Smos/Actions/Convenience.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE LambdaCase #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
module Smos.Actions.Convenience
( allConveniencePlainActions,
convDoneAndWaitForResponse,
convRepinged,
convResponded,
convRespondedButStillWaiting,
convNewEntryAndClockIn,
convArchiveFile,
convOpenUrl,
... |
264198ba7adc10379e9223c2746db101e70083029401a8d713e2ae3b297388c8 | palletops/visaje | file_server.clj | (ns visaje.file-server
(:use [ring.adapter.jetty :only [run-jetty]]))
(defonce seeds (atom {}))
(defonce last-seed-id (atom 0))
(defonce server (run-jetty #'file-server {:port 8055 :join? false}))
(defn file-server [{:keys [uri] :as req}]
(let [[_ seed-id file-name] (clojure.string/split uri #"/")
conten... | null | https://raw.githubusercontent.com/palletops/visaje/486473c1858ce4c2f32846cb020d9167d083be6d/src/visaje/file_server.clj | clojure | (ns visaje.file-server
(:use [ring.adapter.jetty :only [run-jetty]]))
(defonce seeds (atom {}))
(defonce last-seed-id (atom 0))
(defonce server (run-jetty #'file-server {:port 8055 :join? false}))
(defn file-server [{:keys [uri] :as req}]
(let [[_ seed-id file-name] (clojure.string/split uri #"/")
conten... | |
3e7f9573221b9b9935fdb2de103baedc7d8e98f7512c690f8462d60a9949be95 | facebook/pyre-check | prefix.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/10c375bea52db5d10b71cb5206fac7da9549eb0c/source/hack_parallel/hack_parallel/heap/prefix.ml | ocaml | ***************************************************************************
The prefix is used to guarantee that we are not mixing different kind of
* keys in the heap.
* It just creates a new prefix every time its called.
* The $ at the end of the prefix ensures that we don't have ambiguities if a key
* happens t... |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
74247ae428575fe8a77ac3a4a77e8173ea3122283b362178ec8d832b33525725 | plandes/clj-nlp-parse | timeout_test.clj | (ns zensols.nlparse.timeout-test
(:require [clojure.test :refer :all])
(:require [zensols.nlparse.parse :as p]
[zensols.nlparse.config :as conf :refer (with-context)]))
(defonce ^:private context
(-> (conf/create-parse-config)
(conf/create-context :timeout-millis 1)))
(defn- parse [utterance]
... | null | https://raw.githubusercontent.com/plandes/clj-nlp-parse/fa157d7683b51f54c9721a21ee1441b0b7661c07/test/zensols/nlparse/timeout_test.clj | clojure | (ns zensols.nlparse.timeout-test
(:require [clojure.test :refer :all])
(:require [zensols.nlparse.parse :as p]
[zensols.nlparse.config :as conf :refer (with-context)]))
(defonce ^:private context
(-> (conf/create-parse-config)
(conf/create-context :timeout-millis 1)))
(defn- parse [utterance]
... | |
d01f3466101c52fe732b541b14e1dcbe8d4b2e22d6d43d85c87b91697497121b | bishboria/learnyouahaskell | 13_a_fistful_of_monads.hs | -- A FISTFUL OF MONADS
-- In this chapter we'll learn that monads are just beefed-up applicative
-- functors. Much like applicative functors are beefed-up functors.
-- Upgrading our Applicative Functors
--
With Functors , we saw it was possible to map functions over various data types using Functor type class .
fm... | null | https://raw.githubusercontent.com/bishboria/learnyouahaskell/d8c7b41398e9672db18c1b1360372fc4a4adefa8/13/13_a_fistful_of_monads.hs | haskell | A FISTFUL OF MONADS
In this chapter we'll learn that monads are just beefed-up applicative
functors. Much like applicative functors are beefed-up functors.
Upgrading our Applicative Functors
What if the function a -> b is already wrapped inside a functor value?
Nothing
Not we can treat them as applicative val... |
With Functors , we saw it was possible to map functions over various data types using Functor type class .
fmap :: (Functor f) => (a -> b) -> f a -> f b
like Just ( * 3 ) applied to Just 5 ... Enter Applicative type class :
(<*>) :: (Applicative f) => f (a -> b) -> f a -> f b
pure :: (Applicative f) => a -> f a... |
f4d4d1bd2af944c38c1f46a3cc85013b23596e0083d700fa5d260934b83761a8 | alex-gutev/generic-cl | misc.lisp | ;;;; misc.lisp
;;;;
Copyright 2019 - 2021
;;;;
;;;; Permission is hereby granted, free of charge, to any person
;;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;;; restriction, including without limitation the rights to use,
;;;; co... | null | https://raw.githubusercontent.com/alex-gutev/generic-cl/a2626e85f400ba6f453ce849899071b722c2b6b5/test/misc.lisp | lisp | misc.lisp
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
Software is furnished to do so, subject to the follo... | Copyright 2019 - 2021
files ( the " Software " ) , to deal in the Software without
copies of the Software , and to permit persons to whom the
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
(in-package :generic-cl/test)
... |
d4922df35fc06ec5622742486c726bbd9f114a086fcd01f9f5ab08a6c9a251af | metabase/metabase | setting_test.clj | (ns metabase-enterprise.advanced-permissions.api.setting-test
"Permisisons tests for API that needs to be enforced by Application Permissions to access Admin/Setting pages."
(:require
[clojure.test :refer :all]
[metabase.api.geojson-test :as geojson-test]
[metabase.email :as email]
[metabase.integration... | null | https://raw.githubusercontent.com/metabase/metabase/ce64e033f75bcf5d80b062da3e6187fa3d207aed/enterprise/backend/test/metabase_enterprise/advanced_permissions/api/setting_test.clj | clojure | (ns metabase-enterprise.advanced-permissions.api.setting-test
"Permisisons tests for API that needs to be enforced by Application Permissions to access Admin/Setting pages."
(:require
[clojure.test :refer :all]
[metabase.api.geojson-test :as geojson-test]
[metabase.email :as email]
[metabase.integration... | |
f0fcdf01107760e651cf794e74a409d8209c49a01ec8a98fb944a92f477cf9ad | omelkonian/AlgoRhythm | TonalHarmony.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Grammar.TonalHarmony
( tonalHarmony
) where
import qualified Grammar.Harmony as H
import Grammar.Types
import Music
data Degree =
-- terminals
I | II | III | IV | ... | null | https://raw.githubusercontent.com/omelkonian/AlgoRhythm/fdc1ccbae0b3d8a7635b24d37716123aba2d6c11/AlgoRhythm/src/Grammar/TonalHarmony.hs | haskell | # LANGUAGE FlexibleContexts #
terminals
non-terminals
| Grammar for tonal harmony, based on the paper:
Phrase level
Functional level: Expansion
Functional level: Modulation
Scale-degree level: Secondary dominants
Scale-degree level: Functional-Scale interface
| Expands modulations and intreprets degrees t... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Grammar.TonalHarmony
( tonalHarmony
) where
import qualified Grammar.Harmony as H
import Grammar.Types
import Music
data Degree =
I | II | III | IV | V | VI | VII
| Piece | TR | DR | SR | TS | DS | SS
... |
11d9ab1f469ad5cb8a4df272b38c8683e11a16fcd9321577ee63b1f65c16c6ea | ArulselvanMadhavan/haskell-first-principles | Paths_chapter8.hs | # LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - missing - import - lists #
# OPTIONS_GHC -fno - warn - implicit - prelude #
module Paths_chapter8 (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
i... | null | https://raw.githubusercontent.com/ArulselvanMadhavan/haskell-first-principles/06e0c71c502848c8e75c8109dd49c0954d815bba/chapter8/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/autogen/Paths_chapter8.hs | haskell | # LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - missing - import - lists #
# OPTIONS_GHC -fno - warn - implicit - prelude #
module Paths_chapter8 (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
i... | |
70174b2f3cceb68759915dab22b2d467b05273a9a9f944b265714e3b9f3fbea5 | jnear/compiler-construction-assignments | interp-R1.rkt | #lang racket
(require racket/fixnum)
(require "utilities.rkt")
(provide interp-R1 interp-C0 interp-x86)
;; Note to maintainers of this code:
;; A copy of this interpreter is in the book and should be
;; kept in sync with this code.
(define (interp-exp env)
(lambda (e)
(match e
[(? fixnum?) e]
[`... | null | https://raw.githubusercontent.com/jnear/compiler-construction-assignments/17a1edbd59627341622203056180d9af7830756d/interp-R1.rkt | racket | Note to maintainers of this code:
A copy of this interpreter is in the book and should be
kept in sync with this code.
| #lang racket
(require racket/fixnum)
(require "utilities.rkt")
(provide interp-R1 interp-C0 interp-x86)
(define (interp-exp env)
(lambda (e)
(match e
[(? fixnum?) e]
[`(read)
(define r (read))
(cond [(fixnum? r) r]
[else (error 'interp-R1 "expected an integer" r)])]
... |
9dc46994819fe05c15162937aa0c86dd0b1536fedb3e2af4fba9efe2cfa8ae92 | zotonic/zotonic | z_tempfile_cleanup.erl | @author < >
2015
@doc Periodically cleanup leftover tempfiles in the tempdir
Copyright 2015
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unle... | null | https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/apps/zotonic_core/src/support/z_tempfile_cleanup.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | @author < >
2015
@doc Periodically cleanup leftover tempfiles in the tempdir
Copyright 2015
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(z_tempfile_cleanup).
-author("Marc Worrell <>").
-export([... |
2ed4d65319fabdf9c96d4bd3d68a0c7d23228140fc52eca269954f6f95cd16a8 | jordanthayer/ocaml-search | info-old.ml | (* maintaining search stats and parameters
*)
(********** logging *********)
let make_simple_logger node_cost saved_cost ch =
(** logs every leaf *)
Verb.pf Verb.always ch "# Nodes\tLeaves\tCurr\tBest\tTime\n" ;
let start = Sys.time () in
fun i node ->
match i#curr_best with
None -> failwith "logg... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/bounded_depth/info-old.ml | ocaml | maintaining search stats and parameters
********* logging ********
* logs every leaf
*************************** object based *********************
type parameterized by search node and saved search node types.
methods aren't actually polymorphic, given these class parameters
nodes generated = leaves + bran... |
let make_simple_logger node_cost saved_cost ch =
Verb.pf Verb.always ch "# Nodes\tLeaves\tCurr\tBest\tTime\n" ;
let start = Sys.time () in
fun i node ->
match i#curr_best with
None -> failwith "logging before setting best?"
| Some sol ->
let s = i#curr_stats in
Verb.pf Verb.always ch "%... |
cf02c896319356354d824a96521c833392b737afdc213fd4421cf6216f73c113 | r0man/cljs-http | test.cljs | (ns cljs-http.test
(:require [cljs-http.client-test]
[cljs-http.core-test]
[cljs-http.util-test]
[doo.runner :refer-macros [doo-tests]]))
(doo-tests
'cljs-http.client-test
'cljs-http.core-test
'cljs-http.util-test)
| null | https://raw.githubusercontent.com/r0man/cljs-http/5588ebbd810de00db3c1dc2bea5ab9fb8d5be9b4/test/cljs_http/test.cljs | clojure | (ns cljs-http.test
(:require [cljs-http.client-test]
[cljs-http.core-test]
[cljs-http.util-test]
[doo.runner :refer-macros [doo-tests]]))
(doo-tests
'cljs-http.client-test
'cljs-http.core-test
'cljs-http.util-test)
| |
48a53c265ed0b1b6c86fb7c378f7f69a1aa63b9eee7645e7787aac2950eac8c4 | satos---jp/mincaml_self_hosting | open_test_include.mli |
val f : int -> int
| null | https://raw.githubusercontent.com/satos---jp/mincaml_self_hosting/5fdf8b5083437d7607a924142eea52d9b1de0439/test/open_test_include.mli | ocaml |
val f : int -> int
| |
526f3371a040c9ab7a5b56b033837010af69d3bc1bbf23220ec8f25561161458 | axelarge/advent-of-code | day17_test.clj | (ns advent-of-code.y2015.day17-test
(:require [clojure.test :refer :all]
[advent-of-code.y2015.day17 :refer :all]))
(def test-input "20\n15\n10\n5\n5")
(deftest test-solve1
(is (= (solve1 25 test-input) 4))
(is (= (solve1 input) 4372)))
(deftest test-solve2
(is (= (solve2 25 test-input) 3))
(is... | null | https://raw.githubusercontent.com/axelarge/advent-of-code/4c62a53ef71605780a22cf8219029453d8e1b977/test/advent_of_code/y2015/day17_test.clj | clojure | (ns advent-of-code.y2015.day17-test
(:require [clojure.test :refer :all]
[advent-of-code.y2015.day17 :refer :all]))
(def test-input "20\n15\n10\n5\n5")
(deftest test-solve1
(is (= (solve1 25 test-input) 4))
(is (= (solve1 input) 4372)))
(deftest test-solve2
(is (= (solve2 25 test-input) 3))
(is... | |
fa657ecd165ebf68857264b1cb3fbef777e96fb8c79ead9ba01e4614616bdb68 | pink-gorilla/webly | events.cljs | (ns demo.events
(:require
[taoensso.timbre :as timbre :refer [info warn]]
[re-frame.core :refer [reg-event-db dispatch]]))
(reg-event-db
:demo/start
(fn [db [_]]
(info "starting demo app..")
(dispatch [:ga/event {:category "webly-demo" :action "started" :label 77 :value 13}])
; simulate a slow bundl... | null | https://raw.githubusercontent.com/pink-gorilla/webly/d449a506e6101afc16d384300cdebb7425e3a7f3/demo-webly/src/demo/events.cljs | clojure | simulate a slow bundle load time, so we can see the ui | (ns demo.events
(:require
[taoensso.timbre :as timbre :refer [info warn]]
[re-frame.core :refer [reg-event-db dispatch]]))
(reg-event-db
:demo/start
(fn [db [_]]
(info "starting demo app..")
(dispatch [:ga/event {:category "webly-demo" :action "started" :label 77 :value 13}])
(.setTimeout js/window ... |
ab494ab603eae3e331d4015820ded6678c070e47731f0fe32e745379c072aa8c | bmourad01/ocamlchess | test_move.ml | open Core_kernel [@@warning "-D"]
open OUnit2
open Chess
let cmp_move_opt = Option.equal Move.equal
let cmp_square = Square.equal
let cmp_promote = Option.equal Move.Promote.equal
let test_parse () =
let m = Move.of_string_exn "a1b2" in
assert_equal (Move.src m) Square.a1 ~cmp:cmp_square;
assert_equal (Move.dst... | null | https://raw.githubusercontent.com/bmourad01/ocamlchess/6c7214f5b709d9b1327b384a057fbdb2b5a9c3db/chess/test/test_move.ml | ocaml | open Core_kernel [@@warning "-D"]
open OUnit2
open Chess
let cmp_move_opt = Option.equal Move.equal
let cmp_square = Square.equal
let cmp_promote = Option.equal Move.Promote.equal
let test_parse () =
let m = Move.of_string_exn "a1b2" in
assert_equal (Move.src m) Square.a1 ~cmp:cmp_square;
assert_equal (Move.dst... | |
2257663b148c3fd8dd62c7ecfd0b5fadef6322077fff6fecb5a8e1677ff9910d | TerrorJack/ghc-alter | dynamic004.hs | module Main where
import Data.Typeable
import GHC.Fingerprint
import Text.Printf
f :: Typeable a => Int -> a -> [TypeRep]
f 0 a = []
f n a = typeOf a : f (n-1) [a]
pointwise compare 1000x1001 TypeReps , there should be exactly 1000 equalities
-- (can be used as a benchmark)
main = print $ length [ t1 | t1 <- f 100... | null | https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/tests/dynamic004.hs | haskell | (can be used as a benchmark) | module Main where
import Data.Typeable
import GHC.Fingerprint
import Text.Printf
f :: Typeable a => Int -> a -> [TypeRep]
f 0 a = []
f n a = typeOf a : f (n-1) [a]
pointwise compare 1000x1001 TypeReps , there should be exactly 1000 equalities
main = print $ length [ t1 | t1 <- f 1000 (), t2 <- f 1001 (), t1 == t2 ... |
7cf57156e28b487d9309876feeee9f8c8153b76cad9ddcdef450f21b9e42cb4a | radusw/hpffp | ch8.hs | {-# LANGUAGE BangPatterns #-}
module Main where
import Data.List (intersperse)
naiveFact :: Integer -> Integer
naiveFact 0 = 1
naiveFact n = n * naiveFact (n - 1)
fact :: Integer -> Integer
fact n =
let loop !acc n
| n <= 0 = acc
| otherwise = loop (n * acc) (n - 1)
in loop 1 n
applyTimes... | null | https://raw.githubusercontent.com/radusw/hpffp/114a55fec93f98995ed4cec64a95007330954eb4/ch8.hs | haskell | # LANGUAGE BangPatterns # |
module Main where
import Data.List (intersperse)
naiveFact :: Integer -> Integer
naiveFact 0 = 1
naiveFact n = n * naiveFact (n - 1)
fact :: Integer -> Integer
fact n =
let loop !acc n
| n <= 0 = acc
| otherwise = loop (n * acc) (n - 1)
in loop 1 n
applyTimes :: (Eq a, Num a) => a -> (b -... |
fad6ba98e9cc771e160f2d1afa4224ba57631e9c2200e610b53485b5891a4538 | avsm/platform | bugs.ml | type 'a opt = 'a option
let foo (type a) ?(bar : a opt) () = ()
* Triggers an assertion failure when
{ : } is not fixed .
{:} is not fixed. *)
type 'a opt' = int option
let foo' (type a) ?(bar : a opt') () = ()
* Similar to the above , but the printed type of [ ~bar ] should be [ int ] , not
[ ' a ] .... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/odoc.1.4.2/test/html/cases/bugs.ml | ocaml | type 'a opt = 'a option
let foo (type a) ?(bar : a opt) () = ()
* Triggers an assertion failure when
{ : } is not fixed .
{:} is not fixed. *)
type 'a opt' = int option
let foo' (type a) ?(bar : a opt') () = ()
* Similar to the above , but the printed type of [ ~bar ] should be [ int ] , not
[ ' a ] .... | |
1e17e98be2fa6fecab77bf7bc5e03db9156b9ee8f18046acfeb282cd03daf3de | alura-cursos/clojure-introducao | core_test.clj | (ns curso.core-test
(:require [clojure.test :refer :all]
[curso.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/alura-cursos/clojure-introducao/9b37f6cca3c33dd2382a3b44c87896d33e0246ae/test/curso/core_test.clj | clojure | (ns curso.core-test
(:require [clojure.test :refer :all]
[curso.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| |
3ef93cb91e38d4f7776d61f357d2b4929c090728285b46fd1df88b4118e3cad8 | reborg/clojure-essential-reference | 3.clj | < 1 >
;; ["b" "c"]
< 2 >
;; ["a "b"]
(pop '("a" "b" "c")) ; <3>
;; ("b" "c") | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/Vectors/peekandpop/3.clj | clojure | ["b" "c"]
["a "b"]
<3>
("b" "c") | < 1 >
< 2 >
|
01e7c686e7b140ccce6742116d5ab8d268ee910f40b3a2336b5dcd04e7e29d65 | dmitryvk/sbcl-win32-threads | query.lisp | ;;;; querying the user: Y-OR-N-P, YES-OR-NO-P
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public do... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/code/query.lisp | lisp | querying the user: Y-OR-N-P, YES-OR-NO-P
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information. |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!IMPL")
(defun query-read-char ()
(clear-input *query-io*)
(prog1 (read-char *query-io*)
(clear-input... |
53a3a333a47b61c4c21ad143dc1437a8a85fa50c85a46c4662fcc3731520056d | aptmcl/rosetta | syntax.rkt | #lang racket/base
;; This file is part of Protocol Buffers for Racket.
Copyright ( c ) 2012 by < >
;;
;; Protocol Buffers for Racket 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
versi... | null | https://raw.githubusercontent.com/aptmcl/rosetta/38aeafd730f93edaec7474106e84dae6d8bc1261/archicad/protobuf1/syntax.rkt | racket | This file is part of Protocol Buffers for Racket.
Protocol Buffers for Racket is free software: you can redistribute
it and/or modify it under the terms of the GNU Lesser General
Protocol Buffers for Racket is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied
war... | #lang racket/base
Copyright ( c ) 2012 by < >
Public License as published by the Free Software Foundation , either
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
(require
(for-syntax
srfi/26
racket/base
racket/list
... |
f5c7660d055bf04b3af017080bd871e82bdfa5735c8487c7583ee5055a043471 | ocaml-flambda/ocaml-jst | objinfo.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/7e5a626e4b4e12f1e9106564e1baba4d0ef6309a/tools/objinfo.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
, PPS laboratory , University Paris Diderot
Copyright 1996 Institut National de Recherche en Informatique et
Copyright 2010
the GNU Lesser General Public License version 2.1... |
2ee0196b5b250647028815428bd23994f9b518d183c09dfc370731178aa4d948 | manu291/dypgen | dypgen_parser.mli |
# 499 "dypgen_parser.dyp"
module String_set : Set.S with type elt = string
type gd = {
gd_count : int;
gd_symbs : String_set.t;
gd_regexp_decl : String_set.t }
val use_dyplex : bool ref
# 14 "dypgen_parser.mli"
type token =
EOF
| STRING of string
| CHAR of char
| LIDENT of (s... | null | https://raw.githubusercontent.com/manu291/dypgen/59d11b4c70b8d0971348ca6913839ff1fb4f9b5f/dypgen/dypgen_parser.mli | ocaml |
# 499 "dypgen_parser.dyp"
module String_set : Set.S with type elt = string
type gd = {
gd_count : int;
gd_symbs : String_set.t;
gd_regexp_decl : String_set.t }
val use_dyplex : bool ref
# 14 "dypgen_parser.mli"
type token =
EOF
| STRING of string
| CHAR of char
| LIDENT of (s... | |
009767ec894117747674faed46f344073f5c90db31c751896d93c9a003fb4c3a | rescript-lang/rescript-compiler | destructiveSubstitutionSubModules.ml | module type Id =
sig type t val toString : t -> string val ofString : string -> t option end
module type A = sig module Id : Id type name = string val name : name end
module type B = sig module A : A val fullName : A.Id.t -> string end
module MakeB(A:A): B with module A.Id := A.Id =
(struct
module A = A
... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e87d6b52b7a78207c1fecfaba672523003e1dc3e/res_syntax/tests/conversion/reason/destructiveSubstitutionSubModules.ml | ocaml | module type Id =
sig type t val toString : t -> string val ofString : string -> t option end
module type A = sig module Id : Id type name = string val name : name end
module type B = sig module A : A val fullName : A.Id.t -> string end
module MakeB(A:A): B with module A.Id := A.Id =
(struct
module A = A
... | |
bb0924862b7a63d22b0ee09b49ae0635ecf0876c21ca63543de5a9b60d4a044e | ghcjs/jsaddle-dom | DataTransferItem.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.DataTransferItem
(getAsString, getAsFile, getAsFile_, getAsFileUnsafe,
getAsFileUnchecked, getKind, getType... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/DataTransferItem.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.DataTransferItem
(getAsString, getAsFile, getAsFile_, getAsFileUnsafe,
getAsFileUnchecked, getKind, getType, DataTransferItem(..),
gTypeDataTransferItem)
where
import Prelude ((.), (==), (>>=... |
90fef306cbe47140bff3c3a04957058a22c1b7c4a2bba9976ad37d076cc204cd | Verites/verigraph | MorphismSpec.hs | # LANGUAGE TupleSections #
module Data.TypedGraph.MorphismSpec where
import Test.Hspec
import Test.HUnit
import Abstract.Category
import Category.TypedGraph ()
import Base.Valid
import Data.Graphs (Node(..), Edge(..))
import qualified Data.Graphs as Graph
import qualified Data.Graphs.M... | null | https://raw.githubusercontent.com/Verites/verigraph/754ec08bf4a55ea7402d8cd0705e58b1d2c9cd67/tests/Data/TypedGraph/MorphismSpec.hs | haskell | # LANGUAGE TupleSections #
module Data.TypedGraph.MorphismSpec where
import Test.Hspec
import Test.HUnit
import Abstract.Category
import Category.TypedGraph ()
import Base.Valid
import Data.Graphs (Node(..), Edge(..))
import qualified Data.Graphs as Graph
import qualified Data.Graphs.M... | |
3c1d5e78ab91b25d611e4d39fa5dc049112e3c10c121dd1764fc639d0c8c8e18 | toschoo/mom | streams.hs | module Main
where
import Common
import System.Exit
import qualified System.ZMQ as Z
import Test.QuickCheck
import qualified Data.ByteString.Char8 as B
import Data.List (sort)
import qualified Data.Conduit as C
import qualified Data.Conduit.List as CL
import ... | null | https://raw.githubusercontent.com/toschoo/mom/b58ca23d05c98ab50d9e981bd4ad2cdb76846399/src/patterns/test/suite/streams.hs | haskell | pass with
- Router/Dealer <--
OnError is called with
- Fatal
- Critical
- Error
pause streams
resume streams
remove stream
change timeout
stop streams | module Main
where
import Common
import System.Exit
import qualified System.ZMQ as Z
import Test.QuickCheck
import qualified Data.ByteString.Char8 as B
import Data.List (sort)
import qualified Data.Conduit as C
import qualified Data.Conduit.List as CL
import ... |
04fff247e3cd79fc0d16269fbcd81770dfbf9750ae8d95d0ea205b43e6671395 | aantron/luv | buffer.ml | This file is part of Luv , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
module Array1 = Bigarray.Array1
type t = (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Array1.t
let create =
Bigarray.(Array1.create Char C_layout)
let size =
Array1.di... | null | https://raw.githubusercontent.com/aantron/luv/4b49d3edad2179c76d685500edf1b44f61ec4be8/src/buffer.ml | ocaml | This file is part of Luv , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
module Array1 = Bigarray.Array1
type t = (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Array1.t
let create =
Bigarray.(Array1.create Char C_layout)
let size =
Array1.di... | |
49eae20aef55e3c993eac34868ed5fc9a5a5c4565f2c808be44b97bc6243866e | exercism/scheme | example.scm | (use-modules (ice-9 regex))
(define (acronym text)
(apply (compose string-upcase string-append)
(map (lambda (ss)
(string-take (match:substring ss) 1))
(list-matches "[[:alpha:]|']+" text))))
| null | https://raw.githubusercontent.com/exercism/scheme/aa880e6222a393fcf5d672decb5c5dd6fae286ff/exercises/practice/acronym/.meta/example.scm | scheme | (use-modules (ice-9 regex))
(define (acronym text)
(apply (compose string-upcase string-append)
(map (lambda (ss)
(string-take (match:substring ss) 1))
(list-matches "[[:alpha:]|']+" text))))
| |
5b7c166c17bcf0395847369bc135032488a409f203a319c7c9b7753ef6c34287 | eerohele/sigel | elements.clj | (ns sigel.xslt.elements
"Functions for creating XSLT elements.
This namespace declares so many vars that conflict with vars in the
Clojure core that you probably want to alias the vars in this
namespace.
The docstrings in this file are copied directly from
[the Saxon documentation](-elements)."
(:requir... | null | https://raw.githubusercontent.com/eerohele/sigel/9c2c8e9526cccf7c3f980ef062ab404175f80da1/src/sigel/xslt/elements.clj | clojure | if not, it
TODO: Implement Saxon STYLE_PARSER_CLASS and XSLT_STATIC_URI_RESOLVER_CLASS
xsl:stream omitted -- use xsl:source-document instead.
xsl:transform omitted -- use xsl:stylesheet instead. | (ns sigel.xslt.elements
"Functions for creating XSLT elements.
This namespace declares so many vars that conflict with vars in the
Clojure core that you probably want to alias the vars in this
namespace.
The docstrings in this file are copied directly from
[the Saxon documentation](-elements)."
(:requir... |
699e2e4aee8198d8d40b8edd473575391e5a5cbede1270b2ba74d4adb4fd10d6 | etrepum/haskell-for-erlangers-2014 | value-syntax.hs | greeting :: String
greeting = "Hello, "
sayHello :: String -> String
sayHello name = greeting ++ name
desugars to :
sayHello = \name -> (++) greeting name
sayHello name = result
where result = greeting ++ name
desugars to :
sayHello = \name ->
let result = (++) greeting name
in result
| null | https://raw.githubusercontent.com/etrepum/haskell-for-erlangers-2014/9fb88fd975df4a9eb1975d7ceb8758e6cb52cc36/examples/value-syntax.hs | haskell | greeting :: String
greeting = "Hello, "
sayHello :: String -> String
sayHello name = greeting ++ name
desugars to :
sayHello = \name -> (++) greeting name
sayHello name = result
where result = greeting ++ name
desugars to :
sayHello = \name ->
let result = (++) greeting name
in result
| |
e7aa939b060057ae920c07a88f6d78401bb04c23f48dc10c9b6c2f55cc8e76fb | expez/superstring | test_helpers.clj | (ns superstring.test-helpers)
(defmacro defexamples [name & examples]
test for cljs
`(cljs.test/deftest ~name
(cljs.test/are [actual expected] (= actual expected)
~@examples))
`(clojure.test/deftest ~name
(clojure.test/are [actual expected] (= actual expected)
~@exam... | null | https://raw.githubusercontent.com/expez/superstring/a24e30367b0bca2144ffd25fe78abe3cd0f42bb1/test/superstring/test_helpers.clj | clojure | (ns superstring.test-helpers)
(defmacro defexamples [name & examples]
test for cljs
`(cljs.test/deftest ~name
(cljs.test/are [actual expected] (= actual expected)
~@examples))
`(clojure.test/deftest ~name
(clojure.test/are [actual expected] (= actual expected)
~@exam... | |
1ac700df17037c3248bdd481a3d537b20e0bb19ed25ab624442c045ea062b6ff | smanek/trivial-lisp-webapp | cmucl.lisp | $ I d : cmucl.lisp 469 2008 - 10 - 28 12:00:38Z ctian $
;;;; $URL: svn-lisp.net/project/usocket/svn/usocket/trunk/backend/cmucl.lisp $
;;;; See LICENSE for licensing information.
(in-package :usocket)
#+win32
(defun remap-for-win32 (z)
(mapcar #'(lambda (x)
(cons (mapcar #'(lambda (y)
... | null | https://raw.githubusercontent.com/smanek/trivial-lisp-webapp/36816c17ea378822e02a123c1be960fd9ce3e29d/aux/usocket-svn/backend/cmucl.lisp | lisp | $URL: svn-lisp.net/project/usocket/svn/usocket/trunk/backend/cmucl.lisp $
See LICENSE for licensing information.
information other than the OS error string from which the
error can be determined. The OS error string isn't good enough
given that it may have been localized (l10n).
19d and newer are expected to
co... | $ I d : cmucl.lisp 469 2008 - 10 - 28 12:00:38Z ctian $
(in-package :usocket)
#+win32
(defun remap-for-win32 (z)
(mapcar #'(lambda (x)
(cons (mapcar #'(lambda (y)
(+ 10000 y))
(car x))
(cdr x)))
z))
(defparam... |
57398c82106f91d9e3b03666a76ecc9994e98eac33ca3687f7435bb45a566bb3 | rm-hull/nvd-clojure | log.clj | (ns nvd.log
"Uses the same logging pattern `dependency-check-core` does,
keeping the dependency tree simple."
(:import
(org.slf4j LoggerFactory)
(org.slf4j.simple SimpleLogger)))
(defrecord nvd-clojure [])
(def ^SimpleLogger logger (LoggerFactory/getLogger nvd-clojure))
| null | https://raw.githubusercontent.com/rm-hull/nvd-clojure/f84616f815fdad9d541dffaeac918996883fde86/src/nvd/log.clj | clojure | (ns nvd.log
"Uses the same logging pattern `dependency-check-core` does,
keeping the dependency tree simple."
(:import
(org.slf4j LoggerFactory)
(org.slf4j.simple SimpleLogger)))
(defrecord nvd-clojure [])
(def ^SimpleLogger logger (LoggerFactory/getLogger nvd-clojure))
| |
169e2809af7a50fd828dafec0c86f1544c554106fbac7aaa2239cdfc9ceca40e | eudoxia0/corona | virtual-machines.lisp | ;;;; Defining virtual machines (instances of a box) and building them
(in-package :cl-user)
(defpackage corona.vm
(:use :cl :anaphora)
(:import-from :corona.sys
:<system>
:box)
(:export :<hardware>
:memory
:cpu-count
:<vm>
:name
... | null | https://raw.githubusercontent.com/eudoxia0/corona/8d34d75cdf2d2830cf6bde067d7f5ad4ffb97eef/src/virtual-machines.lisp | lisp | Defining virtual machines (instances of a box) and building them
The way we build virtual machienes from base boxes is roughly:
Now we have to copy everything in box-contents to destination-directory
And now, finally, actually issue the import command using
cl-virtualbox If we're testing, don't actually import an... | (in-package :cl-user)
(defpackage corona.vm
(:use :cl :anaphora)
(:import-from :corona.sys
:<system>
:box)
(:export :<hardware>
:memory
:cpu-count
:<vm>
:name
:system
:hardware
:gb
:vm-directory... |
a8594e7f8233efcbbd2bc9a55eb123274bcf31144124714dbf5d3b6b9ce4e6ff | amuletml/amulet | Type.hs | # LANGUAGE DeriveDataTypeable , FlexibleContexts , , StandaloneDeriving , TemplateHaskell , TypeFamilies
, UndecidableInstances , ViewPatterns , , MultiParamTypeClasses , FlexibleInstances #
, StandaloneDeriving, TemplateHaskell, TypeFamilies
, UndecidableInstances, ViewPatterns, ConstraintKinds
, MultiPa... | null | https://raw.githubusercontent.com/amuletml/amulet/fcba0b7e198b8d354e95722bbe118bccc8483f4e/src/Syntax/Type.hs | haskell | | An annotation which contains no type information. Used for top-level
terms and whatnot.
| The default annotation for terms which have a type.
| An annotation for types. This disappears during desugaring, as most
types are synthesised.
| Constraint sufficient to derive a 'Show' instance for phrase-indexed terms.... | # LANGUAGE DeriveDataTypeable , FlexibleContexts , , StandaloneDeriving , TemplateHaskell , TypeFamilies
, UndecidableInstances , ViewPatterns , , MultiParamTypeClasses , FlexibleInstances #
, StandaloneDeriving, TemplateHaskell, TypeFamilies
, UndecidableInstances, ViewPatterns, ConstraintKinds
, MultiPa... |
807c772bd99aa20aa6c5e127ec7285d7d5f586749287d3379f7c638eafb662a7 | appleby/99-lisp-problems | p56.lisp | ;;;; (**) Symmetric binary trees
;;;;
;;;; Let us call a binary tree symmetric if you can draw a vertical
;;;; line through the root node and then the right subtree is the
;;;; mirror image of the left subtree. Write a function symmetric to
;;;; check whether a given binary tree is symmetric. We are only
;;;; intereste... | null | https://raw.githubusercontent.com/appleby/99-lisp-problems/a12b2a585ac5af06f456f844d308bbada78e647c/p56.lisp | lisp | (**) Symmetric binary trees
Let us call a binary tree symmetric if you can draw a vertical
line through the root node and then the right subtree is the
mirror image of the left subtree. Write a function symmetric to
check whether a given binary tree is symmetric. We are only
interested in the structure, not in t... |
(in-package :99-problems)
(defun symmetric (tree)
(labels ((mirror-images-p (t1 t2)
(cond ((and (tree-empty-p t1) (tree-empty-p t2)) t)
((or (tree-empty-p t1) (tree-empty-p t2)) nil)
(t (and (mirror-images-p (tree-left t1) (tree-right t2))
(mirror-images-p (tree-right t1) (tree-left t2)))))))
... |
5017b63fda1e73bdcc4657d1f7e96f0a4230608f509a72605cb9966753079a10 | phoe/protest | protocol-error.lisp | ;;;; src/base/protocol-error.lisp
(in-package #:protest/base)
(define-protocol-condition-type protocol-error (error) ()
(:documentation
"The parent condition type for all protocol errors.
\
This condition type is a protocol condition type and must not be instantiated
directly."))
(define-condition protocol-obje... | null | https://raw.githubusercontent.com/phoe/protest/be885130044d9950758a2d1726246c4c114692c1/src/base/protocol-error.lisp | lisp | src/base/protocol-error.lisp |
(in-package #:protest/base)
(define-protocol-condition-type protocol-error (error) ()
(:documentation
"The parent condition type for all protocol errors.
\
This condition type is a protocol condition type and must not be instantiated
directly."))
(define-condition protocol-object-instantiation (protocol-error)
... |
d2021564b4f0b6f81869718f4dde515e0d84dc0854c3be44a783437f2fcc7bbe | helmutkian/cl-wasm-runtime | instance-example.lisp | (defvar *add-one-wat*
"(module
(type $add_one_t (func (param i32) (result i32)))
(func $add_one_f (type $add_one_t) (param $value i32) (result i32)
local.get $value
i32.const 1
i32.add)
(export \"add_one\" (func $add_one_f)))")
(defun run-instance-example ()
(let* ((engin... | null | https://raw.githubusercontent.com/helmutkian/cl-wasm-runtime/283dc86fee11191d3a32a6116cc0cb4207e5dc3e/examples/instance-example.lisp | lisp | (defvar *add-one-wat*
"(module
(type $add_one_t (func (param i32) (result i32)))
(func $add_one_f (type $add_one_t) (param $value i32) (result i32)
local.get $value
i32.const 1
i32.add)
(export \"add_one\" (func $add_one_f)))")
(defun run-instance-example ()
(let* ((engin... | |
b35e13b42b894981ec9f6ce5c783629c91093bdd98c443efeb7ba6c6f19d221a | gelisam/hyzzy | PublicObjects.hs | -- NOT generated by ./regenPublicObjects.sh, so we can also export String.
-- A variant of Objects which only export the type constructors, not the data constructors,
-- so the player cannot cheat.
module PublicObjects (PaperDispenser, Paper, Pen, String) where
import Objects
| null | https://raw.githubusercontent.com/gelisam/hyzzy/c5c861d5556ed3ca82fbb583d6928fac40d0d8df/games/maze/PublicObjects.hs | haskell | NOT generated by ./regenPublicObjects.sh, so we can also export String.
A variant of Objects which only export the type constructors, not the data constructors,
so the player cannot cheat. |
module PublicObjects (PaperDispenser, Paper, Pen, String) where
import Objects
|
5644d81df6c2192be800c5a010bdb285f708d6865c055530213c080a1c6f3df2 | vim-erlang/vim-erlang-tags | vim_erlang_tags.erl | #!/usr/bin/env escript
-*- tab - width : 4;erlang - indent - level : 4;indent - tabs - mode : nil -*-
%% ex: ts=4 sw=4 ft=erlang et
This script creates a tags file that can be used by Vim .
%%%
%%% See more information in the {@link print_help/0} function.
Copyright 2013 - 2020
Copyright 2013
%%%
Licens... | null | https://raw.githubusercontent.com/vim-erlang/vim-erlang-tags/cf6e9319818a6737dc9b79b7fa53fe4cdfc65139/bin/vim_erlang_tags.erl | erlang | ex: ts=4 sw=4 ft=erlang et
See more information in the {@link print_help/0} function.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY K... | #!/usr/bin/env escript
-*- tab - width : 4;erlang - indent - level : 4;indent - tabs - mode : nil -*-
This script creates a tags file that can be used by Vim .
Copyright 2013 - 2020
Copyright 2013
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is di... |
401d27058f0a7216c20736e381318c04f739e9e385ff71dd9296f5b4a4d608dc | solbloch/stumpwm-configs | per-screen-group.lisp | (in-package :stumpwm)
(defvar *metagroup* (group-by-name "meta"))
;; (defun pull-from-group-head (new-group frame head)
;; (let (( ))))
(defun list-heads ()
(screen-heads (current-screen)))
(defun swap-tile-group-frame-tree (g1 g2)
(let ((g1-tree (tile-group-frame-tree g1))
(g2-tree (tile-group-frame... | null | https://raw.githubusercontent.com/solbloch/stumpwm-configs/687118d5202e3e3c8317ba1ba8404034a5bca667/per-screen-group.lisp | lisp | (defun pull-from-group-head (new-group frame head)
(let (( )))) | (in-package :stumpwm)
(defvar *metagroup* (group-by-name "meta"))
(defun list-heads ()
(screen-heads (current-screen)))
(defun swap-tile-group-frame-tree (g1 g2)
(let ((g1-tree (tile-group-frame-tree g1))
(g2-tree (tile-group-frame-tree g2)))
(setf (tile-group-frame-tree g1) g2-tree)
(setf (til... |
e42bb38d6547a591b26eee26377933045dce5e0c3a463f2f9c85aab7d7977196 | serokell/qtah | QButtonGroup.hs | This file is part of Qtah .
--
Copyright 2015 - 2018 The Qtah Authors .
--
-- This program 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) ... | null | https://raw.githubusercontent.com/serokell/qtah/abb4932248c82dc5c662a20d8f177acbc7cfa722/qtah-generator/src/Graphics/UI/Qtah/Generator/Interface/Widgets/QButtonGroup.hs | haskell |
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MER... | This file is part of Qtah .
Copyright 2015 - 2018 The Qtah Authors .
the Free Software Foundation , either version 3 of the License , or
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public License
module Graphics.UI.Qtah.Generator.Interface.Wi... |
49f4f862ee4c0afb16c603f06d9d63f0abac517b2886b2dd03b0707a06cb3e64 | yesodweb/yesod | lite.hs | {-# LANGUAGE OverloadedStrings #-}
import Yesod.Core
import Data.Aeson
import Data.Monoid ((<>))
import Data.Text (Text, pack)
people :: [(Text, Int)]
people = [("Alice", 25), ("Bob", 43), ("Charlie", 37)]
main = warp 3000 $ liteApp $ do
onStatic "people" $ dispatchTo getPeople
onStatic "person" $ withDynamic... | null | https://raw.githubusercontent.com/yesodweb/yesod/c59993ff287b880abbf768f1e3f56ae9b19df51e/demo/lite/lite.hs | haskell | # LANGUAGE OverloadedStrings # | import Yesod.Core
import Data.Aeson
import Data.Monoid ((<>))
import Data.Text (Text, pack)
people :: [(Text, Int)]
people = [("Alice", 25), ("Bob", 43), ("Charlie", 37)]
main = warp 3000 $ liteApp $ do
onStatic "people" $ dispatchTo getPeople
onStatic "person" $ withDynamic $ dispatchTo . getPerson
getPeopl... |
fc9f0ad8695d84e47d591f33013eabfe62fdfb0fa04015798677631eb5ec9f49 | pink-gorilla/webly | events.cljs | (ns modular.ws.events
(:require
[taoensso.timbre :refer-macros [debug info warn error]]
[cemerick.url :as url]
[re-frame.core :as rf]
[modular.ws.core :refer [init-ws!]]))
(defn application-url
"gets the current url, as a map"
[]
(url/url (-> js/window .-location .-href)))
(defn is-https? []
(le... | null | https://raw.githubusercontent.com/pink-gorilla/webly/0a22430790eb600218cce90ebe307e4f417208e4/websocket/src/modular/ws/events.cljs | clojure | [{:type :auto,
:open? false,
:ever-opened? false, | (ns modular.ws.events
(:require
[taoensso.timbre :refer-macros [debug info warn error]]
[cemerick.url :as url]
[re-frame.core :as rf]
[modular.ws.core :refer [init-ws!]]))
(defn application-url
"gets the current url, as a map"
[]
(url/url (-> js/window .-location .-href)))
(defn is-https? []
(le... |
0a11926c827140f84991b3df924877fe3bb2174d5eed72d58806fbf189b00a97 | jrm-code-project/LISP-Machine | uc-scavenger.lisp | -*- Mode : LISP ; Package : LAMBDA ; : ZL ; Base:8 ; Fonts:(CPTFONT MEDFNT ) -*-
( c ) Copyright 1985 , Lisp Machine Incorporated .
(defconstant uc-scavenger '(
(locality a-mem)
a-scavenge-region (0)
a-scavenge-region-origin (0)
a-scavenge-region-free-pointer (0)
a-scavenge-object (0)
a-scavenge-next-object (0)
... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/ulambda/uc-scavenger.lisp | lisp | Package : LAMBDA ; : ZL ; Base:8 ; Fonts:(CPTFONT MEDFNT ) -*-
Set scavenge pointer back to object boundary.
Check to see if we're beyond free pointer.
If we're still below the free pointer, don't worry about it.
Past free pointer, set scavenge-pointer = free-pointer and reset scavenger.
This should scavenge eve... | ( c ) Copyright 1985 , Lisp Machine Incorporated .
(defconstant uc-scavenger '(
(locality a-mem)
a-scavenge-region (0)
a-scavenge-region-origin (0)
a-scavenge-region-free-pointer (0)
a-scavenge-object (0)
a-scavenge-next-object (0)
a-scavenge-object-bound (0)
a-scavenge-block-bound (0)
a-scavenge-work (0)
a-scaveng... |
788cf27005ea84e475052ce9e2414da327a9fec9a3a34ad93892a37edd6e3d6b | tensorflow/haskell | Parse.hs | Copyright 2016 TensorFlow authors .
--
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- -2.0
--
-- Unless required by applicable law or agreed to in writing, software
distr... | null | https://raw.githubusercontent.com/tensorflow/haskell/d088e30b80f1508281e400975bec9d14b431a22c/tensorflow-mnist/src/TensorFlow/Examples/MNIST/Parse.hs | haskell |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2016 TensorFlow authors .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
# LANGUAGE OverloadedLists #
# LANGUAGE FlexibleInstances #
# LANGUAGE ViewPatterns #
module TensorFlow.Examples.MNIST.Parse where
impor... |
0b000ddfa6a92da674395bd363683a37f4d4bd2161d9361ac5c33bcca826af45 | zwizwa/erl_tools | gpio_poll.erl | -module(gpio_poll).
-export([start/1, parse/1]).
start(GpioNbs) ->
%% FIXME: remove this hack
Priv =
case code:priv_dir(erl_tools) of
{error,bad_name} ->
%% Allow files to be copied into other application's
%% source tree. In that case an environment variab... | null | https://raw.githubusercontent.com/zwizwa/erl_tools/affd4060ab5b963e0cc8fcfd4a1ca5023aa518d3/src/gpio_poll.erl | erlang | FIXME: remove this hack
Allow files to be copied into other application's
source tree. In that case an environment variable
needs to be set to recover the location of the
binary.
Any other messages cause pattern errors and kill the process. | -module(gpio_poll).
-export([start/1, parse/1]).
start(GpioNbs) ->
Priv =
case code:priv_dir(erl_tools) of
{error,bad_name} ->
case os:getenv("ERL_TOOLS_APP") of
false -> throw(no_env_ERL_TOOLS_APP);
AppStr -> code:priv_dir(list_to_atom(A... |
8cd6d298b86c20c6f66f67240adc63ac76406e3da3330169c0cc3c3dee3439f9 | fukamachi/clozure-cl | arm-backtrace.lisp | -*-Mode : LISP ; Package : CCL -*-
;;;
Copyright ( C ) 2010 Clozure Associates
This file is part of Clozure CL .
;;;
Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
License , known as the LLGPL and distributed with Clozure CL as the
;;; file "LICENSE". The LLGPL consists of a p... | null | https://raw.githubusercontent.com/fukamachi/clozure-cl/4b0c69452386ae57b08984ed815d9b50b4bcc8a2/lib/arm-backtrace.lisp | lisp | Package : CCL -*-
file "LICENSE". The LLGPL consists of a preamble and the LGPL,
conflict, the preamble takes precedence.
Clozure CL is referenced in the preamble as the "LIBRARY."
The LLGPL is also available online at
Used for printing only.
This frame is where the code continues after an unw... | Copyright ( C ) 2010 Clozure Associates
This file is part of Clozure CL .
Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
License , known as the LLGPL and distributed with Clozure CL as the
which is distributed with Clozure CL as the file " LGPL " . Where these
(in-package ... |
1f0fe968bbb9a708b64759b56d3cf0413fa1b6ba664b029b25d801e585280343 | CarlosMChica/HaskellBook | programmers.hs | module Programmers where
import Control.Applicative
data OperatingSystem =
GnuPlusLinux
| OpenBSDPlusNeverMindJustBSDStill
| Mac
| Windows
deriving (Eq, Show)
data ProgrammingLanguage =
Haskell
| Agda
| Idris
| PureScript
deriving (Eq, Show)
data Programmer =
Programmer { os :: OperatingSy... | null | https://raw.githubusercontent.com/CarlosMChica/HaskellBook/86f82cf36cd00003b1a1aebf264e4b5d606ddfad/chapter11/programmers.hs | haskell | module Programmers where
import Control.Applicative
data OperatingSystem =
GnuPlusLinux
| OpenBSDPlusNeverMindJustBSDStill
| Mac
| Windows
deriving (Eq, Show)
data ProgrammingLanguage =
Haskell
| Agda
| Idris
| PureScript
deriving (Eq, Show)
data Programmer =
Programmer { os :: OperatingSy... | |
42e5d7a7b9cb9d268d32e99212aa0c163c5fe5f3f7d6529b421c38e1febe0643 | guedes/exjson | exjson_to_keyword.erl | -module(exjson_to_keyword).
-export([parse/1, parse_and_scan/1, format_error/1]).
-file("src/exjson_to_keyword.yrl", 100).
extract_value({_,_,Value}) -> Value.
build_object([L]) when is_list(L) -> L;
build_object(T) when is_tuple(T) -> [ T ];
build_object(Any) -> Any.
build_pair(K, V) -> { unicode:characters_to_bina... | null | https://raw.githubusercontent.com/guedes/exjson/ca913eef08db13c826310022007558eb8faea6f9/src/exjson_to_keyword.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | -module(exjson_to_keyword).
-export([parse/1, parse_and_scan/1, format_error/1]).
-file("src/exjson_to_keyword.yrl", 100).
extract_value({_,_,Value}) -> Value.
build_object([L]) when is_list(L) -> L;
build_object(T) when is_tuple(T) -> [ T ];
build_object(Any) -> Any.
build_pair(K, V) -> { unicode:characters_to_bina... |
31c6b3c7e5b2c80d718142ad84256785c668d392bf710a167ed5cbdc546c571e | JakobBruenker/monadic-bang | Error.hs | # LANGUAGE LambdaCase #
module MonadicBang.Error where
import Prelude hiding ((<>))
import Control.Effect.Writer
import GHC
import GHC.Types.Error
import GHC.Types.Name.Occurrence
import GHC.Parser.Errors.Types
import GHC.Utils.Outputable
data Error = ErrOutOfScopeVariable OccName
| ErrBangOutsideOfDo
... | null | https://raw.githubusercontent.com/JakobBruenker/monadic-bang/2f27b66e6c3af96caf58883508ce0bd2f087cbda/src/MonadicBang/Error.hs | haskell | # LANGUAGE LambdaCase #
module MonadicBang.Error where
import Prelude hiding ((<>))
import Control.Effect.Writer
import GHC
import GHC.Types.Error
import GHC.Types.Name.Occurrence
import GHC.Parser.Errors.Types
import GHC.Utils.Outputable
data Error = ErrOutOfScopeVariable OccName
| ErrBangOutsideOfDo
... | |
20593ae39af7ac0a01d69417e0bcd29f466854f56530fde8a658289110708a1f | conscell/hugs-android | Lex.hs | # OPTIONS_GHC -fno - implicit - prelude #
-----------------------------------------------------------------------------
-- |
Module : Text . Read .
Copyright : ( c ) The University of Glasgow 2002
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability :... | null | https://raw.githubusercontent.com/conscell/hugs-android/31e5861bc1a1dd9931e6b2471a9f45c14e3c6c7e/hugs/lib/hugs/packages/base/Text/Read/Lex.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : provisional
Portability : non-portable (uses Text.ParserCombinators.ReadP)
---------------------------------------------------------------... | # OPTIONS_GHC -fno - implicit - prelude #
Module : Text . Read .
Copyright : ( c ) The University of Glasgow 2002
The cut - down , used by Text . Read
module Text.Read.Lex
: : leading spaces
: : Reads just one char , with H98 escapes
: : a = > a - > ( Bool ) - > ( Char -... |
2066d0350ff755736505b8ca215dbb4928567501253e2867029c134d0bd787a9 | igorhvr/bedlam | fmt-js.scm | ;;;; fmt-js.scm -- javascript formatting utilities
;;
Copyright ( c ) 2011 - 2012 . All rights reserved .
;; BSD-style license:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (js-expr x)
(fmt-let 'gen js-expr/sexp
(lambda (st) (((or (fmt-gen st) js-expr/sexp) x) s... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/fmt/fmt-0.8.1/fmt-js.scm | scheme | fmt-js.scm -- javascript formatting utilities
BSD-style license:
| Copyright ( c ) 2011 - 2012 . All rights reserved .
(define (js-expr x)
(fmt-let 'gen js-expr/sexp
(lambda (st) (((or (fmt-gen st) js-expr/sexp) x) st))))
(define (js-expr/sexp x)
(cond
((procedure? x)
x)
((pair? x)
(case (car x)
((%fun function) (apply js-function (cdr x)))
... |
3bb0f768d89eb78eb9f06ee427619543c72036172b8ca2cc44c173f101a17f9d | facebook/duckling | Corpus.hs | 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.Volume.KO.Corpus
( corpus ) where
import Data.String
... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Volume/KO/Corpus.hs | haskell | 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 # | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Volume.KO.Corpus
( corpus ) where
import Data.String
import Prelude
import Duckling.Locale
import Duckling.Resolve
import Duckling.Volume.Types
import Duckling.Testing.Types
corpus :: Corpus
corpus = (testContext {locale = makeLocale KO Nothing}... |
3cb86c6b2be05c4606b83ddc73f9f3ae945f47068b1dcaf405b30ba6be9cda38 | nshepperd/funn | TypeLits.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
{-# LANGUAGE TypeInType #-}
# LANGUAGE UndecidableInstances #
module AI.Funn.TypeLits (withNat... | null | https://raw.githubusercontent.com/nshepperd/funn/23138fc44cfda90afd49927c39b122ed78945293/AI/Funn/TypeLits.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE TypeInType #
cLogTest :: Integer -> Integer
cLogTest n = withNat n $ \(Proxy :: Proxy n) ->
natVal (Proxy :: Proxy (CLog n))
prop_cLogTypeLevel :: Property | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module AI.Funn.TypeLits (withNat, CLog, Max) where
import Data.Constraint
import Data.O... |
4ad90af2aa737ef241cc4f4b2c68ef39f70d435a78519ed5feefe41fa50203da | ghcjs/ghcjs-boot | Dynamic.hs | # LANGUAGE Trustworthy #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE AutoDeriveTypeable , StandaloneDeriving #
-----------------------------------------------------------------------------
-- |
-- Module : Data.Dynamic
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the fil... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-boot/8c549931da27ba9e607f77195208ec156c840c8a/boot/base/Data/Dynamic.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Dynamic
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : portable
with operations for converting dynamic values into a concrete
(monomor... | # LANGUAGE Trustworthy #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE AutoDeriveTypeable , StandaloneDeriving #
Copyright : ( c ) The University of Glasgow 2001
The Dynamic interface provides basic support for dynamic types .
Operations for injecting values of arbitrary type into
a dynamically typed value , ... |
43f0e8a403f5a3fbfcb792be3ec3feef5461ca7004c004e78d42c0e13e02112b | chiroptical/snailscheme | IO.hs | module Snail.IO where
import Data.Text.IO qualified as Text
import Snail.Lexer
import Text.Megaparsec
readSnailFile :: FilePath -> IO (Either String [SExpression])
readSnailFile fp = do
contents <- Text.readFile fp
pure $ case parse sExpressions (show fp) contents of
Left parseErrorBundle -> Left $ errorBundl... | null | https://raw.githubusercontent.com/chiroptical/snailscheme/da7fbce2b9a29c1e9562467d913583ba1c6d62c9/src/Snail/IO.hs | haskell | module Snail.IO where
import Data.Text.IO qualified as Text
import Snail.Lexer
import Text.Megaparsec
readSnailFile :: FilePath -> IO (Either String [SExpression])
readSnailFile fp = do
contents <- Text.readFile fp
pure $ case parse sExpressions (show fp) contents of
Left parseErrorBundle -> Left $ errorBundl... | |
3d50860716968460a0f064a347b21245f9f15bf072dc926ad169a5fbe16cab1b | inhabitedtype/ocaml-aws | batchPutAttributes.mli | open Types
type input = BatchPutAttributesRequest.t
type output = unit
type error = Errors_internal.t
include
Aws.Call with type input := input and type output := output and type error := error
| null | https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/b6d5554c5d201202b5de8d0b0253871f7b66dab6/libraries/sdb/lib/batchPutAttributes.mli | ocaml | open Types
type input = BatchPutAttributesRequest.t
type output = unit
type error = Errors_internal.t
include
Aws.Call with type input := input and type output := output and type error := error
| |
ad174b573a0b4157c514713f676eb538ead6c2059b4def53ddd2d759615907ba | synduce/Synduce | max.ml | type 'a list = Elt of 'a | Cons of 'a * 'a list
let rec repr = function Elt x -> Elt x | Cons (hd, tl) -> insert hd (repr tl)
and insert y = function
| Elt x -> if y < x then Cons (y, Elt x) else Cons (x, Elt y)
| Cons (hd, tl) -> if y < hd then Cons (y, Cons (hd, tl)) else Cons (hd, insert y tl)
let rec spec = ... | null | https://raw.githubusercontent.com/synduce/Synduce/d453b04cfb507395908a270b1906f5ac34298d29/benchmarks/sort_list/max.ml | ocaml | type 'a list = Elt of 'a | Cons of 'a * 'a list
let rec repr = function Elt x -> Elt x | Cons (hd, tl) -> insert hd (repr tl)
and insert y = function
| Elt x -> if y < x then Cons (y, Elt x) else Cons (x, Elt y)
| Cons (hd, tl) -> if y < hd then Cons (y, Cons (hd, tl)) else Cons (hd, insert y tl)
let rec spec = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.