{"id":15750358,"url":"https://github.com/nwtgck/type-safe-mips-haskell","last_synced_at":"2025-07-04T06:07:34.020Z","repository":{"id":87735943,"uuid":"100643398","full_name":"nwtgck/type-safe-mips-haskell","owner":"nwtgck","description":" Type-Safe Virtual MIPS Architecture in Haskell","archived":false,"fork":false,"pushed_at":"2018-06-18T13:28:02.000Z","size":152,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-31T07:15:57.656Z","etag":null,"topics":["haskell","simulation"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nwtgck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-17T20:39:31.000Z","updated_at":"2018-06-18T13:45:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b7ff0f4-042d-4e62-93a1-96bdb33b9d4e","html_url":"https://github.com/nwtgck/type-safe-mips-haskell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nwtgck/type-safe-mips-haskell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtgck%2Ftype-safe-mips-haskell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtgck%2Ftype-safe-mips-haskell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtgck%2Ftype-safe-mips-haskell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtgck%2Ftype-safe-mips-haskell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwtgck","download_url":"https://codeload.github.com/nwtgck/type-safe-mips-haskell/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtgck%2Ftype-safe-mips-haskell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263457183,"owners_count":23469290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","simulation"],"created_at":"2024-10-04T06:40:27.658Z","updated_at":"2025-07-04T06:07:33.983Z","avatar_url":"https://github.com/nwtgck.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  type-safe-mips\n[![Build Status](https://travis-ci.com/nwtgck/type-safe-mips-haskell.svg?branch=develop)](https://travis-ci.com/nwtgck/type-safe-mips-haskell)\n\nSubset of Virtual MIPS Architecture written in Haskell in Type-Safe way\n\n\n## MIPS Schematic\n\nHere is the whole schematic implemented virtually in Haskell.\n\n\u003cimg src=\"./img/mips-schematic.svg\" width='700'\u003e\n\nYou can also get detail specification of Main Control and ALU Control from URL below.\n\nhttp://web-ext.u-aizu.ac.jp/~yliu/teaching/comparch/lab4.html\n\n## How to run\n\n```\nstack build\nstack exec type-safe-mips-exe\n```\n\n## Technologies \u0026 Main GHC Pragmas\n\n* Yampa (FRP library)\n* Arrows\n* GADTs (Generalized Algebraic Data Types)\n* TypeFamilies\n* TypeOperators\n\nSome of these technologies make it to be type-safe!\n\n## Type safety\n\n`iRFormat`, for example, is a typed-legth list, which provide type safety more than normal list.\n\n```hs\nlet iRFormat = O:*O:*O:*O:*O:*O:*End :: Bits N6\n```\n(Type `:: Bits N6` or  `:: Bits N32` is typed-length list.)\n\n`Bits` has some list-operators which has type safety.\n\n```hs\nheadBits :: Bits (Succ n) -\u003e Bit\ntakeBits :: SNat n -\u003e Bits m -\u003e Bits (Min n m)\ndropBits :: SNat n -\u003e Bits m -\u003e Bits (m - n)\n(+*+) :: Bits n -\u003e Bits m -\u003e Bits (n+m) -- similar to (++) in list\n```\n\n\n### Normal List\n\n```hs\nlet list = [] :: [Bool]\nhead list -- Compile pass. but \"Exception: Prelude.head: empty list\"\n```\n\n### `Bits` (type-safe)\n\n```hs\nlet bits = End :: Bits N0 -- similar to []\nheadBits bits -- Compile Error (GOOD!)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwtgck%2Ftype-safe-mips-haskell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwtgck%2Ftype-safe-mips-haskell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwtgck%2Ftype-safe-mips-haskell/lists"}