+
Skip to content

VoQn/cacco

Repository files navigation

cacco

cacco
Important
Cacco is still in the design stage. It’s not working yet.

Introduction

Comment

;; This is inline comment (to the end of the line).

(; (1)
  This is block comment.
  block comment is keeping until the terminator -> ;) ;; (2)

(;
  (; These block comments can be nested. ;)
;)
  1. (; is the start of block comment

  2. ;) is the end of block comment

Literals

0     ;; Fuzzy Numeric.  (default: Natural)
-1 +1 ;; Fuzzy Integer.  (default: Integer)
0.0   ;; Fuzzy Decimal.  (default: Decimal)
1/2   ;; Rational.
'a'   ;; Character.      (same as Uint32)
""    ;; Fuzzy Text.     (default: String_UTF8)
:key  ;; Keyword.
[]    ;; Fuzzy Sequence. (default: List)
{}    ;; Key-Value Map.
Fuzzy Types Include Types

Fuzzy-Numeric

Uint8, Uint16, Uint32, Uint64, Natural, and Fuzzy-Integer

Fuzzy-Integer

Int8, Int16, Int32, Int64, Integer, and Fuzzy-Decimal

Fuzzy-Decimal

Float16, Float32, Float64, Flonum

Fuzzy-Text

Bytes, String-UTF8, String-UTF16, String-UTF32

Fuzzy-Sequence

List, Vector, Array, Sequence

Declaration and Reassign

;; Declare procedure or constant value or variable value.
(: x Integer)

;; Declare a constant value once.
(= x 1000)

;; Declare a mutable variable value.
(:= y 0)

;; Strictly typing with literal.
(= z (: 0 Uint8))
(:= w (: "something" Bytes))

;; Reassign
(=! y 1000)    ;; OK
(=! y "hello") ;; Can't. `y` has been declared as Number type.
(=! x 10)      ;; Can't. `x` has been declared as immutable.

Calling procedure

;; Simply calling a procedure.
(foo a b c)

;; Calling closure.
((|a| (* a a)) 10) ;; returns 100

Define procedure

;; Declare a procedure
(: cubic (-> Number Number)) ;;(1)

;; Define the procedure
(= (cubic x) (* x x x))
  1. (→ T1 T2 …​ Tn) is Function type receive T1, T2 …​ then return value as Tn type.

Development

Git Policy for AI Tools

This project uses AI tools (e.g., Cursor, Serena, GitHub Copilot) for collaboration. To balance openness and security:

  • Tracked Directories: .cursor/, .serena/, and .github/ directories are tracked in Git to enable collaboration among contributors.

  • Ignored Secure Files: Within these directories, sensitive files (e.g., API keys, tokens, secrets, private configurations) are ignored via nested .gitignore files.

  • How to Contribute:

    • Clone the repository and check out the appropriate branch.

    • Ensure your AI tools are configured to respect the nested .gitignore files.

    • If you need to add secure files, place them in subdirectories like secrets/ or private/ within these directories, as they are automatically ignored.

  • Example:

    • Place API keys in .cursor/secrets/api.key – it will be ignored.

    • Shared configurations can be placed directly in the directory (e.g., .cursor/settings.json) and will be tracked.

This policy ensures that collaborative tools remain useful while protecting private information.

Prerequisites

  • Haskell Stack

Build and Testing

Simply building libraries and application

stack build

Clean

stack clean

Run Tests

# simply run test-suites
stack test

# run test-suites and generate coverage-report
stack test --coverage

# open coverage-report in your browser
open $(stack path --local-hpc-root)/index.html

Check Haddock

stack haddock

open $(stack path --local-doc-root)/index.html

Serena Integration

This project includes scripts for using Serena AI assistant with Haskell LSP support. These scripts are located in .serena/scripts/ and provide convenient commands for various Serena operations.

Serena Scripts

The following scripts are available:

# Start Serena MCP server with Haskell LSP support
.serena/scripts/serena-start-mcp.sh

# Start Serena in planning mode for Haskell development
.serena/scripts/serena-with-haskell.sh

# Activate current project with Serena
.serena/scripts/serena-activate-project.sh

# Index current project for improved Serena performance
.serena/scripts/serena-index-project.sh

Each script includes help information:

# Show help for any script
.serena/scripts/serena-start-mcp.sh --help

Configuration

Before using the scripts, configure the Serena repository path in .serena/.serenarc:

# Example .serena/.serenarc content:
SERENA_ROOT=/path/to/local/serena-repo

Usage Examples

# Start Serena MCP server
.serena/scripts/serena-start-mcp.sh

# Start Serena in planning mode (recommended for complex tasks)
.serena/scripts/serena-with-haskell.sh

# Index the project for better performance
.serena/scripts/serena-index-project.sh

# Activate project with Serena
.serena/scripts/serena-activate-project.sh

About

(A programming language)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载