_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 |
|---|---|---|---|---|---|---|---|---|
b3563869f952bc297113c27a4bba209b7b95683afb76cdb56f632c36c1642f19 | ocamllabs/ocaml-modular-implicits | genlex.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, proje... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/stdlib/genlex.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
type token =
Kwd of string
| Iden... |
664bfdca7f9f4765008bb21262144645fc45aff32ab9833699c8be9710822f43 | wireless-net/erlang-nommu | qlc_pt.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2004 - 2014 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/stdlib/src/qlc_pt.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2004 - 2014 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(qlc_pt).
-export([parse_transform... |
bd845500322c01578780ad432140f85ced573bb5ffad48486425db90b4fce525 | coccinelle/coccinelle | lexer_cli.mli | exception Lexical of string
val tok : Lexing.lexbuf -> string
type cli_tok = Id of string | NotEq | EqEq | Other of string | EOF
val pretty_print : cli_tok -> string
val __ocaml_lex_tables : Lexing.lex_tables
val token : Lexing.lexbuf -> cli_tok
val __ocaml_lex_token_rec : Lexing.lexbuf -> int -> cli_tok
| null | https://raw.githubusercontent.com/coccinelle/coccinelle/57cbff0c5768e22bb2d8c20e8dae74294515c6b3/parsing_cocci/lexer_cli.mli | ocaml | exception Lexical of string
val tok : Lexing.lexbuf -> string
type cli_tok = Id of string | NotEq | EqEq | Other of string | EOF
val pretty_print : cli_tok -> string
val __ocaml_lex_tables : Lexing.lex_tables
val token : Lexing.lexbuf -> cli_tok
val __ocaml_lex_token_rec : Lexing.lexbuf -> int -> cli_tok
| |
7ff43b9582ecf2edbf731541bd50bc202df783a9ed693d6a947c86eb0d421c6b | rd--/hsc3 | grainFM.help.hs | -- grainFM
let d = 15
lin a b = line kr a b d RemoveSynth
l = lin (-0.5) 0.5
f = lin 200 800
t = impulse kr (lin 7.5 15) 0
i = lin (-1) 1
in grainFM 2 t 0.1 f 200 i l (-1) 512 * 0.1
grainFM ;
let n1 = whiteNoiseId 'α' kr
n2 = lfNoise1Id 'β' kr 500
x = mouseX kr (-0.5) 0.5 Linear 0.1
... | null | https://raw.githubusercontent.com/rd--/hsc3/e1c9377f4985f4cc209a9cb11421bc8f1686c6f2/Help/Ugen/grainFM.help.hs | haskell | grainFM
grainFM ; event control | let d = 15
lin a b = line kr a b d RemoveSynth
l = lin (-0.5) 0.5
f = lin 200 800
t = impulse kr (lin 7.5 15) 0
i = lin (-1) 1
in grainFM 2 t 0.1 f 200 i l (-1) 512 * 0.1
grainFM ;
let n1 = whiteNoiseId 'α' kr
n2 = lfNoise1Id 'β' kr 500
x = mouseX kr (-0.5) 0.5 Linear 0.1
y = mouseY... |
6420622e4dffc82355a04c09fa69549dcf186c112f91577ed891d63e82587e73 | thepower/tpnode | blockchain_updater.erl | -module(blockchain_updater).
-include("include/tplog.hrl").
-behaviour(gen_server).
-define(SERVER, ?MODULE).
%% ------------------------------------------------------------------
%% API Function Exports
%% ------------------------------------------------------------------
-export([start_link/0]).
-export([new_block/... | null | https://raw.githubusercontent.com/thepower/tpnode/8eb38eb7f6def0edcd12c63ff77cce1866dcdf4d/apps/tpnode/src/blockchain_updater.erl | erlang | ------------------------------------------------------------------
API Function Exports
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------
-------------------------... | -module(blockchain_updater).
-include("include/tplog.hrl").
-behaviour(gen_server).
-define(SERVER, ?MODULE).
-export([start_link/0]).
-export([new_block/1, new_sig/2]).
-export([apply_block_conf/2,
apply_block_conf_meta/2,
apply_ledger/2,
store_mychain/3,
backup/1, restore/1]).
... |
286abb87488a85ea7294b88e6766493ee6222b7763be26ad0c54a4420efc2260 | bgaster/hopencl | Scene.hs | {-# OPTIONS_GHC -XNamedFieldPuns #-}
Copyright © 2012 Advanced Micro Devices , Inc. All rights reserved .
* Redistribution and use in source and binary forms , with or without modification , are permitted provided that the following conditions are met :
* Redistributions of source code must retain t... | null | https://raw.githubusercontent.com/bgaster/hopencl/a5b6387cd32d3ca3338b4f433a363e3a581c0bf9/CLGLInterop/examples/HCLRayTrace/Scene.hs | haskell | # OPTIONS_GHC -XNamedFieldPuns #
read the camera position
|
Copyright © 2012 Advanced Micro Devices , Inc. All rights reserved .
* Redistribution and use in source and binary forms , with or without modification , are permitted provided that the following conditions are met :
* Redistributions of source code must retain the above copyright notice , this list ... |
218aad35d40d0989a8b00577deb598825a213b3f548938f4df45269c5506cee6 | nomeata/ghc-proofs | Test.hs | {-# OPTIONS_GHC -fplugin GHC.Proof.Plugin #-}
module Test (foo, bar, proofs) where
import GHC.Proof
foo = 1
bar = 1
proofs = [proof1,proof2]
proof1 = proof foo foo
proof2 = proof foo bar
| null | https://raw.githubusercontent.com/nomeata/ghc-proofs/9d013d36e1cac7b6e9322cd0b6295479cc7429eb/Test.hs | haskell | # OPTIONS_GHC -fplugin GHC.Proof.Plugin # | module Test (foo, bar, proofs) where
import GHC.Proof
foo = 1
bar = 1
proofs = [proof1,proof2]
proof1 = proof foo foo
proof2 = proof foo bar
|
5cf42df957375f428e38d7cc212465bbaba6b813520d8502e2fa9397b0dfa4e5 | Vigilans/hscc | LLVM.hs | # LANGUAGE RecursiveDo #
module Language.C.CodeGen.LLVM where
import Language.C.Program
import Language.C.Syntax
import Language.C.Semantic
import Data.Char
import Data.Maybe
import Data.Functor
import Data.Bifunctor
import Data.String.Transform
import Control.Monad.Identity
import Control.Monad.State
import qualif... | null | https://raw.githubusercontent.com/Vigilans/hscc/d612c54f9263d90fb01673aea1820a62fdf62551/src/Language/C/CodeGen/LLVM.hs | haskell | Defined functions
External functions
Global variable
External Variable
Statement in C does not necessarily have value
case maybeInit of
Compound vals -> forM genExpression vals
while
do while
Expression will return a typed value
return the same operand
Acts like const, return the left operand
L... | # LANGUAGE RecursiveDo #
module Language.C.CodeGen.LLVM where
import Language.C.Program
import Language.C.Syntax
import Language.C.Semantic
import Data.Char
import Data.Maybe
import Data.Functor
import Data.Bifunctor
import Data.String.Transform
import Control.Monad.Identity
import Control.Monad.State
import qualif... |
477f2652e309d2ec03d34e33d339f5d58f20ac19dcd38beaa1852a364fe90026 | typelead/eta | tcfail069.hs |
From : < >
Date : We d , 9 Apr 1997 14:06:39 +0100 ( BST )
I just wanted to report that the erroneous and tiny
program added below can not be compiled within 6 MB of
heap ( Admitted it can be compiled with a bigger heap ) .
It was part of a bigger program that could not be
compiled within 20 MB of he... | null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/fail/tcfail069.hs | haskell | too_much ds q2m s2m |
From : < >
Date : We d , 9 Apr 1997 14:06:39 +0100 ( BST )
I just wanted to report that the erroneous and tiny
program added below can not be compiled within 6 MB of
heap ( Admitted it can be compiled with a bigger heap ) .
It was part of a bigger program that could not be
compiled within 20 MB of he... |
5e0982c15a7c74dd5c71495f5fe55a4ed5649d5b8fc543fc004ba614f736f981 | well-typed/large-records | R000.hs | #if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
module Experiment.SR_ToJSON.Sized.R000 where
| null | https://raw.githubusercontent.com/well-typed/large-records/e6941d0c1b34e176323b1ca7f20e96257f10e01f/large-records-benchmarks/bench/superrecord/Experiment/SR_ToJSON/Sized/R000.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings # | #if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
module Experiment.SR_ToJSON.Sized.R000 where
|
5cdcae739b200f4b3d9b8553d6e1d78e747b94e7617a33119e1ab1d208c588bf | KingoftheHomeless/in-other-words | ContSpec.hs | module ContSpec where
import Control.Effect
import Control.Effect.Cont
import Control.Effect.Reader
import Test.Hspec
test :: Effs '[Shift (Int, Int), Reader Int] m => m (Int, Int)
test = do
i <- local @Int (*2) $
shift @(Int, Int) $ \c ->
local @Int (*3) (ask @Int)
>>= local @Int (*5)... | null | https://raw.githubusercontent.com/KingoftheHomeless/in-other-words/9c864c81beb4fdf71d363b6962db5c90275c57ef/test/ContSpec.hs | haskell | module ContSpec where
import Control.Effect
import Control.Effect.Cont
import Control.Effect.Reader
import Test.Hspec
test :: Effs '[Shift (Int, Int), Reader Int] m => m (Int, Int)
test = do
i <- local @Int (*2) $
shift @(Int, Int) $ \c ->
local @Int (*3) (ask @Int)
>>= local @Int (*5)... | |
4160cf32263c799ff2eb2de94c1b70001870cd812ed1210c0fbf657d204873a4 | IG-Group/ig-webapi-clojure-sample | connection_listener_adapter.clj | (ns ig-webapi-sample.lsclient.connection-listener-adapter
(:use [clojure.pprint] :reload-all)
(:import [com.lightstreamer.ls_client ConnectionListener PushServerException PushConnException]))
(defn create []
(reify
ConnectionListener
(onConnectionEstablished [this] (println "onConnectionEstablished"))... | null | https://raw.githubusercontent.com/IG-Group/ig-webapi-clojure-sample/ce339d69b5d78168b3b8fbcdea96c3a1d268386b/src/ig_webapi_sample/lsclient/connection_listener_adapter.clj | clojure | (ns ig-webapi-sample.lsclient.connection-listener-adapter
(:use [clojure.pprint] :reload-all)
(:import [com.lightstreamer.ls_client ConnectionListener PushServerException PushConnException]))
(defn create []
(reify
ConnectionListener
(onConnectionEstablished [this] (println "onConnectionEstablished"))... | |
8e9bed628223452b941055889a89d25a70ca94e690551400b0aac1f53750b76c | ocaml-ppx/ocamlformat | Docstring.ml | (**************************************************************************)
(* *)
(* OCamlFormat *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/461e0c499a1aac6ca11c736a96fbdb4d9a622e20/lib/Docstring.ml | ocaml | ************************************************************************
OCamlFormat
... | Copyright ( c ) Facebook , Inc. and its affiliates .
This source code is licensed under the MIT license found in
let parse ~loc text =
let location = loc.Location.loc_start in
let location =
{ location with
in
let v = Odoc_parser.parse_comment ~location ~text in
mat... |
f7d502b75c280d95aa89489ccf93a5ec42d2d21d9fb29833bc2d66290a149661 | datastax/cass-config-builder | config_file_renderer.clj | ;; Copyright DataStax, Inc.
;; Please see the included license file for details.
(ns com.datastax.configbuilder.render.config-file-renderer
(:require [com.datastax.configbuilder.definitions :as d]
[com.datastax.configbuilder.render.helpers :as rh]
[lcm.utils.data :refer [as-int]]
... | null | https://raw.githubusercontent.com/datastax/cass-config-builder/88623cca0c09b510a6e363c4c7579ffa7d773344/src/com/datastax/configbuilder/render/config_file_renderer.clj | clojure | Copyright DataStax, Inc.
Please see the included license file for details.
This encodes special characters, but replaces space with +
portion of the URL, as it will be left as a + instead of
being converted back into space. Thus, we must replace
+ after encoding with %20.
Adds filters to the selmer renderer glob... |
(ns com.datastax.configbuilder.render.config-file-renderer
(:require [com.datastax.configbuilder.definitions :as d]
[com.datastax.configbuilder.render.helpers :as rh]
[lcm.utils.data :refer [as-int]]
[lcm.utils.yaml :as yaml]
[selmer.parser :refer [render]]
... |
529a58011b71de8faeb628ac92494494914ce5354c4c0c37df1133aeb205a8b3 | BillHallahan/G2 | M07.hs | {-@ LIQUID "--no-termination" @-}
module M7 (main) where
data List a = Cons a (List a) | Nil
@ main : : List Bool - > n : { n : Int | n > = 0 } - > { b : | b } @
main :: List Bool -> Int -> Bool
main xs n =
case while xs (0, n, 0, 0) of
(i', n', a', b') -> a' + b' == 3 * n'
while :: List Bool -> (Int,... | null | https://raw.githubusercontent.com/BillHallahan/G2/f2584eb2ec211aed73b3ccd88c6e232c3cf4386d/tests/LiquidInf/Paper/Eval/Compare/M07.hs | haskell | @ LIQUID "--no-termination" @ |
module M7 (main) where
data List a = Cons a (List a) | Nil
@ main : : List Bool - > n : { n : Int | n > = 0 } - > { b : | b } @
main :: List Bool -> Int -> Bool
main xs n =
case while xs (0, n, 0, 0) of
(i', n', a', b') -> a' + b' == 3 * n'
while :: List Bool -> (Int, Int, Int, Int) -> (Int, Int, Int,... |
c1122cff97f5683ec75c0b62bc96e95b5be3b70bb7ac7f8ad2336b29be775a84 | metabase/metabase | nested_queries_test.clj | (ns metabase.query-processor-test.nested-queries-test
"Tests for handling queries with nested expressions."
(:require
[clojure.test :refer :all]
[honey.sql :as sql]
[java-time :as t]
[medley.core :as m]
[metabase.driver :as driver]
[metabase.driver.sql.query-processor-test-util :as sql.qp-test-uti... | null | https://raw.githubusercontent.com/metabase/metabase/f827b28e5cd3a6eff8bce08780d48bb9b825a654/test/metabase/query_processor_test/nested_queries_test.clj | clojure | This is the format that is actually used by the frontend; it gets translated to the normal `source-query`
format by middleware. It's provided as a convenience so only minimal changes need to be made to the frontend.
e.g. the ORDER BY in the source-query should refer the 'stddev' aggregation, NOT the 'avg' aggregatio... | (ns metabase.query-processor-test.nested-queries-test
"Tests for handling queries with nested expressions."
(:require
[clojure.test :refer :all]
[honey.sql :as sql]
[java-time :as t]
[medley.core :as m]
[metabase.driver :as driver]
[metabase.driver.sql.query-processor-test-util :as sql.qp-test-uti... |
ddc3bda9cb4cc1c5f122746eab38cdaffe5a5959d04b8cf78bcc987caecf0d7f | con-kitty/categorifier-c | Operations.hs | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeSynonymInstances #-}
-- | Core operation types for the post-SBV code-generation system.
module Categorifier.C.CExpr.Types.Operations
( IntBinOp (..),
IntUnOp (..),
IntTestOp (..),
IntSetBit (..),
Round (..),
FPBinO... | null | https://raw.githubusercontent.com/con-kitty/categorifier-c/a34ff2603529b4da7ad6ffe681dad095f102d1b9/Categorifier/C/CExpr/Types/Operations.hs | haskell | # LANGUAGE TypeSynonymInstances #
| Core operation types for the post-SBV code-generation system. | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TypeFamilies #
module Categorifier.C.CExpr.Types.Operations
( IntBinOp (..),
IntUnOp (..),
IntTestOp (..),
IntSetBit (..),
Round (..),
FPBinOp (..),
FPUnOp (..),
FPTestOp (..),
FPConvert (..),
CmpOp (..),
Assert (..),
Bool... |
c6cdf55881e550e94b904d619dbef04b0ef6f833496e356b6177e46adcb6ce60 | vikram/lisplibraries | scaffold.lisp |
(in-package :weblocks)
(export '(scaffold scaffold-class-name scaffold-view-type
scaffold-view-field-type generate-scaffold-view
generate-scaffold-view-field class-visible-slots
class-visible-slots-impl inspect-typespec
extract-view-property-from-type
typespec->view-field-presentation))
;;; Scaffold c... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/weblocks-stable/src/views/view/scaffold.lisp | lisp | Scaffold class
Scaffold protocol
Scaffold utilities
Type introspection protocol |
(in-package :weblocks)
(export '(scaffold scaffold-class-name scaffold-view-type
scaffold-view-field-type generate-scaffold-view
generate-scaffold-view-field class-visible-slots
class-visible-slots-impl inspect-typespec
extract-view-property-from-type
typespec->view-field-presentation))
(defclass scaf... |
194d5b5c5cf71407d72c913552f99450a453d8034a625ede311dd29370746a80 | susanemcg/pandoc-tufteLaTeX2GitBook | Markdown.hs | {-# LANGUAGE OverloadedStrings #-}
module Tests.Writers.Markdown (tests) where
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
import Tests.Helpers
import Tests.Arbitrary()
markdown :: (ToString a, ToPandoc a) => a -> String
markdown = writeMarkdown def . toPandoc
{-
"my test" =: X =?> Y
is sh... | null | https://raw.githubusercontent.com/susanemcg/pandoc-tufteLaTeX2GitBook/00c34b4299dd89c4e339e1cde006061918b559ab/pandoc-1.12.4.2/tests/Tests/Writers/Markdown.hs | haskell | # LANGUAGE OverloadedStrings #
"my test" =: X =?> Y
is shorthand for
test markdown "my test" $ X =?> Y
which is in turn shorthand for
test markdown "my test" (X,Y)
| module Tests.Writers.Markdown (tests) where
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
import Tests.Helpers
import Tests.Arbitrary()
markdown :: (ToString a, ToPandoc a) => a -> String
markdown = writeMarkdown def . toPandoc
infix 4 =:
(=:) :: (ToString a, ToPandoc a)
=> String -> (a, ... |
9ae64f145be21394616ff49f7cccc4cc2778a1739186d4d06ec0fdc1de89b96a | clojure-interop/aws-api | AmazonPersonalizeAsync.clj | (ns com.amazonaws.services.personalize.AmazonPersonalizeAsync
"Interface for accessing Amazon Personalize asynchronously. Each asynchronous method will return a Java Future object
overloads which accept an AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Note: Do not d... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.personalize/src/com/amazonaws/services/personalize/AmazonPersonalizeAsync.clj | clojure | (ns com.amazonaws.services.personalize.AmazonPersonalizeAsync
"Interface for accessing Amazon Personalize asynchronously. Each asynchronous method will return a Java Future object
overloads which accept an AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Note: Do not d... | |
3ac51a91b299c6c205828e120beabf321816ee1caf9f9dcea59b778af79f68ac | graninas/Andromeda | Parsing.hs | module Andromeda.Utils.Parsing where
import Text.Parsec.String
import Text.Parsec.Combinator
import Text.Parsec.Char
import Text.Parsec
symbols = "!@#$%^&*()`~-_=+[]{};'\\:\"|,./<>?"
stringSymbols = " !@#$%^&*()`~-_=+[]{};'\\:|,./<>?"
quote = char '"'
underscore = char '_'
trueSpace = char ' ' <|> tab
trueSpaces = ma... | null | https://raw.githubusercontent.com/graninas/Andromeda/6b56052bca64fc6f55a28f8001dd775a744b95bf/src/Andromeda/Utils/Parsing.hs | haskell | module Andromeda.Utils.Parsing where
import Text.Parsec.String
import Text.Parsec.Combinator
import Text.Parsec.Char
import Text.Parsec
symbols = "!@#$%^&*()`~-_=+[]{};'\\:\"|,./<>?"
stringSymbols = " !@#$%^&*()`~-_=+[]{};'\\:|,./<>?"
quote = char '"'
underscore = char '_'
trueSpace = char ' ' <|> tab
trueSpaces = ma... | |
0df3618d3e132d40ba7b4852ce0fc808d638ce5a06d5847ffa5a3d0fe96a7910 | Leberwurscht/Diaspora-User-Directory | spider.ml | open StdLabels
open MoreLabels
open Printf
open Pstyle
open Common
module Set = PSet.Set
module Unix = UnixLabels
let stats_timeout = 10
(** Argument parsing *)
let root =
if Array.length Sys.argv = 2 then
(Sys.argv.(1),11370)
else
("stinkfoot.org",11370)
let input_lines cin =
let rec loop lines =
... | null | https://raw.githubusercontent.com/Leberwurscht/Diaspora-User-Directory/1ca4a06a67d591760516edffddb0308b86b6314c/trie_manager/spider.ml | ocaml | * Argument parsing
retrieval failed | open StdLabels
open MoreLabels
open Printf
open Pstyle
open Common
module Set = PSet.Set
module Unix = UnixLabels
let stats_timeout = 10
let root =
if Array.length Sys.argv = 2 then
(Sys.argv.(1),11370)
else
("stinkfoot.org",11370)
let input_lines cin =
let rec loop lines =
match (try Some (input... |
0704fc60d73e4bdd9a9fff2a4cfa903d01e229ef0440229cbe112e8d5206d96a | bcc32/advent-of-code | event.mli | open! Core
open! Async
open! Import
type t
val of_string : string -> t
(** list of (guard id, (sleep, wake) times) *)
val analyze : t list -> (int * (int * int)) list
| null | https://raw.githubusercontent.com/bcc32/advent-of-code/653c0f130e2fb2f599d4e76804e02af54c9bb19f/2018/04/event.mli | ocaml | * list of (guard id, (sleep, wake) times) | open! Core
open! Async
open! Import
type t
val of_string : string -> t
val analyze : t list -> (int * (int * int)) list
|
5c5d0e29eb93c2ae83ad4fbebe8e9f3db8b912ef0729a6b1ee9afee09e9a3815 | mokus0/junkbox | Main.hs | module Susie.Main (susie, Config(modules), config) where
import Config.Dyre
import Config.Dyre.Relaunch
import Control.Monad.Susie
import Control.Monad.ST (RealWorld)
import Data.Maybe
import Susie.Module
import Susie.Module.Boot
import System.IO
import System.Exit
data Config = Config
{ configError :: Maybe St... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Projects/susie/src/Susie/Main.hs | haskell | module Susie.Main (susie, Config(modules), config) where
import Config.Dyre
import Config.Dyre.Relaunch
import Control.Monad.Susie
import Control.Monad.ST (RealWorld)
import Data.Maybe
import Susie.Module
import Susie.Module.Boot
import System.IO
import System.Exit
data Config = Config
{ configError :: Maybe St... | |
ef1abe3bdd3bcdb7720037a73805dd8998f5773830d77ffe9da84136dcee7f1e | JAremko/spacetools | util_test.clj | (ns spacetools.spacedoc.util-test
"Testing general purpose helpers."
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]
[clojure.test :refer :all]
[clojure.test.check.clojure-test :refer [defspec]]
[clojure.test.check.generators :as gen]
[clojur... | null | https://raw.githubusercontent.com/JAremko/spacetools/d047e99689918b5a4ad483022f35802b2015af5f/components/spacedoc/test/spacetools/spacedoc/util_test.clj | clojure | Empty lines aren't indented. | (ns spacetools.spacedoc.util-test
"Testing general purpose helpers."
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]
[clojure.test :refer :all]
[clojure.test.check.clojure-test :refer [defspec]]
[clojure.test.check.generators :as gen]
[clojur... |
90f38e49ac43ca72a87793b19e948e203dda9719b3004f88ae5d9508eb714bee | snowleopard/alga | Algorithm.hs | # LANGUAGE LambdaCase #
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.AdjacencyIntMap.Algorithm
Copyright : ( c ) 2016 - 2022
License : MIT ( see the file LICENSE )
-- Maintainer :
-- Stability : unstable
--
-- __Alga__ is a library for al... | null | https://raw.githubusercontent.com/snowleopard/alga/32b1dbe8b76aea6b042b1ec4508d67564700186f/src/Algebra/Graph/AdjacencyIntMap/Algorithm.hs | haskell | ---------------------------------------------------------------------------
|
Module : Algebra.Graph.AdjacencyIntMap.Algorithm
Maintainer :
Stability : unstable
__Alga__ is a library for algebraic construction and manipulation of graphs
motivation behind the library, the underlying theory, and implementati... | # LANGUAGE LambdaCase #
Copyright : ( c ) 2016 - 2022
License : MIT ( see the file LICENSE )
in Haskell . See < -paper this paper > for the
This module provides basic graph algorithms , such as /depth - first search/ ,
Following ' . ' and ' IntMap . IntMap ' , the /W/ stands for
word size ( usuall... |
902ac37633ddb70421337fcccfb268b2db75647b39258042a433c3a11c6b63ab | MaxwellBo/scratches | scratch.hs | mapPlusOne :: (Functor f) => f Int -> f Int
mapPlusOne = fmap (+1)
res :: Either String [Int]
res = do
x <- Right [5]
y <- Left "COULD NOT RECOVER AN INTEGER"
return $ x ++ y
readThenPrint :: IO ()
readThenPrint = readLn >>= putStrLn
| null | https://raw.githubusercontent.com/MaxwellBo/scratches/3ba8f44eaa40b86d4dc1c2514b10b910fbd38f5a/mbpscratch/scratch.hs | haskell | mapPlusOne :: (Functor f) => f Int -> f Int
mapPlusOne = fmap (+1)
res :: Either String [Int]
res = do
x <- Right [5]
y <- Left "COULD NOT RECOVER AN INTEGER"
return $ x ++ y
readThenPrint :: IO ()
readThenPrint = readLn >>= putStrLn
| |
319393ca5c162e73801bf2c7abcd74f6fd53cc4252d42055574bca746ff9a6ad | bsansouci/bsb-native | printcmm.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bsansouci/bsb-native/9a89457783d6e80deb0fba9ca7372c10a768a9ea/vendor/ocaml/asmcomp/printcmm.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
Pretty - printing of C-- code
open F... |
43378fa02c5b37bae947e01e6ae1728dc221facfd8323a59f428828077dd3e71 | brendanhay/gogol | Types.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-servicenetworking/gen/Gogol/ServiceNetworking/Types.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
* Configuration
* Types
** Xgafv
** AddDnsRecordSetMetadata
** AddDnsRecordSetRequest
** AddDnsZoneMetadata
** AddDnsZoneRequest
** AddDnsZoneResponse
** AddRolesMetadata
** AddSubnetworkRequest
** Api
** Api_Syntax
** ... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
ab0fb2ed953456a332648593b2d114d6be9b70c17579d9f00c135c681858cd5a | ghc/packages-Cabal | cabal.test.hs | import Test.Cabal.Prelude
-- This is like T6083Pre, but also goes via mixins
--
main = cabalTest $
cabal' "v2-run" ["pkg-abc:program"] >>= assertOutputContains "pkg-def:pkg-def"
| null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/MultipleLibraries/T6083PostMixin/cabal.test.hs | haskell | This is like T6083Pre, but also goes via mixins
| import Test.Cabal.Prelude
main = cabalTest $
cabal' "v2-run" ["pkg-abc:program"] >>= assertOutputContains "pkg-def:pkg-def"
|
70d1fa1e285e71585dc7d905f114d7ebe4e7b6383def33244058424f523a44a0 | hbr/fmlib | generic.ml | open Fmlib_std
open Interfaces
module Make
(Token: ANY)
(State: ANY)
(Expect: ANY)
(Semantic: ANY)
(Final: ANY)
=
struct
module B =
Buffer.Make (State) (Token) (Expect) (Semantic)
module Error =
Error.Make (Expect) (Semantic)
module Parser ... | null | https://raw.githubusercontent.com/hbr/fmlib/0c7b923605a211e9c706d427fb33c5ba40248321/src/parse/generic.ml | ocaml | Illegal call.
As long as there are lookaheads in the buffer, consume them.
The parsing combinators
-----------------------
A parsing combinator is a continuation monad with state. The state is the
parse buffer.
Basic Combinators
Try [p]. If it fails without consuming token, then try ... | open Fmlib_std
open Interfaces
module Make
(Token: ANY)
(State: ANY)
(Expect: ANY)
(Semantic: ANY)
(Final: ANY)
=
struct
module B =
Buffer.Make (State) (Token) (Expect) (Semantic)
module Error =
Error.Make (Expect) (Semantic)
module Parser ... |
5fb6b3316a831470ce9b5e5169888737e2aebd66fda615c9751328b03c835f6b | EFanZh/EOPL-Exercises | exercise-4.22-test.rkt | #lang racket
(require rackunit)
(require "../solutions/exercise-4.x-statement-oriented-implicit-refs-lang.rkt")
(define (get-output string)
(with-output-to-string (λ ()
(run string))))
(check-equal? (get-output "var x, y;
{
x = 3;
... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/tests/exercise-4.22-test.rkt | racket | #lang racket
(require rackunit)
(require "../solutions/exercise-4.x-statement-oriented-implicit-refs-lang.rkt")
(define (get-output string)
(with-output-to-string (λ ()
(run string))))
{
print +(x, y)
}")
... | |
6d1b4e2ec90fbd79a5ca575cc2b698ded0d1cc08dc58715361f879ed551e6031 | scrintal/heroicons-reagent | folder.cljs | (ns com.scrintal.heroicons.mini.folder)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:d "M3.75 3A1.75 1.75 0 002 4.75v3.26a3.235 3.235 0 011.75-.51h12.5c.644 0 1.245.188 1.75.51V6.75A1.75 1.75 0 0016.25 5h-4.836... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/mini/folder.cljs | clojure | (ns com.scrintal.heroicons.mini.folder)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:d "M3.75 3A1.75 1.75 0 002 4.75v3.26a3.235 3.235 0 011.75-.51h12.5c.644 0 1.245.188 1.75.51V6.75A1.75 1.75 0 0016.25 5h-4.836... | |
801132c169dc6d654478dfd9d2306afb984db39165561925db1ff424796b620a | mauny/the-functional-approach-to-programming | load.ml | include "load_strict";;
include "load_lazy";;
| null | https://raw.githubusercontent.com/mauny/the-functional-approach-to-programming/1ec8bed5d33d3a67bbd67d09afb3f5c3c8978838/cl-75/Eval/load.ml | ocaml | include "load_strict";;
include "load_lazy";;
| |
e44bbf4b5d207f6f6f3ead9b56392ce728c2960d255baee2b72423afc7bb611a | herd/herdtools7 | ARMArch_herd.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/891da45ba63e84935e9ee7c12ab259483b035258/herd/ARMArch_herd.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2010 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
d6781e4a506113164f70e32707f65e9811a4c173b68b4d6c5d28786c4c83c440 | spechub/Hets | ParseOWL.hs | |
Module : ./OWL2 / ParseOWL.hs
Copyright : , Uni Bremen 2004 - 2007
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : non - portable
analyse OWL files by calling the external Java parser .
Module : ./OWL2/ParseOWL.... | null | https://raw.githubusercontent.com/spechub/Hets/98f81719637d37092aa29178822f662e99e69e36/OWL2/ParseOWL.hs | haskell | | call for owl parser (env. variable $HETS_OWL_TOOLS muss be defined)
^ arguments for java parser
| converts owl file to desired syntax using owl-api | |
Module : ./OWL2 / ParseOWL.hs
Copyright : , Uni Bremen 2004 - 2007
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : non - portable
analyse OWL files by calling the external Java parser .
Module : ./OWL2/ParseOWL.... |
f1b4e6f6a052ec5c66711c2519d8fed503efbc3116c30691383d12af27417059 | liquidz/clj-jwt | json_key_fn.clj | (ns clj-jwt.json-key-fn
(:require
[clojure.string :as str]))
(defn write-key
[x]
(cond
(string? x) (str "\"" x "\"")
:else (name x)))
(defn read-key
[x]
(if-let [y (re-seq #"^\"(.*)\"$" x)]
(-> y first second)
(keyword x)))
| null | https://raw.githubusercontent.com/liquidz/clj-jwt/8a339824504593c417eca508ca31539202108e32/src/clj_jwt/json_key_fn.clj | clojure | (ns clj-jwt.json-key-fn
(:require
[clojure.string :as str]))
(defn write-key
[x]
(cond
(string? x) (str "\"" x "\"")
:else (name x)))
(defn read-key
[x]
(if-let [y (re-seq #"^\"(.*)\"$" x)]
(-> y first second)
(keyword x)))
| |
81b1b1abbd72854e0021138d12af308722c3cd25aae157b2c8cd5719dd0cb239 | facundominguez/stitch-lh | Repl.hs | # LANGUAGE FlexibleInstances , UndecidableInstances , ViewPatterns ,
NondecreasingIndentation #
NondecreasingIndentation #-}
# OPTIONS_GHC -fplugin = LiquidHaskell #
-- XXX: Why do we need --exact-data-cons here?
{-@ LIQUID "--exact-data-cons" @-}
{-@ LIQUID "--ple" @-}
--------------------... | null | https://raw.githubusercontent.com/facundominguez/stitch-lh/710ca6e59756ec8ebc551e53dec89de2c9368fa4/src/Language/Stitch/LH/Repl.hs | haskell | XXX: Why do we need --exact-data-cons here?
@ LIQUID "--exact-data-cons" @
@ LIQUID "--ple" @
---------------------------------------------------------------------------
|
Module : Language.Stitch.LH.Repl
License : BSD-style (see LICENSE)
Stability : experimental
Implements a REPL for stitch.
----... | # LANGUAGE FlexibleInstances , UndecidableInstances , ViewPatterns ,
NondecreasingIndentation #
NondecreasingIndentation #-}
# OPTIONS_GHC -fplugin = LiquidHaskell #
Copyright : ( C ) 2015
Maintainer : ( )
module Language.Stitch.LH.Repl ( main ) where
import Prelude hidi... |
0faaf04ea4afcf2e7260c599a8ff3b3482a660811bf12571765894d99decbc80 | gorillalabs/sparkling | types.clj | (ns sparkling.sql.types
"allows for creation of dataframes from an existing rdd, steps:
1. turn rdd into rows using create row
2. create struct type passing in representation of the schema
3. pass rdd of rows and struct type to sparkling.sql/data-frame"
(:import [org.apache.spark.sql.types DataTypes]
... | null | https://raw.githubusercontent.com/gorillalabs/sparkling/ffedcc70fd46bf1b48405be8b1f5a1e1c4f9f578/src/clojure/sparkling/sql/types.clj | clojure | The list of types supported by spark | (ns sparkling.sql.types
"allows for creation of dataframes from an existing rdd, steps:
1. turn rdd into rows using create row
2. create struct type passing in representation of the schema
3. pass rdd of rows and struct type to sparkling.sql/data-frame"
(:import [org.apache.spark.sql.types DataTypes]
... |
5ca493fdd3a18182459a0f27deb39c2f73724f6e6e350675d6acd312f324ee7a | racket/typed-racket | safe-vector.rkt | #lang typed/racket/base #:with-refinements
(require typed/racket/unsafe
racket/unsafe/ops)
(provide (all-defined-out))
(: safe-vector-ref (All (A) (-> ([v : (Vectorof A)]
[n : Natural])
#:pre (v n) (< n (vector-length v))
... | null | https://raw.githubusercontent.com/racket/typed-racket/0236151e3b95d6d39276353cb5005197843e16e4/typed-racket-test/succeed/safe-vector.rkt | racket | #lang typed/racket/base #:with-refinements
(require typed/racket/unsafe
racket/unsafe/ops)
(provide (all-defined-out))
(: safe-vector-ref (All (A) (-> ([v : (Vectorof A)]
[n : Natural])
#:pre (v n) (< n (vector-length v))
... | |
c450920e187558292e3f11127fafa3e3f1255e8bd59b86266cacab30ac4c0044 | richardharrington/robotwar | shell.clj | (ns robotwar.shell
(:use [robotwar.constants])
(:require [robotwar.physics :as physics]))
(defn init-shell
[pos-x pos-y aim id distance]
; TODO: make the starting point dependent upon the robot radius,
; which should be in constants.
(let [{unit-x :x unit-y :y} (physics/decompose-angle aim)]
{:id id
... | null | https://raw.githubusercontent.com/richardharrington/robotwar/7f826649dd1a141fdacebb30d843773ceb5fee1f/src/robotwar/shell.clj | clojure | TODO: make the starting point dependent upon the robot radius,
which should be in constants. | (ns robotwar.shell
(:use [robotwar.constants])
(:require [robotwar.physics :as physics]))
(defn init-shell
[pos-x pos-y aim id distance]
(let [{unit-x :x unit-y :y} (physics/decompose-angle aim)]
{:id id
:pos-x pos-x
:pos-y pos-y
:v-x (* unit-x SHELL-SPEED)
:v-y (* unit-y SHELL-SPEED)
... |
9f68b0764df4ce716da1963c51284c60f1bcdfb06cdaef1502b95616d0c9a141 | atlas-engineer/nyxt | file-manager.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(nyxt:define-package :nyxt/file-manager-mode
(:documentation "Mode for file management from the prompt buffer."))
(in-package :nyxt/file-manager-mode)
(nyxt/prompt-buffer-mode::define-command-prompt directory-up (prompt... | null | https://raw.githubusercontent.com/atlas-engineer/nyxt/8d71ac1917d45da4d8ab500e5bdc2d1df4d5e68e/source/mode/file-manager.lisp | lisp | -US/docs/Web/Media/Formats/Image_types
and -US/docs/Web/Media/Formats/Containers
Images.
Audio.
Video.
TODO: Allow `data-path's?
Open the rest of the files in new buffers unconditionally.
TODO: File/directory copying.
We can probably signal something and display a notification. | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(nyxt:define-package :nyxt/file-manager-mode
(:documentation "Mode for file management from the prompt buffer."))
(in-package :nyxt/file-manager-mode)
(nyxt/prompt-buffer-mode::define-command-prompt directory-up (prompt... |
dd2d4dfa274d705ca5f96fee58901c795dfb20b8a02527cbb59c525607e837ad | runtimeverification/haskell-backend | InternalString.hs | |
Copyright : ( c ) Runtime Verification , 2018 - 2021
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2018-2021
License : BSD-3-Clause
-}
module Kore.Simplify.InternalString (
simplify,
) where
import Kore.Internal.InternalString
import Kore.Internal.OrPattern (
OrPattern,... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/b06757e252ee01fdd5ab8f07de2910711997d845/kore/src/Kore/Simplify/InternalString.hs | haskell | |
Copyright : ( c ) Runtime Verification , 2018 - 2021
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2018-2021
License : BSD-3-Clause
-}
module Kore.Simplify.InternalString (
simplify,
) where
import Kore.Internal.InternalString
import Kore.Internal.OrPattern (
OrPattern,... | |
a6d6275ab59572238ce6b23e53fc49cfbe2a57f84d608afd39af94389cbb411e | NorfairKing/smos | Type.hs | # LANGUAGE CPP #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -fno - warn - orphans #
module Smos.Calendar.Import.RecurrenceRule.Type where
import Autodocodec
import Data.Aeson ... | null | https://raw.githubusercontent.com/NorfairKing/smos/cf1669f353dce8c5d5fc2f378a89a9bc945f3f0b/smos-calendar-import/src/Smos/Calendar/Import/RecurrenceRule/Type.hs | haskell | # LANGUAGE OverloadedStrings #
| A recurrence rule
= Definition
#section-3.3.10
There is more info about how they are used in section 3.8.5.3: "Recurrence rules"
#section-3.8.5.3
Do not even _think_ about modifying this code unless you have read these
parts of the spec.
Purpose: This value type is used to ... | # LANGUAGE CPP #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -fno - warn - orphans #
module Smos.Calendar.Import.RecurrenceRule.Type where
import Autodocodec
import Data.Aeson (FromJSON, ToJSON)
import Data.List... |
d6763a5f89409a871a8005dca7ed214908692e2409f84bd40c9e0d61e2692b96 | S8A/htdp-exercises | ex259.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname ex259) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex259.rkt | racket | about the language level of this file in a form that our tools can easily process.
A Word is a [List-of 1String]
A Dictionary is a [List-of Strings].
– "a"
– ...
– "z"
or, equivalently, a member? of this list:
String -> [List-of String]
finds all words that the letters of some given word spell
The dictionar... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname ex259) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp") (lib "web-io.rkt" ... |
993b65ccd525f3639ff9c010e7cd1c1d26636f15d070a4715fbbcff6071f5e23 | koji-kojiro/cl-repl | inspector.lisp | (in-package :cl-repl)
(defvar *inspected*)
(defvar *inspect-elements*)
(defvar *inspect-named-p*)
(defvar *inspector-state*)
(defvar *inspector-redisplay-banner*)
(defparameter *inspector-flush-screen* nil)
(defun inspector-banner ()
(when *inspector-flush-screen* (flush-screen))
(with-cursor-hidden
#+sbcl
... | null | https://raw.githubusercontent.com/koji-kojiro/cl-repl/bfd1521f856a9f8020611e8d8b34634fe75fbbc8/src/inspector.lisp | lisp | (in-package :cl-repl)
(defvar *inspected*)
(defvar *inspect-elements*)
(defvar *inspect-named-p*)
(defvar *inspector-state*)
(defvar *inspector-redisplay-banner*)
(defparameter *inspector-flush-screen* nil)
(defun inspector-banner ()
(when *inspector-flush-screen* (flush-screen))
(with-cursor-hidden
#+sbcl
... | |
7719da400877e0b214a43eeebea8db0f74b765dc579801e423704574037e5763 | akapav/js | translate.lisp | (in-package :cl-js)
(defvar *scope* ())
(defparameter *label-name* nil)
(defvar *break* ())
(defvar *continue* ())
(defvar *symbol-table*)
(defun as-sym (name)
(or (gethash name *symbol-table*)
(setf (gethash name *symbol-table*) (make-symbol name))))
(defgeneric lookup-variable (name scope rest))
(defgeneri... | null | https://raw.githubusercontent.com/akapav/js/5ffa5e9d113f2000bbbdccda634f09e272b1983d/translate.lisp | lisp | TODO hasOwnProperty?
These handle their own label
Used in ,@
These should be caught by parser. This is just a sanity check.
Don't enter inner functions
Don't enter inner functions
TODO sane object init
Make sure the argument list covers at least the named args
Hack to join 'a' + 'b' + 'c' into a single concate... | (in-package :cl-js)
(defvar *scope* ())
(defparameter *label-name* nil)
(defvar *break* ())
(defvar *continue* ())
(defvar *symbol-table*)
(defun as-sym (name)
(or (gethash name *symbol-table*)
(setf (gethash name *symbol-table*) (make-symbol name))))
(defgeneric lookup-variable (name scope rest))
(defgeneri... |
303bd962e39bf3ca518c695b50e7d4ef3a2928633e625201ff64c0cac517de0e | agda/agda | Empty.hs | -- | An empty type with some useful instances.
module Agda.Utils.Empty where
import Control.DeepSeq
import Control.Exception (evaluate)
import Agda.Utils.Impossible
data Empty
-- | Values of type 'Empty' are not forced, because 'Empty' is used as
-- a constructor argument in 'Agda.Syntax.Internal.Substitution''.
... | null | https://raw.githubusercontent.com/agda/agda/b48ac5ea21150e6d98811d884e44814e1ba557dc/src/full/Agda/Utils/Empty.hs | haskell | | An empty type with some useful instances.
| Values of type 'Empty' are not forced, because 'Empty' is used as
a constructor argument in 'Agda.Syntax.Internal.Substitution''.
| @toImpossible e@ extracts the @Impossible@ value raised via
catching the exception.
this should never happen | module Agda.Utils.Empty where
import Control.DeepSeq
import Control.Exception (evaluate)
import Agda.Utils.Impossible
data Empty
instance NFData Empty where
rnf _ = ()
instance Eq Empty where
_ == _ = True
instance Ord Empty where
compare _ _ = EQ
instance Show Empty where
showsPrec p _ = showParen (p ... |
754a35c285adcdba2ade0c95c7373561760ef6d3f6dfb4945cab1d3729e74c5a | bmeurer/ocamljit2 | marshal.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/stdlib/marshal.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1997 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ Id$
type extern_flags =
No_sha... |
af434f96ffe2635ae35226c9b195b6fa0c45fb11ad239bb6c6de5c66a7fd72f2 | RBornat/jape | paraparam.ml |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
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 ver... | null | https://raw.githubusercontent.com/RBornat/jape/afe9f207e89e965636b43ef8fad38fd1f69737ae/distrib/camlengine/paraparam.ml | ocaml | ABSTRACTION P |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
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 ver... |
c0e2353d37ba8159b0344af3004c0a2f0ad1d7955b1e5515a144515884712cd6 | philschonholzer/co2db | Average.hs | module Application.Helper.Average (average) where
import Data.Foldable
import Data.Semigroup
import IHP.Prelude
data Average n = Average {length :: !Int, sum :: !n}
averageDatum :: n -> Average n
averageDatum n = Average 1 n
getAverage :: (Num n, Fractional n) => Average n -> Maybe n
getAverage (Average l n) =
if... | null | https://raw.githubusercontent.com/philschonholzer/co2db/ce153fd9d51f4a159395dd679de17cdeeec1ba94/Application/Helper/Average.hs | haskell | module Application.Helper.Average (average) where
import Data.Foldable
import Data.Semigroup
import IHP.Prelude
data Average n = Average {length :: !Int, sum :: !n}
averageDatum :: n -> Average n
averageDatum n = Average 1 n
getAverage :: (Num n, Fractional n) => Average n -> Maybe n
getAverage (Average l n) =
if... | |
e8eb41482da80ced57439c8219de7085e8170f037ad91a43bacbb8f32f47131f | stolen/dysdav | dys_time.erl | -module(dys_time).
-export([now/0, unique/0]).
-compile({no_auto_import, [{now, 0}]}).
now() ->
{Mega, Sec, Micro} = os:timestamp(),
Mega*1000000000 + Sec*1000 + Micro div 1000.
unique() ->
{Mega, Sec, Micro} = erlang:now(),
Mega*1000000000000 + Sec*1000000 + Micro.
| null | https://raw.githubusercontent.com/stolen/dysdav/17f4f82bec344b275b8481aa921d172276b811df/src/dys_time.erl | erlang | -module(dys_time).
-export([now/0, unique/0]).
-compile({no_auto_import, [{now, 0}]}).
now() ->
{Mega, Sec, Micro} = os:timestamp(),
Mega*1000000000 + Sec*1000 + Micro div 1000.
unique() ->
{Mega, Sec, Micro} = erlang:now(),
Mega*1000000000000 + Sec*1000000 + Micro.
| |
dd29e7ce1b054a14b4033cc7a6062bbbc648194cbea2e33b958a12c3ab024058 | OCamlPro/ez_api | ezCohttp_base.ml | (**************************************************************************)
(* *)
(* Copyright 2018-2023 OCamlPro *)
(* *)
(* All righ... | null | https://raw.githubusercontent.com/OCamlPro/ez_api/5253f7dd8936e923290aa969ee43ebd3dc6fce2d/src/request/ezCohttp_base.ml | ocaml | ************************************************************************
Copyright 2018-2023 OCamlPro
All rights reserved. This ... | GNU Lesser General Public License version 2.1 , with the special
open Lwt.Infix
let meth_of_str = function
| "GET" -> `GET
| "HEAD" -> `HEAD
| "PUT" -> `PUT
| "POST" -> `POST
| "CONNECT" -> `CONNECT
| "PATCH" -> `PATCH
| "TRACE" -> `TRACE
| "DELETE" -> `DELETE
| "OPTIONS" -> `OPTIONS
| s... |
18327a45e18ea47b0dbf90800c5f11599b5aa7e1b327df5f9b620deb37d9e40f | nklein/Woolly | checkbox.lisp |
(in-package #:woolly)
(sheeple:defproto =checkbox= (=button=)
(pushed))
(sheeple:defreply sheeple:init-object :after ((checkbox =checkbox=)
&key (pushed nil pushed-p)
&allow-other-keys)
(when pushed-p
(setf (pushed checkbox) pushed)))
(sheeple:defreply clicked ((checkbox =checkbox=) mo... | null | https://raw.githubusercontent.com/nklein/Woolly/f18b5d5dc28b04e6a194757d7ebc1f03bb6ebd4d/woolly/checkbox.lisp | lisp |
(in-package #:woolly)
(sheeple:defproto =checkbox= (=button=)
(pushed))
(sheeple:defreply sheeple:init-object :after ((checkbox =checkbox=)
&key (pushed nil pushed-p)
&allow-other-keys)
(when pushed-p
(setf (pushed checkbox) pushed)))
(sheeple:defreply clicked ((checkbox =checkbox=) mo... | |
bbd975a394973da59da2b943f549f7726cb1b7989e19c5a1a4e001e7a5c40fa0 | Disco-Dave/message-db | Main.hs | module Main (main) where
import qualified Spec
import System.Timeout (timeout)
import Test.Hspec (around_, hspec, parallel)
import UnliftIO.Exception (throwString)
addTimeout :: IO () -> IO ()
addTimeout specItem = do
result <- timeout 10_000_000 specItem
case result of
Nothing -> throwString "Spec item too... | null | https://raw.githubusercontent.com/Disco-Dave/message-db/b272c1648587046657e778685518a79f27c9f793/message-db/test/Main.hs | haskell | module Main (main) where
import qualified Spec
import System.Timeout (timeout)
import Test.Hspec (around_, hspec, parallel)
import UnliftIO.Exception (throwString)
addTimeout :: IO () -> IO ()
addTimeout specItem = do
result <- timeout 10_000_000 specItem
case result of
Nothing -> throwString "Spec item too... | |
6fe11a7dd70a7ad7152c0dceeb25bf005449b8a08b2b1eb332665639faf2fa2a | manuel-serrano/bigloo | recette.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / api / packrat / recette / recette.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/api/packrat/recette/recette.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* A test module that deploys the examples of packrat. */
*===========================... | * serrano / prgm / project / bigloo / api / packrat / recette / recette.scm * /
* Author : * /
* Creation : Mon Feb 4 14:28:58 2002 * /
* Last change : Mon Apr 20 09:00:20 2009 ( serrano ) * /
* C... |
68b98fe5ee03240708644a09d0a1994ecde1b7c772fd47deeb12725add987013 | Chris00/ocaml-curve-sampling | osc.ml |
let pi = acos(-1.)
let () =
let f x = if x = 0. then 0. else x *. sin (1. /. x) in
let xmin = -0.4 and xmax = 0.4 in
let t0 = Curve_sampling.uniform f xmin xmax ~n:1000 in
Curve_sampling.to_file t0 "osc0.dat";
let t = Curve_sampling.fn f xmin xmax ~n:227 in
Curve_sampling.to_file t "osc227.dat";
let t =... | null | https://raw.githubusercontent.com/Chris00/ocaml-curve-sampling/355b207c4c161152b84ab0cf42edb594fc913266/tests/osc.ml | ocaml |
let pi = acos(-1.)
let () =
let f x = if x = 0. then 0. else x *. sin (1. /. x) in
let xmin = -0.4 and xmax = 0.4 in
let t0 = Curve_sampling.uniform f xmin xmax ~n:1000 in
Curve_sampling.to_file t0 "osc0.dat";
let t = Curve_sampling.fn f xmin xmax ~n:227 in
Curve_sampling.to_file t "osc227.dat";
let t =... | |
1bc604efccf83d3f293c853a876fd9388011830de68225ba387d8e8a577dcd66 | ghc/testsuite | tc228.hs | # LANGUAGE ExistentialQuantification #
-- Without a type sig this is slightly tricky.
See Trac # 1430
-- Reason: we get an implication constraint (forall a. Typeable a => Typeable b),
when generalising unExTypeable . We want to infer a context for the
-- whole thing of (Typeable b).
-- See Note [Inference and i... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_compile/tc228.hs | haskell | Without a type sig this is slightly tricky.
Reason: we get an implication constraint (forall a. Typeable a => Typeable b),
whole thing of (Typeable b).
See Note [Inference and implication constraints] in TcSimplify
unExTypeable :: Typeable h => ExTypeable -> Maybe h | # LANGUAGE ExistentialQuantification #
See Trac # 1430
when generalising unExTypeable . We want to infer a context for the
module Foo where
import Data.Typeable
data ExTypeable = forall a. Typeable a => ExTypeable a
unExTypeable (ExTypeable a) = cast a
|
c9956f791f473c728473350fdbcea1231df2e30d9e3291588cc0f7c5cf7c5fc6 | dwayne/eopl3 | senv.test.rkt | #lang racket
(require "./senv.rkt")
(require rackunit)
(let ([senv (extend-senv
'd
(extend-senv
'y
(extend-senv
'x
(extend-senv
'y
(empty-senv)))))])
(check-eq? (apply-senv senv 'd) 0)
(check-eq? ... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/03-ch3/interpreters/racket/NAMELESS-PROC-3.42-ATTEMPT-1/senv.test.rkt | racket | #lang racket
(require "./senv.rkt")
(require rackunit)
(let ([senv (extend-senv
'd
(extend-senv
'y
(extend-senv
'x
(extend-senv
'y
(empty-senv)))))])
(check-eq? (apply-senv senv 'd) 0)
(check-eq? ... | |
f79fa09c2da159e7dfc702f0732693ceac39a6cf8c1ef02ca392daab00a95c10 | kunstmusik/music-examples | example2_basic.clj | (ns music-examples.example2-basic
(:require [pink.simple :refer :all]
[pink.io.midi :refer :all]
[pink.config :refer :all]
[pink.space :refer :all]
[pink.oscillators :refer :all]
[pink.envelopes :refer [env xar]]
[pink.filters :refer :all]
... | null | https://raw.githubusercontent.com/kunstmusik/music-examples/6d0410be272d0b86c1851e943c07515af37e5f7a/src/music_examples/example2_basic.clj | clojure | Example 2 - Basic Engine Use - Add/Remove Audio Functions
Basic MIDI Keyboard
Create a Pink MIDI Manager
Register a virtual device
Instrument function
Bind key event function to virtual device
On note on, create a saw function, record it in the active array
by key number, then add it to the engine
<= add-afunc... | (ns music-examples.example2-basic
(:require [pink.simple :refer :all]
[pink.io.midi :refer :all]
[pink.config :refer :all]
[pink.space :refer :all]
[pink.oscillators :refer :all]
[pink.envelopes :refer [env xar]]
[pink.filters :refer :all]
... |
e372b74de826eb73e7b208804bc5e97242a5032b362c184b516080657b7c0ece | nikita-volkov/rerebase | Writer.hs | module Control.Monad.Trans.Writer
(
module Rebase.Control.Monad.Trans.Writer
)
where
import Rebase.Control.Monad.Trans.Writer
| null | https://raw.githubusercontent.com/nikita-volkov/rerebase/25895e6d8b0c515c912c509ad8dd8868780a74b6/library/Control/Monad/Trans/Writer.hs | haskell | module Control.Monad.Trans.Writer
(
module Rebase.Control.Monad.Trans.Writer
)
where
import Rebase.Control.Monad.Trans.Writer
| |
2354d30e8e8860ab8de7df5841280f63296a6a7137c9b913cb842ddc882ecd28 | phoe/safe-read | safe-read.lisp | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; SAFE-READ
" phoe " Herda 2016
;;;; safe-read.lisp
;; Lisp reader hackery below. Beware.
(in-package #:safe-read)
;; Exported conditions and parameters
(define-condition incomplete-input () ())
(define-condition malformed-input (error) ())
(defin... | null | https://raw.githubusercontent.com/phoe/safe-read/b5d9a7804ed392b24fc7fad9fd4a5207999013cc/safe-read.lisp | lisp |
SAFE-READ
safe-read.lisp
Lisp reader hackery below. Beware.
Exported conditions and parameters
Utility functions
Buffers for streams
Utility macro - temporary packages
Utility macro - creating a safe readtable at compile-time
Main exported function
Handler-case and macro-wrapper for safe reading
Safe read -... | " phoe " Herda 2016
(in-package #:safe-read)
(define-condition incomplete-input () ())
(define-condition malformed-input (error) ())
(define-condition input-size-exceeded (error) ())
(defvar *max-input-size* (* 128 1024))
(defun condition-key (condition)
(intern (string (type-of condition)) (find-package :k... |
253026809539bf60fa1ab8ebc051d99f6664daa31b86bf3419c3b697edeb00e3 | Vaguery/klapaucius | general.clj | (ns push.util.general)
(defn extract-keyword-argument
"Helper function (for use in macros) that parses argument lists specified by keyword.
Returns the specified keyword variable, if any; returns nil otherwise."
[kwd args]
(second (drop-while (complement #{kwd}) args)))
(defn extract-docstring
"Helper func... | null | https://raw.githubusercontent.com/Vaguery/klapaucius/17b55eb76feaa520a85d4df93597cccffe6bdba4/src/push/util/general.clj | clojure | returns nil otherwise."
returns nil otherwise" | (ns push.util.general)
(defn extract-keyword-argument
"Helper function (for use in macros) that parses argument lists specified by keyword.
[kwd args]
(second (drop-while (complement #{kwd}) args)))
(defn extract-docstring
"Helper function (for use in macros) that extracts a string if it's the second
[args... |
066fa720a173d0cd08b4d2823795a5e3c6b371a2501022388a32feef94fe9572 | reynir/ocaml-ssh-agent | test.ml | let with_faraday (f : Faraday.t -> unit) : string =
let buf = Faraday.create 1024 in
f buf;
Faraday.serialize_to_string buf
module Request : Alcotest.TESTABLE with type t = Ssh_agent.any_ssh_agent_request = struct
type t = Ssh_agent.any_ssh_agent_request
let pp fmt (_t : Ssh_agent.any_ssh_agent_request) =
... | null | https://raw.githubusercontent.com/reynir/ocaml-ssh-agent/574cf846d52c061efae20a238209ce25327ceb51/test/test.ml | ocaml | FIXME: unordered list
FIXME: unordered list in the constraints
FIXME: unordered list in the constraints
You should probably never write an extension like this | let with_faraday (f : Faraday.t -> unit) : string =
let buf = Faraday.create 1024 in
f buf;
Faraday.serialize_to_string buf
module Request : Alcotest.TESTABLE with type t = Ssh_agent.any_ssh_agent_request = struct
type t = Ssh_agent.any_ssh_agent_request
let pp fmt (_t : Ssh_agent.any_ssh_agent_request) =
... |
650232f0b96c4a4e039944ac66efcdd0d79f87cc8bb741eb7093d9b2d0dd190a | sboehler/beans | VIAC.hs | module Beans.Import.CH.VIAC (parse) where
import qualified Beans.Account as Account
import Beans.Command (Command (CmdPrice))
import Beans.Commodity (Commodity (Commodity))
import Beans.Date (Date)
import qualified Beans.Import.Common as Common
import Beans.Price (Price (Price))
import qualified Data.Aeson as A
import... | null | https://raw.githubusercontent.com/sboehler/beans/897fc30a602f49906eb952c4fd5c8c0bf05a6beb/src/Beans/Import/CH/VIAC.hs | haskell | module Beans.Import.CH.VIAC (parse) where
import qualified Beans.Account as Account
import Beans.Command (Command (CmdPrice))
import Beans.Commodity (Commodity (Commodity))
import Beans.Date (Date)
import qualified Beans.Import.Common as Common
import Beans.Price (Price (Price))
import qualified Data.Aeson as A
import... | |
6ab37e220dedb0aeca81ced46d151137d1fab5650dcd23487f32e0f02cc9f462 | ermine/xmpp | xmpp_prep.ml | open Xmpp_prep_tables
exception Error of string
let rec get_bst arr x s e =
if s > e || x < Array.unsafe_get (Array.unsafe_get arr s) 0 ||
x > Array.unsafe_get (Array.unsafe_get arr e) 1 then
-1
else
let mid = s + (e-s)/2 in
let amid = Array.unsafe_get arr mid in
if x < Array.unsafe_get am... | null | https://raw.githubusercontent.com/ermine/xmpp/85f31c5aaac6e3b5042694ff33ac8afdfb845c06/src/xmpp_prep.ml | ocaml | if neither case was true
Check prohibited symbols and bidi
for domains | open Xmpp_prep_tables
exception Error of string
let rec get_bst arr x s e =
if s > e || x < Array.unsafe_get (Array.unsafe_get arr s) 0 ||
x > Array.unsafe_get (Array.unsafe_get arr e) 1 then
-1
else
let mid = s + (e-s)/2 in
let amid = Array.unsafe_get arr mid in
if x < Array.unsafe_get am... |
3c5807de4b08c48bf00ee2ac670585bce0f42d1668dcdf113d4e329d5c2d9e7c | thobbs/genartlib | util_test.clj | (ns genartlib.util-test
(:require
[clojure.test :refer [deftest is]]
[genartlib.util :as u]))
(deftest test-in?
(is (u/in? [1 2 3] 2))
(is (u/in? '(1 2 3) 2))
(is (u/in? #{1 2 3} 2))
(is (not (u/in? [] 4)))
(is (not (u/in? [1 2 3] 4)))
(is (not (u/in? '(1 2 3) 4)))
(is (not (u/in? #{1 2 3} 4))... | null | https://raw.githubusercontent.com/thobbs/genartlib/032f685b326ef56235e1dc1198cacf02264d3c39/test/genartlib/util_test.clj | clojure | (ns genartlib.util-test
(:require
[clojure.test :refer [deftest is]]
[genartlib.util :as u]))
(deftest test-in?
(is (u/in? [1 2 3] 2))
(is (u/in? '(1 2 3) 2))
(is (u/in? #{1 2 3} 2))
(is (not (u/in? [] 4)))
(is (not (u/in? [1 2 3] 4)))
(is (not (u/in? '(1 2 3) 4)))
(is (not (u/in? #{1 2 3} 4))... | |
98ca6e3240bec16d0bada57faf4968f22c1c0f532a9764e924ceb0edd58bafa9 | Helium4Haskell/Top | StateFix.hs | # LANGUAGE UndecidableInstances , FlexibleInstances , MultiParamTypeClasses #
-----------------------------------------------------------------------------
-- | License : GPL
--
-- Maintainer :
-- Stability : provisional
-- Portability : non-portable (requires extensions)
------------------------... | null | https://raw.githubusercontent.com/Helium4Haskell/Top/5e900184d6b2ab6d7ce69945287d782252e5ea68/src/Top/Monad/StateFix.hs | haskell | ---------------------------------------------------------------------------
| License : GPL
Maintainer :
Stability : provisional
Portability : non-portable (requires extensions)
---------------------------------------------------------------------------
To satisfy the 7.10.x proposal:
Back... | # LANGUAGE UndecidableInstances , FlexibleInstances , MultiParamTypeClasses #
module Top.Monad.StateFix
( module Top.Monad.StateFix
, module Control.Monad.State
) where
import Control.Monad.State
import Control.Monad.Identity
import Control.Monad.Writer
import Control . Applicative
type StateFix s = StateF... |
630e227fffbfe9b95039bbae950c775df3a516f2207c35d1b41c7c6d7e32c62f | fujita-y/ypsilon | base.scm | Copyright ( c ) 2004 - 2022 Yoshikatsu Fujita / LittleWing Company Limited .
;;; See LICENSE file for terms and conditions of use.
(define expand-lambda
(lambda (form env)
(cond ((> (safe-length form) 2)
(let ((vars (collect-lambda-formals (cadr form) form)))
(let* ((suffix (fresh-renam... | null | https://raw.githubusercontent.com/fujita-y/ypsilon/44260d99e24000f9847e79c94826c3d9b76872c2/heap/boot/macro/base.scm | scheme | See LICENSE file for terms and conditions of use. | Copyright ( c ) 2004 - 2022 Yoshikatsu Fujita / LittleWing Company Limited .
(define expand-lambda
(lambda (form env)
(cond ((> (safe-length form) 2)
(let ((vars (collect-lambda-formals (cadr form) form)))
(let* ((suffix (fresh-rename-count))
(renames (map cons vars ... |
58a7e02d819ebb653c5f0c64e65d5d623493c288b3ecdd0b7a8fc5edce16049e | backtracking/functory | main.ml | (**************************************************************************)
(* *)
(* Functory: a distributed computing library for OCaml *)
Copyright ( C ) 2010- and
(* ... | null | https://raw.githubusercontent.com/backtracking/functory/75368305a853a90ebea9e306d82e4ef32649d1ce/tests/n-queens/main.ml | ocaml | ************************************************************************
Functory: a distributed computing library for OCaml
This software is free soft... | Copyright ( C ) 2010- and
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
let () = Functory.Control.set_debug true
open Functory . Sequential
open Functory.Cores
let () = set_number_of_cores 3
open F... |
acc8976617c3ec0702139cd89ebf4c0cb3d8ad888cd12a38e9ad8cd18554c7a0 | rurban/clisp | input.lisp | -*- Mode : LISP ; Syntax : Common - lisp ; Package : XLIB ; Base : 10 ; Lowercase : Yes -*-
This file contains definitions for the DISPLAY object for Common - Lisp X windows version 11
;;;
TEXAS INSTRUMENTS INCORPORATED
;;; P.O. BOX 2909
AUSTIN , TEXAS 78769
;;;
Copyright ( C ) 1987 Texas I... | null | https://raw.githubusercontent.com/rurban/clisp/75ed2995ff8f5364bcc18727cde9438cca4e7c2c/modules/clx/mit-clx/input.lisp | lisp | Syntax : Common - lisp ; Package : XLIB ; Base : 10 ; Lowercase : Yes -*-
P.O. BOX 2909
Permission is granted to any individual or institution to use, copy, modify,
and distribute this software, provided that this complete copyright and
permission notice is maintained, intact, in all copies and supporting
... |
This file contains definitions for the DISPLAY object for Common - Lisp X windows version 11
TEXAS INSTRUMENTS INCORPORATED
AUSTIN , TEXAS 78769
Copyright ( C ) 1987 Texas Instruments Incorporated .
Texas Instruments Incorporated provides this software " as is " without
(in-package :xlib)
(e... |
bdf68889a0034165139fd2be9adbdd4edf97a6f7e71bad170f7620beca03f0cc | heyarne/airsonic-ui | test_helpers.cljs | (ns airsonic-ui.test-helpers)
(defn dispatches?
"Helper to see whether an event is dispatched in a coeffect; `ev` can either
be a whole vector or a keyword which is interpreted as the event name."
[cofx ev]
(let [all-events (conj (get cofx :dispatch-n []) (:dispatch cofx))]
(boolean (some #(= ev (if (vecto... | null | https://raw.githubusercontent.com/heyarne/airsonic-ui/7adb03d6e2ba0ff764796a57b7e87f62b242c9b7/test/cljs/airsonic_ui/test_helpers.cljs | clojure | `ev` can either | (ns airsonic-ui.test-helpers)
(defn dispatches?
be a whole vector or a keyword which is interpreted as the event name."
[cofx ev]
(let [all-events (conj (get cofx :dispatch-n []) (:dispatch cofx))]
(boolean (some #(= ev (if (vector? ev) % (first %))) all-events))))
(defn rand-str
"Generates a random strin... |
efa6f465ab523819bbb7b6af27971903e9b55357f535a51f71afbe15d93e9a19 | tweag/asterius | cgrun069.hs | # LANGUAGE MagicHash , GHCForeignImportPrim , UnliftedFFITypes #
module Main where
import GHC.Exts
import Control.Exception
import System.IO
foreign import prim "memintrinTest" basicTest :: Int# -> Int#
foreign import prim "testMemset8_0" testMemset8_0 :: Int# -> Int#
foreign import prim "testMemset8_8" testMemset8_... | null | https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/ghc-testsuite/codeGen/cgrun069.hs | haskell | # LANGUAGE MagicHash , GHCForeignImportPrim , UnliftedFFITypes #
module Main where
import GHC.Exts
import Control.Exception
import System.IO
foreign import prim "memintrinTest" basicTest :: Int# -> Int#
foreign import prim "testMemset8_0" testMemset8_0 :: Int# -> Int#
foreign import prim "testMemset8_8" testMemset8_... | |
f27b9be101860a2e311931ca62b6b89370497a61a968f8609427b849b2653ff9 | WorksHub/client | components.cljc | (ns wh.search.components
(:refer-clojure :exclude [atom])
(:require #?(:cljs [wh.pages.core :as pages])
[re-frame.core :refer [dispatch]]
[wh.components.side-card.components :as c]
[wh.components.skeletons.components :as skeletons]
[wh.components.tag :as tag]
... | null | https://raw.githubusercontent.com/WorksHub/client/77e4212a69dad049a9e784143915058acd918982/common-pages/src/wh/search/components.cljc | clojure | our main application div has id "app". id "app" is used here so when you click
on "All", it scrolls to top of application | (ns wh.search.components
(:refer-clojure :exclude [atom])
(:require #?(:cljs [wh.pages.core :as pages])
[re-frame.core :refer [dispatch]]
[wh.components.side-card.components :as c]
[wh.components.skeletons.components :as skeletons]
[wh.components.tag :as tag]
... |
d6c2b8f0d7964a778359a127ffe5361feedb5fc8b6d2c9818122defbf7dc9ec4 | TrustInSoft/tis-kernel | pdg_state.ml | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/pdg/pdg_state.ml | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
5805f92dc447873c61b09b2504d1ab6d5e470c88d6662de16d04617e44fcfe34 | coot/ghc-tags-plugin | CTag.hs | {-# LANGUAGE GADTs #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
module Test.CTag (tests) where
import qualified Data.Attoparsec.ByteString.Char8 as AChar
import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Char8 as BS.Char8
import qualified Data.Byt... | null | https://raw.githubusercontent.com/coot/ghc-tags-plugin/9e3005b676e03c6102c29fd6e8539d4053571e53/ghc-tags-test/test/Test/CTag.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
the 'roundTripProp' property holds only for normalised paths
we are generating `TagLineCol` even though they are not present
in ctag files; The roundTrip property will check if the address
Header generator
|
module Test.CTag (tests) where
import qualified Data.Attoparsec.ByteString.Char8 as AChar
import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Char8 as BS.Char8
import qualified Data.ByteString.Lazy as BL
import Data.Text (Text)
import qualified Data.Text as Text
import qualified ... |
ec15cedae90b04a44f781751514275db033e890b0c6e17e0128500917c23ac67 | nd/bird | 8.1.3.hs | 1. isEmpty empty = True
isEmptyc emptyc =
{def emptyc}
isEmptyc [] =
{def isEmptyc, def null}
True
2. isEmpty (join x xq) = False
isEmptyc (joinc x xq) =
{def joinc}
isEmptyc xq ++ [x] =
{def isEmptyc, def null}
False
3. isEmpty (join x undefined) = undef... | null | https://raw.githubusercontent.com/nd/bird/06dba97af7cfb11f558eaeb31a75bd04cacf7201/ch08/8.1.3.hs | haskell | 1. isEmpty empty = True
isEmptyc emptyc =
{def emptyc}
isEmptyc [] =
{def isEmptyc, def null}
True
2. isEmpty (join x xq) = False
isEmptyc (joinc x xq) =
{def joinc}
isEmptyc xq ++ [x] =
{def isEmptyc, def null}
False
3. isEmpty (join x undefined) = undef... | |
e01da2c9a3f165e46da9730671a9c5700ba0d67d0d6ab4afd6dc38c59c4fc60b | ocamllabs/ocaml-modular-implicits | boxedints.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/basic/boxedints.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 2000 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
Test the types nativeint , int32 , in... |
f09a9bed984cf3f5bf2712a3e28033b5f725b64d4ed6bc192475ae8a82c1857c | johnlawrenceaspden/hobby-code | test.clj | (require 'clojure.test)
(is (= (* 4 4) 16)) | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/maven_uber_project/src/test/clojure/test.clj | clojure | (require 'clojure.test)
(is (= (* 4 4) 16)) | |
9fde4f42481b49d43306ad9367431825265822564901c9c58396124fcb896817 | archhaskell/cblrepo | BuildPkgs.hs |
- Copyright 2011 Per
-
- 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... | null | https://raw.githubusercontent.com/archhaskell/cblrepo/83316afca397b1e5e526a69d360efd9cb260921b/src/BuildPkgs.hs | haskell |
- Copyright 2011 Per
-
- 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... | |
e9d771f3709b9bd0196b1558982a97c6efb27911e5aa580e623a6bfd2f0f0e89 | brandonbloom/proact | state.cljc | (ns proact.render.state
(:refer-clojure :exclude [get])
(:require [proact.render.loop :as loop]))
(defonce global
(add-watch (atom {}) ::watch (fn [& _] (loop/trigger!))))
(defn get [id]
(@global id))
(def left-merge (partial merge-with (fn [x _] x)))
(defn init! [id state]
((swap! global update id left-m... | null | https://raw.githubusercontent.com/brandonbloom/proact/bb4f9e4b316316c93e4f751c47112ba5307e1fd0/src/proact/render/state.cljc | clojure | (ns proact.render.state
(:refer-clojure :exclude [get])
(:require [proact.render.loop :as loop]))
(defonce global
(add-watch (atom {}) ::watch (fn [& _] (loop/trigger!))))
(defn get [id]
(@global id))
(def left-merge (partial merge-with (fn [x _] x)))
(defn init! [id state]
((swap! global update id left-m... | |
692453d44ad543d22ecc97b113657e1252967b3eeca12987d224b3074f234d3f | atgreen/red-light-green-light | util.lisp | -*- Mode : LISP ; Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : POSTMODERN ; -*-
(in-package :postmodern)
(defun make-keyword (name)
(values (intern (string-upcase name) "KEYWORD")))
(defun valid-sql-character-p (chr)
"Returns t if chr is letter, underscore, digits or dollar sign"
(or (uax-15:unicode-... | null | https://raw.githubusercontent.com/atgreen/red-light-green-light/f067507721bbab4aa973866db5276c83df3e8784/local-projects/postmodern-20220220-git/postmodern/util.lisp | lisp | Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : POSTMODERN ; -*-
Databases
See namespace.lisp
Sequences
Types
Tables
create table can only be done either using a deftable approach or s-sql
Columns
"
"
Views
Functions
Indices
Keys
Constraints
"
Triggers
Misc that need to be reorganized
\"" | (in-package :postmodern)
(defun make-keyword (name)
(values (intern (string-upcase name) "KEYWORD")))
(defun valid-sql-character-p (chr)
"Returns t if chr is letter, underscore, digits or dollar sign"
(or (uax-15:unicode-letter-p chr)
(digit-char-p chr)
(eq chr #\_)
(eq chr #\$)))
(defun code... |
44b40afe215301e56dff170a8e6558d1e32d14717c162f5511c8903eb9ee897f | pangloss/pattern | util.clj | (ns pattern.util
(:require [clojure.zip :as zip]
[clojure.set :as set]
[clojure.walk :as walk])
(:import [clojure.lang IMeta IObj]))
(defn listy?
"Returns true if x is any kind of list except a vector."
[x]
(and (sequential? x) (not (vector? x))))
(defn ints?
"Return true if x is a... | null | https://raw.githubusercontent.com/pangloss/pattern/e17f241b7053dc026eceeff9db76bfacd08cfc6a/src/pattern/util.clj | clojure | I assume records maintain or update their metadata correctly: | (ns pattern.util
(:require [clojure.zip :as zip]
[clojure.set :as set]
[clojure.walk :as walk])
(:import [clojure.lang IMeta IObj]))
(defn listy?
"Returns true if x is any kind of list except a vector."
[x]
(and (sequential? x) (not (vector? x))))
(defn ints?
"Return true if x is a... |
39306f27e66b0848e38551096695df0253e660d79febbf72b878209e6c9571d1 | JoelSanchez/ventas | indexing.clj | (ns ventas.search.indexing
(:require
[ventas.common.utils :as common.utils]
[ventas.database.entity :as entity]
[ventas.utils :as utils]
[ventas.search :as search]
[datomic.api :as d]
[ventas.search.schema :as search.schema]
[ventas.database :as db]
[mount.core :refer [defstate]]
[clojure.s... | null | https://raw.githubusercontent.com/JoelSanchez/ventas/dc8fc8ff9f63dfc8558ecdaacfc4983903b8e9a1/src/clj/ventas/search/indexing.clj | clojure | Does transformations depending on the entity type
Changes :db/id to :document/id, as that's what the indexer expects
product.taxonomy/keyword -> product__taxonomy/keyword | (ns ventas.search.indexing
(:require
[ventas.common.utils :as common.utils]
[ventas.database.entity :as entity]
[ventas.utils :as utils]
[ventas.search :as search]
[datomic.api :as d]
[ventas.search.schema :as search.schema]
[ventas.database :as db]
[mount.core :refer [defstate]]
[clojure.s... |
aca74292942f006c7b67b8d3f4e85418d5b0a0372a790cb455c76cf9e20e82a7 | realworldocaml/book | test.ml | type r = Neg | Pos | Zero
let equal w a b = match w with
| Zero -> a = 0 && b = 0
| Neg -> a < 0 && b < 0
| Pos -> a > 0 && b > 0
let of_expected = function
| 0 -> Zero | n -> if n < 0 then Neg else Pos
let value w = Alcotest.testable Fmt.int (equal w)
let be a b expected =
let title = Fmt.str "be %S %S =... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/eqaf/test/test.ml | ocaml | (x / m = q) and (x mod m = r)
exhaustive :-) | type r = Neg | Pos | Zero
let equal w a b = match w with
| Zero -> a = 0 && b = 0
| Neg -> a < 0 && b < 0
| Pos -> a > 0 && b > 0
let of_expected = function
| 0 -> Zero | n -> if n < 0 then Neg else Pos
let value w = Alcotest.testable Fmt.int (equal w)
let be a b expected =
let title = Fmt.str "be %S %S =... |
04bab1bec288c986f47f1a5281726e3b6cbfbb1c1876cecf1cf2ec85096b4e7f | goldfirere/wordle | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Criterion.Main
import Response
-- Our benchmark harness.
main = defaultMain [
bgroup "respond" [ bench "peach/party" $ whnf (respondToGuess "peach") "party"
, bench "aioli/fries" $ whnf (respondToGuess "aioli") "fries"
... | null | https://raw.githubusercontent.com/goldfirere/wordle/f802a66f62b5ea7d4626951be2116ae419d79012/bench/Main.hs | haskell | # LANGUAGE OverloadedStrings #
Our benchmark harness.
whnf = weak head normal form |
module Main where
import Criterion.Main
import Response
main = defaultMain [
bgroup "respond" [ bench "peach/party" $ whnf (respondToGuess "peach") "party"
, bench "aioli/fries" $ whnf (respondToGuess "aioli") "fries"
, bench "bench/patty" $ whnf (respondToGuess "bench") "p... |
0dc7c1067c3337d903916b178a480a5e2d9b158da4b41843a13b8d04bd330f8d | haskell-distributed/distributed-process-platform | Exchange.hs | -----------------------------------------------------------------------------
-- |
-- Module : Control.Distributed.Process.Platform.Execution.Exchange
Copyright : ( c ) 2012 - 2014
-- License : BSD3 (see the file LICENSE)
--
Maintainer : < >
-- Stability : experimental
-- Portability : ... | null | https://raw.githubusercontent.com/haskell-distributed/distributed-process-platform/46d63f81910e7dd527fb1d41e654a5cfb0dbfdba/src/Control/Distributed/Process/Platform/Execution/Exchange.hs | haskell | ---------------------------------------------------------------------------
|
Module : Control.Distributed.Process.Platform.Execution.Exchange
License : BSD3 (see the file LICENSE)
Stability : experimental
Portability : non-portable (requires concurrency)
[Message Exchanges]
The concept of a /m... | Copyright : ( c ) 2012 - 2014
Maintainer : < >
to one or more /consumers/ , depending on the implementation 's semantics .
[ Broadcast Exchanges ]
The broadcast exchange type , started via ' broadcastExchange ' , forward their
is highly optimised for local ( intra - node ) traffic and provides... |
e36ca6067c51b069202d531da107f20a9a04ffdb1270635049746c1bd23fef6f | rbkmoney/erlang_capi_v2 | capi_handler_countries.erl | -module(capi_handler_countries).
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
-behaviour(capi_handler).
-export([prepare/3]).
-import(capi_handler_utils, [general_error/2]).
-import(capi_utils, [unwrap/1]).
-spec prepare(
OperationID :: capi_handler:operation_id(),
Req :: capi_handler:request_dat... | null | https://raw.githubusercontent.com/rbkmoney/erlang_capi_v2/8226a41e05b5cb324241b9880f492d348c973417/apps/capi/src/capi_handler_countries.erl | erlang | -module(capi_handler_countries).
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
-behaviour(capi_handler).
-export([prepare/3]).
-import(capi_handler_utils, [general_error/2]).
-import(capi_utils, [unwrap/1]).
-spec prepare(
OperationID :: capi_handler:operation_id(),
Req :: capi_handler:request_dat... | |
2f9b26efbb796a32860c882b9a8f3ff71bd8022aa1abe6121bebf6c287188a2b | dchelimsky/sicp-exercises | ex-1.33.scm | #lang scheme
(require rackunit)
You can obtain an even more general version of accumulate ( exercise 1.32 ) by introducing the notion of a filter on the terms to be combined . That is , combine only those terms derived from values in the range that satisfy a specified condition . The resulting filtered - accumulate a... | null | https://raw.githubusercontent.com/dchelimsky/sicp-exercises/55c804e3775b87a490e05f8337fc59bc7ce07f28/chapter-1/ex-1.33.scm | scheme | Show how to express the following using filtered-accumulate:
a. the sum of the squares of the prime numbers in the interval a to b (assuming that you have a prime? predicate already written) | #lang scheme
(require rackunit)
You can obtain an even more general version of accumulate ( exercise 1.32 ) by introducing the notion of a filter on the terms to be combined . That is , combine only those terms derived from values in the range that satisfy a specified condition . The resulting filtered - accumulate a... |
2fdca0de7da071cce97f71e832407a76f6743efa4963546f195a92559442b38c | bondy-io/bondy | bondy.erl | %% =============================================================================
%% bondy.erl -
%%
Copyright ( c ) 2016 - 2022 Leapsight . All rights reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You ma... | null | https://raw.githubusercontent.com/bondy-io/bondy/a1267e7e5526db24f278e12315020753f3168b44/apps/bondy/src/bondy.erl | erlang | =============================================================================
bondy.erl -
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... | Copyright ( c ) 2016 - 2022 Leapsight . All rights reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(bondy).
-include_lib("wamp/include/wamp.hrl").
-include("bondy.hrl").
-include("bondy_uris.hrl").
-... |
2844dbafb480265d851a9a33c4b025ac04670da56557a2d896306652605b5da3 | VisionsGlobalEmpowerment/webchange | state.cljs | (ns webchange.admin.pages.classes.state
(:require
[re-frame.core :as re-frame]
[re-frame.std-interceptors :as i]
[webchange.admin.routes :as routes]
[webchange.state.warehouse :as warehouse]))
(def path-to-db :school-classes)
(re-frame/reg-sub
path-to-db
(fn [db]
(get db path-to-db)))
(defn... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/2b14cfa0b116034312a382763e6aebd67e2f25a7/src/cljs/webchange/admin/pages/classes/state.cljs | clojure | :on-edit-teachers-finished [::edit-class-finished school-id] | (ns webchange.admin.pages.classes.state
(:require
[re-frame.core :as re-frame]
[re-frame.std-interceptors :as i]
[webchange.admin.routes :as routes]
[webchange.state.warehouse :as warehouse]))
(def path-to-db :school-classes)
(re-frame/reg-sub
path-to-db
(fn [db]
(get db path-to-db)))
(defn... |
1b18ba87f1a620575c1af83c53fb1ef4f27da26fe69589f8dc1c0ada01ec4e0c | bennn/dissertation | huffman.rkt | #lang typed/racket
guile - jpeg
Copyright ( C ) 2014 < wingo at pobox dot com >
;; This library 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)... | null | https://raw.githubusercontent.com/bennn/dissertation/779bfe6f8fee19092849b7e2cfc476df33e9357b/dissertation/QA/math-test/jpeg/s-d/huffman.rkt | racket | This library is free software; you can redistribute it and/or modify
either version 3 of the License , or ( at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR... | #lang typed/racket
guile - jpeg
Copyright ( C ) 2014 < wingo at pobox dot com >
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
JPEG Huffman coding .
(require require-typed-check)
(require "typedefs.rkt")
(require/ty... |
0b31c0e6af6503554b9340ad90d1c6159d8f050383c98f8f5545f5d0ff3b8d62 | RefactoringTools/wrangler | tests_arit_simpl.erl | @private
-module(tests_arit_simpl).
-compile([export_all]).
testPlusZero(X) -> X.
testPlusZero2(X,Y) -> X + Y.
testExpTimesOne(X,Y) -> X + Y.
testExpTimesOne2(X,Y) -> X + Y + 1.
testPlusZero3(X,Y) ->
Z = X + Y + 1,
Z.
testMinusZero(X) ->
Z = X,
Z.
testTimes0AndPlus0(X) -> X.
testDivBy... | null | https://raw.githubusercontent.com/RefactoringTools/wrangler/1c33ad0e923bb7bcebb6fd75347638def91e50a8/src/symbolic_evaluation/tests/transformed/tests_arit_simpl.erl | erlang | @private
-module(tests_arit_simpl).
-compile([export_all]).
testPlusZero(X) -> X.
testPlusZero2(X,Y) -> X + Y.
testExpTimesOne(X,Y) -> X + Y.
testExpTimesOne2(X,Y) -> X + Y + 1.
testPlusZero3(X,Y) ->
Z = X + Y + 1,
Z.
testMinusZero(X) ->
Z = X,
Z.
testTimes0AndPlus0(X) -> X.
testDivBy... | |
876f30213539d6f05f6bb8359e0fac4f70b56d13718bc66463029c33b603e028 | mirage/orm | record_mutate.ml | pp camlp4orf
type x = {
mutable foo: string;
mutable bar: string option
} with orm
open Test_utils
open OUnit
module H = Hashtbl.Make (
struct
type t = x
let equal = (==)
let compare = (==)
let hash _ = 0
end )
let name = "record_mutate.db"
let test_mutate_nodb () =
let t1 = { foo="foo"; ... | null | https://raw.githubusercontent.com/mirage/orm/24c2e0e3157853b2328d09feacdbe637e34d354c/lib_test/record_mutate.ml | ocaml | same as previous, but changes bar | pp camlp4orf
type x = {
mutable foo: string;
mutable bar: string option
} with orm
open Test_utils
open OUnit
module H = Hashtbl.Make (
struct
type t = x
let equal = (==)
let compare = (==)
let hash _ = 0
end )
let name = "record_mutate.db"
let test_mutate_nodb () =
let t1 = { foo="foo"; ... |
8296a4a5149f97173324c56f6d90533a67370c60762448374d1c7cbd7a4e7db0 | danilkolikov/dfl | Processor.hs | |
Module : Frontend . Inference . DataType . Processor
Description : Functions for data type processing
Copyright : ( c ) , 2019
License : MIT
Processor of data types
Module : Frontend.Inference.DataType.Processor
Description : Functions for data type processing
Copyright ... | null | https://raw.githubusercontent.com/danilkolikov/dfl/698a8f32e23b381afe803fc0e353293a3bf644ba/src/Frontend/Inference/DataType/Processor.hs | haskell | | Type of the error which can be encountered during data type processing
^ Unknown data type
^ Can't derive instance
| Output of data type processing
| Debug output of data type processing
| Process data types and generate constructors and derived instances | |
Module : Frontend . Inference . DataType . Processor
Description : Functions for data type processing
Copyright : ( c ) , 2019
License : MIT
Processor of data types
Module : Frontend.Inference.DataType.Processor
Description : Functions for data type processing
Copyright ... |
c71be96cc062b6c07432725440beafb3b3a0a7a9458c5d55124f99779203c530 | andreas/ocaml-graphql-server | graphql_lwt.ml | module Schema =
Graphql_schema.Make
(struct
include Lwt
module Stream = struct
type 'a t = 'a Lwt_stream.t * (unit -> unit)
let map (t, close) f = (Lwt_stream.map_s f t, close)
let iter (t, _close) f = Lwt_stream.iter_s f t
let close (_, close) = close ()
end
... | null | https://raw.githubusercontent.com/andreas/ocaml-graphql-server/d615cbb164d4ddfdc2efeb246a198dfe114adf24/graphql-lwt/src/graphql_lwt.ml | ocaml | module Schema =
Graphql_schema.Make
(struct
include Lwt
module Stream = struct
type 'a t = 'a Lwt_stream.t * (unit -> unit)
let map (t, close) f = (Lwt_stream.map_s f t, close)
let iter (t, _close) f = Lwt_stream.iter_s f t
let close (_, close) = close ()
end
... | |
cf36a988d4c809f8a70ff94df587e3888df6a273d83be1f7144c0cb49e54b8d3 | roosta/startpage | server.cljs | (ns startpage.server
(:require [cljs.nodejs :as nodejs]
[startpage.handler :as handler]
[clojure.string :as string]
[goog.object :as gobj]
[cljs.reader :refer [read-string]]
[figwheel.client :as fw]
[reagent.debug :as d]))
(goog-define DEBUG tru... | null | https://raw.githubusercontent.com/roosta/startpage/ae89d1fb3bd9d4273458367f4eb2f26308e690c8/src/server/startpage/server.cljs | clojure | had issues using cljs-http on node so fell back to request
app gets redefined on reload
----- ROUTES -----
routes get redefined on each reload
This is the secret sauce. you want to capture a reference to
the app function (don't use it directly) this allows it to be redefined on each reload
this allows you to cha... | (ns startpage.server
(:require [cljs.nodejs :as nodejs]
[startpage.handler :as handler]
[clojure.string :as string]
[goog.object :as gobj]
[cljs.reader :refer [read-string]]
[figwheel.client :as fw]
[reagent.debug :as d]))
(goog-define DEBUG tru... |
efb370f9c8914234c577b33842af6378d83f0a9d67aeec352e59026ca7c796d9 | awolven/cl-vulkan | sampler.lisp | Copyright 2019 , 2020
;;
;; 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, copy, modify, merge, publish,
d... | null | https://raw.githubusercontent.com/awolven/cl-vulkan/dd64af0ceb57cfc4aedbd3ba8d3340e2e922e16f/src/sampler.lisp | lisp |
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
the following conditions:
The above copyright notice and this permission notice shall be
EXPRESS OR IMPLIE... | Copyright 2019 , 2020
" Software " ) , to deal in the Software without restriction , including
distribute , sublicense , and/or sell copies of the Software , and to
permit persons to whom the Software is furnished to do so , subject to
included in all copies or substantial portions of the Software .
THE ... |
34528d4d5b9345c974fcf149691c9095fe425df77c8cf5c1f6567e6a2683d7ae | dwayne/eopl3 | store.test.rkt | #lang racket
(require "./store.rkt")
(require rackunit)
(begin
(initialize-store!)
(let ([r1 (newref 5)]
[r2 (newref 10)])
(check-equal? (deref r1) 5)
(check-equal? (deref r2) 10)
(setref! r1 (deref r2))
(setref! r2 15)
(check-equal? (deref r1) 10)
(check-equal? (deref r2) 15))... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/04-ch4/interpreters/racket/IMPLICIT-REFS-4.19/store.test.rkt | racket | #lang racket
(require "./store.rkt")
(require rackunit)
(begin
(initialize-store!)
(let ([r1 (newref 5)]
[r2 (newref 10)])
(check-equal? (deref r1) 5)
(check-equal? (deref r2) 10)
(setref! r1 (deref r2))
(setref! r2 15)
(check-equal? (deref r1) 10)
(check-equal? (deref r2) 15))... | |
85c6549a5b0f7a3cc99d0db84fb4abcef733a0e504848df35d1af001e6b055a3 | openmusic-project/openmusic | controls.lisp | ;=========================================================================
OpenMusic : Visual Programming Language for Music Composition
;
Copyright ( C ) 1997 - 2009 IRCAM - Centre , Paris , France .
;
This file is part of the OpenMusic environment sources
;
OpenMusic is free software : yo... | null | https://raw.githubusercontent.com/openmusic-project/openmusic/76896253fdb9707c222e30f13d73db41645902e2/OPENMUSIC/code/kernel/ommodele/omframes/simpleframes/boxes/controls.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 - 2009 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 Publi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.