_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 |
|---|---|---|---|---|---|---|---|---|
f9035b4c3ebd1516659f331d5fcb571867b24b7d6cb69a4edd3e5c3c77599b13 | fdopen/ppx_cstubs | ppx_cstubs_internals.ml | Copyright 2018 fdopen
Permission to use , copy , modify , and/or distribute this software for any
purpose with or without fee is hereby granted .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCH... | null | https://raw.githubusercontent.com/fdopen/ppx_cstubs/638b019ab5eb0d8a187710d00414a1d2536e249c/src/runtime/ppx_cstubs_internals.ml | ocaml | Allow to pass and return abstract types. I don't know why it is
disabled upstream. They are handled like structs and unions | Copyright 2018 fdopen
Permission to use , copy , modify , and/or distribute this software for any
purpose with or without fee is hereby granted .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCH... |
d9b70bf861dad75745108dee5432047ac3af9c4b197c209ea1aab00a476d8de4 | yokolet/clementine | repl.clj | Copyright ( c ) . All rights reserved .
;; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php )
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the t... | null | https://raw.githubusercontent.com/yokolet/clementine/b26c2318625e49606b5cc3b95cc9e1f5085ac309/ext/clojure-clojurescript-bef56a7/src/clj/cljs/repl.clj | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software.
we e... | Copyright ( c ) . All rights reserved .
Eclipse Public License 1.0 ( -1.0.php )
(ns cljs.repl
(:refer-clojure :exclude [load-file])
(:import java.io.File)
(:require [clojure.string :as string]
[clojure.java.io :as io]
[cljs.compiler :as comp]
[cljs.analyzer :as ana]
... |
b873138e3deff31136711a558dce0973034bc7585811d8d375a6311726de0b08 | lindig/hello | hello.ml | let hello name = Printf.printf "Hello, %s!\n" name
| null | https://raw.githubusercontent.com/lindig/hello/706ab9dc7020782c321975127ffdce6cc049bdcd/lib/hello.ml | ocaml | let hello name = Printf.printf "Hello, %s!\n" name
| |
fd7a45e7a863f2b37012065e558e2dac6db6a8fcfbe14cd90ab01769a19785e0 | jabber-at/ejabberd | mod_roster.erl | %%%----------------------------------------------------------------------
%%% File : mod_roster.erl
Author : < >
%%% Purpose : Roster management
Created : 11 Dec 2002 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2018 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/o... | null | https://raw.githubusercontent.com/jabber-at/ejabberd/7bfec36856eaa4df21b26e879d3ba90285bad1aa/src/mod_roster.erl | erlang | ----------------------------------------------------------------------
File : mod_roster.erl
Purpose : Roster management
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ... | Author : < >
Created : 11 Dec 2002 by < >
ejabberd , Copyright ( C ) 2002 - 2018 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
... |
3d894756ea3e9165eed08a246639ad1491ca5c719d19c4a32af88d1289303499 | brendanhay/gogol | List.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-storage-transfer/gen/Gogol/StorageTransfer/TransferJobs/List.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Lists transfer jobs.
* Resource
** Constructing a Request
| A resource alias for @storagetransfer.transferJobs.list@ method which the
'StorageTransferTransferJobsList' request conforms to.
| Lists transfer jobs.
/See:/ 'ne... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
3f4f75f9448bec771b10a4a3404c1281ad1d7e4b6970468ecf6b08d0373944a2 | robert-strandh/SICL | packages.lisp | (cl:in-package #:common-lisp-user)
(defpackage #:sicl-allocator
(:use #:common-lisp)
(:export #:initialize
#:allocate-dyad
#:allocate-chunk
#:free))
| null | https://raw.githubusercontent.com/robert-strandh/SICL/7624f002048778ab6981c3f4e9b869e70c7976e0/Code/Garbage-collector/Allocator/packages.lisp | lisp | (cl:in-package #:common-lisp-user)
(defpackage #:sicl-allocator
(:use #:common-lisp)
(:export #:initialize
#:allocate-dyad
#:allocate-chunk
#:free))
| |
b5c2adbde5d260d4b416396c920b3b2efddb290a9b12f34ae9534e9bb8f13863 | jordanthayer/ocaml-search | speediest.ml | *
@author jtd7
@since 2012 - 07 - 21
@author jtd7
@since 2012-07-21
*)
*
Greedy search algorithm as through the search interface
- July 2009
Greedy search algorithm as through the search interface
Jordan Thayer - July 2009
*)
type 'a node = {
Data Payload
d : float;... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/search/best_first/speediest.ml | ocaml | Heuristic at node
Cost of reaching a node
Depth of node in tree. Root @ 0
Position info for dpq
* takes a function to be applied to the data payload
such as the goal-test or the domain heuristic and
wraps it so that it can be applied to the entire
node
* Unwraps a solution which is in the for... | *
@author jtd7
@since 2012 - 07 - 21
@author jtd7
@since 2012-07-21
*)
*
Greedy search algorithm as through the search interface
- July 2009
Greedy search algorithm as through the search interface
Jordan Thayer - July 2009
*)
type 'a node = {
Data Payload
}
let wrap... |
c6919932493df1a74314e55d0fce023a806669fb96518f1bde70334b4b1202cb | robrix/sequoia | Par.hs | | Exponentials , represented as ¬A ⅋
module Sequoia.Profunctor.Exp.Par
( -- * Exponentials
Exp(..)
-- * Construction
, exp
, exp'
-- * Elimination
, runExp
) where
import Prelude hiding (exp)
import Sequoia.Connective.Not
import Sequoia.Connective.NotUntrue
import Sequoia.Profunctor
import Sequoia.Profunctor.... | null | https://raw.githubusercontent.com/robrix/sequoia/e4fae1100fa977a656f2fc654762f23d4448ad76/src/Sequoia/Profunctor/Exp/Par.hs | haskell | * Exponentials
* Construction
* Elimination
Exponentials
Construction
Elimination | | Exponentials , represented as ¬A ⅋
module Sequoia.Profunctor.Exp.Par
Exp(..)
, exp
, exp'
, runExp
) where
import Prelude hiding (exp)
import Sequoia.Connective.Not
import Sequoia.Connective.NotUntrue
import Sequoia.Profunctor
import Sequoia.Profunctor.Command
import Sequoia.Profunctor.Continuation
import Sequo... |
6f303fd0c97f876d362d1450968d14feca318c9b6ae9976f533c02147169fd84 | mfoemmel/erlang-otp | verify.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/test_server/src/things/verify.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 1996 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(verify).
-export([dir/0, dir/1]).
... |
c9f7cdede7c6795d2e9fd2154f4455d0beb10c2fe427f1581b481d1b8b67cf17 | leanil/LambdaGen | Transformation.hs | # LANGUAGE DataKinds , FlexibleContexts , LambdaCase , ScopedTypeVariables , TupleSections , TypeOperators , ViewPatterns #
module Transformation where
import Expr
import Recursion
import Replace
import Type
import Typecheck
import Utility (intersectWithIndex, setByIndex, takeByIndex, dropByIndex, partitionByIndex)
i... | null | https://raw.githubusercontent.com/leanil/LambdaGen/aff49962759c1ce1fcfb2a1cc4a9a11d78e713a9/src/Transformation.hs | haskell | TODO: lens?
higher lambda vars, higher arguments, lower vars, lower args -> ((re-occuring vars,rest of w), lists of changes for each input list)
mapFusePat, mapFuseRep :: PExpr | # LANGUAGE DataKinds , FlexibleContexts , LambdaCase , ScopedTypeVariables , TupleSections , TypeOperators , ViewPatterns #
module Transformation where
import Expr
import Recursion
import Replace
import Type
import Typecheck
import Utility (intersectWithIndex, setByIndex, takeByIndex, dropByIndex, partitionByIndex)
i... |
cafc91fb2766f2ea61cf2a2ee289bd14d8626dba73da37f98921090675afb1bb | processone/ejabberd | ejabberd_oauth_sql.erl | %%%-------------------------------------------------------------------
%%% File : ejabberd_oauth_sql.erl
Author : < >
%%% Purpose : OAUTH2 SQL backend
Created : 27 Jul 2016 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
%%%
%%% This program is free software; you can redistribute it... | null | https://raw.githubusercontent.com/processone/ejabberd/c103182bc7e5b8a8ab123ce02d1959a54e939480/src/ejabberd_oauth_sql.erl | erlang | -------------------------------------------------------------------
File : ejabberd_oauth_sql.erl
Purpose : OAUTH2 SQL backend
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WI... | Author : < >
Created : 27 Jul 2016 by < >
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License
Founda... |
8d287cb86274c1fbc4bf49d95e6d09dd8d735f2c445e4979e4446a723dc8e59a | willprice/little-schemer | rels.rkt | #lang racket/base
(require "sets.rkt"
"pairs.rkt"
"lists.rkt")
(provide
fun?
revrel
fullfun?)
(define fun?
(lambda (rel)
(set? (firsts rel))))
(define revrel
(lambda (rel)
(cond
((null? rel) '())
(else
(cons
(build (second (car rel))
(firs... | null | https://raw.githubusercontent.com/willprice/little-schemer/b2bd9ab7b1f1d43fe92415c6d41e18d3a2ba4677/rels.rkt | racket | #lang racket/base
(require "sets.rkt"
"pairs.rkt"
"lists.rkt")
(provide
fun?
revrel
fullfun?)
(define fun?
(lambda (rel)
(set? (firsts rel))))
(define revrel
(lambda (rel)
(cond
((null? rel) '())
(else
(cons
(build (second (car rel))
(firs... | |
cbd081a9859a84391e0902c69ad44b74282e21cd9a2acd7573d41f14adbaf4d4 | tsloughter/kuberl | kuberl_apps_v1beta1_deployment_rollback.erl | -module(kuberl_apps_v1beta1_deployment_rollback).
-export([encode/1]).
-export_type([kuberl_apps_v1beta1_deployment_rollback/0]).
-type kuberl_apps_v1beta1_deployment_rollback() ::
#{ 'apiVersion' => binary(),
'kind' => binary(),
'name' := binary(),
'rollbackTo' := kuberl_apps_v1beta1_rollba... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_apps_v1beta1_deployment_rollback.erl | erlang | -module(kuberl_apps_v1beta1_deployment_rollback).
-export([encode/1]).
-export_type([kuberl_apps_v1beta1_deployment_rollback/0]).
-type kuberl_apps_v1beta1_deployment_rollback() ::
#{ 'apiVersion' => binary(),
'kind' => binary(),
'name' := binary(),
'rollbackTo' := kuberl_apps_v1beta1_rollba... | |
f60fa8be8fcd7b04e1be56be1d89a4293f1b99a8ba3048020160aeceedcfe182 | ConsumerDataStandardsAustralia/validation-prototype | RequestTest.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Web.ConsumerData.Au.Api.Types.Auth.RequestTest where
import ... | null | https://raw.githubusercontent.com/ConsumerDataStandardsAustralia/validation-prototype/ff63338b77339ee49fa3e0be5bb9d7f74e50c28b/consumer-data-au-api-types/tests/Web/ConsumerData/Au/Api/Types/Auth/RequestTest.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes # | # LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Web.ConsumerData.Au.Api.Types.Auth.RequestTest where
import Control.Exception (throw)
import Control.Lens (( # ))
import Control.Monad ((<=<))
import ... |
24c63cfba59eb800de04ed9501821868d429afceacb052237208c8a851935b02 | TristeFigure/shuriken | exception.clj | (ns shuriken.exception
"### Macros to deal with exceptions"
(:require [shuriken.associative :refer [submap?]])
(:import [clojure.lang ExceptionInfo]))
(defn ^:no-doc regex? [x]
(instance? java.util.regex.Pattern x))
(defmacro catch-it
([substitute-f pattern expr]
(let [z `(let [pattern# ~pattern
... | null | https://raw.githubusercontent.com/TristeFigure/shuriken/cd36dd2a4005c85260125d89d5a3f475d248e6e4/src/shuriken/exception.clj | clojure | watch out !
raises: | (ns shuriken.exception
"### Macros to deal with exceptions"
(:require [shuriken.associative :refer [submap?]])
(:import [clojure.lang ExceptionInfo]))
(defn ^:no-doc regex? [x]
(instance? java.util.regex.Pattern x))
(defmacro catch-it
([substitute-f pattern expr]
(let [z `(let [pattern# ~pattern
... |
56702cb966cc1e2ed94ee5c9e1e2649300c67a0ecf7be0e7b6d650c537af0c9c | alanz/ghc-exactprint | AddLocalDecl3.hs | module AddLocalDecl2 where
-- |This is a function
foo = x -- comment 0
comment 1
-- |Another fun
comment 2
comment 3
nn = 2
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/transform/AddLocalDecl3.hs | haskell | |This is a function
comment 0
|Another fun | module AddLocalDecl2 where
comment 1
comment 2
comment 3
nn = 2
|
f72162f332a791f56dfc2e225020e70d5a7b7627583fdb4613df2da2786934fe | spawngrid/htoad | seresye_engine.erl | SERESYE , a Swarm oriented ERlang Expert SYstem Engine
%%%
Copyright ( c ) 2005 - 2010 , ,
Copyright ( c ) 2011 Afiniate , Inc.
%%% All rights reserved.
%%%
You may use this file under the terms of the BSD License . See the
%%% license distributed with this project or
%%% -license.php
-module(seresye_engin... | null | https://raw.githubusercontent.com/spawngrid/htoad/f0c7dfbd911b29fb0c406b7c26606f553af11194/deps/seresye/src/seresye_engine.erl | erlang |
All rights reserved.
license distributed with this project or
-license.php
====================================================================
Include files
====================================================================
====================================================================
External exports
... | SERESYE , a Swarm oriented ERlang Expert SYstem Engine
Copyright ( c ) 2005 - 2010 , ,
Copyright ( c ) 2011 Afiniate , Inc.
You may use this file under the terms of the BSD License . See the
-module(seresye_engine).
-ifdef(debug).
-define(LOG(F, X), io:format(F, X)).
-else.
-define(LOG(F, X), true).
-endi... |
6bf51976ae735c37dd330a86055fa3cd712a217993e4f3633312ab7c80e77c83 | ddmcdonald/sparser | hyphen-patterns.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
;;; copyright (c) 2015-2016,2021 David D. McDonald -- all rights reserved
;;;
;;; File: "hyphen-patterns"
;;; Module: "analysers;psp:patterns:"
version : August 2021
Broken out from patterns 7/20/15 . 11/2/15 fanout from converting
;; edge pat... | null | https://raw.githubusercontent.com/ddmcdonald/sparser/da94d1bbbed289859ddfcb6d352bced66054a939/Sparser/code/s/analyzers/psp/patterns/hyphen-patterns.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright (c) 2015-2016,2021 David D. McDonald -- all rights reserved
File: "hyphen-patterns"
Module: "analysers;psp:patterns:"
edge patterns early.
-------------------------------------
patterns for sequences with hyphens
------------------------... | version : August 2021
Broken out from patterns 7/20/15 . 11/2/15 fanout from converting
(in-package :sparser)
(defun resolve-hyphen-pattern (pattern start-pos end-pos)
"Called from ns-pattern-dispatch when no edge in the span covers
more than one edge and hyphen(s) is the only punctuation."
(let ((e... |
c48280282f38f68ca0db2823369a2f063c9e9043c5353064336a3dc2f7355586 | polyfy/polylith | shared.clj | (ns polylith.clj.core.deps.text-table.shared
(:require [polylith.clj.core.util.interface.color :as color]
[polylith.clj.core.text-table.interface :as text-table]))
(def type->color {"component" :green
"base" :blue})
(defn brick->color [{:keys [components bases]}]
(into {} (map (juxt ... | null | https://raw.githubusercontent.com/polyfy/polylith/76936c752fb5b729c216b23d92c8a8d71cfdc92f/components/deps/src/polylith/clj/core/deps/text_table/shared.clj | clojure | (ns polylith.clj.core.deps.text-table.shared
(:require [polylith.clj.core.util.interface.color :as color]
[polylith.clj.core.text-table.interface :as text-table]))
(def type->color {"component" :green
"base" :blue})
(defn brick->color [{:keys [components bases]}]
(into {} (map (juxt ... | |
ac446fd9fc9bb4539da158bf6c68fe9cf927632172e476c8dfa731bd23ddd6ae | ucsd-progsys/mist | pagination3.hs | tick and tock with session types in Mist
-- Message -> State -> State
measure updateRecv :: Int -> Int -> Int
measure updateSend :: Int -> Int -> Int
undefined as rforall a. a
undefined = 0
assert :: {v:Bool | v} -> Unit
assert = \tru -> Unit
unreachable :: forall s,t,p,q. {v:Int | False} -> ST <p >q >Int
unreach... | null | https://raw.githubusercontent.com/ucsd-progsys/mist/0a9345e73dc53ff8e8adb8bed78d0e3e0cdc6af0/tests/Tests/Integration/todo/pagination3.hs | haskell | Message -> State -> State
unreachable = undefined
--------------------------------------------------------------------------
| The ST Monad ----------------------------------------------------------
--------------------------------------------------------------------------
-------------------------------------------... | tick and tock with session types in Mist
measure updateRecv :: Int -> Int -> Int
measure updateSend :: Int -> Int -> Int
undefined as rforall a. a
undefined = 0
assert :: {v:Bool | v} -> Unit
assert = \tru -> Unit
unreachable :: forall s,t,p,q. {v:Int | False} -> ST <p >q >Int
unreachable = undefined
unreachab... |
1188f55a436b80b21065638b7045d2fddd73cb83d36bc80a7400d2ebe426b3f1 | target/theta-idl | Python.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE DuplicateRecordFields #
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE OverloadedLists #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeApp... | null | https://raw.githubusercontent.com/target/theta-idl/0fed73dc7f3963fd2c63cb408edcda0547a6d453/theta/test/Test/Theta/Target/Python.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
same module: no prefix
different module: prefix + qualified
| Compare a @Python@ value that might error with an expected
@Python@ value, igno... | # LANGUAGE DuplicateRecordFields #
# LANGUAGE OverloadedLists #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeApplications #
| Tests for the python code generation from Theta .
module Test.Theta.Target.Python where
import Prelude hiding (toEnum)
import Data.Aes... |
85a11d0b5491e38dd08d966fdb6c5ba3dd6507a14c4cb206fd78ade641de2385 | clojure-interop/google-cloud-clients | CompanyServiceClient$ListCompaniesPage.clj | (ns com.google.cloud.talent.v4beta1.CompanyServiceClient$ListCompaniesPage
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.talent.v4beta1 CompanyServiceClient$ListCompaniesPage]))
(defn create-page-async
"context - `com.google.api.gax.rpc.PageContext`
future-response - `com.google.a... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.talent/src/com/google/cloud/talent/v4beta1/CompanyServiceClient%24ListCompaniesPage.clj | clojure | (ns com.google.cloud.talent.v4beta1.CompanyServiceClient$ListCompaniesPage
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.talent.v4beta1 CompanyServiceClient$ListCompaniesPage]))
(defn create-page-async
"context - `com.google.api.gax.rpc.PageContext`
future-response - `com.google.a... | |
e79add98340e41ad345dd4ba7c1db4be2bdbbe1e72617418a40ae3b4e8567b51 | bazurbat/chicken-scheme | posix-common.scm | posix-common.scm - common code for UNIX and Windows versions of the posix unit
;
Copyright ( c ) 2010 - 2016 , The CHICKEN Team
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
; conditions are met:
;
; Redistribu... | null | https://raw.githubusercontent.com/bazurbat/chicken-scheme/f0c9d1fd8b68eb322e320e65ec40b0bf7d1b41dc/posix-common.scm | scheme |
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
Redistribution... | posix-common.scm - common code for UNIX and Windows versions of the posix unit
Copyright ( c ) 2010 - 2016 , The CHICKEN Team
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS
CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR
C... |
6cfa1d690efcfc8ddcdac099f27f2532e5ac1640b4c8eb53fb1cd3adfa8f1387 | afiskon/simple-neural-networks | Simple.hs | |
Simple parallel neural networks implementation
@
import AI.NeuralNetworks . Simple
import Text . Printf
import System . Random
import Control . y =
let [ r ] = runNeuralNetwork net [ x , y ]
in r
mse net =
let square x = x * x
e1 = square $ calcXor ... | null | https://raw.githubusercontent.com/afiskon/simple-neural-networks/04856f5b47de170017405eadc0b71504b296dbaf/src/AI/NeuralNetworks/Simple.hs | haskell | | Activation function
^ Hyperbolic tangent
| Neural network
| Deltas calculated by backpropagation algorithm
@
{-
-}
@
^ Number of neurons in each layer
^ Activation functions
^ New neural network
| Weights of the given neural network.
^ Neural network
^ Weights (layer 0.., neuron 1.., input 0..)
| Ch... | |
Simple parallel neural networks implementation
@
import AI.NeuralNetworks . Simple
import Text . Printf
import System . Random
import Control . y =
let [ r ] = runNeuralNetwork net [ x , y ]
in r
mse net =
let square x = x * x
e1 = square $ calcXor ... |
811f5c014b529d19c3be33a7b1cc260abe38d4b58355f14d88ab626469c64dbf | tqtezos/stablecoin | Impl.hs | SPDX - FileCopyrightText : 2021 Oxhead Alpha
SPDX - License - Identifier : MIT
module Stablecoin.Client.Impl
( AddressAndAlias(..)
, deploy
*
, transfer
, getBalanceOf
, UpdateOperatorData(..)
, updateOperators
, isOperator
*
, pause
, unpause
, configureMinter
, removeMinter
, mi... | null | https://raw.githubusercontent.com/tqtezos/stablecoin/48012781d6c2d46d4cb8f0508a8ca1576481a561/haskell/src/Stablecoin/Client/Impl.hs | haskell | * Query commands
| An address and an optional alias, if one is found.
| Deploy the stablecoin contract.
Returns the operation hash and the contract's new address.
Saves the contract with the given alias.
If the given alias already exists, nothing happens.
Make the metadata bigmap
User wants to store metadata e... | SPDX - FileCopyrightText : 2021 Oxhead Alpha
SPDX - License - Identifier : MIT
module Stablecoin.Client.Impl
( AddressAndAlias(..)
, deploy
*
, transfer
, getBalanceOf
, UpdateOperatorData(..)
, updateOperators
, isOperator
*
, pause
, unpause
, configureMinter
, removeMinter
, mi... |
4e6a6abe81357107b29bd4881f3206b078cb3bfcc2f56b83d53e28e4a3b9d750 | nominolo/lambdachine | MultiReturn3.hs | # LANGUAGE MagicHash , NoImplicitPrelude , UnboxedTuples , BangPatterns #
# OPTIONS_GHC -fobject - code #
module Bc.MultiReturn3 where
import GHC.Prim
import GHC.Types
import GHC.Num
import GHC.Base
# NOINLINE g #
g :: Int# -> State# RealWorld -> (# Int, State# RealWorld, Int #)
g n s = (# I# (n +# 5#), s, I# (n +# 1... | null | https://raw.githubusercontent.com/nominolo/lambdachine/49d97cf7a367a650ab421f7aa19feb90bfe14731/tests/Bc/MultiReturn3.hs | haskell | # LANGUAGE MagicHash , NoImplicitPrelude , UnboxedTuples , BangPatterns #
# OPTIONS_GHC -fobject - code #
module Bc.MultiReturn3 where
import GHC.Prim
import GHC.Types
import GHC.Num
import GHC.Base
# NOINLINE g #
g :: Int# -> State# RealWorld -> (# Int, State# RealWorld, Int #)
g n s = (# I# (n +# 5#), s, I# (n +# 1... | |
e475de00db17dfec4d215c904f0eada7bdc08fd4a7f9007bd94ece7c7fb8ef19 | mishadoff/project-euler | project.clj | (defproject project-euler "0.0.1"
:description "Project for solving problems"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/math.combinatorics "0.0.8"]
[org.clojure/clojure-contrib "1.2.0"]])
| null | https://raw.githubusercontent.com/mishadoff/project-euler/45642adf29626d3752227c5a342886b33c70b337/project.clj | clojure | (defproject project-euler "0.0.1"
:description "Project for solving problems"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/math.combinatorics "0.0.8"]
[org.clojure/clojure-contrib "1.2.0"]])
| |
1d54c1ef68611cdf9ffec7c280337b00dd4bbf17dbc474f3d2f9c8fb67b43949 | jabberbees/egherkin | egherkin_SUITE.erl | Copyright ( c ) 2018 , Jabberbees SAS
%% Permission to use, copy, modify, and/or 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 AUTHOR ... | null | https://raw.githubusercontent.com/jabberbees/egherkin/1e8414b4653d7848457ebf0f46bf5f47a3a8b292/test/egherkin_SUITE.erl | erlang | Permission to use, copy, modify, and/or 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.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO E... | Copyright ( c ) 2018 , Jabberbees SAS
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
@author < >
-module(egherkin_S... |
c9b0030e2631c73f90f842409b4ab166fdd699564c6c723b13bf8fcfc5cc6f1b | greghendershott/frog | version.rkt | #lang racket/base
(require racket/require
(multi-in racket (file match path runtime-path))
setup/getinfo
syntax/parse/define)
(provide frog-version)
(define (frog-version)
(or/fail ((get-info/full "frog") 'version)
((get-info/full "../..") 'version)
(version-from-in... | null | https://raw.githubusercontent.com/greghendershott/frog/93d8b442c2e619334612b7e2d091e4eb33995021/frog/private/version.rkt | racket | As a fallback try the ugly hack of regexp-ing info.rkt as text.
or/fail | #lang racket/base
(require racket/require
(multi-in racket (file match path runtime-path))
setup/getinfo
syntax/parse/define)
(provide frog-version)
(define (frog-version)
(or/fail ((get-info/full "frog") 'version)
((get-info/full "../..") 'version)
(version-from-in... |
4c45f1911b8adb28c1d151e4768c46f699e7b5bf2eb9880d0e4776a57a8041e5 | ucsd-progsys/dsolve | digest.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/stdlib/digest.mli | 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 GNU Library General Public License , with
$ I d : digest.mli , v 1.17 2005/10/2... |
c3b27cb11df728f356deb789c054cb2c05608cf2edef5d6a01512f35d15e29f5 | gelisam/hyzzy | F7.hs | {-# LANGUAGE OverloadedStrings #-}
module Rooms.F7 where
import Hyzzy.Command
import Hyzzy.Object
import Objects
look :: Command
look = "More foliage walls. This place is a maze..."
note :: Instance Paper
note = Instance Paper $ PaperFields
{ paperLines = ["SOUTH"]
}
north :: Command
north = Command $ goToRoo... | null | https://raw.githubusercontent.com/gelisam/hyzzy/c5c861d5556ed3ca82fbb583d6928fac40d0d8df/games/maze/Rooms/F7.hs | haskell | # LANGUAGE OverloadedStrings #
1 2 3 4 5 6 7
+-+-+ +-+-+-+-+
A| | |
+ +-+-+-+-+-+ +
B| | | |
+ + +-+-+ + +-+
+ + +-+ +-+ + +
D| | | | |
+ + + + + + + +
E| | | | | |
+ + +-+ + +-+ +
F| | | *|
+ +-+-+ +-+-+ +
+-+-+-+-+-+-+-+ | module Rooms.F7 where
import Hyzzy.Command
import Hyzzy.Object
import Objects
look :: Command
look = "More foliage walls. This place is a maze..."
note :: Instance Paper
note = Instance Paper $ PaperFields
{ paperLines = ["SOUTH"]
}
north :: Command
north = Command $ goToRoom "E7"
south :: Command
south =... |
cd9fe9a9bd8b2ab22f993afcb32a9d77d2feba3af9b899175298811afd42d3ac | saikyun/clobits | hello_world.clj | (ns clobits.examples.ncurses.hello-world
(:require [clobits.native-interop :refer [*native-image*]]
[clobits.c :as c])
(:gen-class))
(if *native-image*
(do (println "In native image context")
(require '[clobits.ncurses.ni :as ncurses]))
(do (println "In polyglot context")
(require '[clo... | null | https://raw.githubusercontent.com/saikyun/clobits/67bc60cbf6bed8a5178d552d3485e4117fb4df10/examples/ncurses/src/clobits/examples/ncurses/hello_world.clj | clojure | (ns clobits.examples.ncurses.hello-world
(:require [clobits.native-interop :refer [*native-image*]]
[clobits.c :as c])
(:gen-class))
(if *native-image*
(do (println "In native image context")
(require '[clobits.ncurses.ni :as ncurses]))
(do (println "In polyglot context")
(require '[clo... | |
df8ec7981deb59c99b92db863b81c0f22d44c474347b791ca8e4f40cb9ac6002 | aredington/monotony | lazywatch.clj | (ns leiningen.lazywatch
(:require [clojure.string :as s]
[clojure.java.io :as io]
[leiningen.classpath :as lcp])
(:import java.io.BufferedInputStream))
(defn- copy-bytes [in out]
(with-open [input in]
(loop [b (.read input)]
(when (not (= -1 b))
(.write out b)
(r... | null | https://raw.githubusercontent.com/aredington/monotony/2847584d301b3fc6371e1eab13364d6def7942f9/resources/leiningen/lazywatch.clj | clojure | (ns leiningen.lazywatch
(:require [clojure.string :as s]
[clojure.java.io :as io]
[leiningen.classpath :as lcp])
(:import java.io.BufferedInputStream))
(defn- copy-bytes [in out]
(with-open [input in]
(loop [b (.read input)]
(when (not (= -1 b))
(.write out b)
(r... | |
25b1c7c7188c00e03caa6ecde82eee28b3525aa9e7632872422fe28fad5bcfd3 | poscat0x04/telegram-types | Message.hs | # LANGUAGE StandaloneDeriving #
module Web.Telegram.Types.Internal.Message where
import Common
import Data.Time.Clock.POSIX
import Web.Telegram.Types.Internal.Animation
import Web.Telegram.Types.Internal.Audio
import {-# SOURCE #-} Web.Telegram.Types.Internal.Chat
import Web.Telegram.Types.Internal.Contact
import Web... | null | https://raw.githubusercontent.com/poscat0x04/telegram-types/c09ccc81cff10399538894cf2d1273022c797e18/src/Web/Telegram/Types/Internal/Message.hs | haskell | # SOURCE #
| Unique message identifier inside this chat
| Sender, empty for messages sent to channels
| Sender of the message, sent on behalf of a chat. The channel itself
for channel messages. The supergroup itself for messages from anonymous
group administrators. The linked channel for messages automatically... | # LANGUAGE StandaloneDeriving #
module Web.Telegram.Types.Internal.Message where
import Common
import Data.Time.Clock.POSIX
import Web.Telegram.Types.Internal.Animation
import Web.Telegram.Types.Internal.Audio
import Web.Telegram.Types.Internal.Contact
import Web.Telegram.Types.Internal.Dice
import Web.Telegram.Types... |
c4090b67562bdc3f0e62a1aae1ef0e4321988cfeafca4b5526a1371f7983d686 | nixin72/shan | default.clj | (ns shan.commands.default
(:require [shan.util :as u]
[shan.print :as p]
[shan.managers :as pm]
[shan.config :as c :refer [app-config]]))
(defn- cli-default
"Sets the :default-manager key in the shan.edn file"
[{:keys [_arguments]}]
(let [conf (u/get-new)
default (fi... | null | https://raw.githubusercontent.com/nixin72/shan/4f78124c3bbbefce5b33efab7364416ea8e6e1be/src/shan/commands/default.clj | clojure | (ns shan.commands.default
(:require [shan.util :as u]
[shan.print :as p]
[shan.managers :as pm]
[shan.config :as c :refer [app-config]]))
(defn- cli-default
"Sets the :default-manager key in the shan.edn file"
[{:keys [_arguments]}]
(let [conf (u/get-new)
default (fi... | |
1e4437d131be2c1e12bff4494b5a067dde5425cacc24666399bebee5726e478f | superstructor/re-frame-fetch-fx | deps.cljs | {:npm-dev-deps {"shadow-cljs" "2.15.2"
"karma" "6.3.4"
"karma-chrome-launcher" "3.1.0"
"karma-cljs-test" "0.1.0"
"karma-junit-reporter" "2.0.1"}}
| null | https://raw.githubusercontent.com/superstructor/re-frame-fetch-fx/0de96e8fcad3384fbb3ac54ab76a11b7251b8eb6/src/deps.cljs | clojure | {:npm-dev-deps {"shadow-cljs" "2.15.2"
"karma" "6.3.4"
"karma-chrome-launcher" "3.1.0"
"karma-cljs-test" "0.1.0"
"karma-junit-reporter" "2.0.1"}}
| |
aafbbb442ae8ad5aa8efb8dfe2f147ecfe0872a321c22bec4058570ea9394225 | NorfairKing/tickler | Time.hs | # LANGUAGE DerivingVia #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -fno - warn - orphans #
module Tickler.Data.Time where
import Autodocodec
import Data.Aeson (FromJSON, ToJSON)
import Data.Time
import Database.Persist.Sql
import Import
import Text.Printf
instance HasCodec Time... | null | https://raw.githubusercontent.com/NorfairKing/tickler/49f10fd0c55d9702dd7bd0116557ddcde9cc3ce0/tickler-data/src/Tickler/Data/Time.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DerivingVia #
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -fno - warn - orphans #
module Tickler.Data.Time where
import Autodocodec
import Data.Aeson (FromJSON, ToJSON)
import Data.Time
import Database.Persist.Sql
import Import
import Text.Printf
instance HasCodec TimeZone where
codec =
object "Ti... |
7e592452e41c38b31ac9835024f1b0bbf000b0fde07f9681c3798224955f0948 | xmonad/xmonad-contrib | DecorationAddons.hs | ----------------------------------------------------------------------------
-- |
Module : XMonad . Layout . DecorationAddons
-- Description : Various stuff that can be added to the decoration.
Copyright : ( c ) Jan Vornberger 2009
-- License : BSD3-style (see LICENSE)
--
-- Maintainer :
-- St... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/3058d1ca22d565b2fa93227fdde44d8626d6f75d/XMonad/Layout/DecorationAddons.hs | haskell | --------------------------------------------------------------------------
|
Description : Various stuff that can be added to the decoration.
License : BSD3-style (see LICENSE)
Maintainer :
Stability : unstable
Portability : not portable
Various stuff that can be added to the decoration. Most of i... | Module : XMonad . Layout . DecorationAddons
Copyright : ( c ) Jan Vornberger 2009
" XMonad . Layout . ButtonDecoration " for a module that makes use of this .
module XMonad.Layout.DecorationAddons (
titleBarButtonHandler
,default... |
076d95128b25495e6dc1d9da0a2e77188d61d10cc31f660e4c3f21b95de83296 | nikita-volkov/domain | Domain.hs | {-|
This module contains the whole API of \"domain\".
Many functions come with collapsed example sections.
Do check them out for better understanding.
-}
module Domain
(
-- * Declaration
declare,
-- * Schema
Schema,
schema,
loadSchema,
-- * Deriver
Deriver.Deriver,
stdDeriver,
-- ** Common
enumDe... | null | https://raw.githubusercontent.com/nikita-volkov/domain/1f140a8981cc604c52ebd02f9f8f773345e766b8/library/Domain.hs | haskell | |
This module contains the whole API of \"domain\".
Many functions come with collapsed example sections.
Do check them out for better understanding.
* Declaration
* Schema
* Deriver
** Common
* Clarifications
** Type Equality Constraint #type-equality-constraint#
|
have some unusual tilde (@~@) constraint:
... | module Domain
(
declare,
Schema,
schema,
loadSchema,
Deriver.Deriver,
stdDeriver,
enumDeriver,
boundedDeriver,
showDeriver,
eqDeriver,
ordDeriver,
genericDeriver,
dataDeriver,
typeableDeriver,
hashableDeriver,
liftDeriver,
* *
hasFieldDeriver,
* *
constructorIsLabelDeriver,
a... |
2d09a5c6fa5f7a2b9583824e1746e0f119b399079a6a5ce67b35af5b640d1af6 | fizruk/lambda-mu-mu-calculus | Syntax.hs | # LANGUAGE DeriveFoldable #
{-# LANGUAGE DeriveFunctor #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeSynonymInstances #-}
module LambdaMuMuCalculus... | null | https://raw.githubusercontent.com/fizruk/lambda-mu-mu-calculus/46532c5e5782c555196635f2abefef5ed8cca84f/src/LambdaMuMuCalculus/Untyped/Syntax.hs | haskell | # LANGUAGE DeriveFunctor #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeSynonymInstances #
| Standard type variables.
| Enum instance allows to easily increment index for a variable:
x₁
| Increment index for a variable.
>>> incVarIndex "x"
x₁
| Standard term.
| Standard context.
... | # LANGUAGE DeriveFoldable #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
module LambdaMuMuCalculus.Untyped.Syntax where
import Data.Char
import Data.Coerce (coerce)
import Data.Function (on)
import... |
15357cffefbd7f988126021726226af563781fbb83b0421e845daca7951d1ab3 | pauleve/pint | TestPintReach.ml |
open OUnit2
open PintTypes
open TestCommon
let exe = "../bin/pint-reach"
let test_exe ?length:(length=OUnitTest.Short)
?ctx:(ctx="") ?opts:(opts=[]) model reach expected =
let expected = string_of_ternary expected
in
let foutput cout =
assert_equal expected (cs_next_word cout)
~printer:(fun a -> a)
in
... | null | https://raw.githubusercontent.com/pauleve/pint/7cf943ec60afcf285c368950925fd45f59f66f4a/tests/TestPintReach.ml | ocaml |
open OUnit2
open PintTypes
open TestCommon
let exe = "../bin/pint-reach"
let test_exe ?length:(length=OUnitTest.Short)
?ctx:(ctx="") ?opts:(opts=[]) model reach expected =
let expected = string_of_ternary expected
in
let foutput cout =
assert_equal expected (cs_next_word cout)
~printer:(fun a -> a)
in
... | |
c28264d69107d24e3f328a45b8c0250549793305556db9c76f223d28c6091ff4 | edsko/ChinesePodAPI | HSK2012.hs | # LANGUAGE TemplateHaskell #
module Servant.ChinesePod.HSK.HSK2012 (
hsk1
, hsk2
, hsk3
, hsk4
, hsk5
, hsk6
) where
import Prelude hiding (Word)
import Servant.ChinesePod.HSK.Aux
$(spliceStickyStudy [
("HSK/2012/HSK1.txt", mkName "hsk1")
, ("HSK/2012/HSK2.txt", mkName "hsk2")
, ("HSK/2012/HS... | null | https://raw.githubusercontent.com/edsko/ChinesePodAPI/f77ebfd55286316c4a54c42c195d5a51b4a0e4cd/src/Servant/ChinesePod/HSK/HSK2012.hs | haskell | # LANGUAGE TemplateHaskell #
module Servant.ChinesePod.HSK.HSK2012 (
hsk1
, hsk2
, hsk3
, hsk4
, hsk5
, hsk6
) where
import Prelude hiding (Word)
import Servant.ChinesePod.HSK.Aux
$(spliceStickyStudy [
("HSK/2012/HSK1.txt", mkName "hsk1")
, ("HSK/2012/HSK2.txt", mkName "hsk2")
, ("HSK/2012/HS... | |
8be36ae3e9b958635ccdd4e41284b613341dc183c097ee449a7b556a9d90a749 | ucsd-progsys/liquidhaskell | Alphaconvert_List.hs | {-@ LIQUID "--pruneunsorted" @-}
{-@ LIQUID "--no-termination" @-}
{-@ LIQUID "--short-names" @-}
{-@ LIQUID "--fullcheck" @-}
{-@ LIQUID "--maxparams=3" @-}
| An example from " A Relational Framework for Higher - Order Shape Analysis " ,
by , ICFP 2014 .
module Alphaconvert_List (subst, alpha, i... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/pos/Alphaconvert_List.hs | haskell | @ LIQUID "--pruneunsorted" @
@ LIQUID "--no-termination" @
@ LIQUID "--short-names" @
@ LIQUID "--fullcheck" @
@ LIQUID "--maxparams=3" @
-------------------------------------------------------------------
| Datatype Definition --------------------------------------------
-----------------------------------... |
| An example from " A Relational Framework for Higher - Order Shape Analysis " ,
by , ICFP 2014 .
module Alphaconvert_List (subst, alpha, isAbs, maxs) where
import Prelude hiding ((++), elem)
import qualified Data.Set as S
import Language.Haskell.Liquid.Prelude
alpha :: [Bndr] -> Expr -> Expr
subst :: E... |
a66b179cb7d1509a57c79861e3c7cf31569c099ede44c20bcd8c4aec971c5b72 | haskus/packages | Server.hs | module Haskus.Web.Server
( module Network.Wai.Handler.Warp
, module Network.Wai.Handler.WarpTLS
, module Network.Wai
, module Network.Wai.Internal
, module Network.HTTP.Types
, module Network.HTTP.Types.Header
)
where
import Network.Wai.Handler.Warp
import Network.Wai.Handler.WarpTLS
import Networ... | null | https://raw.githubusercontent.com/haskus/packages/40ea6101cea84e2c1466bc55cdb22bed92f642a2/haskus-web/src/lib/Haskus/Web/Server.hs | haskell | module Haskus.Web.Server
( module Network.Wai.Handler.Warp
, module Network.Wai.Handler.WarpTLS
, module Network.Wai
, module Network.Wai.Internal
, module Network.HTTP.Types
, module Network.HTTP.Types.Header
)
where
import Network.Wai.Handler.Warp
import Network.Wai.Handler.WarpTLS
import Networ... | |
efa1540997244b7c6cad3b0f45020c81609c1cce675fe59e0fed1d43bbb6a31e | dchelimsky/sicp-exercises | ex-2.27.scm | #lang scheme
(require rackunit)
Modify your reverse procedure of exercise 2.18 to produce a deep - reverse procedure that takes a list as argument and returns as its value the list with its elements reversed and with all sublists deep - reversed as well . For example ,
;
( define x ( list ( list 1 2 ) ( list 3 4 ) ) ... | null | https://raw.githubusercontent.com/dchelimsky/sicp-exercises/55c804e3775b87a490e05f8337fc59bc7ce07f28/chapter-2/ex-2.27.scm | scheme |
x
(reverse x)
(deep-reverse x) | #lang scheme
(require rackunit)
Modify your reverse procedure of exercise 2.18 to produce a deep - reverse procedure that takes a list as argument and returns as its value the list with its elements reversed and with all sublists deep - reversed as well . For example ,
( define x ( list ( list 1 2 ) ( list 3 4 ) ) )
... |
a02c171c8840b398409e2d356197c434a7e90842d6199035d4da862146fc70f8 | soulomoon/SICP | Exercise 1.22.scm | Exercise 1.22 . Most Lisp implementations include a primitive called runtime that returns an integer that specifies the amount of time the system has been running ( measured , for example , in microseconds ) . The following timed - prime - test procedure , when called with an integer nn , prints nn and checks to see ... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter1/Exercise%201.22.scm | scheme | (define (runtime) (current-milliseconds))
(define (timed-prime-test n)
(newline)
(display n)
(start-prime-test n (runtime)))
(define (start-prime-test n start-time)
(if (prime? n)
(report-prime (- (runtime) start-time))
#f))
(define (report-prime elapsed-time)
(display " *** ")
(disp... | Exercise 1.22 . Most Lisp implementations include a primitive called runtime that returns an integer that specifies the amount of time the system has been running ( measured , for example , in microseconds ) . The following timed - prime - test procedure , when called with an integer nn , prints nn and checks to see ... |
2ff6913e62ab278a79665fc2f180d78cfb41ebd74282170ac8ee1f47be2b8d42 | zenhack/haskell-capnp | Bits.hs | module Module.Capnp.Bits (bitsTests) where
import Capnp.Bits
import Data.Bits
import Data.Foldable (traverse_)
import Data.Word
import Test.Hspec
bitsTests :: Spec
bitsTests = do
describe "bitRange" bitRangeExamples
describe "replaceBits" replaceBitsExamples
bitRangeExamples :: Spec
bitRangeExamples = do
it "S... | null | https://raw.githubusercontent.com/zenhack/haskell-capnp/6cf9fae35189a3668f2740d64c634675ec5fbdec/tests/Module/Capnp/Bits.hs | haskell | module Module.Capnp.Bits (bitsTests) where
import Capnp.Bits
import Data.Bits
import Data.Foldable (traverse_)
import Data.Word
import Test.Hspec
bitsTests :: Spec
bitsTests = do
describe "bitRange" bitRangeExamples
describe "replaceBits" replaceBitsExamples
bitRangeExamples :: Spec
bitRangeExamples = do
it "S... | |
3db839d0eb3eec7139d652dcd3103777edbbb16127573234cf4883ab639be7fc | greghendershott/markdown | ci-environment.rkt | Copyright ( c ) 2013 - 2022 by .
SPDX - License - Identifier : BSD-2 - Clause
#lang racket/base
(provide ci-environment?)
(define ci-environment?
(ormap getenv '("CI"
"TRAVIS"
"PLT_PKG_BUILD_SERVICE")))
| null | https://raw.githubusercontent.com/greghendershott/markdown/34ada7458fad51d3a5e0516352f8bd399c517140/markdown/ci-environment.rkt | racket | Copyright ( c ) 2013 - 2022 by .
SPDX - License - Identifier : BSD-2 - Clause
#lang racket/base
(provide ci-environment?)
(define ci-environment?
(ormap getenv '("CI"
"TRAVIS"
"PLT_PKG_BUILD_SERVICE")))
| |
fca83bab4e47dfcc13773ad2a849110b22e08ba8d44082d5a83fde89a661536f | jlouis/maps_eqc | toy.erl | -module(toy).
-include_lib("eqc/include/eqc.hrl").
-compile(export_all).
prop_zip_inverse() ->
?FORALL(Arr, list(choose(0, 255)),
begin
Bin = list_to_binary(Arr),
Z = zlib:uncompress(zlib:compress(Bin)),
measure(array_length, length(Arr), equals(Bin, Z))
end).
| null | https://raw.githubusercontent.com/jlouis/maps_eqc/14272fc01e8e1d24855ff015596c245a7e6a862f/slides/toy.erl | erlang | -module(toy).
-include_lib("eqc/include/eqc.hrl").
-compile(export_all).
prop_zip_inverse() ->
?FORALL(Arr, list(choose(0, 255)),
begin
Bin = list_to_binary(Arr),
Z = zlib:uncompress(zlib:compress(Bin)),
measure(array_length, length(Arr), equals(Bin, Z))
end).
| |
debed0587d1936a67ec099a5e285824bcb561e2fa59b491f76e91dd2f9715157 | ajtulloch/dnngraph | Torch.hs | module NN.Backend.Torch where
import NN.Backend.Torch.Codegen
import NN.Backend.Torch.Flat
import NN.Backend.Torch.Torch
import NN.DSL
backend :: Net -> Maybe String
backend gr = do
flat <- flatten' $ clean gr
return $ codegen $ lower flat
| null | https://raw.githubusercontent.com/ajtulloch/dnngraph/152f45780f3c4e9204cf4e129017df4394df662c/NN/Backend/Torch.hs | haskell | module NN.Backend.Torch where
import NN.Backend.Torch.Codegen
import NN.Backend.Torch.Flat
import NN.Backend.Torch.Torch
import NN.DSL
backend :: Net -> Maybe String
backend gr = do
flat <- flatten' $ clean gr
return $ codegen $ lower flat
| |
f0520b00c94a250a5a9453dbd6d7d856065e4ceddfd764bde2be1a8ea0b64f02 | chenyukang/eopl | interp.scm | (module interp (lib "eopl.ss" "eopl")
(require "drscheme-init.scm")
(require "lang.scm")
(require "data-structures.scm")
(require "environments.scm")
(require "store.scm")
(require "classes.scm")
(provide value-of-program value-of instrument-let instrument-newref)
;;;;;;;;;;;;;;;; swit... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/base/chapter9/typed-oo/interp.scm | scheme | switches for instrument-let ;;;;;;;;;;;;;;;;
say (instrument-let #t) to turn instrumentation on.
(instrument-let #f) to turn it off again.
the interpreter ;;;;;;;;;;;;;;;;
args need to be non-empty for type checker
new cases for typed-oo
exercise: add instrumentation to apply-method, like that for
ap... | (module interp (lib "eopl.ss" "eopl")
(require "drscheme-init.scm")
(require "lang.scm")
(require "data-structures.scm")
(require "environments.scm")
(require "store.scm")
(require "classes.scm")
(provide value-of-program value-of instrument-let instrument-newref)
(define instrumen... |
f298227f073658575ab8139d4485e63cf41d379bf3ef278e9b2bfa5fc22451e6 | locusmath/locus | object.clj | (ns locus.set.mapping.general.core.object
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.set.logic.structure.protocols :refer :all]
[locus.sub.core.object :refer :all]
[locus.con.core.object :refer :all]
[... | null | https://raw.githubusercontent.com/locusmath/locus/19f7c07f9d23d2f1090938862a853d170dc52d3d/src/clojure/locus/set/mapping/general/core/object.clj | clojure | This presheaf topos is the key to providing our whole new system of topos theoretic foundations,
and its implementation as it motivates all our decisions about how we should create a topos
theoretic ontology of computation and of algebra. The topos of functions supports the topos
theoretic model of computation, by ... | (ns locus.set.mapping.general.core.object
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.set.logic.structure.protocols :refer :all]
[locus.sub.core.object :refer :all]
[locus.con.core.object :refer :all]
[... |
d04e3544ae782b9f1861c098b952cf73b1ec966e02b8af83b11757cad6c737f2 | morpheusgraphql/morpheus-graphql | Gmap.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# ... | null | https://raw.githubusercontent.com/morpheusgraphql/morpheus-graphql/13d7eaf283df13b2860092f44c73a954a0f09683/morpheus-graphql-server/src/Data/Morpheus/Server/Deriving/Utils/Gmap.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
# LANGUAGE RankNTypes # | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE NoImplicitPrelude #
m... |
2c873bed4fd3622ca19a35ffff3c7654c4fc90fa30c11454a646c84c47fcb277 | korya/efuns | equations.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/korya/efuns/78b21d9dff45b7eec764c63132c7a564f5367c30/inliner/perf/KB/equations.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . Distributed only by permission .
$ I d : equations.ml , v 1.1 1999/11/22 10:35:57 lefessan Exp $
open Terms
type rule =
{ number: int;
... |
4947d3d0e299f14fc8c8812c0376b2182d8d5f68ef35038b9aee18c22283ccad | 5HT/ant | Substitute.mli |
open XNum;
open Maps;
open Unicode.Types;
type border_glyph =
[ Space (* for kerning with spaces *)
| Margin (* for margin kerning *)
| Foreign (* for kerning with glyphs of other fonts *)
];
type glyph_desc =
[ Undef
| Simple of int
| Accent of int and int
| Sequence ... | null | https://raw.githubusercontent.com/5HT/ant/6acf51f4c4ebcc06c52c595776e0293cfa2f1da4/Runtime/Substitute.mli | ocaml | for kerning with spaces
for margin kerning
for kerning with glyphs of other fonts |
open XNum;
open Maps;
open Unicode.Types;
type border_glyph =
];
type glyph_desc =
[ Undef
| Simple of int
| Accent of int and int
| Sequence of list int
| Extendable of glyph_desc and glyph_desc and glyph_desc and glyph_desc
| Border of border_glyph
];
module OrderedGlyphDesc :
sig
type t = glyph_... |
cc38e419251bcc2017e1462cb95ba292674a913dcdcfd61c85085612ef0f5117 | day8/re-com | hyperlink_href.cljs | (ns re-demo.hyperlink-href
(:require-macros
[re-com.core :refer []])
(:require
[re-com.core :refer [at h-box v-box box gap line label title radio-button hyperlink-href p checkbox]]
[re-com.buttons :refer [hyperlink-href-parts-desc hyperlink-href-args-desc]]
[re-demo.utils :refer [panel-title ... | null | https://raw.githubusercontent.com/day8/re-com/07451b1d19c59eb185548efe93e2d00b5d3eab89/src/re_demo/hyperlink_href.cljs | clojure | (ns re-demo.hyperlink-href
(:require-macros
[re-com.core :refer []])
(:require
[re-com.core :refer [at h-box v-box box gap line label title radio-button hyperlink-href p checkbox]]
[re-com.buttons :refer [hyperlink-href-parts-desc hyperlink-href-args-desc]]
[re-demo.utils :refer [panel-title ... | |
70c4e1697b486ed2e55cff189c8f7a69f6133d2ae83a3a9339569e9ca7144f57 | ndmitchell/hoogle | Search.hs | # LANGUAGE LambdaCase , MultiWayIf , RecordWildCards , ScopedTypeVariables ,
TupleSections #
TupleSections #-}
module Action.Search
(actionSearch, withSearch, search
,targetInfo
,targetResultDisplay
,action_search_test
) where
import Control.DeepSeq
import Control.Excep... | null | https://raw.githubusercontent.com/ndmitchell/hoogle/e50ce4d276ae3a0bc63672f14f927caa97fd8db6/src/Action/Search.hs | haskell | -- generate all
@tagsoup -- generate tagsoup
search the tagsoup package
filter -- search all
deliberately reopen the database each time
| Returns the details printed out when hoogle --info is called
| Bool argument decides whether links are shown
------------------------------------------------------------------... | # LANGUAGE LambdaCase , MultiWayIf , RecordWildCards , ScopedTypeVariables ,
TupleSections #
TupleSections #-}
module Action.Search
(actionSearch, withSearch, search
,targetInfo
,targetResultDisplay
,action_search_test
) where
import Control.DeepSeq
import Control.Excep... |
9a5b21cea7b2c77fc59f4c52f6c37705d45c0f88f594fe44774c70bbe3c7074f | bennn/trivial | string-pass.rkt | #lang typed/racket/base
(module+ test
(require
trivial/regexp
trivial/string
trivial/define
trivial/integer
typed/rackunit)
(test-case "string"
(check-equal?
(ann (string-length "") Zero)
0)
(check-equal?
(ann (- (string-length "racket") 6) Zero)
0)
(check-... | null | https://raw.githubusercontent.com/bennn/trivial/c8fb9dcc377d1bf40ca167e34072bec90d2651e1/test/string-pass.rkt | racket | (check-equal?
(check-equal? | #lang typed/racket/base
(module+ test
(require
trivial/regexp
trivial/string
trivial/define
trivial/integer
typed/rackunit)
(test-case "string"
(check-equal?
(ann (string-length "") Zero)
0)
(check-equal?
(ann (- (string-length "racket") 6) Zero)
0)
(check-... |
f9172ce7cea0284552fa13688c5b90f5ba2d9d9177f1959e8577dac19b625629 | rroohhh/guix_packages | tvm.scm | (define-module (vup tvm)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system cmake)
#:use-module (guix build-system python)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages llvm)
#:use-module (gnu packages libffi)
#:use-module (gnu packages version-cont... | null | https://raw.githubusercontent.com/rroohhh/guix_packages/117480ede867def846fa3120766864ed634e9321/vup/tvm.scm | scheme | breaks because of homeless shelter | (define-module (vup tvm)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system cmake)
#:use-module (guix build-system python)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages llvm)
#:use-module (gnu packages libffi)
#:use-module (gnu packages version-cont... |
31b3223411de4ea5b708631d07d8a76cbee49e009660fb696524e5fec6bb4cb4 | coccinelle/coccinelle | kbuild.mli | open Common
(* used my tools/meta_files *)
correspond usually to a kernel_files.meta
type kbuild_info = directory list
and group = Group of filename list
val unparse_kbuild_info : kbuild_info -> filename (*outfile*) -> unit
val parse_kbuild_info : filename -> kbuild_info
val generate_naive_kbuild_info : str... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/57cbff0c5768e22bb2d8c20e8dae74294515c6b3/extra/kbuild.mli | ocaml | used my tools/meta_files
outfile
out
remove the .git directory, wrong include, from the list of directories
* passed in parameter
| open Common
correspond usually to a kernel_files.meta
type kbuild_info = directory list
and group = Group of filename list
val parse_kbuild_info : filename -> kbuild_info
val generate_naive_kbuild_info : string list -> kbuild_info
val generate_less_naive_kbuild_info : string list -> kbuild_info
val generate... |
5b7a044b2661d86d06fcedef4fc3e2a5e3d140b5183c20156d4b9caa4e1c939f | crategus/cl-cffi-gtk | glib.stable-pointer.lisp | ;;; ----------------------------------------------------------------------------
;;; glib.stable-pointer.lisp
;;;
Copyright ( C ) 2009 - 2011
Copyright ( C ) 2011 - 2021
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU Lesser General Public License f... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/ba198f7d29cb06de1e8965e1b8a78522d5430516/glib/glib.stable-pointer.lisp | lisp | ----------------------------------------------------------------------------
glib.stable-pointer.lisp
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License for Lisp
License, or (at your option) any later version and with a preamble to
wi... | Copyright ( C ) 2009 - 2011
Copyright ( C ) 2011 - 2021
as published by the Free Software Foundation , either version 3 of the
the GNU Lesser General Public License that clarifies the terms for use
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser Gen... |
9d642ff0583fb29a692c2882706bc1a0f9fe41c93b7f2672dfe8e6288c03b0a5 | metametadata/clj-fakes | was_called_once.cljc | (ns unit.was-called-once
(:require
[clojure.test :refer [is testing]]
[unit.utils :as u]
[clj-fakes.core :as f]
[unit.was-called-fn-contract :as c]))
(u/deftest+
"contract"
(c/test-was-called-fn-contract f/was-called-once
#"^Function was not called the expected nu... | null | https://raw.githubusercontent.com/metametadata/clj-fakes/d928ddfd11b150b1cd2df5621265c447bf42395a/test/unit/was_called_once.cljc | clojure | (ns unit.was-called-once
(:require
[clojure.test :refer [is testing]]
[unit.utils :as u]
[clj-fakes.core :as f]
[unit.was-called-fn-contract :as c]))
(u/deftest+
"contract"
(c/test-was-called-fn-contract f/was-called-once
#"^Function was not called the expected nu... | |
1814dd61661d8158b23ee7a1e0c44a281d06d07b340a042bfc49eaf4cb255a5b | jimcrayne/jhc | Names.hs | {-# LANGUAGE OverloadedStrings #-}
-- | All hardcoded names in the compiler should go in here
-- the convention is
-- v_foo for values
-- tc_foo for type constructors
-- dc_foo for data constructors
-- s_foo for sort names
-- rt_foo for raw names
-- class_foo for classes
module Name.Names(module Name.Name,module Name.... | null | https://raw.githubusercontent.com/jimcrayne/jhc/1ff035af3d697f9175f8761c8d08edbffde03b4e/src/Name/Names.hs | haskell | # LANGUAGE OverloadedStrings #
| All hardcoded names in the compiler should go in here
the convention is
v_foo for values
tc_foo for type constructors
dc_foo for data constructors
s_foo for sort names
rt_foo for raw names
class_foo for classes
tWorld__ = tc_World__
No tuple instance because it is easy to ge... |
module Name.Names(module Name.Name,module Name.Names,module Name.Prim) where
import Char(isDigit)
import Name.Name
import Name.Prim
import Name.VConsts
import StringTable.Atom
import Ty.Level
instance TypeNames Name where
tInt = tc_Int
tBool = tc_Bool
tInteger = tc_Integer
tChar = tc_Char
tUnit ... |
0daf87eec9394f7a2313400e88ec30b14d2680a8eb583105507c992056ca42d7 | openmusic-project/openmusic | cl-jackplay-interleaved.lisp | (in-package :cl-jack)
;;===========================================================================
JACK Player for Common Lisp / CFFI
;;
;;This program is free software; you can redistribute it and/or modify
;;it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation ; e... | null | https://raw.githubusercontent.com/openmusic-project/openmusic/2d3c937a08756c2ce1632d490debc1db69892dfc/OPENMUSIC/code/projects/fluid/jack/cl-jackplay-interleaved.lisp | lisp | ===========================================================================
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
either version 2.1 of the License , or
(at your option) any later version.
This program is distr... | (in-package :cl-jack)
JACK Player for Common Lisp / CFFI
You should have received a copy of the GNU Lesser General Public License
Foundation , Inc. , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
Author :
(defparameter *jack-sndfile-handle* nil)
(unless (find :libsndfile *features*)
(error "ja... |
669ef467f50b2c9b5ce02bd37ffd156158aafcb0a6db04b3bb55ce4bcfa5480d | wdebeaum/step | proxy.lisp | ;;;;
;;;; W::proxy
;;;;
(define-words :pos W::n :templ COUNT-PRED-TEMPL
:words (
(W::proxy
(SENSES
((LF-PARENT ONT::agent-representative) ;professional) ;agent)
(templ other-reln-theme-templ (xp (% W::pp (W::ptype (? pt W::for)))))
(EXAMPLE "connect through a proxy server")
(meta-data :origin... | null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/LexiconManager/Data/new/proxy.lisp | lisp |
W::proxy
professional) ;agent) |
(define-words :pos W::n :templ COUNT-PRED-TEMPL
:words (
(W::proxy
(SENSES
(templ other-reln-theme-templ (xp (% W::pp (W::ptype (? pt W::for)))))
(EXAMPLE "connect through a proxy server")
(meta-data :origin task-learning :entry-date 20050815 :change-date nil :wn ("proxy%1:18:00") :comments nil)
... |
34107e208f58e0617b1aee7dabeb7631d7ca18d4acff66d50f391ae192f6d2bf | synduce/Synduce | int_nat_toint.ml | First representation of integers : positive or negative natural numbers .
type nat = Z | S of nat
type inat = P of nat | N of nat
let rec itoint = function N n -> -(nsum n + 1) | P n -> nsum n
and nsum = function Z -> 0 | S n -> 1 + nsum n
Second representation : counting from zero down or up
type eint = Zero... | null | https://raw.githubusercontent.com/synduce/Synduce/d453b04cfb507395908a270b1906f5ac34298d29/benchmarks/numbers/int_nat_toint.ml | ocaml | First representation of integers : positive or negative natural numbers .
type nat = Z | S of nat
type inat = P of nat | N of nat
let rec itoint = function N n -> -(nsum n + 1) | P n -> nsum n
and nsum = function Z -> 0 | S n -> 1 + nsum n
Second representation : counting from zero down or up
type eint = Zero... | |
9ca8baa4417aaa925c18311642ce27c4e36d16b4bb21fc71b119ea6abda452c9 | skynet-gh/skylobby | settings_test.clj | (ns skylobby.fx.settings-test
(:require
[cljfx.api :as fx]
[clojure.test :refer [deftest is]]
[skylobby.fx.settings :as fx.settings]))
(set! *warn-on-reflection* true)
(deftest battle-settings
(is (map?
(fx.settings/battle-settings
{:fx/context (fx/create-context nil)}))))
(defte... | null | https://raw.githubusercontent.com/skynet-gh/skylobby/7895ad30d992b790ffbffcd2d7be2cf17f8df794/test/clj/skylobby/fx/settings_test.clj | clojure | (ns skylobby.fx.settings-test
(:require
[cljfx.api :as fx]
[clojure.test :refer [deftest is]]
[skylobby.fx.settings :as fx.settings]))
(set! *warn-on-reflection* true)
(deftest battle-settings
(is (map?
(fx.settings/battle-settings
{:fx/context (fx/create-context nil)}))))
(defte... | |
ed01753cb3098a51db756468e621a356f31d19e6859e5107beb819145c55c0f2 | ryanpbrewster/haskell | P173.hs | module Problems.P173
( solve
, solveProblem
) where
- We shall define a square lamina to be a square outline with a square " hole "
- so that the shape possesses vertical and horizontal symmetry . For example ,
- using exactly thirty - two square tiles we can form two different square
- laminae :
... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/src/Problems/P173.hs | haskell | > a < = x/(4k ) - k
> 4*k*(k+1 ) < = x -- > 4*k^2 < x
> a <= x/(4k) - k
> 4*k*(k+1) <= x --> 4*k^2 < x | module Problems.P173
( solve
, solveProblem
) where
- We shall define a square lamina to be a square outline with a square " hole "
- so that the shape possesses vertical and horizontal symmetry . For example ,
- using exactly thirty - two square tiles we can form two different square
- laminae :
... |
6c8a30c015a3b0a06bbdc1cbc1085456da4647612fb378916bfb4d2bb76e8d02 | bgusach/exercises-htdp2e | ex-107.rkt | #lang htdp/bsl
(require 2htdp/image)
(require 2htdp/universe)
(require test-engine/racket-tests)
(define CAGE-HEIGHT 300)
(define CAGE-WIDTH CAGE-HEIGHT)
(define CAGE (empty-scene CAGE-WIDTH CAGE-HEIGHT))
(define SPEED 3)
(define HAPPINESS-SPEED -1)
(define HAPPINESS-FOOD 2)
(define HAPPINESS-PET 5)
(define MIN-HAPP ... | null | https://raw.githubusercontent.com/bgusach/exercises-htdp2e/c4fd33f28fb0427862a2777a1fde8bf6432a7690/ex-107.rkt | racket | Position is a Number
interpretation: position in the x-coordinate
Direction is one of
- "left"
- "right"
interpretation: x is the Position of the cat, d its Direction and h its Happiness
- "r"
- "b"
- "g"
intepretation: state of the world defined by
where is the chameleon, what colour it has and how happy it... | #lang htdp/bsl
(require 2htdp/image)
(require 2htdp/universe)
(require test-engine/racket-tests)
(define CAGE-HEIGHT 300)
(define CAGE-WIDTH CAGE-HEIGHT)
(define CAGE (empty-scene CAGE-WIDTH CAGE-HEIGHT))
(define SPEED 3)
(define HAPPINESS-SPEED -1)
(define HAPPINESS-FOOD 2)
(define HAPPINESS-PET 5)
(define MIN-HAPP ... |
e2424e62812ea060115c3bf6e647c055e70ede97254a23136c2cc040014bce57 | synduce/Synduce | sum_of_parities.ml |
let c1 = 0
let c0 = 0
let rec target = function Elt(a) -> c0 | Node(a, l, r) -> c1
| null | https://raw.githubusercontent.com/synduce/Synduce/d453b04cfb507395908a270b1906f5ac34298d29/extras/solutions/constraints/even_tree/sum_of_parities.ml | ocaml |
let c1 = 0
let c0 = 0
let rec target = function Elt(a) -> c0 | Node(a, l, r) -> c1
| |
f3e567eb0c289376dd78864c075a3b29c7de4d053feac8c299a0f9e035fb2a2b | RefactoringTools/wrangler | api_spec.erl | Copyright ( c ) 2010 , ,
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions are met:
%% %% Redistributions of source code must retain the above copyright
%% notice, this list of conditions... | null | https://raw.githubusercontent.com/RefactoringTools/wrangler/1c33ad0e923bb7bcebb6fd75347638def91e50a8/src/api_spec.erl | erlang | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
%% Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
%% Redi... | Copyright ( c ) 2010 , ,
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR
@private
-module(api_spec).
-export([rename_in_spec/2, add_arg_type_to_spec/3,
tuple_arg_types_in_spec/3,
rm_ar... |
0cc2bf514ef776f07565b18e08c82395475794da120600b32e199d564530fd72 | 7even/endless-ships | routes.cljs | (ns endless-ships.routes
(:require [re-frame.core :as rf]
[bidi.bidi :as bidi]
[pushy.core :as pushy]
[endless-ships.events :as events]
[endless-ships.views.utils :refer [kebabize nbspize]]))
(def name-pattern
#"[A-Za-z0-9\-\(\)\,\"]+")
(def routes
["/" {"" :ships... | null | https://raw.githubusercontent.com/7even/endless-ships/acb7ee2852a6bc2f80137bc8aa2e3541ceed83ff/src/cljs/endless_ships/routes.cljs | clojure | (ns endless-ships.routes
(:require [re-frame.core :as rf]
[bidi.bidi :as bidi]
[pushy.core :as pushy]
[endless-ships.events :as events]
[endless-ships.views.utils :refer [kebabize nbspize]]))
(def name-pattern
#"[A-Za-z0-9\-\(\)\,\"]+")
(def routes
["/" {"" :ships... | |
a0ac32c5b58b686aa4143c0847018f1ab04d545fa6697ebead43739ade374d48 | Decentralized-Pictures/T4L3NT | test_contract_repr.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 Marigold < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/proto_011_PtHangz2/lib_protocol/test/unit/test_contract_repr.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 Marigold < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER I... |
36a35ef93923d8255baa258766ca5de43bbfb49b8181363dd520db1062f3df8d | k0ral/imm | Handle.hs | # LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeFamilies #-}
# LANGUAGE UndecidableInstances #
module Database.Handle
* 1st - level primitives
HandleF(..)
, ... | null | https://raw.githubusercontent.com/k0ral/imm/eae96d96297aec0533bfcb88393827613e4235eb/src/main/Database/Handle.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
* Re-exports
| Database functor | # LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
module Database.Handle
* 1st - level primitives
HandleF(..)
, Handle(..)
, interpret
, DatabaseException(..)
* 2nd - level primitive... |
750ebead345afa157c647630633024e70116d976f3b716717241329f8175dd7c | charlieg/Sparser | time-classes.lisp | -*- Mode : Lisp ; Syntax : COMMON - LISP ; ; -*-
$ Id$
Copyright ( c ) 2010
Derived from code , converted 10/28/10
(unless (find-package :time)
(defpackage time
(:use :common-lisp :ddm-util)))
(in-package :time)
;;;--------------------------------------
;;; class needed to hook up realizations
... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/util/time-classes.lisp | lisp | Syntax : COMMON - LISP ; ; -*-
--------------------------------------
class needed to hook up realizations
--------------------------------------
-----------------------------------------
top classes referred to by time classes
-----------------------------------------
UnitOfMeasure)
deliniates an 'amount' of the ... | $ Id$
Copyright ( c ) 2010
Derived from code , converted 10/28/10
(unless (find-package :time)
(defpackage time
(:use :common-lisp :ddm-util)))
(in-package :time)
(defclass realizable ()
((realization))
(:documentation "Provides something for mumble:realization-for to
sink its teeth into. In... |
b4041aa24cfe49cf8f52a5eb028526ff341932df564e24c61dd3ae636e844c72 | ocsigen/eliom | eliommod_parameters.ml | Ocsigen
*
* Copyright ( C ) 2007
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your ... | null | https://raw.githubusercontent.com/ocsigen/eliom/c3e0eea5bef02e0af3942b6d27585add95d01d6c/src/lib/client/eliommod_parameters.ml | ocaml | Ocsigen
*
* Copyright ( C ) 2007
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your ... | |
f4d8f4fb412305558650fa998fcf4b9b599389451d3eec6f77c6c98c1989a8a9 | bitblaze-fuzzball/fuzzball | smtlib_batch_engine.mli |
Based on stp_external_engine.mli , which bears the following notice :
Copyright ( C ) BitBlaze , 2009 - 2011 , and copyright ( C ) 2010 Ensighta
Security Inc. All rights reserved .
Based on stp_external_engine.mli, which bears the following notice:
Copyright (C) BitBlaze, 2009-2011, and copyright (C... | null | https://raw.githubusercontent.com/bitblaze-fuzzball/fuzzball/b9a617b45e68fa732f1357fedc08a2a10f87a62c/execution/smtlib_batch_engine.mli | ocaml |
Based on stp_external_engine.mli , which bears the following notice :
Copyright ( C ) BitBlaze , 2009 - 2011 , and copyright ( C ) 2010 Ensighta
Security Inc. All rights reserved .
Based on stp_external_engine.mli, which bears the following notice:
Copyright (C) BitBlaze, 2009-2011, and copyright (C... | |
a89039482b5e313755df466e743da38bcbe603202a7efc259528bc82fad0e7df | russmatney/reframe-games | core.cljs | (ns games.tetris.core
(:require
[games.grid.core :as grid]
[games.tetris.db :as tetris.db]
[games.tetris.shapes :as tetris.shapes]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Predicates and game logic
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/russmatney/reframe-games/ff05f6ad4794e4505b6231522af0c90c3e212631/src/games/tetris/core.cljs | clojure |
Predicates and game logic
this also indicates that the pieces has been played, so we increment
remove the hold-lock to allow another hold to happen
Instant fall
mark new cell coords as occupied
Move piece
down-only
any falling cells?
any falling cells that can't move down?
i.e. with occupied cells below... | (ns games.tetris.core
(:require
[games.grid.core :as grid]
[games.tetris.db :as tetris.db]
[games.tetris.shapes :as tetris.shapes]))
(defn cell-occupied? [{:keys [game-grid]} cell]
(:occupied (grid/get-cell game-grid cell)))
(defn cell-open?
"Returns true if the indicated cell is within the grid's bou... |
76f3883551e5bf7a6fa74bd33adbd6c8280f07373a00982cd8c76dd8a1f16279 | chaoxu/fancy-walks | D.hs | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies , FlexibleInstances #
{-# OPTIONS_GHC -O2 #-}
import Data.List
import Data.Maybe
import Data.Char
import Data.Array.IArray
import Data.Array.Unboxed (UArray)
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control ... | null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/codeforces.com/113/D.hs | haskell | # OPTIONS_GHC -O2 #
can't handle free variables or extra equations
--------------------------------------------------------------------
--------------------------------------------------------------------
-------------------------------------------------------------------- | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies , FlexibleInstances #
import Data.List
import Data.Maybe
import Data.Char
import Data.Array.IArray
import Data.Array.Unboxed (UArray)
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control . Monad . State
import C... |
7329c479c27ffe8d8dae858ff2330a66bf87b06b06f6006091a4137f144ac2fc | xtdb/xtdb | java.clj | (ns xtdb.api.java
(:refer-clojure :exclude [sync])
(:require [xtdb.api :as xt]
[xtdb.tx.event :as txe])
(:import (clojure.lang IDeref)
(java.time Duration)
(java.util Date List Map)
(java.util.concurrent CompletableFuture)
(java.util.function Supplier)
... | null | https://raw.githubusercontent.com/xtdb/xtdb/e1b2127973b6ca7403329fc495f8dbd0f04230ee/core/src/xtdb/api/java.clj | clojure | (ns xtdb.api.java
(:refer-clojure :exclude [sync])
(:require [xtdb.api :as xt]
[xtdb.tx.event :as txe])
(:import (clojure.lang IDeref)
(java.time Duration)
(java.util Date List Map)
(java.util.concurrent CompletableFuture)
(java.util.function Supplier)
... | |
658b768e77cf0d68cdbc951f9680740bc851bd9c9e412186cca85dd2df87ad85 | danieljharvey/mimsa | ServerConfig.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
module Server.ServerConfig
( ServerConfig (..),
)
where
import GHC.Generics
import Language.Mimsa.Types.Store.RootPath
data ServerConfig = ServerConfig
{ scPort :: Int, -- "PORT",
scRootPath :: RootPath,
scShowLogs :: Bool,
scPrometheusPort... | null | https://raw.githubusercontent.com/danieljharvey/mimsa/fa7eefede23f4b37168566593fe48fe21c894545/server/server/Server/ServerConfig.hs | haskell | "PORT", | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
module Server.ServerConfig
( ServerConfig (..),
)
where
import GHC.Generics
import Language.Mimsa.Types.Store.RootPath
data ServerConfig = ServerConfig
scRootPath :: RootPath,
scShowLogs :: Bool,
scPrometheusPort :: Maybe Int
}
deriving s... |
12ff4643498d6674afc70d0428e5a34677535cc40733ab8ed00e30fbdc1415da | racket/distro-build | record-installer.rkt | #lang racket/base
(require racket/file)
(provide record-installer)
(define (record-installer dir filename desc)
(when desc
(define table-file (build-path dir "table.rktd"))
(call-with-file-lock/timeout
#:max-delay 2
table-file
'exclusive
(lambda ()
(define t (hash-set
... | null | https://raw.githubusercontent.com/racket/distro-build/080f8ccb9b1007a07ac2da25e12d75f18e799eb5/distro-build-server/record-installer.rkt | racket | #lang racket/base
(require racket/file)
(provide record-installer)
(define (record-installer dir filename desc)
(when desc
(define table-file (build-path dir "table.rktd"))
(call-with-file-lock/timeout
#:max-delay 2
table-file
'exclusive
(lambda ()
(define t (hash-set
... | |
2dcbeecada75ee7f1ddd15cbbd7f3f59a88977dc45034435a023fc8d00c00c4f | emqx/emqx | emqx_resource_validator.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 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 o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx_resource/src/emqx_resource_validator.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 ) 2020 - 2023 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(emqx_resource_validator).
-export([
min/2,
max/2,
not_empty/1
]).
max(Type... |
e2e4cd38c70a50e62af3c864cdd767e1720af1adb669f15611f9c4bb621cf091 | arenadotio/ocaml-mssql | mssql_error.ml | open Core_kernel
type t =
{ msg : string
; reraised_exn : Exn.t option [@sexp.option]
; here : Source_code_position.t
; query : string option [@sexp.option]
; params : Db_field.t option list [@sexp.list]
; formatted_query : string option [@sexp.option]
; results : Row.t list list [@sexp.list]
}
[@@deri... | null | https://raw.githubusercontent.com/arenadotio/ocaml-mssql/28963720dfa095d00837cfef3af94e954343998f/src/mssql_error.ml | ocaml | Preserve original info if set, but override if not set
Note that we never mess with the original [%here] | open Core_kernel
type t =
{ msg : string
; reraised_exn : Exn.t option [@sexp.option]
; here : Source_code_position.t
; query : string option [@sexp.option]
; params : Db_field.t option list [@sexp.list]
; formatted_query : string option [@sexp.option]
; results : Row.t list list [@sexp.list]
}
[@@deri... |
90975db52ed84a68a200f5eb9d72bbc4fe574e24a74b6425fde8925ff6075335 | ashinn/chibi-scheme | scribble.scm | ;; scribble.scm - scribble parsing
Copyright ( c ) 2011 . All rights reserved .
;; BSD-style license:
;;> A library used for parsing "scribble" format, introduced by
;;> \hyperlink["-lang.org/"]{Racket} and the format
;;> used to write this manual. The default escape character is
> backslash as in TeX instead ... | null | https://raw.githubusercontent.com/ashinn/chibi-scheme/8b27ce97265e5028c61b2386a86a2c43c1cfba0d/lib/chibi/scribble.scm | scheme | scribble.scm - scribble parsing
BSD-style license:
> A library used for parsing "scribble" format, introduced by
> \hyperlink["-lang.org/"]{Racket} and the format
> used to write this manual. The default escape character is
> overridden.
general character utils
list utils
scribble reader (standalone, don't us... | Copyright ( c ) 2011 . All rights reserved .
> backslash as in TeX instead of @ as in Racket , though this can be
(define (char-mirror ch)
(case ch ((#\() #\)) ((#\[) #\]) ((#\{) #\}) ((#\<) #\>) (else ch)))
(define (char-delimiter? ch)
(or (eof-object? ch) (char-whitespace? ch)
(memv ch '(#\( #\) #... |
625a7be7923668fac663f8b620b67b2f338c830b4b0ceaf990e5462a22bb6ee6 | conscell/hugs-android | Lattice.hs | This file contains a Hugs implementation of the programs described in :
--
, Computing with lattices : An application of type classes ,
Journal of Functional Programming , Volume 2 , Number 4 , Oct 1992 .
--
module Lattice where
class Eq a => Lattice a where -- A type class representing lattices
... | null | https://raw.githubusercontent.com/conscell/hugs-android/31e5861bc1a1dd9931e6b2471a9f45c14e3c6c7e/hugs/lib/hugs/demos/Lattice.hs | haskell |
A type class representing lattices
Simple instances of Lattice
Defining the least fixed point operator:
Maximum and minimum frontiers:
Lattice structure
list to minimum frontier
list to maximum frontier
A representation for functions of type Lattice a => a -> Bool:
&& f0==g0
Navigable lattices:
implementat... | This file contains a Hugs implementation of the programs described in :
, Computing with lattices : An application of type classes ,
Journal of Functional Programming , Volume 2 , Number 4 , Oct 1992 .
module Lattice where
bottom, top :: a
meet, join :: a -> a -> a
lt :: a -> a -> Bool
... |
40d0aaef2aa5405e1143ca355909e87f9d83f0193978e2194bcf0c618483ab0b | dnikolovv/haskell-tic-tac-toe | Common.hs | module Common where
import ClassyPrelude
import Control.Monad.Catch (MonadThrow, throwM)
checkEither :: (MonadThrow m, Exception e) => Either a b -> (a -> e) -> m b
checkEither (Right a) _ = return a
checkEither (Left e) f = throwM $ f e
checkMaybe :: (MonadThrow m, Exception e) => Maybe a -> e -> m a
checkMaybe (Ju... | null | https://raw.githubusercontent.com/dnikolovv/haskell-tic-tac-toe/d8282dfcd73a07d49a86312a1f7f7275dadabc3a/src/Common.hs | haskell | module Common where
import ClassyPrelude
import Control.Monad.Catch (MonadThrow, throwM)
checkEither :: (MonadThrow m, Exception e) => Either a b -> (a -> e) -> m b
checkEither (Right a) _ = return a
checkEither (Left e) f = throwM $ f e
checkMaybe :: (MonadThrow m, Exception e) => Maybe a -> e -> m a
checkMaybe (Ju... | |
7dcd740a06e75016372e1f3008766fbcbde80387799fa691b54d56c7e8036373 | lwhjp/ecmascript | lex.rkt | #lang racket/base
(require parser-tools/lex
ragg/support
(prefix-in : parser-tools/lex-sre))
(provide lex)
(define-lex-abbrev white-space
(:or #\u0009 #\u000B #\u000C #\u0020 #\u00A0 #\uFEFF))
(define-lex-abbrev line-terminator
(:or #\u000A #\u000D #\u2028 #\u2029))
(define-lex-abbrev comment... | null | https://raw.githubusercontent.com/lwhjp/ecmascript/69fcfa42856ea799ff9d9d63a60eaf1b1783fe50/lang/lex.rkt | racket | #lang racket/base
(require parser-tools/lex
ragg/support
(prefix-in : parser-tools/lex-sre))
(provide lex)
(define-lex-abbrev white-space
(:or #\u0009 #\u000B #\u000C #\u0020 #\u00A0 #\uFEFF))
(define-lex-abbrev line-terminator
(:or #\u000A #\u000D #\u2028 #\u2029))
(define-lex-abbrev comment... | |
4cfb7626cff05ebab2bd88762fca65eec61b2ae7b5e6807c08106d05c2dcd349 | janestreet/ppx_sexp_conv | conv_test.ml | open Ppx_sexp_conv_lib
open Conv
let%test_module "Exceptions" =
(module struct
let check_sexp exn string =
match sexp_of_exn_opt exn with
| None -> raise exn
| Some sexp ->
let sexp_as_string = Ppx_sexp_conv_lib.Sexp.to_string sexp in
if sexp_as_string <> string then failwith se... | null | https://raw.githubusercontent.com/janestreet/ppx_sexp_conv/e8404bcacb24c36d5ba1f1e6b035ff4f7921119d/test/lib/conv_test.ml | ocaml | now local exceptions | open Ppx_sexp_conv_lib
open Conv
let%test_module "Exceptions" =
(module struct
let check_sexp exn string =
match sexp_of_exn_opt exn with
| None -> raise exn
| Some sexp ->
let sexp_as_string = Ppx_sexp_conv_lib.Sexp.to_string sexp in
if sexp_as_string <> string then failwith se... |
4a76528944b49a34dc93a5425f4058b25c6f1a4130eba8b1636cc6c4265d096c | SnootyMonkey/coming-soon | project.clj | (defproject coming-soon "0.3.0-SNAPSHOT"
:description "coming-soon is a simple Clojure/ClojureScript/Redis 'landing page' application that takes just a few minute to setup"
:url "-soon/"
:license {:name "Mozilla Public License v2.0"
:url "/"}
:min-lein-version "2.7.1"
:dependencies [
;; Serv... | null | https://raw.githubusercontent.com/SnootyMonkey/coming-soon/52f9ed9911b8eeb005f43dd13f3ff0285c418e01/project.clj | clojure | Server-side
Web Server -clojure/ring
Web routing
Redis client
HTTP client -http
JSON encoding -json/
XML encoding
CSV encoding -csv
HTML templates
HTML generation
color manipulation
DateTime utilities -time/clj-time
Client-side
ClojureScript compiler
Common ring tasks -ring
Example-based testing ... | (defproject coming-soon "0.3.0-SNAPSHOT"
:description "coming-soon is a simple Clojure/ClojureScript/Redis 'landing page' application that takes just a few minute to setup"
:url "-soon/"
:license {:name "Mozilla Public License v2.0"
:url "/"}
:min-lein-version "2.7.1"
:dependencies [
Lisp on t... |
0778b9d51daa9f331c8214cb6e5f5a8863d132c9a859a0fc5bb132a8643932d3 | wilkerlucio/pathom-viz-connector | pathom3.clj | (ns com.wsscode.pathom-viz.connector.demos.pathom3
(:require [com.wsscode.pathom.viz.ws-connector.pathom3 :as p.connector]
[com.wsscode.pathom3.connect.built-in.resolvers :as pbir]
[com.wsscode.pathom3.interface.eql :as p.eql]
[com.wsscode.pathom3.interface.smart-map :as psm]
... | null | https://raw.githubusercontent.com/wilkerlucio/pathom-viz-connector/d95371ef5039849e031e3bad39748d8ac8bb1cf0/examples/com/wsscode/pathom_viz/connector/demos/pathom3.clj | clojure | (ns com.wsscode.pathom-viz.connector.demos.pathom3
(:require [com.wsscode.pathom.viz.ws-connector.pathom3 :as p.connector]
[com.wsscode.pathom3.connect.built-in.resolvers :as pbir]
[com.wsscode.pathom3.interface.eql :as p.eql]
[com.wsscode.pathom3.interface.smart-map :as psm]
... | |
ea5928fc70f4e7d561600a7f62c881dbb4d41e170fe3b4551fb3e189729f8489 | soranoba/erlup | spam_2.erl | -module(spam_2).
-export([a/0]).
a() ->
2.
| null | https://raw.githubusercontent.com/soranoba/erlup/c7d785eb8222b9f38d94b911c84a06b398b43f0f/ct/erlup_SUITE_data/spam_v1/apps/spam_2/src/spam_2.erl | erlang | -module(spam_2).
-export([a/0]).
a() ->
2.
| |
fa8e619d7f760b758e216b5f11917eec12959572b7298cfd6a5386ee4c86f072 | mmirman/caledon | HOU.hs | {-# LANGUAGE ViewPatterns #-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Src.HOU (unifyAll, newGraph, ConsGraph) where
import Choice
import Names
import Src.AST
import Src.Substitution
i... | null | https://raw.githubusercontent.com/mmirman/caledon/7e97110270362d46d8784a5197a84b6a4b7e2982/sources/Src/HOU.hs | haskell | # LANGUAGE ViewPatterns #
# LANGUAGE BangPatterns #
# LANGUAGE ScopedTypeVariables #
-----------------
- Combinators ---
-----------------
| unify only performes transitions relating to "A :=: B".
implements the "switching" for atoms
this is safe since we are at ... | # LANGUAGE FlexibleContexts #
module Src.HOU (unifyAll, newGraph, ConsGraph) where
import Choice
import Names
import Src.AST
import Src.Substitution
import Src.Context
import Src.FormulaSequence (Ctxt)
import Src.Variables
import Src.LatticeUnify
import Src.Tracing
import Control.Monad.Trans (lift)... |
744afdc4e425364d71328b69c9f58c30e5726255ec727e3fc9669048fbf93385 | serokell/foundry | Foundry.hs | # LANGUAGE LambdaCase #
# LANGUAGE OverloadedLists #
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Sdam.Parser (pValue, parse)
import Source
import Source.Language.Morte
import System.Environment (getArgs)
import System.Exit (die)
import Text.Megaparsec as Megaparsec
main :: IO ()
main = do
mParsedVa... | null | https://raw.githubusercontent.com/serokell/foundry/dd5b9744a88f441559d254f868792956dc552037/src/bin/Foundry.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE LambdaCase #
# LANGUAGE OverloadedLists #
module Main where
import Sdam.Parser (pValue, parse)
import Source
import Source.Language.Morte
import System.Environment (getArgs)
import System.Exit (die)
import Text.Megaparsec as Megaparsec
main :: IO ()
main = do
mParsedValue <- getArgs >>= \case
[filep... |
46801a79d0309db1864db9ce333ca03943e6c13389b1e1b3262649ae6ad212aa | ncannasse/xml-light | xml.ml |
* Xml Light , an small Xml parser / printer with DTD support .
* Copyright ( C ) 2003 ( )
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* version 2.1 ... | null | https://raw.githubusercontent.com/ncannasse/xml-light/fd62588fb7515e61d43771d885f585d3cd3fb9ca/src/xml.ml | ocaml |
* Xml Light , an small Xml parser / printer with DTD support .
* Copyright ( C ) 2003 ( )
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* version 2.1 ... | |
456e604df7bf0b1fb68015008374b8076845e5db58fb538f73a806e5a1cc5da0 | jarohen/phoenix | handler.clj | (ns {{name}}.handler
(:require [bidi.bidi :as bidi]
[bidi.ring :refer [make-handler]]
[modular.ring :refer [WebRequestHandler]]
[ring.util.response :refer [response]]))
This is all in one NS for now , but you 'll likely want to split it
;; out when your application grows!
(def ... | null | https://raw.githubusercontent.com/jarohen/phoenix/f828bf144154f110f0a73f54645f5696e2c8bdab/templates/phoenix-api/src/leiningen/new/phoenix_api/handler.clj | clojure | out when your application grows! | (ns {{name}}.handler
(:require [bidi.bidi :as bidi]
[bidi.ring :refer [make-handler]]
[modular.ring :refer [WebRequestHandler]]
[ring.util.response :refer [response]]))
This is all in one NS for now , but you 'll likely want to split it
(def api-routes
{"/" {:get ::default-ro... |
5473bc3cc9b5ca6b0928e921ca653de88f0014e440a5b11392d81cfacbc0db95 | rntz/moxy | debug.rkt | #lang racket
(require racket/pretty)
(provide
debug! undebug! toggle-debug!
debug debugf debugf-pretty)
(define *debug* #t)
(define (debug!) (set! *debug* #t))
(define (undebug!) (set! *debug* #f))
(define (toggle-debug!) (set! *debug* (not *debug*)))
(define-syntax-rule (debug body ...)
(when *debug* body .... | null | https://raw.githubusercontent.com/rntz/moxy/18015aed1596ae55658be4ac9eb5cbb3debb1644/debug.rkt | racket | #lang racket
(require racket/pretty)
(provide
debug! undebug! toggle-debug!
debug debugf debugf-pretty)
(define *debug* #t)
(define (debug!) (set! *debug* #t))
(define (undebug!) (set! *debug* #f))
(define (toggle-debug!) (set! *debug* (not *debug*)))
(define-syntax-rule (debug body ...)
(when *debug* body .... | |
0c97840e70156ffbc6bc5b87a81a77ddb930ff64a7ff34accd0b56f6f3841c5a | willghatch/racket-rash | cd.rkt | #lang racket/base
(provide
cd
)
(require
linea/line-macro
(only-in shell/pipeline path-string-symbol?)
racket/contract/base
racket/contract/region
shell/utils/bourne-expansion-utils
(for-syntax
racket/base
syntax/parse
))
(define/contract (change-directory dir)
(-> path-string-symbol? void?)
(let (... | null | https://raw.githubusercontent.com/willghatch/racket-rash/c40c5adfedf632bc1fdbad3e0e2763b134ee3ff5/rash/private/cd.rkt | racket | #lang racket/base
(provide
cd
)
(require
linea/line-macro
(only-in shell/pipeline path-string-symbol?)
racket/contract/base
racket/contract/region
shell/utils/bourne-expansion-utils
(for-syntax
racket/base
syntax/parse
))
(define/contract (change-directory dir)
(-> path-string-symbol? void?)
(let (... | |
7d21cb1449b6beb5ec319c0e9a27573c4c19767f0757d3651a1a30e9a71e09e4 | input-output-hk/ouroboros-network | Types.hs | {-# LANGUAGE DerivingStrategies #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralisedNewtypeDeriving #
# LANGUAGE MonoLocalBinds #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
-- DUPLICATE -- adapted from: cardano-node/src/Cardano/Node/Types.hs... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/162c2b426ca66047f92a7d073036c13a434bf026/ouroboros-consensus-cardano-tools/src/Cardano/Node/Types.hs | haskell | # LANGUAGE DerivingStrategies #
# LANGUAGE OverloadedStrings #
DUPLICATE -- adapted from: cardano-node/src/Cardano/Node/Types.hs
* Configuration
* Consensus protocol configuration
| Errors for the cardano-config module.
| Filepath of the configuration yaml file. This file determines
all the confi... | # LANGUAGE FlexibleInstances #
# LANGUAGE GeneralisedNewtypeDeriving #
# LANGUAGE MonoLocalBinds #
# LANGUAGE NamedFieldPuns #
module Cardano.Node.Types (
AdjustFilePaths (..)
, ConfigError (..)
, ConfigYamlFilePath (..)
, DbFile (..)
, GenesisFile (..)
, GenesisHash ... |
7512c3765fafe99e2d8f3c8a1e0914d7f5353424e4e08a61be4a1e64a5598ec9 | solita/mnt-teet | cooperation_tx.clj | (ns teet.cooperation.cooperation-tx
(:require [datomic.client.api :as d]
[datomic.ion :as ion]
[teet.cooperation.cooperation-db :as cooperation-db]
[teet.cooperation.cooperation-model :as cooperation-model]
[teet.meta.meta-model :as meta-model]))
(defn save-3rd-party [... | null | https://raw.githubusercontent.com/solita/mnt-teet/7a5124975ce1c7f3e7a7c55fe23257ca3f7b6411/app/backend/src/clj/teet/cooperation/cooperation_tx.clj | clojure | (ns teet.cooperation.cooperation-tx
(:require [datomic.client.api :as d]
[datomic.ion :as ion]
[teet.cooperation.cooperation-db :as cooperation-db]
[teet.cooperation.cooperation-model :as cooperation-model]
[teet.meta.meta-model :as meta-model]))
(defn save-3rd-party [... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.