_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 |
|---|---|---|---|---|---|---|---|---|
be2943ff95ddbb2538339a8f9d04abc4171388709a5bc9ea0912abe50c4a18d3 | haskell/vector | maximum.hs | import qualified Data.Vector as U
import Data.Bits
main = print . U.maximum . U.map (*2) . U.map (`shiftL` 2) $ U.replicate (100000000 :: Int) (5::Int)
| null | https://raw.githubusercontent.com/haskell/vector/4c87e88f07aad166c6ae2ccb94fa539fbdd99a91/old-testsuite/microsuite/maximum.hs | haskell | import qualified Data.Vector as U
import Data.Bits
main = print . U.maximum . U.map (*2) . U.map (`shiftL` 2) $ U.replicate (100000000 :: Int) (5::Int)
| |
9f48d9b9a8dc9e2bf00893ff0cc569c8e8a623126f86e3130c39486d6fb1e3bf | nha/temporal | temporal_test.clj | (ns nha.temporal-test
(:require
[clojure.test :refer [deftest testing is are]]
[nha.temporal :as sut]
[nha.temporal.testing :as testsut])
(:import
[io.temporal.activity Activity ActivityInterface ActivityMethod ActivityOptions]
[io.temporal.client WorkflowClient WorkflowOptions WorkflowClientOptions]... | null | https://raw.githubusercontent.com/nha/temporal/f44b135a6b96b5aa25f622f691ce9a669c142daf/test/nha/temporal_test.clj | clojure | hardcode the
-java/blob/main/src/main/java/io/temporal/samples/hello/HelloActivity.java
Left all the exploration steps in there too
-java/blob/d92d48ca4431d6ea6af564a2d303fad9a9d3521b/src/main/java/io/temporal/samples/hello/HelloActivity.java
on method
^{java.lang.annotation.Retention RetentionPolicy/RUNTIME
... | (ns nha.temporal-test
(:require
[clojure.test :refer [deftest testing is are]]
[nha.temporal :as sut]
[nha.temporal.testing :as testsut])
(:import
[io.temporal.activity Activity ActivityInterface ActivityMethod ActivityOptions]
[io.temporal.client WorkflowClient WorkflowOptions WorkflowClientOptions]... |
6343a935097c0066b71c2901b8b5e45bc60300d2c4cfc74e6df273e0f127d514 | bmeurer/ocaml-experimental | mtype.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bmeurer/ocaml-experimental/fe5c10cdb0499e43af4b08f35a3248e5c1a8b541/typing/mtype.ml | ocaml | *********************************************************************
Objective Caml
... | , 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 .
$ Id$
open Asttypes
open Path
open ... |
31765bb21d49c7b90eb35c4af58e70f6173b46d2e9162e7f758b1d6fb6b50ca1 | CommonDoc/codex | test-system.lisp | (in-package :cl-user)
(defpackage codex-test-system
(:use :cl)
(:documentation "docstring"))
(in-package :codex-test-system)
;;; Common Lisp nodes
(defun func (a b &optional (c "") (l 1))
"docstring"
(declare (ignore a b c l))
t)
(defmacro mac (a b c)
"docstring"
(declare (ignore a b c))
t)
(defpara... | null | https://raw.githubusercontent.com/CommonDoc/codex/f591d1e12ecc1c926232a437e1a9c1b6cb41ddbb/t/test-system/test-system.lisp | lisp | Common Lisp nodes
CFFI nodes | (in-package :cl-user)
(defpackage codex-test-system
(:use :cl)
(:documentation "docstring"))
(in-package :codex-test-system)
(defun func (a b &optional (c "") (l 1))
"docstring"
(declare (ignore a b c l))
t)
(defmacro mac (a b c)
"docstring"
(declare (ignore a b c))
t)
(defparameter var t
"docstri... |
d6b57b54070fb86ab24eaadb123629d26d8cff672d4c011a47e8ead3cde7e6dd | advancedtelematic/quickcheck-state-machine | IORefs.hs | {-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DerivingStrategies #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
# LANGUAGE ScopedTypeVariables... | null | https://raw.githubusercontent.com/advancedtelematic/quickcheck-state-machine/3cbf466db302235afdea91dac06a57b8fe0f0b4d/test/IORefs.hs | haskell | # LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveTraversable #
# LANGUAGE DerivingStrategies #
# LANGUAGE RankNTypes #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeOperators #
------------------------------------------------------------------------------
Instanti... | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module IORefs (prop_IORefs_sequential) where
import Control.Concurrent
import Data.Coerce
(coerce)
import Data.Foldable
... |
c059e3d806a796af55e3ac858600ce0753bc9695921bd8d099a2c3a1b220e439 | everpeace/programming-erlang-code | chat_socket.erl | -module(chat_socket).
-compile(export_all).
%% server:
chat_socket : start_chat_server("joe " , " 123 " ) .
" " is who I am
%%
%% client:
chat_socket : call("localhost","fred " , " 123 " ) .
%% "fred" is who I am
%% When we call we don't know the name of who we are calling
%% so... | null | https://raw.githubusercontent.com/everpeace/programming-erlang-code/8ef31aa13d15b41754dda225c50284915c29cb48/code/chat_socket.erl | erlang | server:
client:
"fred" is who I am
When we call we don't know the name of who we are calling
so we'll have to wait until the server tells us
Secret = none | string
Who = the person who owns the server
The client is the initiator
-----------------------------------------------------------... | -module(chat_socket).
-compile(export_all).
chat_socket : start_chat_server("joe " , " 123 " ) .
" " is who I am
chat_socket : call("localhost","fred " , " 123 " ) .
start_chat_server(Who, Secret) ->
lib_auth_cs:start_server(3030,
{?MODULE, chat_server, Who},
Secret,
... |
2a02d0953463c34da17fe4ee79367bb2541811d07058b55cc4f7e56d2f68f36d | ocaml-sf/learn-ocaml-corpus | test.ml | open Report
open Test_lib
let sample_exp () =
let rec sample level =
match Random.int level with
| 0 -> EInt (Random.int 20 - 10)
| _ ->
if Random.bool () then
EAdd (sample (level - 1), sample (level - 1))
else
EMul (sample (level - 1), sample (level - 1)) in
sample ... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/mooc/week3/seq2/ex1/test.ml | ocaml | open Report
open Test_lib
let sample_exp () =
let rec sample level =
match Random.int level with
| 0 -> EInt (Random.int 20 - 10)
| _ ->
if Random.bool () then
EAdd (sample (level - 1), sample (level - 1))
else
EMul (sample (level - 1), sample (level - 1)) in
sample ... | |
7fbf7cd3fb9752d0e24b680d804bbf1df64c431050e06d8e9013f001ac680a02 | dsorokin/aivika | Activity.hs |
-- |
-- Module : Simulation.Aivika.Activity
Copyright : Copyright ( c ) 2009 - 2017 , < >
-- License : BSD3
Maintainer : < >
-- Stability : experimental
Tested with : GHC 8.0.1
--
-- It models an activity that can be utilised. The activity is similar to a 'Server'
-- but destined for simulation w... | null | https://raw.githubusercontent.com/dsorokin/aivika/7a14f460ab114b0f8cdfcd05d5cc889fdc2db0a4/Simulation/Aivika/Activity.hs | haskell | |
Module : Simulation.Aivika.Activity
License : BSD3
Stability : experimental
It models an activity that can be utilised. The activity is similar to a 'Server'
but destined for simulation within 'Net' computation.
* Activity
* Processing
* Activity Properties
* Statistics Reset
* Summary
* Derived ... |
Copyright : Copyright ( c ) 2009 - 2017 , < >
Maintainer : < >
Tested with : GHC 8.0.1
module Simulation.Aivika.Activity
Activity,
newActivity,
newStateActivity,
newPreemptibleActivity,
newPreemptibleStateActivity,
activityNet,
activityInitState,
... |
1034a6d763d2638f46e69a8a9cf7c07d153980cb99b09c1353e08ad1f69420c6 | LexiFi/menhir | codePieces.ml | (******************************************************************************)
(* *)
(* *)
... | null | https://raw.githubusercontent.com/LexiFi/menhir/794e64e7997d4d3f91d36dd49aaecc942ea858b7/src/codePieces.ml | ocaml | ****************************************************************************
file LICEN... |
, Paris
, PPS , Université Paris Diderot
. All rights reserved . This file is distributed under the
terms of the GNU General Public License version 2 , as... |
13292ce93d1dfba944eef18e27dfbc66c83ba1c5be238815fc9a2b8a1716c44d | ktakashi/sagittarius-scheme | pretty.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; srfi/%3a159/internal/pretty.scm - Combinator Formatting (pretty)
;;;
Copyright ( c ) 2020 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/3971b131d463696297c320dbe595dffd08867dac/sitelib/srfi/%253a159/internal/pretty.scm | scheme | coding : utf-8 ; -*-
srfi/%3a159/internal/pretty.scm - Combinator Formatting (pretty)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright... | Copyright ( c ) 2020 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
#!nounbound
(library (srfi :159 internal pretty)
... |
7683c579e2f51f73bfbd8ea93989a707ac5e9db9c0d080c98a4bc2c14711ac1f | janestreet/resource_cache | resource_cache0.mli | include Resource_cache_intf.Resource_cache
| null | https://raw.githubusercontent.com/janestreet/resource_cache/666b030496b998c128aba9a622b03f846940a1b8/src/resource_cache0.mli | ocaml | include Resource_cache_intf.Resource_cache
| |
5b2ef99cc6025906b4c1af46c90000c3cf00ec46e1a9760bf1fa8f8f19471408 | smarkets/smk_erlang_sdk | eto_uleb128.erl | -module(eto_uleb128).
-export([encode/1, encode/2, decode/1, decode/2]).
% For property tests
-include_lib("proper/include/proper.hrl").
-export([prop_encode_decode/0]).
-spec encode(non_neg_integer()) -> binary().
encode(I) when I >= 0 -> encode_1(I, 0).
-spec encode(non_neg_integer(), binary()) -> binary().
encod... | null | https://raw.githubusercontent.com/smarkets/smk_erlang_sdk/f56ba38201a8d3bc6e2621a402e16f486f8acf09/src/eto_uleb128.erl | erlang | For property tests
Properties for testing | -module(eto_uleb128).
-export([encode/1, encode/2, decode/1, decode/2]).
-include_lib("proper/include/proper.hrl").
-export([prop_encode_decode/0]).
-spec encode(non_neg_integer()) -> binary().
encode(I) when I >= 0 -> encode_1(I, 0).
-spec encode(non_neg_integer(), binary()) -> binary().
encode(I, Acc) -> <<Acc/bi... |
d790a6989a6813d2f0720d03dde4d7fff929c14596802d9f02727b0a0b80a352 | haskell-graphql/graphql-api | Main.hs | module Main where
import Protolude
import Test.Hspec
import qualified Spec (spec)
main :: IO ()
main = do
hspec Spec.spec
| null | https://raw.githubusercontent.com/haskell-graphql/graphql-api/8ced344485cd638cee50eeb6b653baecea359406/tests/Main.hs | haskell | module Main where
import Protolude
import Test.Hspec
import qualified Spec (spec)
main :: IO ()
main = do
hspec Spec.spec
| |
e056ac561c8e9c747de8f0d7cca1422bf555abb48d71f0452dc72b71a258aae6 | plum-umd/adapton.ocaml | bits.ml | (* *)
let ffs0 =
zero - index , i.e. , like ( count trailing zero ) but returns 0 for 0
let shift = 8 in
let size = 1 lsl shift in
let mask = size - 1 in
let table = Bytes.init size begin fun x -> Char.unsafe_chr begin
if x = 0 then 0 else
let rec loop r = if (x lsr r) land 1 <> 0 th... | null | https://raw.githubusercontent.com/plum-umd/adapton.ocaml/a8e642ac1cc113b33e1837da960940c2dfcfa772/src/core/bits.ml | ocaml | let ffs0 =
zero - index , i.e. , like ( count trailing zero ) but returns 0 for 0
let shift = 8 in
let size = 1 lsl shift in
let mask = size - 1 in
let table = Bytes.init size begin fun x -> Char.unsafe_chr begin
if x = 0 then 0 else
let rec loop r = if (x lsr r) land 1 <> 0 then r el... | |
878cdb97cfe0260818475fa5e0fdbe60bcbba07901510a1003bf65f8e9793978 | ocaml-doc/doc-ock-xml | testCmti.ml |
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/ocaml-doc/doc-ock-xml/d279deb51bb813a6a9adc1b2b0bf7c2b2c7aa73b/test/testCmti.ml | ocaml |
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | |
29e6d5c8262cd0e5e3dac9e630d3203ed92a39f65d00b426501f978ed7a13915 | hammerlab/prohlatype | alignment_parsing.ml | Test the Alignment file parsing logic and invariants about their contained
sequences :
- All sequences have a Start , with only Gaps and Boundaries before the start
- All sequences have an End that may be followed only by Boundaries and Gaps
- There is an End for every Start
- Sequence el... | null | https://raw.githubusercontent.com/hammerlab/prohlatype/3acaf7154f93675fc729971d4c76c2b133e90ce6/src/tests/alignment_parsing.ml | ocaml | files without extensions.
A sequence could be identical to the reference
and therefore the parsed alt will be [] | Test the Alignment file parsing logic and invariants about their contained
sequences :
- All sequences have a Start , with only Gaps and Boundaries before the start
- All sequences have an End that may be followed only by Boundaries and Gaps
- There is an End for every Start
- Sequence el... |
ef97b2eacf731cf25eb94d7225b69cd1dd44a853dc17c50a088cfdb4ad0bdce3 | backtracking/mlpost | tree2.ml | open Mlpost
open Tree
let fig =
[
draw ~node_style:Rect ~arrow_style:Undirected
(node "1"
[ node "2" [ leaf "4"; leaf "5" ]; node "3" [ leaf "6"; leaf "7" ] ]);
]
let _ = Metapost.emit "tree2" fig
| null | https://raw.githubusercontent.com/backtracking/mlpost/bd4305289fd64d531b9f42d64dd641d72ab82fd5/presentations/proval/tree2.ml | ocaml | open Mlpost
open Tree
let fig =
[
draw ~node_style:Rect ~arrow_style:Undirected
(node "1"
[ node "2" [ leaf "4"; leaf "5" ]; node "3" [ leaf "6"; leaf "7" ] ]);
]
let _ = Metapost.emit "tree2" fig
| |
15261a5c9f25d7dcf14bc13786fc880e2d3ddaf6d5b42734da76f032c2c674d4 | s-expressionists/Cleavir | packages.lisp | (cl:in-package #:common-lisp-user)
(defpackage #:cleavir-ast
(:use #:common-lisp)
(:shadow #:symbol #:ignore)
(:export
#:ast
#:define-children #:children #:map-children
#:source-info
#:origin
#:*policy* #:policy
#:constant-ast #:make-constant-ast #:value
#:lexical-bind-ast #:make-lexical-bin... | null | https://raw.githubusercontent.com/s-expressionists/Cleavir/22efd8c954dd63b57cb284ff2739f2be9306f247/Abstract-syntax-tree/packages.lisp | lisp | (cl:in-package #:common-lisp-user)
(defpackage #:cleavir-ast
(:use #:common-lisp)
(:shadow #:symbol #:ignore)
(:export
#:ast
#:define-children #:children #:map-children
#:source-info
#:origin
#:*policy* #:policy
#:constant-ast #:make-constant-ast #:value
#:lexical-bind-ast #:make-lexical-bin... | |
8ae98e820f08d9bd920a92261497567f548efb021b9f51851b7c216cf1e4fb56 | thheller/shadow-arborist | components.cljs | (ns shadow.arborist.components
(:require
[goog.object :as gobj]
[shadow.arborist.common :as common]
[shadow.arborist.protocols :as p]))
(declare component-node?)
(defn safe-inc [x]
(if (nil? x)
0
(inc x)))
(defonce component-id-seq (atom 0))
(defn next-component-id []
(swap! component-id-s... | null | https://raw.githubusercontent.com/thheller/shadow-arborist/39aef8d4361005f3217dc9bab1862aebc56d5990/src/main/shadow/arborist/components.cljs | clojure | must not be modified after init
must not be modified after init
FIXME: what if there was no state?
map of {slot-id target-node}
FIXME: this could just delegate to the root?
FIXME: let (:should-update config) decide if update should happen or not?
FIXME: did-update before/after props
fn-sig should be (fn [env e ... | (ns shadow.arborist.components
(:require
[goog.object :as gobj]
[shadow.arborist.common :as common]
[shadow.arborist.protocols :as p]))
(declare component-node?)
(defn safe-inc [x]
(if (nil? x)
0
(inc x)))
(defonce component-id-seq (atom 0))
(defn next-component-id []
(swap! component-id-s... |
c1e38ea7ba4109ef670435b617c3b91f2e8f910eec39af436cccec19fce9a75f | hasktorch/hasktorch | Type.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
{-# LANGUAGE GADTs #-}
# LANGUAGE StandaloneDeriving #
# LANGUAGE StandaloneKindSignatures #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
module Torch.GraduallyTyped.NN.Type where
import Data.Singletons.TH (genSingletons)
impo... | null | https://raw.githubusercontent.com/hasktorch/hasktorch/c34996b0a401a5b1b98b5774e892fde88adaa079/experimental/gradually-typed/src/Torch/GraduallyTyped/NN/Type.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE StandaloneDeriving #
# LANGUAGE StandaloneKindSignatures #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
module Torch.GraduallyTyped.NN.Type where
import Data.Singletons.TH (genSingletons)
import GHC.Generics (Generi... |
55e86b054bc7d9c7467fa075a513311a8e58e99c0c1bd2badcfb5ab91e3021bb | dyne/social-wallet-api | api_key.clj | Social Wallet REST API
Copyright ( C ) 2018- Dyne.org foundation
designed , written and maintained by
< >
This file is part of Social Wallet REST API .
Social Wallet REST API is free software ; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as publi... | null | https://raw.githubusercontent.com/dyne/social-wallet-api/72cc18989382297e1315a0ab4aac50b9882aa374/src/social_wallet_api/api_key.clj | clojure | you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) any later version .
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See th... | Social Wallet REST API
Copyright ( C ) 2018- Dyne.org foundation
designed , written and maintained by
< >
This file is part of Social Wallet REST API .
You should have received a copy of the GNU Affero General Public License along with this program . If not , see < / > .
Additional permission u... |
f9d24199ea15fab1c2423a0d4b942c0227a67fe0273c321f7565cd2fe299426c | carlwitt/Erlang-Kademlia | metric.erl | -module(metric).
-include("include/metric.hrl").
-include("include/kademliaGlobal.hrl").
-export([
distance/2,
randomKey/0,
randomKey/1,
calculateKey/1,
nthBit/2
]).
distance - returns the distance between two elements in the key space according to this metric
distance(K1, K2) ->
K1#key.hash bxo... | null | https://raw.githubusercontent.com/carlwitt/Erlang-Kademlia/913190e677487cf5c3e9d714f591eb7560693a14/metric.erl | erlang | randomKey - returns a random element of the key space
randomKey(Descriptor) - returns a random element of the key space
uses descriptor as "seed", salted with the current time
descriptor survives as #key.readable
hashes some value to determine an associated element in the key space | -module(metric).
-include("include/metric.hrl").
-include("include/kademliaGlobal.hrl").
-export([
distance/2,
randomKey/0,
randomKey/1,
calculateKey/1,
nthBit/2
]).
distance - returns the distance between two elements in the key space according to this metric
distance(K1, K2) ->
K1#key.hash bxo... |
842454ab9c264f21db57e73eea49831cb6c4f8a36e5fbf645000b2e2c546d3fb | reanimate/reanimate | tangent_and_normal.hs | #!/usr/bin/env stack
-- stack runghc --package reanimate
module Main (main) where
main :: IO ()
main = return ()
import Diagrams . Prelude hiding ( Animation , boundingBox ,
center , circle , duration ,
... | null | https://raw.githubusercontent.com/reanimate/reanimate/5ea023980ff7f488934d40593cc5069f5fd038b0/examples/tangent_and_normal.hs | haskell | stack runghc --package reanimate | #!/usr/bin/env stack
module Main (main) where
main :: IO ()
main = return ()
import Diagrams . Prelude hiding ( Animation , boundingBox ,
center , circle , duration ,
fontSize , rotate , scal... |
8239974e1395f3b7a7e3c6d9a5ef4c6b637aea7a4885688cf3940d24d30eb7e3 | craigl64/clim-ccl | last.lisp | ;; -*- mode: common-lisp; package: silica -*-
;;
;;
;; See the file LICENSE for the full license governing this code.
;;
(in-package :silica)
(provide :climgg)
| null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/homegrown/last.lisp | lisp | -*- mode: common-lisp; package: silica -*-
See the file LICENSE for the full license governing this code.
|
(in-package :silica)
(provide :climgg)
|
2594edae3ba49ebec0438e874f3bb303bfa7000d07dd3376dd7e0fddffdec07c | Beluga-lang/Beluga | recsgn.ml | open Support.Equality
open Support
open Store
open Store.Cid
open Syntax
module C = Whnf
module S = Substitution
module Unify = Unify.StdTrail
module P = Pretty.Int.DefaultPrinter
module R = Store.Cid.DefaultRenderer
let (dprintf, dprint, _) = Debug.makeFunctions' (Debug.toFlags [11])
open Debug.Fmt
type leftover_v... | null | https://raw.githubusercontent.com/Beluga-lang/Beluga/47f44f4e042046d37329c87aaac6da2dbec9353c/src/core/recsgn.ml | ocaml | functions with total decls
functions without total decls
XXX it's strange that this walks backwards, but is called "get *target*".
Perhaps for codatatypes this should be "source" ? -je
%not declaration with nothing following
index cT in a context which contains arguments to cK
convert to a numeric or... | open Support.Equality
open Support
open Store
open Store.Cid
open Syntax
module C = Whnf
module S = Substitution
module Unify = Unify.StdTrail
module P = Pretty.Int.DefaultPrinter
module R = Store.Cid.DefaultRenderer
let (dprintf, dprint, _) = Debug.makeFunctions' (Debug.toFlags [11])
open Debug.Fmt
type leftover_v... |
8204bca9b38ed87fcde07adf595438b354cd08920fdf980de2fd5eba94f7ff7a | wardle/hermes | snomed_test.clj | (ns com.eldrix.hermes.snomed-test
(:require [clojure.java.io :as io]
[clojure.set :as set]
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[clojure.spec.test.alpha :as stest]
[clojure.string :as str]
[clojure.test :refer [deftest is r... | null | https://raw.githubusercontent.com/wardle/hermes/948a116613b2fa2eb8b628c49e47479f216beac6/test/com/eldrix/hermes/snomed_test.clj | clojure | identifier into the filename to say where the file used to exist!
On the face of it, a callous disregard for good data design sensibility. | (ns com.eldrix.hermes.snomed-test
(:require [clojure.java.io :as io]
[clojure.set :as set]
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[clojure.spec.test.alpha :as stest]
[clojure.string :as str]
[clojure.test :refer [deftest is r... |
e0f6adee52d379320c77b41152e4beea6cabf36bdeebac0763857a95d96fd9ea | anoma/juvix | Base.hs | module Juvix.Compiler.Core.Extra.Stripped.Base where
import Juvix.Compiler.Core.Language.Stripped
{------------------------------------------------------------------------}
{- Stripped Node constructors -}
mkVar :: VarInfo -> Index -> Node
mkVar i idx = NVar (Var i idx)
mkVar' :: Index -> Node
mkVar' = mkVar (VarIn... | null | https://raw.githubusercontent.com/anoma/juvix/f2298bd67464d595d1e6ec46b227c17b4a18871d/src/Juvix/Compiler/Core/Extra/Stripped/Base.hs | haskell | ----------------------------------------------------------------------
Stripped Node constructors | module Juvix.Compiler.Core.Extra.Stripped.Base where
import Juvix.Compiler.Core.Language.Stripped
mkVar :: VarInfo -> Index -> Node
mkVar i idx = NVar (Var i idx)
mkVar' :: Index -> Node
mkVar' = mkVar (VarInfo "" Nothing TyDynamic)
mkIdent :: IdentInfo -> Symbol -> Node
mkIdent i sym = NIdt (Ident i sym)
mkIdent... |
60024f4f0ab55a215e01d2a63aa1f514dd27a65ce868b665647e5b5878e9760c | baphled/chatterl | test_chatterl_groups.erl | -module(test_chatterl_groups).
-include_lib("eunit/include/eunit.hrl").
-include_lib("chatterl.hrl").
-import(test_helpers,[start_client/3,start_group/2]).
%% Test our groups functionality
chatterl_group_handle_test_() ->
{Client,Group,Description} = {"boodah","anuva","a nu room"},
[{setup,
fun() ->
... | null | https://raw.githubusercontent.com/baphled/chatterl/5c1bfd8a5ac0c1a0ac5a765aa0c9db80a31da292/lib/chatterl/src/test_chatterl_groups.erl | erlang | Test our groups functionality | -module(test_chatterl_groups).
-include_lib("eunit/include/eunit.hrl").
-include_lib("chatterl.hrl").
-import(test_helpers,[start_client/3,start_group/2]).
chatterl_group_handle_test_() ->
{Client,Group,Description} = {"boodah","anuva","a nu room"},
[{setup,
fun() ->
start_client(Client,Group,Descrip... |
eb3e8f9322776e82e357c720886e1c0598e5670ee032515867298985fc5c7ced | ocsigen/ocaml-eliom | pr6216.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocsigen/ocaml-eliom/497c6707f477cb3086dc6d8124384e74a8c379ae/testsuite/tests/basic-more/pr6216.ml | ocaml | ************************************************************************
OCaml
... | , Nagoya University
Copyright 2013 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
PR6216 : wrong inlining of GADT match
type _ t =
| Float : float t
| String : string t
let f : type a . ... |
fc027ace731c47af919e103552911ea5c08c41969e9e38949ffcf7f3efd3ce35 | IBM/wcs-ocaml | bmd_builder.ml |
* This file is part of the Watson Conversation Service OCaml API project .
*
* Copyright 2016 - 2017 IBM Corporation
*
* 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... | null | https://raw.githubusercontent.com/IBM/wcs-ocaml/b237b7057f44caa09d36e466be015e2bc3173dd5/examples/rulebot/src/bmd/bmd_builder.ml | ocaml |
* This file is part of the Watson Conversation Service OCaml API project .
*
* Copyright 2016 - 2017 IBM Corporation
*
* 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... | |
6d4dcdcd46e0f949a65c261a24c3b194bb62c4ab54e1eb5e7763f62eff29755a | AccelerateHS/accelerate-examples | Simulate.hs | # LANGUAGE TemplateHaskell #
module Gloss.Simulate (
Simulate(..), simulateWorld, simulateDrawTree, simulatePause,
initialise, simulate,
) where
import Common.Type
import Common.World
import Data.Label
data Simulate = Simulate
{
_simulateWorld :: {-# UNPACK #-} !World
-- parameters to contro... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-examples/a973ee423b5eadda6ef2e2504d2383f625e49821/examples/n-body/Gloss/Simulate.hs | haskell | # UNPACK #
parameters to control the visualisation
| Populate the universe with a set of bodies
| Advance the simulation state
| # LANGUAGE TemplateHaskell #
module Gloss.Simulate (
Simulate(..), simulateWorld, simulateDrawTree, simulatePause,
initialise, simulate,
) where
import Common.Type
import Common.World
import Data.Label
data Simulate = Simulate
{
, _simulateDrawTree :: !Bool
, _simulatePause :: !Bool
}
init... |
acb6ee265d3a238d0a7e28638683a85f262349bf837d6b3c8e41de30fc7ba309 | takikawa/racket-ppa | atomic.rkt | #lang racket/base
(require racket/fixnum
"host.rkt"
"place-local.rkt"
"internal-error.rkt"
"parameter.rkt"
"debug.rkt"
(for-syntax racket/base))
(provide atomically
current-atomic
start-atomic
end-atomic
abort-atomic
a... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/26d6ae74a1b19258c9789b7c14c074d867a4b56b/src/thread/atomic.rkt | racket | "atomically" is atomic within a place; when a future-running
pthread tries to enter atomic mode, it is suspended
Althogh it's adjusting atomicity for the thread scheduler,
this function is documented as working in any Scheme thread.
The current implementation relies on parameters like
`future-barrier` and `curren... | #lang racket/base
(require racket/fixnum
"host.rkt"
"place-local.rkt"
"internal-error.rkt"
"parameter.rkt"
"debug.rkt"
(for-syntax racket/base))
(provide atomically
current-atomic
start-atomic
end-atomic
abort-atomic
a... |
24bfab625de4bfcaa20380eab96744895de2e18fca6ea1c6ceb6c7ddc59a24c1 | ghcjs/ghcjs | Main.hs |
From : < >
Date : Fri , 22 Nov 2002 13:49:13 +1100
To :
Subject : Re : diff in : clarification
Just for jollies , here 's a version of Hirschberg 's LCSS
algorithm . It 's O(N^2 ) time but O(N ) space at any given point in
time , assuming eager evaluation . You should be able to make diff out ... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/nofib/gc/lcss/Main.hs | haskell |
From : < >
Date : Fri , 22 Nov 2002 13:49:13 +1100
To :
Subject : Re : diff in : clarification
Just for jollies , here 's a version of Hirschberg 's LCSS
algorithm . It 's O(N^2 ) time but O(N ) space at any given point in
time , assuming eager evaluation . You should be able to make diff out ... | |
df69ed3971d186008673092b90ffb825523a3c40c0b616a5e0a16fa34436ffb9 | meriken/ju | profiles.clj | { : profiles / dev { : env { : database - url " jdbc : mysql:3306 / ju_dev?user = db_user_name_here&password = db_user_password_here " } }
: profiles / test { : env { : database - url " jdbc : db_user_password_here " } } }
{:profiles/dev {:env {:database-url "jdbc:hsqldb:file:ju.hsqldb;user=sa;password=;h... | null | https://raw.githubusercontent.com/meriken/ju/99caa4625535d3da66002c460bf16d8708cabd7e/profiles.clj | clojure | { : profiles / dev { : env { : database - url " jdbc : mysql:3306 / ju_dev?user = db_user_name_here&password = db_user_password_here " } }
: profiles / test { : env { : database - url " jdbc : db_user_password_here " } } }
{:profiles/dev {:env {:database-url "jdbc:hsqldb:file:ju.hsqldb;user=sa;password=;h... | |
879877c3a65db67ae18d0f8187393dacd32698b41af21801cc5715ac35d48ca2 | ogri-la/strongbox-comrades | macro.clj | (ns strongbox-comrades.macro)
touch this file to reload comrades.csv
(defmacro compile-time-comrades-csv
[]
(slurp "comrades.csv"))
| null | https://raw.githubusercontent.com/ogri-la/strongbox-comrades/bd51a4eb3818bbc6780781ef9e21bd0a449f8d2a/src/strongbox_comrades/macro.clj | clojure | (ns strongbox-comrades.macro)
touch this file to reload comrades.csv
(defmacro compile-time-comrades-csv
[]
(slurp "comrades.csv"))
| |
c8d86ee72e08c9c77f4c932b56fabc51b67c62b930dd6b8055f381639441144d | alphaHeavy/protobuf | Internal.hs | module Data.ProtocolBuffers.Internal
( Tag
, WireField(..)
, wireFieldTag
, getWireField
, EncodeWire(..)
, DecodeWire(..)
, zzEncode32
, zzEncode64
, zzDecode32
, zzDecode64
, getVarintPrefixedBS, getVarInt
, putVarintPrefixedBS, putVarSInt, putVarUInt
, Field(..)
, Value(..)
, Always(..)... | null | https://raw.githubusercontent.com/alphaHeavy/protobuf/46cda829cf1e7b6bba2ff450e267fb1a9ace4fb3/src/Data/ProtocolBuffers/Internal.hs | haskell | module Data.ProtocolBuffers.Internal
( Tag
, WireField(..)
, wireFieldTag
, getWireField
, EncodeWire(..)
, DecodeWire(..)
, zzEncode32
, zzEncode64
, zzDecode32
, zzDecode64
, getVarintPrefixedBS, getVarInt
, putVarintPrefixedBS, putVarSInt, putVarUInt
, Field(..)
, Value(..)
, Always(..)... | |
a95b4ff6def06990e70bde03779dc949ecfc3e6f9ca77b686d6dc97cd2bbe5f1 | haskell/hoopl | Parse.hs | {-# LANGUAGE GADTs #-}
# OPTIONS_GHC -Wall #
module Parse (parseCode) where
import Control.Monad
import Prelude hiding (id, last, succ)
-- Note: We do not need to import Hoopl to build an AST.
import Ast
import Expr
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Expr
imp... | null | https://raw.githubusercontent.com/haskell/hoopl/89dde6af5b2fadfad726412c00a1ab01d34fd2a0/testing/Parse.hs | haskell | # LANGUAGE GADTs #
Note: We do not need to import Hoopl to build an AST.
Common lexers:
Expressions:
address | # OPTIONS_GHC -Wall #
module Parse (parseCode) where
import Control.Monad
import Prelude hiding (id, last, succ)
import Ast
import Expr
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Expr
import Text.ParserCombinators.Parsec.Language
import qualified Text.Parse... |
c5d69cdb55ee6a877dcd3f1011949efe4fb5a6590aeeb3a75d39404a28f63310 | REMath/mit_16.399 | red13.mli | (* red13mli *)
open Avalues1
open Avalues3
val reduce : (Avalues1.t * Avalues3.t) -> (Avalues1.t * Avalues3.t)
| null | https://raw.githubusercontent.com/REMath/mit_16.399/3f395d6a9dfa1ed232d307c3c542df3dbd5b614a/project/Generic-FW-Abstract-Interpreter/red13.mli | ocaml | red13mli | open Avalues1
open Avalues3
val reduce : (Avalues1.t * Avalues3.t) -> (Avalues1.t * Avalues3.t)
|
f7fba54273cd7bdb9a7638ac83690197f9a47de6a136ec8b3bc0e9b9966a431d | clj-python/libpython-clj | fn.clj | (ns libpython-clj2.python.fn
"Pathways for creating clojure functions from python callable objects and
vice versa. This namespace expects the GIL is captured.
Functions bridging this way is relatively expensive but it is the foundation
that the more advanced bridging in class.clj is built upon.
Also contain... | null | https://raw.githubusercontent.com/clj-python/libpython-clj/73857422d12ce646c1167be0e84e807b5919c40c/src/libpython_clj2/python/fn.clj | clojure | METH_NOARGS and METH_O must not be combined with the flags above.
no resource tracking - we leak the struct
the method def cannot ever go out of scope
no self, no module reference
no kw arguments
- specifically for sequences.
apply defaults to options map.
Release objects marshalled just for this call immediately
We ... | (ns libpython-clj2.python.fn
"Pathways for creating clojure functions from python callable objects and
vice versa. This namespace expects the GIL is captured.
Functions bridging this way is relatively expensive but it is the foundation
that the more advanced bridging in class.clj is built upon.
Also contain... |
010c69364ff1306f24c67f41c4f9e74ea202259605ef64d596f872d8c3de9f1b | mbutterick/aoc-racket | 05.rkt | #lang br
(require racket/file rackunit)
(define (string->regs str)
(list->vector (map string->number (string-split str #px",\\s*"))))
(define ((binarize proc) x y) (if (proc x y) 1 0))
(define (run str starting-input)
(define regs (string->regs str))
(define (reg-ref ptr) (vector-ref regs ptr))
(define (reg-... | null | https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/2019/05.rkt | racket | #lang br
(require racket/file rackunit)
(define (string->regs str)
(list->vector (map string->number (string-split str #px",\\s*"))))
(define ((binarize proc) x y) (if (proc x y) 1 0))
(define (run str starting-input)
(define regs (string->regs str))
(define (reg-ref ptr) (vector-ref regs ptr))
(define (reg-... | |
7e8ff2b0c88a934cf7002e7be8b4473ee7696262b22730b18334a713d5d56d99 | m-2k/erlach | thread.erl | -module(thread). % THREAD LISTENING / ADDING THREAD HEAD POST
-vsn('0.2.0').
-compile(export_all).
-include_lib("n2o/include/wf.hrl").
-include_lib("kvs/include/kvs.hrl").
-include_lib("kvs/include/feed.hrl").
-include_lib("db/include/post.hrl").
-include_lib("db/include/thread.hrl").
-include_lib("db/include/board.hr... | null | https://raw.githubusercontent.com/m-2k/erlach/ce0a19a0550c3457a1fc1d7c40e4f1cb577d7924/apps/erlach/src/thread.erl | erlang | THREAD LISTENING / ADDING THREAD HEAD POST
view thread
new thread (request)
new thread
u:restricted_call(fun() ->
end, {feature,admin}),
add_post(Id)
u:restricted_call(fun() ->
end, {feature, admin});
u:restricted_call(fun() ->
end, {feature, admin});
u:restricted_call(fun() ->
end, {feature, admin}),
u:r... | -vsn('0.2.0').
-compile(export_all).
-include_lib("n2o/include/wf.hrl").
-include_lib("kvs/include/kvs.hrl").
-include_lib("kvs/include/feed.hrl").
-include_lib("db/include/post.hrl").
-include_lib("db/include/thread.hrl").
-include_lib("db/include/board.hrl").
-include_lib("db/include/user.hrl").
-include_lib("db/inc... |
bec337bfe346f6b5563db21fd4ac746ab5f3ca0b8a8ef8c3fc0ad2d69b98b4d8 | serokell/servant-util | Server.hs | {-# LANGUAGE TypeInType #-}
# OPTIONS_GHC -fno - warn - orphans #
module Servant.Util.Combinators.Filtering.Server
( AreFilteringParams
) where
import Universum
import qualified Data.Map as M
import qualified Data.Text as T
import Fmt (Buildable (..))
import GHC.TypeLits (KnownSymbol)
import Network.HTTP.Typ... | null | https://raw.githubusercontent.com/serokell/servant-util/3dff2de34cce90c4d1dab68e03d30f8939fd52ca/servant-util/src/Servant/Util/Combinators/Filtering/Server.hs | haskell | # LANGUAGE TypeInType #
| Try to parse query key assuming that the specified field to filter on
should match the given name.
If specified filter does not match the given one, 'Nothing' is returned.
Otherwise operation name is extracted and returned.
If the parameter is not recognized as filtering one, 'Nothing' is... | # OPTIONS_GHC -fno - warn - orphans #
module Servant.Util.Combinators.Filtering.Server
( AreFilteringParams
) where
import Universum
import qualified Data.Map as M
import qualified Data.Text as T
import Fmt (Buildable (..))
import GHC.TypeLits (KnownSymbol)
import Network.HTTP.Types.URI (QueryText, parseQuer... |
7577b25596d40e991b4517967e3816c33ceadf0b65f0208703c82746cebb9411 | aryx/xix | image.ml | open Common
open Point
open Rectangle
(* todo: delete once threadUnix is not needed anymore *)
module Unix1 = Unix
module Unix2 = ThreadUnix
open Display
module M = Draw_marshal
type t = Display.image
type refresh =
| RefreshNone
| RefreshBackup
(* less: RefreshMesg *)
(* less: _allocimage and initial image ... | null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/lib_graphics/draw/image.ml | ocaml | todo: delete once threadUnix is not needed anymore
less: RefreshMesg
less: _allocimage and initial image and
* optional color (can pass -1 mean no color to set)
meh
less: color opt
meh
shortcuts
for 'y' id[4] ... header | open Common
open Point
open Rectangle
module Unix1 = Unix
module Unix2 = ThreadUnix
open Display
module M = Draw_marshal
type t = Display.image
type refresh =
| RefreshNone
| RefreshBackup
let alloc_gen display r chans repl color baseopt refopt =
let depth = Channel.depth_of_channels chans in
if chans = []... |
06d70ae7b0a839e4268335efe0450f6c89569f780304664722082ccebe45b4c6 | mfp/ocaml-sqlexpr | t_parse.ml |
open Printf
open Lwt
module SYNC =
struct
module Sqlexpr = Sqlexpr_sqlite.Make(Sqlexpr_concurrency.Id)
module S = Sqlexpr
end
let init db =
let open SYNC in
S.execute (S.make db) sql"CREATE TABLE foo(id INTEGER PRIMARY KEY, v TEXT)"
module BM(Sqlexpr : Sqlexpr_sqlite.S with type 'a result = 'a Lwt.t) =
stru... | null | https://raw.githubusercontent.com/mfp/ocaml-sqlexpr/5b22129a837d43df189bb29aa1d594412075e4f6/tests/syntax/t_parse.ml | ocaml |
open Printf
open Lwt
module SYNC =
struct
module Sqlexpr = Sqlexpr_sqlite.Make(Sqlexpr_concurrency.Id)
module S = Sqlexpr
end
let init db =
let open SYNC in
S.execute (S.make db) sql"CREATE TABLE foo(id INTEGER PRIMARY KEY, v TEXT)"
module BM(Sqlexpr : Sqlexpr_sqlite.S with type 'a result = 'a Lwt.t) =
stru... | |
32b4a72193b4fbbec20d2660525af5ac77fad7914ded72f46a71f71f97a20a1c | fugue/fregot | Tests.hs | |
Copyright : ( c ) 2020 Fugue , Inc.
License : Apache License , version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
Copyright : (c) 2020 Fugue, Inc.
License : Apache License, version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
-}
{-# LANGUAGE Over... | null | https://raw.githubusercontent.com/fugue/fregot/c3d87f37c43558761d5f6ac758d2f1a4117adb3e/tests/hs/Fregot/Parser/Tests.hs | haskell | # LANGUAGE OverloadedStrings # | |
Copyright : ( c ) 2020 Fugue , Inc.
License : Apache License , version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
Copyright : (c) 2020 Fugue, Inc.
License : Apache License, version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
-}
module Fregot.Par... |
2fd7783e659eb653d9eaae19492dd8e6222ebad4d9ec14cb984870955dc08dd3 | zmthy/http-media | RenderHeader.hs | ------------------------------------------------------------------------------
| Defines the ' RenderHeader ' type class , with the ' renderHeader ' method .
-- 'renderHeader' can be used to render basic header values (acting as
identity on ' ByteString 's ) , but it will also work on lists of quality
-- values, wh... | null | https://raw.githubusercontent.com/zmthy/http-media/bc45b456299712299078167cb4b29eba551c54c9/src/Network/HTTP/Media/RenderHeader.hs | haskell | ----------------------------------------------------------------------------
'renderHeader' can be used to render basic header values (acting as
values, which provides the necessary interface for rendering the full
possibilities of Accept headers.
---------------------------------------------------------------------... | | Defines the ' RenderHeader ' type class , with the ' renderHeader ' method .
identity on ' ByteString 's ) , but it will also work on lists of quality
module Network.HTTP.Media.RenderHeader
( RenderHeader (..)
) where
import Data.ByteString (ByteString, intercalate)
| A class for header val... |
f9893f34d76e41147355b372c60182b297e379c99b7722cffe95b862294873c8 | emqx/ekka | mod_etcd.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2019 EMQ Technologies Co. , Ltd. 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 may obtain a copy of the L... | null | https://raw.githubusercontent.com/emqx/ekka/c7f3643545123d4b7348d969877c8f0fac1abdb8/test/mod_etcd.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2019 EMQ Technologies Co. , Ltd. 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(mod_etcd).
-include_lib("inets/include/httpd.hrl").
-export([do/1]).
do(_Req = #mod{method =... |
9c9994462e70a148194e5b0b6d0db680e4479db7003f5e34af45da6c078a732e | stanfordhaskell/cs43 | Main.hs | module Main where
import Data.Semigroup (stimes) -- stimes not imported by default
main :: IO ()
main = do
putStrLn "hello world"
newtype Product = Product Int deriving (Show)
newtype Sum = Sum Int deriving (Show)
instance Semigroup Sum where
_ <> _ = undefined -- define <>
define O(1 ) stimes
--... | null | https://raw.githubusercontent.com/stanfordhaskell/cs43/8353da9e27336a7fe23488c3536e0dab4aaabfff/starter-code/assignment2/src/Main.hs | haskell | stimes not imported by default
define <>
note the type is of stimes :: (Integral b) => b -> a -> a
fromIntegral function to cast any `Integral` value to any other `Num`
value, for example if `x` has a type in typeclass `Integral` then
`fromIntegral x` can be any type (for example, `Int`) in the typeclass
d... | module Main where
main :: IO ()
main = do
putStrLn "hello world"
newtype Product = Product Int deriving (Show)
newtype Sum = Sum Int deriving (Show)
instance Semigroup Sum where
define O(1 ) stimes
To use the first argument as a value of type ` Int ` , you can use the
` Num ` . If you get stuck ,... |
d56f32f5e101f18735c44191c06e0a1adc819fbedbc59a42a7e4bef1cc69ff1e | 5HT/ant | Bezier.mli |
open XNum;
type spline = (num * num * num * num * num * num * num * num);
type path_spec;
value angle_of_vec : num -> num -> float;
value make_spec : num -> num -> path_spec;
value close_spec : path_spec -> bool -> array spline;
value add_point : path_spec -> num -> num -> path_spec;
val... | null | https://raw.githubusercontent.com/5HT/ant/6acf51f4c4ebcc06c52c595776e0293cfa2f1da4/Runtime/Bezier.mli | ocaml |
open XNum;
type spline = (num * num * num * num * num * num * num * num);
type path_spec;
value angle_of_vec : num -> num -> float;
value make_spec : num -> num -> path_spec;
value close_spec : path_spec -> bool -> array spline;
value add_point : path_spec -> num -> num -> path_spec;
val... | |
e827735b027abfc38cbfae26b9c7dbabb6cdcbc565b7eee6a25820d170b8c0c6 | stathissideris/dali | svg_context.clj | (ns dali.svg-context)
(defprotocol SVGContext
(get-bounds [this doc path])
(get-relative-bounds [this doc path]))
| null | https://raw.githubusercontent.com/stathissideris/dali/97ebf43527fe76e838d7b6bb98a953db2747824d/src/dali/svg_context.clj | clojure | (ns dali.svg-context)
(defprotocol SVGContext
(get-bounds [this doc path])
(get-relative-bounds [this doc path]))
| |
c52a756e238deaab8f7f87d5889a82c4f32b325f525bcca53c9a03174c544fd3 | bvaugon/ocapic | chargen.ml | (*************************************************************************)
(* *)
(* OCaPIC *)
(* *)
... | null | https://raw.githubusercontent.com/bvaugon/ocapic/a14cd9ec3f5022aeb5fe2264d595d7e8f1ddf58a/tests/chargen/chargen.ml | ocaml | ***********************************************************************
OCaPIC
... |
This file is distributed under the terms of the CeCILL license .
open Pic;;
module Disp = Lcd.Connect (
struct
let bus_size = Lcd.Four
let e = LATD0
let rs = LATD2
let rw = LATD1
let bus = PORTB
end
);;
Disp.init ();;
Disp... |
bf458325c1be2fcacc206640f04b9a6f3445ce3c2bc45337ada1f29779616290 | hercules-ci/hercules-ci-agent | STMSpec.hs | # LANGUAGE BlockArguments #
module Hercules.Agent.Worker.STMSpec (spec) where
import Control.Concurrent.STM (newEmptyTMVarIO, putTMVar, readTMVar)
import Hercules.Agent.Worker.STM
import Protolude
import Test.Hspec
spec :: Spec
spec = do
describe "asyncIfSTM" do
it "can create a valid async" do
fooAsync ... | null | https://raw.githubusercontent.com/hercules-ci/hercules-ci-agent/2437ff55720063dcbb9f85a63c40e2589867a29b/hercules-ci-agent/test/Hercules/Agent/Worker/STMSpec.hs | haskell | # LANGUAGE BlockArguments #
module Hercules.Agent.Worker.STMSpec (spec) where
import Control.Concurrent.STM (newEmptyTMVarIO, putTMVar, readTMVar)
import Hercules.Agent.Worker.STM
import Protolude
import Test.Hspec
spec :: Spec
spec = do
describe "asyncIfSTM" do
it "can create a valid async" do
fooAsync ... | |
31e42538713297d002cb90ae15d56aab2c8550f1973fcb31df7170cb2bf4708e | ngless-toolkit/ngless | FastQ.hs | Copyright 2013 - 2020 NGLess Authors
- License : MIT
- License: MIT
-}
# LANGUAGE TemplateHaskell , QuasiQuotes #
module Tests.FastQ
( tgroup_FastQ
) where
import Test.Tasty.TH
import Test.QuickCheck.Arbitrary
import Test.QuickCheck.Gen
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import qua... | null | https://raw.githubusercontent.com/ngless-toolkit/ngless/c69baf7e00e807a82ec1b1276763f74f4a5411b2/Tests-Src/Tests/FastQ.hs | haskell | | reads a sequence of short reads.
returns an error if there are any problems.
Note that the result of this function is not lazy! It will consume the whole
whether an error occurred).
Test SUBSTRIM/ENDSTRIM
Property 1: For every s, the size must be always smaller than the input
Property 2: substrim should be ide... | Copyright 2013 - 2020 NGLess Authors
- License : MIT
- License: MIT
-}
# LANGUAGE TemplateHaskell , QuasiQuotes #
module Tests.FastQ
( tgroup_FastQ
) where
import Test.Tasty.TH
import Test.QuickCheck.Arbitrary
import Test.QuickCheck.Gen
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import qua... |
dbe692f0d10d9c101183458d386af0257671bf42e6e9eb86bb2c9a19905b6480 | pjones/byline | Shell.hs | -- |
--
-- Copyright:
-- This file is part of the package byline. It is subject to the
-- license terms in the LICENSE file found in the top-level
-- directory of this distribution and at:
--
--
--
-- No part of this package, including this file, may be copied,
-- modified, propagated, or distributed exc... | null | https://raw.githubusercontent.com/pjones/byline/e975c1d6787acb7019d86cf9e29746796e4a5134/src/Byline/Shell.hs | haskell | |
Copyright:
This file is part of the package byline. It is subject to the
license terms in the LICENSE file found in the top-level
directory of this distribution and at:
No part of this package, including this file, may be copied,
modified, propagated, or distributed except according to the
... | module Byline.Shell
Shell (..),
runShell,
shellHelp,
shellCompletion,
module Byline.Completion,
)
where
import Byline
import Byline.Completion
import qualified Data.Attoparsec.Text as Atto
import Data.Char
import qualified Data.Text as Text
import qualified Options.Applicative as O
import qualif... |
90c604df00caa61abe756aad29870ee57d72a2cc5d02bdea8ed54d140409e36a | exoscale/vinyl | build.clj | (ns build
(:require [clojure.tools.build.api :as b]))
(defn compile-java
[_]
(b/javac {:src-dirs ["protobuf"]
:class-dir "target/classes"
:basis (b/create-basis {})}))
| null | https://raw.githubusercontent.com/exoscale/vinyl/aed9094588f3c5ab9ea2868f9eebc05d2c19bba2/protobuf/build.clj | clojure | (ns build
(:require [clojure.tools.build.api :as b]))
(defn compile-java
[_]
(b/javac {:src-dirs ["protobuf"]
:class-dir "target/classes"
:basis (b/create-basis {})}))
| |
6a4e647f2285ab05285f512a7cf097d3a95c9eb1b0a24835a7b8562f48acda42 | cl-axon/shop2 | Log_ran_problems_35.lisp | name : Log_ran_problems.lisp
# packages : 35 # citys : NUM_CITY
# planes : 7 seed:930944009
;;--------------------------------------
(in-package :shop2-user)
(defproblem log-ran-35-1 logistics
(
(AIRPLANE plane1)
(airplane-at plane1 LOC8-1)
(AIRPLANE plane2)
(airplane-at plane2 LOC17-1)
(AIRPLANE plan... | null | https://raw.githubusercontent.com/cl-axon/shop2/9136e51f7845b46232cc17ca3618f515ddcf2787/examples/logistic/Log_ran_problems_35.lisp | lisp | --------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------... | name : Log_ran_problems.lisp
# packages : 35 # citys : NUM_CITY
# planes : 7 seed:930944009
(in-package :shop2-user)
(defproblem log-ran-35-1 logistics
(
(AIRPLANE plane1)
(airplane-at plane1 LOC8-1)
(AIRPLANE plane2)
(airplane-at plane2 LOC17-1)
(AIRPLANE plane3)
(airplane-at plane3 LOC13-1)
(AIRPL... |
ee1ac6fe9c91a116b36bef03dab776b91be539cd76319d0fbb88ca54d09d2a03 | IvanMalison/notifications-tray-icon | Util.hs | module StatusNotifier.Item.Notifications.Util where
import Control.Arrow
import Control.Monad.Fail
import Control.Monad.IO.Class
import Data.Maybe
import qualified Data.Text as T
import GI.Dbusmenu
import System.Exit (ExitCode (..))
import System.Lo... | null | https://raw.githubusercontent.com/IvanMalison/notifications-tray-icon/8b11b1ddddce8531fca54786cf81b2e8f9d7f111/src/StatusNotifier/Item/Notifications/Util.hs | haskell | | Run the provided command with the provided arguments. | module StatusNotifier.Item.Notifications.Util where
import Control.Arrow
import Control.Monad.Fail
import Control.Monad.IO.Class
import Data.Maybe
import qualified Data.Text as T
import GI.Dbusmenu
import System.Exit (ExitCode (..))
import System.Lo... |
5f9a5a001255b5aabae4e8abd2d4fb2e3d70602c44020749d9026953334255dc | tlaplus/tlapm | error.ml | Copyright 2005 INRIA
open Printf;;
let warnings_flag = ref true;;
let got_warning = ref false;;
let err_file = ref "";;
let print_header = ref false;;
let header = ref "";;
let set_header msg =
print_header := true;
header := msg;
;;
let err_oc = ref stderr;;
let err_inited = ref false;;
let print kind m... | null | https://raw.githubusercontent.com/tlaplus/tlapm/b82e2fd049c5bc1b14508ae16890666c6928975f/zenon/error.ml | ocaml | Copyright 2005 INRIA
open Printf;;
let warnings_flag = ref true;;
let got_warning = ref false;;
let err_file = ref "";;
let print_header = ref false;;
let header = ref "";;
let set_header msg =
print_header := true;
header := msg;
;;
let err_oc = ref stderr;;
let err_inited = ref false;;
let print kind m... | |
84de1cd60074bd178a794fa0562b5a2cc3f7b14c7807c6421e90cb121e0475cb | gfour/gic | EvalFL.hs | | A non - strict interpreter for FL .
--
-- The interpreter is based on activation records that contain variable bindings.
-- Evaluation uses a context stack and pattern matching uses a list of nested
-- contexts. The evaluation model is very close to eduction after the
-- intensional transformation is appli... | null | https://raw.githubusercontent.com/gfour/gic/d5f2e506b31a1a28e02ca54af9610b3d8d618e9a/SLIC/Front/EvalFL.hs | haskell |
The interpreter is based on activation records that contain variable bindings.
Evaluation uses a context stack and pattern matching uses a list of nested
contexts. The evaluation model is very close to eduction after the
intensional transformation is applied to the source program.
constructor name
var... | | A non - strict interpreter for FL .
module SLIC.Front.EvalFL (evalFL) where
import qualified Data.Map as M (lookup)
import Data.Maybe (fromJust)
import Data.Sequence (elemIndexR, fromList)
import SLIC.AuxFun (ierr)
import qualified SLIC.SyntaxAux as SA
import qualified SLIC.SyntaxFL as SFL
import qualified SLIC.T... |
6012b0e2614aff9ac6b57e0ba2299a02f4639bb1b2152d6f2e813fe17ca79293 | sweirich/pi-forall | Environment.hs | {- pi-forall language -}
-- | Utilities for managing a typechecking context.
module Environment
( TcMonad,
runTcMonad,
Env,
emptyEnv,
lookupTy,
lookupTyMaybe,
lookupDef,
lookupRecDef,
lookupHint ,
getCtx,
getLocalCtx,
extendCtx,
extendCtxs,
extendCtxsGlobal,
e... | null | https://raw.githubusercontent.com/sweirich/pi-forall/93de2eee777c9123bf67534b7b8453656370542d/version3/src/Environment.hs | haskell | pi-forall language
| Utilities for managing a typechecking context.
environment), freshness state (for supporting locally-nameless
(for e.g. warning messages).
| Entry point for the type checking monad, given an
initial environment, returns either an error message
or some result.
| Marked locations in the sou... |
module Environment
( TcMonad,
runTcMonad,
Env,
emptyEnv,
lookupTy,
lookupTyMaybe,
lookupDef,
lookupRecDef,
lookupHint ,
getCtx,
getLocalCtx,
extendCtx,
extendCtxs,
extendCtxsGlobal,
extendCtxMods,
extendHints,
extendSourceLocation,
getSourceLocatio... |
d903bdf7913b1e1d87e98328c2bb8315b30c5b8f7ec60a2dc937be02729710ad | input-output-hk/ouroboros-network | Enclose.hs | # LANGUAGE PatternSynonyms #
-- | Utility functions for enclosing a code segment with tracing events.
module Ouroboros.Consensus.Util.Enclose (
Enclosing
, Enclosing' (..)
, encloseWith
, pattern FallingEdge
) where
import Control.Tracer (Tracer, traceWith)
data Enclosing' a =
-- | Precedin... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/c254d02b9de67cabc71d26e3f27a2a3d13538d21/ouroboros-consensus/src/Ouroboros/Consensus/Util/Enclose.hs | haskell | | Utility functions for enclosing a code segment with tracing events.
| Preceding a specific code segment.
| Succeeding a specific code segment, with extra information. | # LANGUAGE PatternSynonyms #
module Ouroboros.Consensus.Util.Enclose (
Enclosing
, Enclosing' (..)
, encloseWith
, pattern FallingEdge
) where
import Control.Tracer (Tracer, traceWith)
data Enclosing' a =
RisingEdge
| FallingEdgeWith !a
deriving (Show, Eq, Ord)
type Enclosing = Enclosi... |
a6601afb52d8a2c6fa3cf34cbe7f3f02845fb5cb653ccc38febd7084de7fc630 | bitblaze-fuzzball/fuzzball | asmir.mli | * High level interface to libasmir .
The functions in this file should be used instead of calling functions
directly . These functions should be easier to use , and , unlike the Libasmir
ones , will handle garbage collection .
@author
The functions in this file should be used... | null | https://raw.githubusercontent.com/bitblaze-fuzzball/fuzzball/b9a617b45e68fa732f1357fedc08a2a10f87a62c/ocaml/asmir.mli | ocaml | This interface is a work-in-progress. I just created it now to avoid exposing
some variables I added. --aij
these shold be deprecated, but vine_tovine and some other stuff still uses
them
newer interface to replace x86_*
takes a char array for historical reasons, but a string would be better
string | * High level interface to libasmir .
The functions in this file should be used instead of calling functions
directly . These functions should be easier to use , and , unlike the Libasmir
ones , will handle garbage collection .
@author
The functions in this file should be used... |
1a50dbfb1b4a7ea59997ce74e637e6a77c4ccb4716df7c019810dcca61c7687c | simonmar/haxl-icfp14-sample-code | Types.hs | # LANGUAGE ExistentialQuantification , GADTs , StandaloneDeriving #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE DeriveDataTypeable #-}
module Types where
import Data.Time
import Data.Typeable
import Data.Hashable
-- -----------------------------------------------------------------------------
-- Types
type ... | null | https://raw.githubusercontent.com/simonmar/haxl-icfp14-sample-code/31859f50e0548f3e581acd26944ceb00953f2c42/haxl-cache/Types.hs | haskell | # LANGUAGE DeriveDataTypeable #
-----------------------------------------------------------------------------
Types
<<Types
>>
<<Request
>>
>> | # LANGUAGE ExistentialQuantification , GADTs , StandaloneDeriving #
# LANGUAGE GeneralizedNewtypeDeriving #
module Types where
import Data.Time
import Data.Typeable
import Data.Hashable
type Id = Int
type Date = UTCTime
newtype PostId = PostId Id
deriving (Eq, Ord, Num, Hashable)
type PostContent = String
data ... |
b2ae160ab672dc6932dae4b7a23ac9e2e278683b6a5304b45d1cc82b83d43f35 | HealthSamurai/dojo.clj | 12_sequence_comprehensions_test.clj | (ns koans.12-sequence-comprehensions-test
(:require [koans.engine :refer :all]))
(meditations
"Sequence comprehensions can bind each element in turn to a symbol"
(= __
(for [x (range 6)]
x))
"They can easily emulate mapping"
(= '(0 1 4 9 16 25)
(map (fn [x] (* x x))
(range 6))
... | null | https://raw.githubusercontent.com/HealthSamurai/dojo.clj/94922640f534897ab2b181c608b54bfbb8351d7b/test/koans/12_sequence_comprehensions_test.clj | clojure | (ns koans.12-sequence-comprehensions-test
(:require [koans.engine :refer :all]))
(meditations
"Sequence comprehensions can bind each element in turn to a symbol"
(= __
(for [x (range 6)]
x))
"They can easily emulate mapping"
(= '(0 1 4 9 16 25)
(map (fn [x] (* x x))
(range 6))
... | |
355f397d9a16367ab9392016118d051597c37003f4d7dd0a634c30b8f5c94094 | liquidz/clj-vimhelp | parser.clj | (ns vimhelp.parser
(:require
[clojure.string :as str]))
(declare parse-line)
(defn replace-by
[s re f]
(let [re (re-pattern (str "(.*)" re "(.*)"))]
(if-let [[[_ head body tail]] (re-seq re s)]
^::matched [head (f body) tail]
[s])))
(defn parse-texts
[texts re f]
(let [res (map #(if (vec... | null | https://raw.githubusercontent.com/liquidz/clj-vimhelp/df108dff495842da2e190a178869c8ea1ff1d1db/src/vimhelp/parser.clj | clojure | Explicit end of example
Inside example
Implicit end of example | (ns vimhelp.parser
(:require
[clojure.string :as str]))
(declare parse-line)
(defn replace-by
[s re f]
(let [re (re-pattern (str "(.*)" re "(.*)"))]
(if-let [[[_ head body tail]] (re-seq re s)]
^::matched [head (f body) tail]
[s])))
(defn parse-texts
[texts re f]
(let [res (map #(if (vec... |
2c0943edca40a741cddbc9d0baa6e86eaf918d1cbc960b0161db51ddce449db5 | hellopatrick/xmas | main.ml | open Containers
module C = Xmas.Coordinate
module M = Map.Make (C)
module P = struct
open Angstrom
open Xmas.Parsing
let comma = char ','
let coord = lift3 (fun x _ y -> (x, y)) number comma number
let arrow = string " -> "
let coord_list = sep_by arrow coord
let parse line =
parse_string ~consu... | null | https://raw.githubusercontent.com/hellopatrick/xmas/87e21ef5d0be59cb8ffda412511180f4136934f3/2022/day14/main.ml | ocaml | open Containers
module C = Xmas.Coordinate
module M = Map.Make (C)
module P = struct
open Angstrom
open Xmas.Parsing
let comma = char ','
let coord = lift3 (fun x _ y -> (x, y)) number comma number
let arrow = string " -> "
let coord_list = sep_by arrow coord
let parse line =
parse_string ~consu... | |
8b8b58758c931920dd8ffcf84b5761ad4329c9e9b30a89d91438f20551ff1e56 | write-you-a-scheme-v2/scheme | testReadScript.hs | {-# LANGUAGE OverloadedStrings #-}
module Cli (
cliIface,
) where
import System.IO
import System.Environment --getArgs
import Eval
import Data.Text as T
import Control.Monad.Trans
import Options.Applicative
import Options.Applicative
import Data.Semigroup ((<>))
--
process :: String -> IO ()
process = evalText $ ... | null | https://raw.githubusercontent.com/write-you-a-scheme-v2/scheme/39f2edf3d2b0f04d76def72c7ea020312e54d601/archive/testReadScript.hs | haskell | # LANGUAGE OverloadedStrings #
getArgs
make this more robust
-applicative
default to empty string so we don't need to specify in the case of using the REPL
script
repl
script, then repl | module Cli (
cliIface,
) where
import System.IO
import Eval
import Data.Text as T
import Control.Monad.Trans
import Options.Applicative
import Options.Applicative
import Data.Semigroup ((<>))
process :: String -> IO ()
process = evalText $ T.pack str
cliIface :: IO ()
cliIface = do
args <- getArgs
inh <- o... |
cdb9b19dae8a725f77060538d57fe2f10ced35f9f99ec907c5a98088684d0f42 | oakmac/humble-animations | ui.clj | (ns humble-animations.ui
"Creates the animation-ticker wrapper component, which is used to trigger animate/tick!
after a draw operation"
(:require
[humble-animations.animate :as animate]
[io.github.humbleui.core :as core]
[io.github.humbleui.protocols :as protocols])
(:import
[io.github.humbleui... | null | https://raw.githubusercontent.com/oakmac/humble-animations/b3c6d54747da904fdc60025da7892570f89175a5/src/humble_animations/ui.clj | clojure | call animate/tick! after we have drawn this components children | (ns humble-animations.ui
"Creates the animation-ticker wrapper component, which is used to trigger animate/tick!
after a draw operation"
(:require
[humble-animations.animate :as animate]
[io.github.humbleui.core :as core]
[io.github.humbleui.protocols :as protocols])
(:import
[io.github.humbleui... |
a63e8f4b891d500b5e6da9d3cc09ebbbf606c6d9fc88939b548fe2715c0f805d | haskell-opengl/GLUT | PickDepth.hs |
PickDepth.hs ( adapted from which is ( c ) Silicon Graphics , Inc. )
Copyright ( c ) 2002 - 2018 < >
This file is part of HOpenGL and distributed under a BSD - style license
See the file libraries / GLUT / LICENSE
Picking is demonstrated in this program . In rendering mode , three
ove... | null | https://raw.githubusercontent.com/haskell-opengl/GLUT/36207fa51e4c1ea1e5512aeaa373198a4a56cad0/examples/RedBook4/PickDepth.hs | haskell | The default z mapping
and the other for the column on the grid. The color of each square is
determined by its position on the grid, and the value in the board array.
Note: In contrast to the the original example, we always give names to
squares, regardless of the render mode. This simplifies the code a bit and
re... |
PickDepth.hs ( adapted from which is ( c ) Silicon Graphics , Inc. )
Copyright ( c ) 2002 - 2018 < >
This file is part of HOpenGL and distributed under a BSD - style license
See the file libraries / GLUT / LICENSE
Picking is demonstrated in this program . In rendering mode , three
ove... |
3dab0c9f84c83e67a1c4a7f86fdb36b1a4a511d8cadbdded3355f9cb82602992 | awslabs/quivela | EnvelopeSmall.hs | Copyright 2018 Amazon.com , Inc. or its affiliates . All Rights Reserved .
SPDX - License - Identifier : Apache-2.0
# LANGUAGE QuasiQuotes #
import Prelude
import Quivela
import qualified System.Exit as E
program =
prove'
emptyVerifyEnv
[prog'|
function skenc(k, a, m)
function skdec(k, a, c)
assert ∀ k... | null | https://raw.githubusercontent.com/awslabs/quivela/c58a883c9387c18b51a83ede60fbb131357173e8/examples/EnvelopeSmall.hs | haskell | Copyright 2018 Amazon.com , Inc. or its affiliates . All Rights Reserved .
SPDX - License - Identifier : Apache-2.0
# LANGUAGE QuasiQuotes #
import Prelude
import Quivela
import qualified System.Exit as E
program =
prove'
emptyVerifyEnv
[prog'|
function skenc(k, a, m)
function skdec(k, a, c)
assert ∀ k... | |
c3551cde5bbdf0c5fcb7c2c087d8884049b7fc07c736f66353d5f722252a8e30 | facebookarchive/pfff | ref.mli |
val x: int
val y: int ref
val z: Hashtbl.t
| null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/tests/ml/visual/ref.mli | ocaml |
val x: int
val y: int ref
val z: Hashtbl.t
| |
ac3250d2c0b6c0c8d8c3835a22891fdcefd27fb283f1d1456552f9c0eed7774b | bos/rwh | ListMonad.hs | {-- snippet returnSingleton --}
returnSingleton :: a -> [a]
returnSingleton x = [x]
{-- /snippet returnSingleton --}
{-- snippet instance --}
instance Monad [] where
return x = [x]
xs >>= f = concat (map f xs)
{-- /snippet instance --}
{-- snippet rest --}
xs >> f = concat (map (\_ -> f) xs)
fail _ = [... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch15/ListMonad.hs | haskell | - snippet returnSingleton -
- /snippet returnSingleton -
- snippet instance -
- /snippet instance -
- snippet rest -
- /snippet rest - | returnSingleton :: a -> [a]
returnSingleton x = [x]
instance Monad [] where
return x = [x]
xs >>= f = concat (map f xs)
xs >> f = concat (map (\_ -> f) xs)
fail _ = []
|
7cb5d9c7fbaebb32b66aa15eff2e2e3934a9365a2da024dee88da4787199a68a | stchang/macrotypes | stlc+reco+sub-tests.rkt | #lang s-exp turnstile/examples/stlc+reco+sub
(require "rackunit-typechecking.rkt")
;; record subtyping tests
(check-type "coffee" : String)
(check-type (tup [coffee = 3]) : (× [coffee : Int])) ; element subtyping
(check-type (var coffee = 3 as (∨ [coffee : Nat])) : (∨ [coffee : Int])) ; element subtyping
;err
(typeche... | null | https://raw.githubusercontent.com/stchang/macrotypes/05ec31f2e1fe0ddd653211e041e06c6c8071ffa6/turnstile-test/tests/turnstile/stlc%2Breco%2Bsub-tests.rkt | racket | record subtyping tests
element subtyping
element subtyping
err
element subtyping (twice)
width subtyping
width+element subtyping
examples from tapl ch26, bounded quantification
this should work! but needs bounded quantification, see fsub.rkt
conditional
previous record tests ----------------------------------... | #lang s-exp turnstile/examples/stlc+reco+sub
(require "rackunit-typechecking.rkt")
(check-type "coffee" : String)
(typecheck-fail
(var cooffee = 3 as (∨ [coffee : Nat]))
#:with-msg "cooffee field does not exist")
(check-type (tup [coffee = 3]) : (× [coffee : Nat]))
(check-type (tup [coffee = 3]) : (× [coffee : Top])... |
1ade5fc2683fff6ca994a609f444d60397335e7ef0f9f70d6f84b7cb80171c49 | avsm/ocaml-regexp | regular_expr.mli |
type regexp;;
val uniq_tag : regexp -> int;;
val empty : regexp;;
val epsilon : regexp;;
val char : char -> regexp;;
val char_interv : char -> char -> regexp;;
val string : string -> regexp;;
val star : regexp -> regexp;;
val alt : regexp -> regexp -> regexp;;
val seq : regexp -> regexp -> regexp;;
val opt : regexp ... | null | https://raw.githubusercontent.com/avsm/ocaml-regexp/90298a535e2570b35eede9cafb698cb7f7329367/lib/regular_expr.mli | ocaml |
type regexp;;
val uniq_tag : regexp -> int;;
val empty : regexp;;
val epsilon : regexp;;
val char : char -> regexp;;
val char_interv : char -> char -> regexp;;
val string : string -> regexp;;
val star : regexp -> regexp;;
val alt : regexp -> regexp -> regexp;;
val seq : regexp -> regexp -> regexp;;
val opt : regexp ... | |
19fbb26aa3d79a8b5238b374ee0f59a053bdfeaed525f127b5d1615b29769987 | anmonteiro/gluten | tls_io.dummy.ml | ----------------------------------------------------------------------------
* Copyright ( c ) 2019
*
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1... | null | https://raw.githubusercontent.com/anmonteiro/gluten/1ba9264df281d39d72b3cfcb3327cfe50f02a719/async/tls_io.dummy.ml | ocaml | ----------------------------------------------------------------------------
* Copyright ( c ) 2019
*
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1... | |
f5339a832e1644673051bcb612c503d5c3594aa9eaba273f1650943fbb3b2f74 | slepher/astranaut | astranaut_do.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2020 ,
%%% @doc
%%%
%%% @end
Created : 2 Jul 2020 by < >
%%%-------------------------------------------------------------------
-module(astranaut_do).
-include("quote.hrl").
%% API
-export([do/2]).
-export([parse... | null | https://raw.githubusercontent.com/slepher/astranaut/f02f62b2036e024dc596eb4d1b8af64a686f9410/src/astranaut_do.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
===================================================================
API
===================================================================
=========================... | @author < >
( C ) 2020 ,
Created : 2 Jul 2020 by < >
-module(astranaut_do).
-include("quote.hrl").
-export([do/2]).
-export([parse_transform/2, format_error/1]).
-spec do(erl_syntax:abstract(), #{monad := module(), monad_fail := module()}) ->
astranaut_traverse:return(erl_syntax:abst... |
fdb280c42765fe71c267b53d7e26c1ce6d27bb86097869d583d774cb54441e86 | jrm-code-project/LISP-Machine | sysdef.lisp | -*- Mode : LISP ; Package : USER ; Fonts:(CPTFONT ) ; -*-
Copyright ( C ) Lisp Machine , Inc. 1984 , 1985 , 1986
;;; See filename "Copyright" for
;;; licensing and release information.
(defflavor zwei:gateway-constraint-frame ()())
(let ((inhibit-fdefine-warnings t))
(load "dj:l.dired-fsdebug;odm-dired-envi... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/dired-fsdebug/sysdef.lisp | lisp | Package : USER ; Fonts:(CPTFONT ) ; -*-
See filename "Copyright" for
licensing and release information. |
Copyright ( C ) Lisp Machine , Inc. 1984 , 1985 , 1986
(defflavor zwei:gateway-constraint-frame ()())
(let ((inhibit-fdefine-warnings t))
(load "dj:l.dired-fsdebug;odm-dired-environment")
(load "dj:l.dired-fsdebug;fs-redefs")
(load "dj:l.dired-fsdebug;tv-redefs")
(load "dj:l.dired-fsdebug;zwei-redefs"))
(l... |
977437039f3613819638526e1f14647900a84eac2fc4c0628b15cddea865d62d | UU-ComputerScience/uhc | Main.hs | -- !!! count the number of solutions to the "n queens" problem.
( grabbed from LML dist )
import System.Environment
main = do
[arg] <- getArgs
print $ nsoln $ read arg
nsoln nq = length (gen nq)
where
safe :: Int -> Int -> [Int] -> Bool
safe x d [] = True
safe x d (q:l) = x /= q && x /= q+d && x ... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/benchmark/nofib/imag/queens/Main.hs | haskell | !!! count the number of solutions to the "n queens" problem. | ( grabbed from LML dist )
import System.Environment
main = do
[arg] <- getArgs
print $ nsoln $ read arg
nsoln nq = length (gen nq)
where
safe :: Int -> Int -> [Int] -> Bool
safe x d [] = True
safe x d (q:l) = x /= q && x /= q+d && x /= q-d && safe x (d+1) l
gen :: Int -> [[Int]]
gen 0 = ... |
4e9684a82720104cf1411ea5a3a07f65e11c98e9b11e146015b659224227e5cd | theodormoroianu/SecondYearCourses | HaskellChurch_20210415162619.hs | {-# LANGUAGE RankNTypes #-}
module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = show $ cIf b True False
The boolean constant true always chooses the ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurch_20210415162619.hs | haskell | # LANGUAGE RankNTypes #
The boolean negation switches the alternatives
The boolean conjunction can be built as a conditional
The boolean disjunction can be built as a conditional
a pair is a way to compute something based on the values
contained within the pair.
a function to be applied on the values, it will apply i... | module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = show $ cIf b True False
The boolean constant true always chooses the first alternative
cTrue :: C... |
ec4e8340b7f77eed73a9fbae49c034b157576fbece7f7e15bc0f62be31ea45af | timbod7/haskell-chart | darcs_usage.hs | -- Quick script to plot darcs patches over time, by user.
-- relies on the following non-standard packages from hackage:
-- xml
-- data-accessor
Chart
import System.Process
import System.IO
import Data.Time.Calendar
import Data.Time.LocalTime
import Data.Time.Format
import Control.Lens
import Data.De... | null | https://raw.githubusercontent.com/timbod7/haskell-chart/8c5a823652ea1b4ec2adbced4a92a8161065ead6/chart-tests/tests/gtk/darcs_usage.hs | haskell | Quick script to plot darcs patches over time, by user.
relies on the following non-standard packages from hackage:
xml
data-accessor | Chart
import System.Process
import System.IO
import Data.Time.Calendar
import Data.Time.LocalTime
import Data.Time.Format
import Control.Lens
import Data.Default
import Data.List(sort,nub)
import qualified Data.Map as Map
import qualified Text.XML.Light as X
import qualified Text.XML.Light.Input as X
import quali... |
b3617ce1896b113dfd83098bf8613418e4086ccfebf345da15320b2b0a873239 | iburzynski/EMURGO_73 | GroupStudents.hs | {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
# HLINT ignore " Eta reduce " #
module GroupStudents where
import StudentData (students)
import qualified Data.Map.Strict as M
-- Introduce some type synonyms to make our type signature more readable:
type StudentRecord = (String, Char)
type GroupedStudents = ([String], [... | null | https://raw.githubusercontent.com/iburzynski/EMURGO_73/a2ee8eb5676b00905f8057b02c451decb776d2bf/HW_08-11/GroupStudents/GroupStudents.hs | haskell | # OPTIONS_GHC -Wno-unrecognised-pragmas #
Introduce some type synonyms to make our type signature more readable:
We want to implement a function that groups a list of student record pairs:
In an imperative language we would use mutable variables and a loop to solve this
We would like our type signature to look like... | # HLINT ignore " Eta reduce " #
module GroupStudents where
import StudentData (students)
import qualified Data.Map.Strict as M
type StudentRecord = (String, Char)
type GroupedStudents = ([String], [String], [String])
Our output will be a three - tuple containing 3 lists : ( Group A , Group B , Group C ) .
( see... |
c4f92c8e34e45cb32285384fb9bbc4cc8cd56e7a4f94cdfe7413a63f67a6e159 | stchang/macrotypes | fomega2.rkt | #lang s-exp macrotypes/typecheck
(reuse Int + #:from "sysf.rkt")
(require (prefix-in sysf: (only-in "sysf.rkt" →- → #%app λ))
(only-in "sysf.rkt" ~→ →?)
(for-syntax racket/string))
(reuse define-type-alias String #%datum #:from "stlc+reco+var.rkt")
same as fomega.rkt except λ and # % app works as b... | null | https://raw.githubusercontent.com/stchang/macrotypes/05ec31f2e1fe0ddd653211e041e06c6c8071ffa6/macrotypes-example/macrotypes/examples/fomega2.rkt | racket | - uses definition from stlc, but tweaks type? and kind? predicates
→ is also both type and kind
Type relation:
Types:
- types from sysf.rkt
- String from stlc+reco+var
Terms:
- extend ∀ Λ inst from sysf
- #%datum from stlc+reco+var
modify predicates to recognize → (function type) as both type and kind
well-f... | #lang s-exp macrotypes/typecheck
(reuse Int + #:from "sysf.rkt")
(require (prefix-in sysf: (only-in "sysf.rkt" →- → #%app λ))
(only-in "sysf.rkt" ~→ →?)
(for-syntax racket/string))
(reuse define-type-alias String #%datum #:from "stlc+reco+var.rkt")
same as fomega.rkt except λ and # % app works as b... |
0b4884f5942038fd291a370404fc591dcab8db0cd768a8608901ccfee736d074 | Metaxal/rascas | smart-simplify.rkt | #lang racket/base
(require "color-printf.rkt"
"misc.rkt"
"algorithmic.rkt"
"automatic-simplify.rkt"
"factor.rkt"
"distribute.rkt"
"rich-return.rkt"
racket/sandbox
racket/dict
racket/list
racket/match)
(provide smart-simplify
... | null | https://raw.githubusercontent.com/Metaxal/rascas/540530c28689de50c526abf36079c07fd0436edb/smart-simplify.rkt | racket | Tries hard to simplify u with various strategies and returns the transformed tree
with the least tree-cost among the various sequences that have been tried.
Still work in progress.
among the different branches and to ensure that no single branch is taking too much time
(the attempted transformation is halted early... | #lang racket/base
(require "color-printf.rkt"
"misc.rkt"
"algorithmic.rkt"
"automatic-simplify.rkt"
"factor.rkt"
"distribute.rkt"
"rich-return.rkt"
racket/sandbox
racket/dict
racket/list
racket/match)
(provide smart-simplify
... |
a9a59f1a235951a0a24472dfd84fa3de94fcb7dcec2bd69eae0cb009e405c433 | dmbarbour/awelon | AOFile.hs | # LANGUAGE FlexibleInstances , TypeSynonymInstances #
-- | The '.ao' file is a format for developing an AO dictionary in
-- the conventional filesystem + text editor. It is also a suitable
-- format for import and export of AO dictionaries.
--
-- The format is extremely simple:
--
-- import1 import2 import3
... | null | https://raw.githubusercontent.com/dmbarbour/awelon/af9124654dd9462cc4887dccf67b3e33302c7351/hsrc/AO/AOFile.hs | haskell | | The '.ao' file is a format for developing an AO dictionary in
the conventional filesystem + text editor. It is also a suitable
format for import and export of AO dictionaries.
The format is extremely simple:
import1 import2 import3
@word2 more ao code
@word3
"word definitions may require
... | # LANGUAGE FlexibleInstances , TypeSynonymInstances #
@word1 ao code here
common to favor one - line defs
e.g. the ` aoi ` executable loads " aoi " .
Cyclic and redundant imports are not an issue . A file is loaded
some words to be implemented as separate ABC resources . These
module AO.AOFile
(... |
e0614c2cc6c5c4ac78fb58a65056d4d7048047c9047c2cac8399f9c96b5a710e | hpyhacking/openpoker | hand.erl | -module(hand).
-export([new/0, new/1, add/2, size/1, rank/1, merge/2]).
-export([make_card/1, make_cards/1, make_rep/1]).
-export([player_hand/1]).
-include("openpoker.hrl").
-define(MASK_A, 2#10000000000000).
-define(MASK_MAX_STRAIGHT, 2#11111000000000).
-define(MASK_MIN_STRAIGHT, 2#00000000011111).
%%%
%%% PUBLIC... | null | https://raw.githubusercontent.com/hpyhacking/openpoker/643193c94f34096cdcfcd610bdb1f18e7bf1e45e/src/texas/hand.erl | erlang |
PUBLIC
按照花色生成对牌型的位组合
CHECK RANK
PRIVATE
| -module(hand).
-export([new/0, new/1, add/2, size/1, rank/1, merge/2]).
-export([make_card/1, make_cards/1, make_rep/1]).
-export([player_hand/1]).
-include("openpoker.hrl").
-define(MASK_A, 2#10000000000000).
-define(MASK_MAX_STRAIGHT, 2#11111000000000).
-define(MASK_MIN_STRAIGHT, 2#00000000011111).
new() ->
n... |
7efb753dcdb6cba624533a7990093b46f2e7f6eaee6d9d797bcfd188e82e71c1 | adrieng/melitte | Var.ml | module M = Symbol.Make()
include M
| null | https://raw.githubusercontent.com/adrieng/melitte/ee5f3bf21ec5ead972cb9234d67ec783bfdc74a6/src/Var.ml | ocaml | module M = Symbol.Make()
include M
| |
07800568b0fe3fef16c11fb9357fb3d8d71f4f4e39f88ab975eaec5e2562a3b6 | lingnand/VIMonad | XPropManage.hs | # LANGUAGE ScopedTypeVariables #
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Hooks.XPropManage
Copyright : ( c ) < >
-- License : BSD
--
Maintainer : < >
-- Stability : unstable
-- Portability : unportable
--
-- A ManageHook match... | null | https://raw.githubusercontent.com/lingnand/VIMonad/048e419fc4ef57a5235dbaeef8890faf6956b574/XMonadContrib/XMonad/Hooks/XPropManage.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Hooks.XPropManage
License : BSD
Stability : unstable
Portability : unportable
A ManageHook matching on XProperties.
---------------------------------------------------------------------------
* Usage
$... | # LANGUAGE ScopedTypeVariables #
Copyright : ( c ) < >
Maintainer : < >
module XMonad.Hooks.XPropManage (
xPropManageHook, XPropMatch, pmX, pmP
, getQuery
) where
import Control.Exception as E
import Data.Char (chr)
import Data.Monoid (mconcat, Endo(... |
1ba871ccd28ef2381f54d2b1392a37bae6e4cc7a37e493a76b97e0f4c823ccd4 | s-expressionists/Cleavir | domain.lisp | (in-package #:cleavir-abstract-interpreter)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; An abstract DOMAIN is a kind of information about parts of a program. Each
;;;; domain consists of a possibly infinite lattice of "info" objects of
;;;; domain-specific nature. As a la... | null | https://raw.githubusercontent.com/s-expressionists/Cleavir/f4f38868bc86c1d0de44e75375f9dcb253730ee4/Abstract-interpreter/domain.lisp | lisp |
An abstract DOMAIN is a kind of information about parts of a program. Each
domain consists of a possibly infinite lattice of "info" objects of
domain-specific nature. As a lattice, each domain must have methods for
the interface's generic functions:
* INFIMUM: Return the least element in the lattice. Initially, ... | (in-package #:cleavir-abstract-interpreter)
in the same way as CL : SUBTYPEP , i.e. it can return T T meaning true ,
* JOIN/2 : The lattice join operation with two info operands . The variable
* MEET/2 : The lattice meet operation with two info operands .
(defclass domain () ())
(defgeneric infimum (domain))... |
5362c78fdc391916376c600e21e3a365adc4cc76d257483ec63465d749761680 | green-coder/girouette | core.cljc | (ns girouette.core
#?(:cljs (:require-macros girouette.core)))
(defmacro css
"This macro should be used as a way to tag the expressions where
all the strings should be interpreted as css class names."
[expr]
expr)
#_ (defmacro not-css
"This macro should be used as a way to tag the expressions where
... | null | https://raw.githubusercontent.com/green-coder/girouette/8771e1dd820fe72849a9dcd7ba4d5b8edfbb3771/lib/girouette/src/girouette/core.cljc | clojure | (ns girouette.core
#?(:cljs (:require-macros girouette.core)))
(defmacro css
"This macro should be used as a way to tag the expressions where
all the strings should be interpreted as css class names."
[expr]
expr)
#_ (defmacro not-css
"This macro should be used as a way to tag the expressions where
... | |
56fcce888e3a60b69bfc2561aad2aa78bd8726816ed0baad05e6b73a4ba7107f | yuriy-chumak/ol | bbox.scm | (define-library (lib gtk-3 bbox)
(description "A container for arranging buttons")
(export
GtkButtonBox*
GTK_TYPE_BUTTON_BOX
gtk_button_box_get_type
gtk_button_box_new
)
(import
(scheme core)
(otus ffi)
(lib gtk-3 gtk)
(lib gtk-3 widget))
(begin
(define G... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/bfcefc78817f72ea688e7fac2fd0c1737ba0177a/libraries/lib/gtk-3/bbox.scm | scheme | gtk_button_box_get_layout
gtk_button_box_set_layout
gtk_button_box_get_child_secondary
gtk_button_box_set_child_secondary
gtk_button_box_get_child_non_homogeneous
gtk_button_box_set_child_non_homogeneous
... | (define-library (lib gtk-3 bbox)
(description "A container for arranging buttons")
(export
GtkButtonBox*
GTK_TYPE_BUTTON_BOX
gtk_button_box_get_type
gtk_button_box_new
)
(import
(scheme core)
(otus ffi)
(lib gtk-3 gtk)
(lib gtk-3 widget))
(begin
(define G... |
9bc1e3e823ba0c2288ee236ca22d54b91920ee2ffc2d34bc1b3d7d66abd9bdbc | OrgPad-com/volcano | project.clj | (defproject orgpad/volcano "0.2.1"
:description "Static web generator with hot-code reloading in development"
:url "-com/volcano"
:license {:name "The MIT License"
:url ""}
:dependencies [[org.clojure/clojurescript "1.10.914" :scope "provided"]
[bidi "2.1.6"]
[reag... | null | https://raw.githubusercontent.com/OrgPad-com/volcano/fb1529e9ef07dd2883b4fe17f39da77970d4f687/project.clj | clojure | (defproject orgpad/volcano "0.2.1"
:description "Static web generator with hot-code reloading in development"
:url "-com/volcano"
:license {:name "The MIT License"
:url ""}
:dependencies [[org.clojure/clojurescript "1.10.914" :scope "provided"]
[bidi "2.1.6"]
[reag... | |
fda1b950658f1322a3074c0f6fc4865d746e83a894bd8932a394f95004fee6e4 | clojure-dus/chess | piece_attacks.clj | (ns chess.test.movelogic.bitboard.piece-attacks
(:use [chess.movelogic.bitboard.chessboard])
(:use [chess.movelogic.bitboard.piece-attacks])
(:use [chess.movelogic.bitboard.bitoperations])
(:use [clojure.test]))
(deftest test-knight-attack-array
(testing "testing knight attack array"
(is (= 1320... | null | https://raw.githubusercontent.com/clojure-dus/chess/7eb0e5bf15290f520f31e7eb3f2b7742c7f27729/test/chess/test/movelogic/bitboard/piece_attacks.clj | clojure | (ns chess.test.movelogic.bitboard.piece-attacks
(:use [chess.movelogic.bitboard.chessboard])
(:use [chess.movelogic.bitboard.piece-attacks])
(:use [chess.movelogic.bitboard.bitoperations])
(:use [clojure.test]))
(deftest test-knight-attack-array
(testing "testing knight attack array"
(is (= 1320... | |
8a69d904110b3261a41567c4a56df6c8bad850843c1161c2f46894572ba04304 | Kappa-Dev/KappaTools | api_runtime.mli | class manager: Kappa_facade.system_process -> Api.manager_simulation
| null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/b34ac13c13faf0b784d328ad61c9fc2338ae2fc6/core/api/api_runtime.mli | ocaml | class manager: Kappa_facade.system_process -> Api.manager_simulation
| |
3c302e7facd0c3a6e5088921ab9e522cf634b77c52cd46b540c9130378e459a0 | dsorokin/aivika | Infinite.hs |
-- |
-- Module : Simulation.Aivika.Queue.Infinite
Copyright : Copyright ( c ) 2009 - 2017 , < >
-- License : BSD3
Maintainer : < >
-- Stability : experimental
Tested with : GHC 8.0.1
--
-- This module defines an infinite queue that can use the specified strategies.
--
module Simulation.Aivika.Que... | null | https://raw.githubusercontent.com/dsorokin/aivika/7a14f460ab114b0f8cdfcd05d5cc889fdc2db0a4/Simulation/Aivika/Queue/Infinite.hs | haskell | |
Module : Simulation.Aivika.Queue.Infinite
License : BSD3
Stability : experimental
This module defines an infinite queue that can use the specified strategies.
* Queue Types
* Creating Queue
* Queue Properties and Activities
* Statistics Reset
* Summary
* Derived Signals for Properties
* Basic Si... |
Copyright : Copyright ( c ) 2009 - 2017 , < >
Maintainer : < >
Tested with : GHC 8.0.1
module Simulation.Aivika.Queue.Infinite
FCFSQueue,
LCFSQueue,
SIROQueue,
PriorityQueue,
Queue,
newFCFSQueue,
newLCFSQueue,
newSIROQueue,
newPriori... |
5df764d6ea64bab87e4e05206755a942d5b3ea4c00268a52bc79c8889e9e0151 | racket/macro-debugger | widget.rkt | #lang racket/base
(require racket/class
racket/gui/base
racket/match
framework
syntax/id-table
racket/class/iop
macro-debugger/syntax-browser/interfaces
"controller.rkt"
"display.rkt"
"keymap.rkt"
"hrule-snip.rkt"
"proper... | null | https://raw.githubusercontent.com/racket/macro-debugger/d4e2325e6d8eced81badf315048ff54f515110d5/macro-debugger/macro-debugger/syntax-browser/widget.rkt | racket | widget%
A syntax widget creates its own syntax-controller.
syntax-browser<%> Methods
Apply highlighting
Underline binders (and shifted binders)
Make arrows (& billboards, when enabled)
DISABLED
phase = #f means not definite binding (ie, "?" arrow)
(define-values (canvas-w canvas-h) (send -ecanvas get-c... | #lang racket/base
(require racket/class
racket/gui/base
racket/match
framework
syntax/id-table
racket/class/iop
macro-debugger/syntax-browser/interfaces
"controller.rkt"
"display.rkt"
"keymap.rkt"
"hrule-snip.rkt"
"proper... |
ef684e85933f82bf2c4dae2638774ae5b92ff94b87a740d31a8bc3b05036f3af | input-output-hk/cardano-ledger | GlobalSum.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
-- | Simple example of a transition system whose states contain the sum of the
-- integers seen in the signals, where 'sum' is an abstract monoidal sum given
-- in the enviroment.
module Control.State.Transition.Examples.GlobalS... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/31c0bb1f5e78e40b83adfd1a916e69f47fdc9835/libs/small-steps-test/test/Control/State/Transition/Examples/GlobalSum.hs | haskell | | Simple example of a transition system whose states contain the sum of the
integers seen in the signals, where 'sum' is an abstract monoidal sum given
in the enviroment. | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Control.State.Transition.Examples.GlobalSum where
import Control.Arrow (right)
import Control.Monad.Reader
import Control.State.Transition.Extended
import Data.Foldable (foldl')
import qualified Data.List.NonEmpty as NE
... |
1e8a10f5cfc196d67206f75f0520422f8524726e861c1bce9c57cc1c84e74dcb | rmloveland/scheme48-0.53 | separate.scm | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
; packages packages-internal scan compiler table
; syntactic vm-exposure signals locations fluids template
; closures types inline dump/restore
; environments
; Separate compilation
; Setting the get-location method isn't sufficient because it won't
... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/scheme/misc/separate.scm | scheme | packages packages-internal scan compiler table
syntactic vm-exposure signals locations fluids template
closures types inline dump/restore
environments
Separate compilation
Setting the get-location method isn't sufficient because it won't
intercept locations in already existing structures (e.g. scheme)...
... | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
be able to remember one of them .
(define (compile-package-to-file p filename)
(let* ((table (make-table location-id))
(env (package->separate p table))
(stuff (scan-package p env))
(templates '()))
(for-each (lambda (filename+nodes)
... |
296a4b2e41e5efb5c870807fc39ec69c58e590cae3f84ddb60e449701bdf57c9 | elarous/O2SN | notifications.clj | (ns o2sn.services.notifications
(:require [aleph.http :as http]
[byte-streams :as bs]
[manifold.stream :as s]
[manifold.deferred :as d]
[manifold.bus :as bus]
[cognitect.transit :as transit]
[o2sn.db.channels :as chans-db]
[o2sn.db.us... | null | https://raw.githubusercontent.com/elarous/O2SN/289e17e5c4b6a19e3c8f964f9faa4efad3edefa8/src/server/main/o2sn/services/notifications.clj | clojure | (ns o2sn.services.notifications
(:require [aleph.http :as http]
[byte-streams :as bs]
[manifold.stream :as s]
[manifold.deferred :as d]
[manifold.bus :as bus]
[cognitect.transit :as transit]
[o2sn.db.channels :as chans-db]
[o2sn.db.us... | |
9a43b4b203c74c5ba183ace6678989af2bbf8880f2d722be23fcf05606a507a5 | mangpo/greenthumb | shaf.rkt | #lang racket
(require "../main.rkt" "../GA-parser.rkt")
(define parser (new GA-parser%))
;; shaf
(optimize (send parser ast-from-string
"0 a! !+ !+ push pop dup 1 b! @b and over - 0 b! @b and or push drop pop")
'((data . 2) (return . 1))
#t #f 0 #:cores 4 #:time-limit 3600
#:input-fi... | null | https://raw.githubusercontent.com/mangpo/greenthumb/7a8626205879af8c788f9927eeff643f4ddc5cde/GA/programs/shaf.rkt | racket | shaf | #lang racket
(require "../main.rkt" "../GA-parser.rkt")
(define parser (new GA-parser%))
(optimize (send parser ast-from-string
"0 a! !+ !+ push pop dup 1 b! @b and over - 0 b! @b and or push drop pop")
'((data . 2) (return . 1))
#t #f 0 #:cores 4 #:time-limit 3600
#:input-file "data... |
5782d63c6bf297bc480a59b8d60c6e3bac5579b92112f94454afc93c5462a5d3 | rm-hull/big-bang | project.clj | (defproject rm-hull/big-bang "0.0.1-SNAPSHOT"
:description "big-bang: a ClojureScript game loop, loosely based on Racket's big-bang and implemented on top of core.async"
:url "-hull/big-bang"
:clojurecript? true
:license {:name "The MIT License (MIT)"
:url ""}
:dependencies [[org.clojure/clojure "... | null | https://raw.githubusercontent.com/rm-hull/big-bang/2825e7f0bb7615e1158a72d58f426bc1e33bd9ef/project.clj | clojure | :optimizations :advanced
:optimizations :advanced | (defproject rm-hull/big-bang "0.0.1-SNAPSHOT"
:description "big-bang: a ClojureScript game loop, loosely based on Racket's big-bang and implemented on top of core.async"
:url "-hull/big-bang"
:clojurecript? true
:license {:name "The MIT License (MIT)"
:url ""}
:dependencies [[org.clojure/clojure "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.