https://github.com/glanguage/sudoku_func
A functional program (in haskell) to solve sudokus.
https://github.com/glanguage/sudoku_func
haskell haskell-library sudoku
Last synced: 8 months ago
JSON representation
A functional program (in haskell) to solve sudokus.
- Host: GitHub
- URL: https://github.com/glanguage/sudoku_func
- Owner: GLanguage
- License: mit
- Created: 2021-04-24T14:39:24.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T10:43:16.000Z (about 5 years ago)
- Last Synced: 2025-03-05T09:18:22.793Z (over 1 year ago)
- Topics: haskell, haskell-library, sudoku
- Language: Haskell
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sudoku_Func
A functional program (in haskell) to solve sudokus.
## Usage
Under the same directory as the `sudoku.hs` file:
```haskell
import Sudoku
```
Inside the module are:
```haskell
type Matrix a = [[a]]
type Cell = Maybe Int
newtype Sudoku = Sudoku (Matrix Cell)
type Block = [Cell]
type Wave = [Int]
type Pos = (Int, Int)
type Info = (Cell, Wave)
isSudoku :: Sudoku -> Bool
isFull :: Sudoku -> Bool
fromString :: String -> Sudoku
getRows :: Sudoku -> [Block]
getColumns :: Sudoku -> [Block]
getBoxes :: Sudoku -> [Block]
getWaves :: Sudoku -> Matrix Wave
binded :: Sudoku -> [(Pos, Info)]
getBlanks :: Sudoku -> [(Pos, Info)]
conflict :: Sudoku -> Bool
replace :: Sudoku -> Pos -> Cell -> Sudoku
solve :: Sudoku -> [Sudoku]
```