Skip to content

purescript-python/pspy-tutorials-linear-algebra

Repository files navigation

module Main where

import Effect
import NumPy
import Prelude
import Tutorials.Core
import Effect.Class.Console (logShow)

test :: S (S Z) :+: S Z
test = auto

n1 :: S Z
n1 = auto

n2 = eval (n1 :+: n1)

Compiled:

main :: Effect Unit
main = do
  logShow $ asInt $ eval test
  let x = init (eval $ n2 :+: n2) (eval $ n2 :+: n1) 6
  logShow x
  let y = init (eval $ n1 :+: n2) (eval $ n2 :+: n2) 6
  logShow $ x `matmul` y

Compile Error:

main :: Effect Unit
main = do
  logShow $ asInt $ eval test
  let x = init (eval $ n2 :+: n2) (eval $ n2 :+: n1) 6
  logShow $ x `matmul` x -- dim mismatch

About

a demo to show type-safe linear algebra with purescript python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published