{
  "source_file": "0930",
  "source_platform": "Dev.to",
  "author": "amananandrai",
  "title_listed": "Palindrome Program using Haskell",
  "keywords": "",
  "domain": "机器学习",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://dev.to/amananandrai/palindrome-program-using-haskell-4g0a",
  "publish_date": "2021-03-06",
  "corpus_stage": "",
  "notes": "",
  "id": "b60b8078ac0b",
  "collected_at": "2026-10-02T14:02:24",
  "title": "Palindrome Program using Haskell - DEV Community",
  "body_markdown": "I try to learn the syntax of different programming languages. In\nthis\nblog I have written the program to find whether a number is a palindrome or not using 6 different programming languages. These languages include\nC\n,\nC++\n,\nJava\n,\nPython\n,\nPerl\n, and\nRuby\n.\nI tried learning functional programming and wrote a program to find whether a number is a palindrome number using\nHaskell\n. The program for finding palindrome using Haskell is given below.\nFunctional programming is a programming paradigm in which we try to bind everything in pure mathematical functions style. It is a declarative type of programming style. Its main focus is on “what to solve” in contrast to an imperative style where the main focus is “how to solve”.\n-- Main function which takes input and prints palindrome or not by using the function palindrome to check\nmain\n::\nIO\n()\nmain\n=\ndo\nprint\n\"Enter a number: \"\ninputStr\n<-\ngetLine\nlet\ninput\n=\nread\ninputStr\n::\nInteger\nif\npalindrome\ninput\nthen\nprint\n$\nshow\ninput\n<>\n\" is a palindrome number\"\nelse\nprint\n$\nshow\ninput\n<>\n\" is not palindrome number\"\n-- palindrome function which checks whether the number is a palindrome by comparing with the reverse of the number\npalindrome\n::\nInteger\n->\nBool\npalindrome\nx\n=\nreversal\nx\n==\nx\n-- reversal function for calculating the reverse of the number\nreversal\n::\nIntegral\na\n=>\na\n->\na\nreversal\n=\ngo\n0\nwhere\ngo\na\n0\n=\na\ngo\na\nb\n=\nlet\n(\nq\n,\nr\n)\n=\nb\n`\nquotRem\n`\n10\nin\ngo\n(\na\n*\n10\n+\nr\n)\nq\nEnter fullscreen mode\nExit fullscreen mode",
  "metadata": {
    "title": "Palindrome Program using Haskell - DEV Community",
    "description": "I try to learn the syntax of different programming languages. In this blog I have written the program... Tagged with haskell, functional.",
    "keywords": "haskell, functional, software, coding, development, engineering, inclusive, community",
    "author": null,
    "og:type": "article",
    "og:url": "https://dev.to/amananandrai/palindrome-program-using-haskell-4g0a",
    "og:title": "Palindrome Program using Haskell",
    "og:description": "I try to learn the syntax of different programming languages. In this blog I have written the program...",
    "og:site_name": "DEV Community",
    "og:image": "https://media2.dev.to/dynamic/image/width=1000,height=500,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz2nma5gp9lp8nlzpbjul.png",
    "twitter:site": "@thepracticaldev",
    "twitter:creator": "@",
    "twitter:title": "Palindrome Program using Haskell",
    "twitter:description": "I try to learn the syntax of different programming languages. In this blog I have written the program...",
    "twitter:card": "summary_large_image",
    "twitter:widgets:new-embed-design": "on",
    "twitter:image:src": "https://media2.dev.to/dynamic/image/width=1000,height=500,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz2nma5gp9lp8nlzpbjul.png"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [
    {
      "file": "attachments/b60b8078ac0b/code/body-000.txt",
      "chars": 750,
      "language": "text"
    }
  ],
  "images": [],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://dev.to/amananandrai/solving-the-mystery-of-12-02-2021-498e",
      "label": "this",
      "type": "a"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:49:19Z",
  "source_url": "https://dev.to/amananandrai/palindrome-program-using-haskell-4g0a",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 1481,
  "expected_body_images": 0,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/b60b8078ac0b/pages/source.html",
  "local_html": "attachments/b60b8078ac0b/pages/article.html",
  "body_base_path": "attachments/b60b8078ac0b/pages/",
  "body_markdown_path": "attachments/b60b8078ac0b/pages/article.md"
}