hasktorch-typed

Implement type-safe tensor operations with compile-time shape verification in Haskell.

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/HermeticOrmus/hermetic-claude --skill hasktorch-typed-hermeticormus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hasktorch-typed
Source: https://github.com/HermeticOrmus/hermetic-claude/tree/main/claude/skills/hasktorch-typed
Command: npx skills add https://github.com/HermeticOrmus/hermetic-claude --skill hasktorch-typed-hermeticormus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the challenge of ensuring type safety and structural integrity in deep learning implementations within Haskell, particularly when dealing with tensor shapes and complex network architectures.

Core Features & Use Cases

  • Type-Safe Tensors: Leverages dependent types to verify tensor shapes at compile time, preventing runtime errors.
  • Categorical Abstractions: Applies category theory concepts (functors, composition) to neural network design for enhanced modularity and correctness.
  • Use Case: Building a formally verified machine learning pipeline where the exact dimensions and data types of tensors must be guaranteed throughout the entire computation graph.

Quick Start

Implement a type-safe linear layer in Haskell using the provided Hasktorch examples.

Frequently Asked Questions about hasktorch-typed

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify tensor shapes at compile time in Haskell deep learning?

You can verify tensor shapes at compile time in Haskell by leveraging dependent types through the Hasktorch library, which prevents runtime shape mismatch errors. This ensures structural integrity throughout the computation graph.

Can I apply category theory to neural network design in Haskell?

Yes, you can apply category theory to neural network design by utilizing categorical abstractions like functors and composition. This approach enhances modularity and correctness when building machine learning pipelines.

How does Hasktorch handle automatic differentiation for functional programming?

Hasktorch handles automatic differentiation natively within Haskell's functional programming paradigm, facilitating the construction of neural networks while maintaining robust, formally verifiable ML systems.

What is the best way to prevent runtime errors in Haskell tensor operations?

The best way to prevent runtime errors in Haskell tensor operations is implementing type-safe tensors with compile-time shape verification. This guarantees exact dimensions and data types throughout the computation graph.

Does functional programming support formally verifiable machine learning pipelines?

Yes, functional programming supports formally verifiable machine learning pipelines by combining type-safe tensor operations, functorial structures, and automatic differentiation to guarantee computation graph integrity.

When do I need compile-time shape verification for deep learning tensors?

You need compile-time shape verification for deep learning tensors when building formally verified machine learning pipelines where exact dimensions and data types must be guaranteed across complex network architectures.